diff --git a/Assets/.DS_Store b/Assets/.DS_Store index ff293fcc..a690fea5 100644 Binary files a/Assets/.DS_Store and b/Assets/.DS_Store differ diff --git a/Assets/_/Features/Template/Editor.meta b/Assets/StreamingAssets.meta old mode 100755 new mode 100644 similarity index 77% rename from Assets/_/Features/Template/Editor.meta rename to Assets/StreamingAssets.meta index a3acf599..3c1a8398 --- a/Assets/_/Features/Template/Editor.meta +++ b/Assets/StreamingAssets.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0ced038fa2686a645995f62841bab076 +guid: eebb81916fa78478a96757294d4d09c0 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/StreamingAssets/.DS_Store b/Assets/StreamingAssets/.DS_Store new file mode 100644 index 00000000..898c0e50 Binary files /dev/null and b/Assets/StreamingAssets/.DS_Store differ diff --git a/Assets/_/Database/Localization.meta b/Assets/StreamingAssets/Localization.meta similarity index 100% rename from Assets/_/Database/Localization.meta rename to Assets/StreamingAssets/Localization.meta diff --git a/Assets/_/Database/Localization/en.xml b/Assets/StreamingAssets/Localization/English.xml similarity index 56% rename from Assets/_/Database/Localization/en.xml rename to Assets/StreamingAssets/Localization/English.xml index dff95236..8c38a245 100644 --- a/Assets/_/Database/Localization/en.xml +++ b/Assets/StreamingAssets/Localization/English.xml @@ -41,22 +41,25 @@ Hamlet Troll A troll has gotten lost near a small hamlet. We must stop it from causing harm! Kill a Troll - + - - - En inspectant la grange, un aventurier remarque des traces de griffes formant une flèche grossière sur le sol, pointant vers un tas de foin. - Le groupe tombe sur un cercle de rats immobiles, figés dans une étrange posture. À leur approche, les rongeurs se dispersent silencieusement… dans une synchronisation parfaite. - Un rat, plus gros que les autres, s’arrête à la lisière de la forêt et fixe les aventuriers. Il montre les dents, puis disparaît dans la brume. - - - Les aventuriers trouvent une mystérieuse meule de fromage. L’un d’eux jure qu’elle lui parle. - En marchant, un héros trébuche... sur absolument rien. Dignité -1. - Un gobelin tente de vendre au groupe des « ongles de pied de dragon authentiques ». Un héros en achète un. - Un débat houleux éclate : la soupe, c’est un plat ou une boisson ? Le groupe se divise, 2 contre 2. + + While inspecting the barn, an adventurer notices deep claw marks forming a crude arrow on the floor, pointing toward a pile of hay. + The party stumbles upon a circle of motionless rats, frozen in an unnatural pose. As they draw near, the rodents scatter in eerie, perfect unison. + A rat—larger than the others—pauses at the forest’s edge, locking eyes with the adventurers. It bares its fangs, then vanishes into the mist. + + The adventurers discover a mysterious wheel of cheese. One swears it just whispered to them. + Mid-stride, a hero trips—over nothing at all. Dignity -1. + A goblin peddles “genuine dragon toenails” to the group. One hero actually buys one. + A fierce debate erupts: is soup a dish or a drink? The party splits, 2 vs. 2. + A chest sits invitingly off the beaten path, hidden from prying eyes. The group (almost) unanimously agrees to open it. Jackpot! 100 gold inside! + Curiosity is a dangerous habit. The adventurers learn this the hard way when something glints in the distance. They *had* to investigate. Barely escaping a pack of sharp-toothed goblins, they vow to mind their own business next time. + Nothing to report. Oh wait—one adventurer is struck by *catastrophic* food poisoning! + + A band of brigands demands a toll at the bridge. You’re forced to pay... or put them down. After a brutal skirmish, your adventurers stand victorious! + + Gold Description for golds. diff --git a/Assets/_/Database/Localization/en.xml.meta b/Assets/StreamingAssets/Localization/English.xml.meta similarity index 100% rename from Assets/_/Database/Localization/en.xml.meta rename to Assets/StreamingAssets/Localization/English.xml.meta diff --git a/Assets/_/Database/Localization/fr.xml b/Assets/StreamingAssets/Localization/French.xml similarity index 100% rename from Assets/_/Database/Localization/fr.xml rename to Assets/StreamingAssets/Localization/French.xml diff --git a/Assets/_/Database/Localization/fr.xml.meta b/Assets/StreamingAssets/Localization/French.xml.meta similarity index 100% rename from Assets/_/Database/Localization/fr.xml.meta rename to Assets/StreamingAssets/Localization/French.xml.meta diff --git a/Assets/_/.DS_Store b/Assets/_/.DS_Store index 14b331e6..ef68b895 100644 Binary files a/Assets/_/.DS_Store and b/Assets/_/.DS_Store differ diff --git a/Assets/_/Content/.DS_Store b/Assets/_/Content/.DS_Store index 11b6c30b..2c18ce5a 100644 Binary files a/Assets/_/Content/.DS_Store and b/Assets/_/Content/.DS_Store differ diff --git a/Assets/_/Content/Classic_RPG_GUI/.DS_Store b/Assets/_/Content/Classic_RPG_GUI/.DS_Store new file mode 100644 index 00000000..e0577ff2 Binary files /dev/null and b/Assets/_/Content/Classic_RPG_GUI/.DS_Store differ diff --git a/Assets/_/Content/Classic_RPG_GUI/Parts/mid_button.png.meta b/Assets/_/Content/Classic_RPG_GUI/Parts/mid_button.png.meta index 474d61a6..1b971bc1 100644 --- a/Assets/_/Content/Classic_RPG_GUI/Parts/mid_button.png.meta +++ b/Assets/_/Content/Classic_RPG_GUI/Parts/mid_button.png.meta @@ -1,9 +1,16 @@ fileFormatVersion: 2 guid: eb6e63566bb4fd54887ce087e3fab573 +AssetOrigin: + serializedVersion: 1 + productId: 160253 + packageName: Classic RPG GUI + packageVersion: 1.1 + assetPath: Assets/Classic_RPG_GUI/Parts/mid_button.png + uploadId: 445012 TextureImporter: - fileIDToRecycleName: {} + internalIDToNameTable: [] externalObjects: {} - serializedVersion: 9 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +27,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,9 +41,9 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 0 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 wrapW: 1 @@ -54,42 +64,87 @@ TextureImporter: textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 2 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 sprites: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 057928698b25d9f42a480ad4411a2d7f + internalID: 0 vertices: [] indices: edges: [] weights: [] - spritePackingTag: + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: -AssetOrigin: - serializedVersion: 1 - productId: 160253 - packageName: Classic RPG GUI - packageVersion: 1.1 - assetPath: Assets/Classic_RPG_GUI/Parts/mid_button.png - uploadId: 445012 diff --git a/Assets/_/Database/.DS_Store b/Assets/_/Database/.DS_Store index 01509948..44899e8c 100644 Binary files a/Assets/_/Database/.DS_Store and b/Assets/_/Database/.DS_Store differ diff --git a/Assets/_/Features/Contenu.txt b/Assets/_/Features/Contenu.txt deleted file mode 100755 index aeb6b37b..00000000 --- a/Assets/_/Features/Contenu.txt +++ /dev/null @@ -1 +0,0 @@ -LE CODE \ No newline at end of file diff --git a/Assets/_/Features/Contenu.txt.meta b/Assets/_/Features/Contenu.txt.meta deleted file mode 100755 index 0af335e1..00000000 --- a/Assets/_/Features/Contenu.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 316f69e8b296f2045901b9fbc5e1a35c -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/_/Features/Core/Runtime/Enums.meta b/Assets/_/Features/Core/Runtime/Enums.meta new file mode 100644 index 00000000..acf1ab59 --- /dev/null +++ b/Assets/_/Features/Core/Runtime/Enums.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7aeca2c5510942e5a3c45ff5272bc040 +timeCreated: 1759234532 \ No newline at end of file diff --git a/Assets/_/Features/Core/Runtime/Enums/EnumLanguage.cs b/Assets/_/Features/Core/Runtime/Enums/EnumLanguage.cs new file mode 100644 index 00000000..bb437071 --- /dev/null +++ b/Assets/_/Features/Core/Runtime/Enums/EnumLanguage.cs @@ -0,0 +1,8 @@ +namespace Core.Runtime.Enums +{ + public enum EnumLanguage + { + English, + French, + } +} diff --git a/Assets/_/Features/Core/Runtime/Enums/EnumLanguage.cs.meta b/Assets/_/Features/Core/Runtime/Enums/EnumLanguage.cs.meta new file mode 100644 index 00000000..05458334 --- /dev/null +++ b/Assets/_/Features/Core/Runtime/Enums/EnumLanguage.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a1f020b6f635444c89c9d8b30acec48b +timeCreated: 1759234549 \ No newline at end of file diff --git a/Assets/_/Features/Core/Runtime/GameManager.cs b/Assets/_/Features/Core/Runtime/GameManager.cs index 0725a8f5..7d33c806 100644 --- a/Assets/_/Features/Core/Runtime/GameManager.cs +++ b/Assets/_/Features/Core/Runtime/GameManager.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Core.Runtime.Enums; using UnityEngine; using UnityEngine.SceneManagement; @@ -58,7 +59,7 @@ namespace Core.Runtime set => _canPause = value; } - public string CurrentLanguage + public EnumLanguage CurrentLanguage { get { @@ -130,15 +131,25 @@ namespace Core.Runtime m_gameFacts = new FactDictionnary(); _localTexts = new Dictionary(); - LoadFacts("GeneralSettings"); - _fact = m_gameFacts; - CurrentLanguage = m_gameFacts.GetFact("language"); - - if (!m_gameFacts.FactExists("language", out _)) + // Chargement ou création des paramètres + if (m_gameFacts.SaveFileExists("GeneralSettings")) { - m_gameFacts.SetFact("language", "fr", FactPersistence.Persistent); + Debug.Log("GeneralSettings exist"); + LoadFacts("GeneralSettings"); } - LocalizationSystem.Instance.LoadLanguage(); + else + { + Debug.Log("GeneralSettings does not exist"); + GeneralSettings settings = new GeneralSettings + { + Language = EnumLanguage.English, + }; + SetFact("GeneralSettings", settings, FactPersistence.Persistent); + SaveFacts("GeneralSettings"); + } + + CurrentLanguage = GetFact("GeneralSettings").Language; + LocalizationSystem.Instance.LoadLanguage(CurrentLanguage); } #endregion @@ -192,13 +203,13 @@ namespace Core.Runtime #region Privates and Protected - private bool isOnPause = false; - private SceneLoader _sceneLoader; - private FactDictionnary _fact; - private bool _canPause; - private string _profile; - private string _currentLanguage = "en"; - private Dictionary _localTexts; + bool isOnPause = false; + SceneLoader _sceneLoader; + FactDictionnary _fact; + bool _canPause; + string _profile; + EnumLanguage _currentLanguage; + Dictionary _localTexts; bool _launchedTime; int _currentGameTime = 0; GameTime _gameTime; diff --git a/Assets/_/Features/Core/Runtime/LocalizationSystem.cs b/Assets/_/Features/Core/Runtime/LocalizationSystem.cs index 283c9ca7..a4ed5eeb 100644 --- a/Assets/_/Features/Core/Runtime/LocalizationSystem.cs +++ b/Assets/_/Features/Core/Runtime/LocalizationSystem.cs @@ -1,4 +1,6 @@ +using System; using System.IO; +using Core.Runtime.Enums; using TMPro; using UnityEngine; @@ -59,23 +61,18 @@ namespace Core.Runtime SetFact("language", newLanguage, FactPersistence.Persistent); } - public void LoadLanguage() + public void LoadLanguage(EnumLanguage langReceived) { - /*if (!FactExists("language", out var language)) + string lang = langReceived.ToString(); + + if (Enum.TryParse(lang, out EnumLanguage parsedLang)) { - SetFact("language", language, FactPersistence.Persistent); - }*/ - - string lang = GetLanguage(); - GameManager.Instance.CurrentLanguage = lang; - - string langFile = GetLanguageFile(); - if (!string.IsNullOrEmpty(langFile)) - { - GameManager.Instance.GetLocalTexts = XmlLoader.LoadDictionary(GetLanguageFile()); + GameManager.Instance.GetLocalTexts = XmlLoader.LoadDictionary(GetLanguageFile(parsedLang)); } else { + Debug.LogError($"Language {lang} not found"); + return; } } @@ -90,15 +87,16 @@ namespace Core.Runtime return file.Split('/')[file.Split('/').Length - 1].Split('.')[0]; } - private string GetLanguageFile() + private string GetLanguageFile(EnumLanguage lang = EnumLanguage.French) { - string filename = Application.dataPath + "/_/Database/Localization/" + GetFact("language") + ".xml"; + string filename = $"Localization/{lang}.xml"; + string filepath = Path.Combine(Application.streamingAssetsPath, filename); - if (File.Exists(filename)) + if (File.Exists(filepath)) { - return filename; + return filepath; } - return ""; + return Path.Combine(Application.streamingAssetsPath, "French.xml"); } #endregion diff --git a/Assets/_/Features/Core/Runtime/datas.meta b/Assets/_/Features/Core/Runtime/datas.meta new file mode 100644 index 00000000..b930eaee --- /dev/null +++ b/Assets/_/Features/Core/Runtime/datas.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c462b8bd55c644cd93431eff1f2da5d2 +timeCreated: 1759234811 \ No newline at end of file diff --git a/Assets/_/Features/Core/Runtime/datas/GeneralSettings.cs b/Assets/_/Features/Core/Runtime/datas/GeneralSettings.cs new file mode 100644 index 00000000..6678855b --- /dev/null +++ b/Assets/_/Features/Core/Runtime/datas/GeneralSettings.cs @@ -0,0 +1,26 @@ +using Core.Runtime.Enums; + +namespace Core.Runtime +{ + public class GeneralSettings + { + #region Attributes + + EnumLanguage _language; + + #endregion + + + public EnumLanguage Language + { + get + { + return _language; + } + set + { + _language = value; + } + } + } +} diff --git a/Assets/_/Features/Core/Runtime/datas/GeneralSettings.cs.meta b/Assets/_/Features/Core/Runtime/datas/GeneralSettings.cs.meta new file mode 100644 index 00000000..29c0301d --- /dev/null +++ b/Assets/_/Features/Core/Runtime/datas/GeneralSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 45ead23d22c643d8be8bf9c1e34904fc +timeCreated: 1759234823 \ No newline at end of file diff --git a/Assets/_/Features/Template.meta b/Assets/_/Features/Template.meta deleted file mode 100644 index 67b1f267..00000000 --- a/Assets/_/Features/Template.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5ac3d52df8c674b6d8b4508eeb23d622 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/_/Features/Template/Editor/Template.Editor.asmdef b/Assets/_/Features/Template/Editor/Template.Editor.asmdef deleted file mode 100755 index 4c715ed2..00000000 --- a/Assets/_/Features/Template/Editor/Template.Editor.asmdef +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "Template.Editor", - "rootNamespace": "Template.Editor", - "references": [], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/Assets/_/Features/Template/Editor/Template.Editor.asmdef.meta b/Assets/_/Features/Template/Editor/Template.Editor.asmdef.meta deleted file mode 100755 index 2ba65331..00000000 --- a/Assets/_/Features/Template/Editor/Template.Editor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: e71f3931e213bd349b00738e7d5376d0 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/_/Features/Tests/Runtime/testLocalization.cs b/Assets/_/Features/Tests/Runtime/testLocalization.cs deleted file mode 100644 index 19410e4d..00000000 --- a/Assets/_/Features/Tests/Runtime/testLocalization.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Core.Runtime; -using UnityEngine; - -namespace TestFacts.Runtime -{ - public class testLocalization : BaseMonobehaviour - { - private LocalizationSystem _localization = LocalizationSystem.Instance; - - [ContextMenu("Current Language ?")] - public void GetCurrentLanguage() - { - _localization.LoadLanguage(); - // Affichage de la langue courante - } - - [ContextMenu("Mettre en anglais")] - public void SetEnglish() - { - GameManager.Instance.CurrentLanguage = "en"; - _localization.SaveLanguage(GameManager.Instance.CurrentLanguage); - SaveFacts("GeneralSettings"); - } - - [ContextMenu("Mettre en français")] - public void SetFrench() - { - GameManager.Instance.CurrentLanguage = "fr"; - _localization.SaveLanguage(GameManager.Instance.CurrentLanguage); - SaveFacts("GeneralSettings"); - } - } -} - diff --git a/Assets/_/Features/Tests/Runtime/testLocalization.cs.meta b/Assets/_/Features/Tests/Runtime/testLocalization.cs.meta deleted file mode 100644 index a4119385..00000000 --- a/Assets/_/Features/Tests/Runtime/testLocalization.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 55ed85535e4d41bdadca7f7c2628ddff -timeCreated: 1752476966 \ No newline at end of file diff --git a/Assets/_/Features/UI/Runtime/Quests/Events/QuestLogUI.cs b/Assets/_/Features/UI/Runtime/Quests/Events/QuestLogUI.cs index d897c7f3..4df4ead3 100644 --- a/Assets/_/Features/UI/Runtime/Quests/Events/QuestLogUI.cs +++ b/Assets/_/Features/UI/Runtime/Quests/Events/QuestLogUI.cs @@ -1,4 +1,3 @@ -using Codice.CM.Common; using Core.Runtime; using TMPro; using UnityEngine;