From 429112c335e6e0a4ea89171f6fe964b1f2287c08 Mon Sep 17 00:00:00 2001 From: mrtoine Date: Tue, 30 Sep 2025 19:22:13 +0200 Subject: [PATCH] update game for all --- Assets/.DS_Store | Bin 10244 -> 12292 bytes .../Editor.meta => StreamingAssets.meta} | 2 +- Assets/StreamingAssets/.DS_Store | Bin 0 -> 6148 bytes .../Localization.meta | 0 .../Localization/English.xml} | 31 ++++--- .../Localization/English.xml.meta} | 0 .../Localization/French.xml} | 0 .../Localization/French.xml.meta} | 0 Assets/_/.DS_Store | Bin 8196 -> 10244 bytes Assets/_/Content/.DS_Store | Bin 6148 -> 10244 bytes Assets/_/Content/Classic_RPG_GUI/.DS_Store | Bin 0 -> 8196 bytes .../Classic_RPG_GUI/Parts/mid_button.png.meta | 85 ++++++++++++++---- Assets/_/Database/.DS_Store | Bin 6148 -> 6148 bytes Assets/_/Features/Contenu.txt | 1 - Assets/_/Features/Contenu.txt.meta | 7 -- Assets/_/Features/Core/Runtime/Enums.meta | 3 + .../Core/Runtime/Enums/EnumLanguage.cs | 8 ++ .../Core/Runtime/Enums/EnumLanguage.cs.meta | 3 + Assets/_/Features/Core/Runtime/GameManager.cs | 41 +++++---- .../Core/Runtime/LocalizationSystem.cs | 32 ++++--- Assets/_/Features/Core/Runtime/datas.meta | 3 + .../Core/Runtime/datas/GeneralSettings.cs | 26 ++++++ .../Runtime/datas/GeneralSettings.cs.meta | 3 + Assets/_/Features/Template.meta | 8 -- .../Template/Editor/Template.Editor.asmdef | 16 ---- .../Editor/Template.Editor.asmdef.meta | 7 -- .../Tests/Runtime/testLocalization.cs | 34 ------- .../Tests/Runtime/testLocalization.cs.meta | 3 - .../UI/Runtime/Quests/Events/QuestLogUI.cs | 1 - 29 files changed, 175 insertions(+), 139 deletions(-) rename Assets/{_/Features/Template/Editor.meta => StreamingAssets.meta} (77%) mode change 100755 => 100644 create mode 100644 Assets/StreamingAssets/.DS_Store rename Assets/{_/Database => StreamingAssets}/Localization.meta (100%) rename Assets/{_/Database/Localization/en.xml => StreamingAssets/Localization/English.xml} (56%) rename Assets/{_/Database/Localization/en.xml.meta => StreamingAssets/Localization/English.xml.meta} (100%) rename Assets/{_/Database/Localization/fr.xml => StreamingAssets/Localization/French.xml} (100%) rename Assets/{_/Database/Localization/fr.xml.meta => StreamingAssets/Localization/French.xml.meta} (100%) create mode 100644 Assets/_/Content/Classic_RPG_GUI/.DS_Store delete mode 100755 Assets/_/Features/Contenu.txt delete mode 100755 Assets/_/Features/Contenu.txt.meta create mode 100644 Assets/_/Features/Core/Runtime/Enums.meta create mode 100644 Assets/_/Features/Core/Runtime/Enums/EnumLanguage.cs create mode 100644 Assets/_/Features/Core/Runtime/Enums/EnumLanguage.cs.meta create mode 100644 Assets/_/Features/Core/Runtime/datas.meta create mode 100644 Assets/_/Features/Core/Runtime/datas/GeneralSettings.cs create mode 100644 Assets/_/Features/Core/Runtime/datas/GeneralSettings.cs.meta delete mode 100644 Assets/_/Features/Template.meta delete mode 100755 Assets/_/Features/Template/Editor/Template.Editor.asmdef delete mode 100755 Assets/_/Features/Template/Editor/Template.Editor.asmdef.meta delete mode 100644 Assets/_/Features/Tests/Runtime/testLocalization.cs delete mode 100644 Assets/_/Features/Tests/Runtime/testLocalization.cs.meta diff --git a/Assets/.DS_Store b/Assets/.DS_Store index ff293fcc09a4ee7fe618a493ac56b94eb71ab3f9..a690fea5ddf3f2be78303ba88aedf246ff681601 100644 GIT binary patch delta 1357 zcmcJO&1(}u6u{rhhe>T}CjE%f7zy2gN_%M4qGF+Gib!ZnLQ^EAt!c8EZWp&R$?hh# zB5s9(=X4L^*^?(Jxr*pN;J@I(KcHR&Z#tV*TPm1~dGKc5d-FbancwW^_cxLNfSE>h z5+EkbpipNg{bG3mkPNkwR}x;~pwMZd!X^L)aA<%IGSF6CvL{kLzmwpz)6r>rf!sc< zdjsu2&=4m zskU#D=Ygro@#Kv=*X?&?#_E!<%FUWP4c}L4nrfI66Q2n|kJslv6A1R5?GFu{3zNv; zP-HkVGBOf99~-Yam9qRu(RqVa=eWl8jMktf5;nH@PFChDuhXVVcZ!xtADadB zi8vcPRk1{?50693yETzBd>rU>y{}WsRux^X<~BDCY8Fq}E6zAs=bD!1hH9#ut*mv% zn{+$NHo2JCR4uxbt2t-J1F9Qh|Es9Du9YiP%dreMO}@QS*7Y(|XlA#livMsvy)&~= zE6XZVq?xasYk)o}ebu!HNUkB6At-%N@*THtnQ=xfDebx-rRRU81z}8FcmdX+4twwt zUc+1X2%q2!d_yk|U=&Aj499T_Z($l|aSj)75tne)t@k*1Ig)U<-z!#yb^5yRo}#N+ z(3!@WB2t|;!~bH@PRHW@1Bbu%My%zz;CCm*oCk65i0U&$dSu-h`c#LX2$9@dR@q~{_xu)^tzB|an@V(x{$Z{U(suSC-eTp#zCO9 GSNaKzR#6}T delta 189 zcmZokXbF&DU|?W$DortDU{C-uIe-{M3-C-V6q~3gIoUvlMI6XyFau&npg2Q*5=a_| z9XAVVEM?!!&cVXLXf~NgVI{kzk&c3~x%uP=LiU?aD|xU^oNPJSLO@`%jKF=y$vZ_Q zH_sByW!kL3D8?$t3^V`;6u5zeE6BRdf{fppC-ch~vI1>kXqfCMBhA4CagWC21euwe NFRD2)A`Glx1OU9PC3ye< 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 0000000000000000000000000000000000000000..898c0e5094ab7837ba4128ad37ea415b44565bcc GIT binary patch literal 6148 zcmeHKTTc@~6g~q*wp?Tj6p5E)V_!^Ykc()D4=x2`h!_YZ2m!3S?NB#tXX@^j3WTK3 z`UCs{{s0r7d@}k6eDu`^|9~$(>zPX<7we;G%${WCJ2P{>Ju}~Cc6I=O-Io`(Oz;6mj34+`k;yqR)%2 z&s~fWABY^5@t@Mr`wP#lhgHpc?^b;;j3y?&kdDqo*M)AQ+vqiR^3QlZA30Gi%sIi9 zXsvPXyG`G5*F9P(|(XSLn3V#VhXX^^p(F z^?fzX<_eQNy?y-`2h7yqP--}pPNzpMjSgPEa(TuHHkg*@?C|4!0g7jyb7sH1L)OXtg3Y!vt%}jxRFX#R|j<{8tK)#6o^S zT<-PRdTw#zthKN_#Uf0^H55t;R{A)WjyQ@(u}H%)OE`$O#)d-dL5qI`qzrKtEAUSh F_yrOw?+O3_ literal 0 HcmV?d00001 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 14b331e6b45a582d7864c2df8f4d1620f04c99b0..ef68b8957c484cfbe9527d19b33948c6349b204f 100644 GIT binary patch delta 809 zcmZp1XbF&DU|?W$DortDU{C-uIe-{M3-C-V6q~50$SA!rU^hRb^kg0Zhsn!?8re+^ zbrg&(jV9{}+w-$CI5Xrkmq=LxFb;9}vqGI9_LQ>K)@dCn0iOJdNMfs(9DbD#h z`9)4SrK#}({KXmh<(|p;c>zVKWtpkvldlUOu8&SH%1j9^NKDSmOINo40JI+nIF%hV zAS?j}We5Z4J^@DM1L*-^E@wzyeqO4w1BAz*?BESm#lfJ>;K&fn5W`T&(7-UAVKKvc zhJy^}7#=fxWn^aLWfWsnV$^2TVKiklXLMk6WaM;a^kMX63}TF)tRbpA*;ZhJG@94S zf{XHU^7GPx7BEgeCD1;3qfi-AP&o3tFeCzlA(0^oh>ICgheuGTZsryG#k#Q}fLV|k z60{23K-v|QJT?}7XP(S26DYz2Ni^W7Vq{=204bbYAk#Z}qOi=+PYs|TaAyPnkVUNR delta 154 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8E20o2aMAD84aZH$S8JWF7&B$^V2JC(jjb zVca%3LZDDpth(A*N5R;@q*h0v+S15CN5Rz8xVDy)LsVJcIw(FnCpRy@WAX<9dB)Do sJH-C83Ni!D1p*0fAmIwKVq@WV=E?jjfgFqwiy0=z^Gw~mR+60=0Li5!2><{9 diff --git a/Assets/_/Content/.DS_Store b/Assets/_/Content/.DS_Store index 11b6c30b0d6097555e7ad0109926d69ab7944324..2c18ce5aad66f83c8bed6d1c6ac08ef214164fd6 100644 GIT binary patch literal 10244 zcmeHM&2Jk;6o2C+t(`RX=BrddC9A$vYA8wD01*cq+cb)3lqe1*QBvHsy>XVTcg*fO zA4HKXBrd>-3pXx^GlC18P!I=hJ#s)u2=Nc}(hC=OZ)Vf1Kh`O#1eG;o&AvCg^PAcE zy?OI?#sI)F_3|`85&)u@Nop7H(jn1v%55p)-$|ilhzHQY0~0vd;I`FPHxvVk0mXn~ zKrx^gcorDIm`y1=#3CHJ2s*W=4%Z8K^4ot#<`8_j#hr&efh)asrGAl!XkbB1Lw|1&qs%%_ww6( zFYoDI-OcFE29;Jhw~8maUc74>dj)Mg%WY3LZNm`&vut3M&38<@%=a?9ZkJtw&C3VT zSTt79E*&1u%uG)vZ_eI0noJ(f-k6$9-n#k9(NQcqk$U;{mBNlywfVVg|#q z{P_9_Y6RI~l8P6tskkEG(3`z3dpfIQliu*!S}02l!~T1+Ze2-#xvxdQihU@&m$eRu$F zi?ccp+-8r9P;d>Y*(2T+7`yVM9`dAsU0b|n@N~9^c}T=*nfJF4<6uNHAPINSSN2dY zqqN`vwMEp*P#2NR!EzS1F{U|~OBe$U)TlO^KC5I6dy6}Q42ZIx(?N5{}a*n zi$JuU{jc65j2WN^9(pfkBR_TF(=8UEi2CH%9*MDC`B71~hoWv*OSi<~v2I=y=6kdTHu(>EuS!qH zK%ays>HPoA@c;jxt`mh;3@8SkX$Dw-E}z3sMsc{%=}qzD1ve`I_c2pqm>W`(N@c1- zQXI!)fsW(FK?~lSqGyy)Py4bVCEmgGKl~XG*e9wlkskUI3D~veyF=~&o6aHr0hq0S A$^ZZW delta 139 zcmZn(XfcprU|?W$DortDU=RQ@Ie-{MGjUEV6q~50C<+o_1dA0hC@|zOBr+uBq;D)- z&dA6y*+D{Va)(6k~T5EfSe diff --git a/Assets/_/Content/Classic_RPG_GUI/.DS_Store b/Assets/_/Content/Classic_RPG_GUI/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e0577ff2ee1450e438f2edd07da86d28981891a7 GIT binary patch literal 8196 zcmeHM&u`;I6n-ylcb$~BPPZ);KO}2&LE38R?o!Z-1KzX=Q*lL-{W6cFQr1!>MB)S7h8}PTA%(LMYtvv9FbWt2i~>dhqrkJE z0Ik_FS!33H-D^stfKlLuR6u?o9Lf^i4Eq|@r-KT$1t6THW|gQ;`vAppGITTSYgAP7 zsdo>UQ8C+Mpr%v5Bh3lj4Eq{29Z=H&v&fk3P*6oDo}cv*2Orzdek*8~mo=YYH|gzMzwfLe!G{$mB;|xwIVTy%ZNXQ?O0ri%FG& zcctlfIZZ2w>3V$XToiVZg}b@RN`S;^dAI8#5^+81v8Fwj(3m${f^Wy{gvPp;vM&Lw-@>?)8|Fv^d z8U>zCfeCH4EcgHKk3au^I%mepC}0$LE)~GZjmC!jfj?NTildM}gB{ABQI<*C^))IA n71BhutL-@9lRpfp?qq##hJB6HL+SrI2r%ovlHU|Br~>~2vnjW} literal 0 HcmV?d00001 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 0150994825c4e69c9a2e392d5a8465bd5bad4715..44899e8ca7079c470a710b3908c2290a8033a7c3 100644 GIT binary patch delta 139 zcmZoMXfc=|#>B`mu~2NHo}wrV0|Nsi1A_nqLn1>GL$PO0esWUI#KPr_ER%a!71$Uo zf%3+aH?bPAF)Rl&U$NSY;HV^%^>D~FxV`}A;z+?;WOiAb`E|HpcO!Y@640= UMJ$1)gKc4g(kz=JMAk3^0PO4^B!ku~2NHo}wrR0|Nsi1A_nqLk>eGLlr|JLkUCXW=5vv%=I8C9tIzV ze1>G8Fp@M-B+oM^KRGEUKMAM?sF%SJi1q%10g#19Us8E-0aV|%q=KBx;t~UcYm7|H zEUawo9PAw29I?R}`Q^bSi6!-=#ZHMu(I9R}etu38jGdSimYG@}FCgNapI4HYnU`7w z){&W#3RDsko|%`DU+$D&nwL@x)*B3w;Naxoj295At~SxqpRo1r-iqFo;&CBlqdw_v478opGzzd~eR40&uGhE7oi}G^v^U{H8K>7u7h2LZ! zMoHfFKo#&%o6N(gz{V&G5}ItpXvD_Y4Q6IB+Oqxxv(_-W@i2i5hH3%EQYYhPb`E|H fU~~dG- _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;