update game for all

This commit is contained in:
mrtoine 2025-09-30 19:22:13 +02:00
parent 423134a840
commit 429112c335
29 changed files with 175 additions and 139 deletions

BIN
Assets/.DS_Store vendored

Binary file not shown.

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0ced038fa2686a645995f62841bab076
guid: eebb81916fa78478a96757294d4d09c0
folderAsset: yes
DefaultImporter:
externalObjects: {}

BIN
Assets/StreamingAssets/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -43,19 +43,22 @@
<quests.2.objective>Kill a Troll</quests.2.objective>
<!-- EVENTS -->
<!-- Events quests -->
<!--<quests.events.rats.infection.1>While scouting the barn, an adventurer notices claw marks forming a crude arrow on the floor, pointing deeper into the hay.</quests.events.rats.infection.1>
<quests.events.rats.infection.2>The team stumbles upon a circle of rats standing unnaturally still. As the adventurers approach, the rats silently disperse… in perfect synchrony.</quests.events.rats.infection.2>
<quests.events.rats.infection.3>One rat, larger than the rest, pauses at the edge of the forest and turns to stare at the adventurers. It bares its teeth, then vanishes into the mist.</quests.events.rats.infection.3>-->
<quests.events.rats.infection.1>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.</quests.events.rats.infection.1>
<quests.events.rats.infection.2>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.</quests.events.rats.infection.2>
<quests.events.rats.infection.3>Un rat, plus gros que les autres, sarrête à la lisière de la forêt et fixe les aventuriers. Il montre les dents, puis disparaît dans la brume.</quests.events.rats.infection.3>
<!-- Quest-related events -->
<quests.events.rats.infection.1>While inspecting the barn, an adventurer notices deep claw marks forming a crude arrow on the floor, pointing toward a pile of hay.</quests.events.rats.infection.1>
<quests.events.rats.infection.2>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.</quests.events.rats.infection.2>
<quests.events.rats.infection.3>A rat—larger than the others—pauses at the forests edge, locking eyes with the adventurers. It bares its fangs, then vanishes into the mist.</quests.events.rats.infection.3>
<!-- RANDOM EVENTS -->
<event.plain.narrative.1>The adventurers discover a mysterious wheel of cheese. One swears it just whispered to them.</event.plain.narrative.1>
<event.plain.narrative.2>Mid-stride, a hero trips—over nothing at all. Dignity -1.</event.plain.narrative.2>
<event.plain.narrative.3>A goblin peddles “genuine dragon toenails” to the group. One hero actually buys one.</event.plain.narrative.3>
<event.plain.narrative.4>A fierce debate erupts: is soup a dish or a drink? The party splits, 2 vs. 2.</event.plain.narrative.4>
<event.plain.narrative.5>A chest sits invitingly off the beaten path, hidden from prying eyes. The group (almost) unanimously agrees to open it. Jackpot! 100 gold inside!</event.plain.narrative.5>
<event.plain.narrative.6>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.</event.plain.narrative.6>
<event.plain.narrative.7>Nothing to report. Oh wait—one adventurer is struck by *catastrophic* food poisoning!</event.plain.narrative.7>
<event.plain.fight.1>A band of brigands demands a toll at the bridge. Youre forced to pay... or put them down. After a brutal skirmish, your adventurers stand victorious!</event.plain.fight.1>
<!-- Randoms -->
<event.plain.narrative.1>Les aventuriers trouvent une mystérieuse meule de fromage. Lun deux jure quelle lui parle.</event.plain.narrative.1>
<event.plain.narrative.2>En marchant, un héros trébuche... sur absolument rien. Dignité -1.</event.plain.narrative.2>
<event.plain.narrative.3>Un gobelin tente de vendre au groupe des « ongles de pied de dragon authentiques ». Un héros en achète un.</event.plain.narrative.3>
<event.plain.narrative.4>Un débat houleux éclate : la soupe, cest un plat ou une boisson ? Le groupe se divise, 2 contre 2.</event.plain.narrative.4>
<!-- ITEMS -->
<item_gold>Gold</item_gold>

BIN
Assets/_/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -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

Binary file not shown.

View file

@ -1 +0,0 @@
LE CODE

View file

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 316f69e8b296f2045901b9fbc5e1a35c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7aeca2c5510942e5a3c45ff5272bc040
timeCreated: 1759234532

View file

@ -0,0 +1,8 @@
namespace Core.Runtime.Enums
{
public enum EnumLanguage
{
English,
French,
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a1f020b6f635444c89c9d8b30acec48b
timeCreated: 1759234549

View file

@ -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<string, string>();
LoadFacts("GeneralSettings");
_fact = m_gameFacts;
CurrentLanguage = m_gameFacts.GetFact<string>("language");
if (!m_gameFacts.FactExists<string>("language", out _))
// Chargement ou création des paramètres
if (m_gameFacts.SaveFileExists("GeneralSettings"))
{
m_gameFacts.SetFact("language", "fr", FactPersistence.Persistent);
Debug.Log("<color=green>GeneralSettings exist</color>");
LoadFacts("GeneralSettings");
}
LocalizationSystem.Instance.LoadLanguage();
else
{
Debug.Log("<color=orange>GeneralSettings does not exist</color>");
GeneralSettings settings = new GeneralSettings
{
Language = EnumLanguage.English,
};
SetFact("GeneralSettings", settings, FactPersistence.Persistent);
SaveFacts("GeneralSettings");
}
CurrentLanguage = GetFact<GeneralSettings>("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<string, string> _localTexts;
bool isOnPause = false;
SceneLoader _sceneLoader;
FactDictionnary _fact;
bool _canPause;
string _profile;
EnumLanguage _currentLanguage;
Dictionary<string, string> _localTexts;
bool _launchedTime;
int _currentGameTime = 0;
GameTime _gameTime;

View file

@ -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<string>("language", newLanguage, FactPersistence.Persistent);
}
public void LoadLanguage()
public void LoadLanguage(EnumLanguage langReceived)
{
/*if (!FactExists<string>("language", out var language))
{
SetFact("language", language, FactPersistence.Persistent);
}*/
string lang = langReceived.ToString();
string lang = GetLanguage();
GameManager.Instance.CurrentLanguage = lang;
string langFile = GetLanguageFile();
if (!string.IsNullOrEmpty(langFile))
if (Enum.TryParse(lang, out EnumLanguage parsedLang))
{
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<string>("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

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c462b8bd55c644cd93431eff1f2da5d2
timeCreated: 1759234811

View file

@ -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;
}
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 45ead23d22c643d8be8bf9c1e34904fc
timeCreated: 1759234823

View file

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 5ac3d52df8c674b6d8b4508eeb23d622
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -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
}

View file

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: e71f3931e213bd349b00738e7d5376d0
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -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");
}
}
}

View file

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 55ed85535e4d41bdadca7f7c2628ddff
timeCreated: 1752476966

View file

@ -1,4 +1,3 @@
using Codice.CM.Common;
using Core.Runtime;
using TMPro;
using UnityEngine;