Gestion de la table de locale & re-numérotation 2DA
This commit is contained in:
parent
276c1acf80
commit
a2ba1c1759
7 changed files with 46 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
id name spell hp
|
||||
1 Yannick 1 120
|
||||
2 Fanch 2 80
|
||||
3 Killian 3 80
|
||||
4 Gwen 4 100
|
||||
0 Yannick 0 120
|
||||
1 Fanch 1 80
|
||||
2 Killian 2 80
|
||||
3 Gwen 3 100
|
||||
|
|
6
Assets/rules/locale_fr.2da
Normal file
6
Assets/rules/locale_fr.2da
Normal file
|
@ -0,0 +1,6 @@
|
|||
id text
|
||||
0 "invalid_strref"
|
||||
1 "Veille nocturne"
|
||||
2 "Coup de crêpière"
|
||||
3 "Goulée de cidre"
|
||||
4 "Omelette aux champignons"
|
4
Assets/rules/locale_fr.2da.meta
Normal file
4
Assets/rules/locale_fr.2da.meta
Normal file
|
@ -0,0 +1,4 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dbf54318cd09dbf4c963baaf759580a2
|
||||
DefaultImporter:
|
||||
userData:
|
|
@ -1,5 +1,5 @@
|
|||
id name ulti alignment
|
||||
1 Notaire 1 villager
|
||||
2 Chasseur 2 villager
|
||||
3 Marionetiste 3 dark
|
||||
4 espion 4 dark
|
||||
0 Notaire 0 villager
|
||||
1 Chasseur 1 villager
|
||||
2 Marionetiste 2 dark
|
||||
3 espion 3 dark
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
id name description script
|
||||
1 "veille nocturne" "se rend invincible pendant un tour" _
|
||||
2 "coup de crépière" "inflige 25 pv de dégats à un personnage" _
|
||||
3 "goulée de cidre" "soigne un personnage de 50 PV" _
|
||||
4 "omelette aux champignons" "rend un personnage malade pendant un tour, ne peux ni parler, ni rien faire pendant un tour" _
|
||||
id name name_strref description script
|
||||
0 "veille nocturne" 1 "se rend invincible pendant un tour" _
|
||||
1 "coup de crépière" 2 "inflige 25 pv de dégats à un personnage" _
|
||||
2 "goulée de cidre" 3 "soigne un personnage de 50 PV" _
|
||||
3 "omelette aux champignons" 4 "rend un personnage malade pendant un tour, ne peux ni parler, ni rien faire pendant un tour" _
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
id name description
|
||||
1 "inspection du domicile" "révèle le rôle d'un personnage"
|
||||
2 "galinette sandrée" "inflige 80 de dégats à un personnage"
|
||||
3 "étrange rituel druidique" "rammène un mort (il peut être mort dans la même nuit), à la vie, peut utiliser le tchat en son nom, ne peut pas voter pour lui"
|
||||
4 "farfouinnage" "révèle le rôle d'un personnage"
|
||||
0 "inspection du domicile" "révèle le rôle d'un personnage"
|
||||
1 "galinette sandrée" "inflige 80 de dégats à un personnage"
|
||||
2 "étrange rituel druidique" "rammène un mort (il peut être mort dans la même nuit), à la vie, peut utiliser le tchat en son nom, ne peut pas voter pour lui"
|
||||
3 "farfouinnage" "révèle le rôle d'un personnage"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -13,6 +13,15 @@ public class RulesDatabase {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static void SetLocale(string lang){
|
||||
m_inst.m_strref = GetTable("locale_"+lang);
|
||||
}
|
||||
|
||||
public static string GetStrRef(int strref){
|
||||
RulesDatabase inst = Get();
|
||||
|
||||
return inst.m_strref.GetValue(strref, "text");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -29,20 +38,23 @@ public class RulesDatabase {
|
|||
//Debug.Log ("Found "+name);
|
||||
}
|
||||
|
||||
//Set default locale table
|
||||
m_tables.TryGetValue("locale_fr", out m_strref);
|
||||
}
|
||||
|
||||
|
||||
private static RulesDatabase inst = null;
|
||||
private static object syncRoot = new Object();
|
||||
private static RulesDatabase m_inst = null;
|
||||
private static object m_singlmutex = new Object();
|
||||
private static RulesDatabase Get(){
|
||||
lock(syncRoot){
|
||||
if(inst==null)
|
||||
inst = new RulesDatabase();
|
||||
lock(m_singlmutex){
|
||||
if(m_inst==null)
|
||||
m_inst = new RulesDatabase();
|
||||
}
|
||||
return inst;
|
||||
return m_inst;
|
||||
}
|
||||
|
||||
private Dictionary<string, TwoDA> m_tables;
|
||||
private TwoDA m_strref = null;
|
||||
private string m_folder = "Assets/rules";
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue