moved Resources/colors.xml and Resources/localization.xml from persistentDataPath to Resources to ensure appstore compatibility
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76f828f47ce26cc43991113c6a39dbbf
|
||||
folderAsset: yes
|
||||
timeCreated: 1466010535
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e7d9a07cc3f02a41a575406e7230846
|
||||
timeCreated: 1466788421
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a6f8c7c1ea72ce46831c5e1b6150d0c
|
||||
timeCreated: 1466790933
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 383 KiB After Width: | Height: | Size: 25 KiB |
21
Assets/Resources/colors.xml
Normal file
21
Assets/Resources/colors.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<colors>
|
||||
<color name="t_color_name_light_blue">
|
||||
<base color="#03A9F4"/>
|
||||
<light color="#E1F5FE"/>
|
||||
<dark color="#0277BD"/>
|
||||
<transparency value="0.75"/>
|
||||
</color>
|
||||
<color name="t_color_name_light_green">
|
||||
<base color="#8BC34A"/>
|
||||
<light color="#F1F8E9"/>
|
||||
<dark color="#558B2F"/>
|
||||
<transparency value="0.75"/>
|
||||
</color>
|
||||
<color name="t_color_name_red">
|
||||
<base color="#F44336"/>
|
||||
<light color="#FFEBEE"/>
|
||||
<dark color="#C62828"/>
|
||||
<transparency value="0.75"/>
|
||||
</color>
|
||||
</colors>
|
||||
9
Assets/Resources/colors.xml.meta
Normal file
9
Assets/Resources/colors.xml.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39366101fc02f3b47a0df7508aa6ef1a
|
||||
timeCreated: 1545484620
|
||||
licenseType: Free
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
65
Assets/Resources/localization.xml
Normal file
65
Assets/Resources/localization.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<localization>
|
||||
<language key="de" name="Deutsch" flagPath="localization/flag_de.png"/>
|
||||
<language key="en" name="English" flagPath="localization/flag_uk_us.png" default="true"/>
|
||||
<entry name="t_color_name_light_blue">
|
||||
<text lang="de" type="inline" value="Hellblau"/>
|
||||
<text lang="en" type="inline" value="Light Blue"/>
|
||||
</entry>
|
||||
<entry name="t_color_name_light_green">
|
||||
<text lang="de" type="inline" value="Hellgrün"/>
|
||||
<text lang="en" type="inline" value="Light Green"/>
|
||||
</entry>
|
||||
<entry name="t_color_name_red">
|
||||
<text lang="de" type="inline" value="Rot"/>
|
||||
<text lang="en" type="inline" value="Red"/>
|
||||
</entry>
|
||||
<entry name="t_tutorial_reticule">
|
||||
<text lang="de" type="inline" value="Exponat anvisieren"/>
|
||||
<text lang="en" type="inline" value="Aim at exhibit"/>
|
||||
</entry>
|
||||
<entry name="t_tutorial_settings">
|
||||
<text lang="de" type="inline" value="Einstellungen öffnen"/>
|
||||
<text lang="en" type="inline" value="Open settings"/>
|
||||
</entry>
|
||||
<entry name="t_tutorial_select">
|
||||
<text lang="de" type="inline" value="Exponat auswählen"/>
|
||||
<text lang="en" type="inline" value="Select exhibit"/>
|
||||
</entry>
|
||||
<entry name="t_menu_button_color">
|
||||
<text lang="de" type="inline" value="Farbe"/>
|
||||
<text lang="en" type="inline" value="Color"/>
|
||||
</entry>
|
||||
<entry name="t_menu_button_language">
|
||||
<text lang="de" type="inline" value="Sprache"/>
|
||||
<text lang="en" type="inline" value="Language"/>
|
||||
</entry>
|
||||
<entry name="t_menu_button_fontsize">
|
||||
<text lang="de" type="inline" value="Textgröße"/>
|
||||
<text lang="en" type="inline" value="Font size"/>
|
||||
</entry>
|
||||
<entry name="t_menu_button_tutorial">
|
||||
<text lang="de" type="inline" value="Anleitung"/>
|
||||
<text lang="en" type="inline" value="Tutorial"/>
|
||||
</entry>
|
||||
<entry name="t_menu_button_credits">
|
||||
<text lang="de" type="inline" value="Credits"/>
|
||||
<text lang="en" type="inline" value="Credits"/>
|
||||
</entry>
|
||||
<entry name="t_languageselect_Default">
|
||||
<text lang="de" type="inline" value="Standard"/>
|
||||
<text lang="en" type="inline" value="Default"/>
|
||||
</entry>
|
||||
<entry name="t_languageselect_Large">
|
||||
<text lang="de" type="inline" value="Groß"/>
|
||||
<text lang="en" type="inline" value="Large"/>
|
||||
</entry>
|
||||
<entry name="t_credits">
|
||||
<text lang="de" type="file" value="localization/t_credits_de.txt"/>
|
||||
<text lang="en" type="file" value="localization/t_credits_en.txt"/>
|
||||
</entry>
|
||||
<entry name="t_credits_version">
|
||||
<text lang="de" type="file" value="localization/t_credits_version.txt"/>
|
||||
<text lang="en" type="file" value="localization/t_credits_version.txt"/>
|
||||
</entry>
|
||||
</localization>
|
||||
9
Assets/Resources/localization.xml.meta
Normal file
9
Assets/Resources/localization.xml.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4652cedf37d935e46a26d6f44630a456
|
||||
timeCreated: 1545484620
|
||||
licenseType: Free
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -86,14 +86,14 @@ namespace RothenburgAR
|
||||
|
||||
public void LoadLanguagesFromXml()
|
||||
{
|
||||
var xmlFilePath = Path.Combine(PathHelper.DataPath, "localization.xml");
|
||||
var file = Resources.Load<TextAsset>("localization");
|
||||
Debug.Log("Loading languages from Resources");
|
||||
|
||||
Debug.Log("Loading languages from '" + xmlFilePath + "'");
|
||||
if (!File.Exists(xmlFilePath))
|
||||
throw new FileNotFoundException(xmlFilePath);
|
||||
if (file == null)
|
||||
throw new FileNotFoundException("Localization file Assets/Resources/localization.xml not found");
|
||||
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(xmlFilePath);
|
||||
doc.LoadXml(file.text);
|
||||
|
||||
var languageNodes = doc.SelectNodes("//language");
|
||||
foreach (XmlNode languageNode in languageNodes)
|
||||
|
||||
@@ -95,13 +95,13 @@ namespace RothenburgAR.UI
|
||||
|
||||
private void InitializeUIColorSchemes()
|
||||
{
|
||||
var xmlFilePath = Path.Combine(PathHelper.DataPath, "colors.xml");
|
||||
Debug.Log("Loading colors from '" + xmlFilePath + "'");
|
||||
var file = Resources.Load<TextAsset>("colors");
|
||||
Debug.Log("Loading colors from Resources..");
|
||||
|
||||
if (!File.Exists(xmlFilePath))
|
||||
if (file == null)
|
||||
{
|
||||
// Set default colors, if not able to load
|
||||
Debug.Log("File " + xmlFilePath + " does not exist - use default colors");
|
||||
Debug.LogWarning("colors.xml does not exist in Resources folder - use default colors");
|
||||
AvailableUIColorSchemes = new List<UIColorScheme>
|
||||
{
|
||||
new UIColorScheme("t_color_name_light_blue", "#03A9F4", "#E1F5FE", "#0277BD", 0.75f),
|
||||
@@ -112,7 +112,7 @@ namespace RothenburgAR.UI
|
||||
}
|
||||
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(xmlFilePath);
|
||||
doc.LoadXml(file.text);
|
||||
|
||||
var colorNodes = doc.SelectNodes("//color");
|
||||
if (colorNodes == null) return;
|
||||
|
||||
Reference in New Issue
Block a user