-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1fde41
commit 8c12d24
Showing
12 changed files
with
352 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// | ||
// CloudsGlobal.h | ||
// CloudsStoryEngine | ||
// | ||
// Created by James George on 7/11/13. | ||
// | ||
// | ||
|
||
#pragma once | ||
|
||
#include "ofMain.h" | ||
#include "CloudsGlobal.h" | ||
|
||
bool confirmedDataPath = false; | ||
bool usingDevelopmentFolder = false; | ||
|
||
//-------------------------------------------------------------------- | ||
string GetCloudsDataPath(bool ignored) | ||
{ | ||
if(!confirmedDataPath){ | ||
usingDevelopmentFolder = ofDirectory("../../../CloudsData/").exists(); | ||
if(!usingDevelopmentFolder){ | ||
ofDirectory("CloudsData/").create(); | ||
} | ||
confirmedDataPath = true; | ||
} | ||
return string(usingDevelopmentFolder ? "../../../" : "") + "CloudsData" + (ignored ? "_ignored" : "") + "/"; | ||
} | ||
|
||
string GetCloudsVisualSystemDataPath(string systemName, bool ignoredFolder){ | ||
// building from src project file | ||
string datapath; | ||
if(ofDirectory("../../../CloudsData/").exists()){ | ||
datapath = string("../../../CloudsData") + (ignoredFolder ? "_ignored" : "") + "/visualsystems/" + systemName + "/"; | ||
} | ||
// stand alone full app | ||
else if(ofDirectory("CloudsData/").exists()){ | ||
datapath = string("CloudsData") + (ignoredFolder ? "_ignored" : "") + "/visualsystems/" + systemName + "/"; | ||
} | ||
// stand alone single app | ||
else{ | ||
datapath = "../../../data/"; | ||
} | ||
|
||
return datapath; | ||
} | ||
|
||
//-------------------------------------------------------------------- | ||
string language = "ENGLISH"; | ||
bool languageSet = false; | ||
string GetLanguage(){ | ||
if(!languageSet){ | ||
string languageFile = GetCloudsDataPath() + "language.txt"; | ||
if(ofFile(languageFile).exists()){ | ||
language = ofBufferFromFile(languageFile).getText(); | ||
} | ||
languageSet = true; | ||
} | ||
return language; | ||
} | ||
|
||
//-------------------------------------------------------------------- | ||
string relinkFilePath(string filePath){ | ||
|
||
vector<string> drives; | ||
|
||
drives.push_back("Seance"); | ||
drives.push_back("Nebula"); | ||
drives.push_back("Supernova"); | ||
drives.push_back("WhiteDwarf"); | ||
|
||
if( !ofFile(filePath).exists() ){ | ||
for(int i = 0; i < drives.size(); i++){ | ||
if(ofFile::doesFileExist("/Volumes/"+ drives[i]+"/")){ | ||
for(int j = 0; j < drives.size(); j++){ | ||
if(j != i){ | ||
ofStringReplace(filePath, drives[j], drives[i]); | ||
} | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
|
||
return filePath; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// CloudsGlobal.h | ||
// CloudsStoryEngine | ||
// | ||
// Created by James George on 7/11/13. | ||
// | ||
// | ||
|
||
#pragma once | ||
|
||
#include "ofMain.h" | ||
#include "CloudsLocalization.h" | ||
#include "CloudsGlobal.h" | ||
#include "ofxLocalization.h" | ||
|
||
|
||
//-------------------------------------- | ||
static ofxLocalization localization; | ||
static bool localizationLoaded = false; | ||
bool InitLocalization(){ | ||
localizationLoaded = true; | ||
return localization.load(GetCloudsDataPath() + "language/languagefile.csv"); | ||
} | ||
|
||
//-------------------------------------- | ||
string GetTranslationForString(string toTranslate){ | ||
if(!localizationLoaded){ | ||
InitLocalization(); | ||
} | ||
|
||
return localization.translateKeyToLanguage(toTranslate, GetLanguage()); | ||
} | ||
|
||
//-------------------------------------- | ||
string GetFontPath(){ | ||
if(GetLanguage() == "JAPANESE"){ | ||
return GetCloudsDataPath() + "font/mplus-1c-regular.ttf"; | ||
} | ||
else{ | ||
return GetCloudsDataPath() + "font/Blender-BOOK.ttf"; | ||
} | ||
} |
Oops, something went wrong.