Elin Decompiled Documentation EA 23.312 Nightly Patch 4
Loading...
Searching...
No Matches
CustomBiographyContent Class Reference
Inheritance diagram for CustomBiographyContent:
CustomFileContent CustomContent EClass

Public Member Functions

override void OnSetLang (string lang)
 
void RefreshCharaBio (Chara chara)
 
- Public Member Functions inherited from CustomFileContent
bool HasFileChanged ()
 
virtual void OnSetLang (string lang)
 
void Load ()
 
- Public Member Functions inherited from CustomContent
virtual void OnGameLoad (GameIOContext context)
 
virtual void OnGameSave (GameIOContext context)
 
override string ToString ()
 

Static Public Member Functions

static CustomBiographyContent CreateFromId (string biographyId, ModPackage owner=null)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Public Attributes

string background
 
int birthDay
 
int birthMonth
 
int birthYear
 
string birthLocation
 
string birthPlace
 
string dad
 
string mom
 
string likeThing
 
string likeHobby
 
string favCategory
 
string favFood
 

Protected Member Functions

override void LoadContent ()
 
abstract void LoadContent ()
 

Static Private Attributes

const int FallbackWordKey = -100
 
static int _lastWordKey
 

Additional Inherited Members

- Static Public Attributes inherited from EClass
static Core core
 
- Properties inherited from CustomFileContent
DateTime LastModified = DateTime.MinValue [get, set]
 
FileInfo File [get, set]
 
- Properties inherited from CustomContent
string ContentId [get, protected set]
 
EMod Owner [get, protected set]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 7 of file CustomBiographyContent.cs.

Member Function Documentation

◆ CreateFromId()

static CustomBiographyContent CustomBiographyContent.CreateFromId ( string  biographyId,
ModPackage  owner = null 
)
inlinestatic

Definition at line 37 of file CustomBiographyContent.cs.

38 {
39 var (fileInfo, eMod) = PackageIterator.GetFilesEx("Data/bio_" + biographyId + ".json").LastOrDefault();
40 if (fileInfo == null)
41 {
42 return null;
43 }
44 if (owner == null)
45 {
46 owner = eMod as ModPackage;
47 }
48 return new CustomBiographyContent
49 {
50 ContentId = "Biography/" + biographyId,
51 Owner = owner,
52 File = fileInfo
53 };
54 }
string ContentId
Definition: CustomContent.cs:6

References CustomContent.ContentId, CustomFileContent.File, and CustomContent.Owner.

Referenced by CustomCharaContent.CreateFromRow(), and OnSetLang().

◆ LoadContent()

override void CustomBiographyContent.LoadContent ( )
inlineprotectedvirtual

Implements CustomFileContent.

Definition at line 124 of file CustomBiographyContent.cs.

125 {
126 CustomBiographyContent customBiographyContent = IO.LoadFile<CustomBiographyContent>(base.File.FullName);
127 background = customBiographyContent.background;
128 birthDay = customBiographyContent.birthDay;
129 birthMonth = customBiographyContent.birthMonth;
130 birthYear = customBiographyContent.birthYear;
131 birthLocation = customBiographyContent.birthLocation;
132 birthPlace = customBiographyContent.birthPlace;
133 dad = customBiographyContent.dad;
134 mom = customBiographyContent.mom;
135 likeThing = customBiographyContent.likeThing;
136 likeHobby = customBiographyContent.likeHobby;
137 favCategory = customBiographyContent.favCategory;
138 favFood = customBiographyContent.favFood;
139 }
Definition: IO.cs:11

References background, birthDay, birthLocation, birthMonth, birthPlace, birthYear, dad, favCategory, favFood, likeHobby, likeThing, and mom.

◆ OnSetLang()

override void CustomBiographyContent.OnSetLang ( string  lang)
inlinevirtual

Reimplemented from CustomFileContent.

Definition at line 56 of file CustomBiographyContent.cs.

57 {
58 CustomBiographyContent customBiographyContent = CreateFromId(base.ContentId.Split('/')[^1]);
59 if (customBiographyContent != null)
60 {
61 base.File = customBiographyContent.File;
62 base.LastModified = DateTime.MinValue;
63 }
64 }
static CustomBiographyContent CreateFromId(string biographyId, ModPackage owner=null)

References CreateFromId(), and CustomFileContent.File.

◆ RefreshCharaBio()

void CustomBiographyContent.RefreshCharaBio ( Chara  chara)
inline

Definition at line 66 of file CustomBiographyContent.cs.

67 {
68 Load();
69 Biography bio = chara.bio;
70 bio.birthDay = birthDay;
71 bio.birthMonth = birthMonth;
72 bio.birthYear = birthYear;
73 Dictionary<int, LangWord.Row> langWord = EClass.sources.langWord.map;
74 if (!langWord.ContainsKey(-100))
75 {
76 _lastWordKey = -100;
77 SetTempWord("");
78 }
79 if (!birthPlace.IsEmpty())
80 {
81 bio.idHome = SetTempWord(birthPlace);
82 }
83 if (!birthLocation.IsEmpty())
84 {
85 bio.idLoc = SetTempWord(birthLocation);
86 }
87 if (!dad.IsEmpty())
88 {
89 bio.idAdvDad = -100;
90 bio.idDad = SetTempWord(dad);
91 }
92 if (!mom.IsEmpty())
93 {
94 bio.idAdvMom = -100;
95 bio.idMom = SetTempWord(mom);
96 }
97 if (!likeThing.IsEmpty() && EClass.sources.things.map.ContainsKey(likeThing))
98 {
99 bio.idLike = likeThing;
100 }
101 if (!likeHobby.IsEmpty() && Core.GetElement(likeHobby) != EClass.sources.elements.rows[0].id)
102 {
103 bio.idHobby = -100;
104 }
105 int SetTempWord(string text)
106 {
107 while (langWord.ContainsKey(_lastWordKey))
108 {
109 _lastWordKey--;
110 }
111 Dictionary<int, LangWord.Row> dictionary = langWord;
112 int lastWordKey = _lastWordKey;
113 LangWord.Row obj = new LangWord.Row
114 {
115 id = _lastWordKey
116 };
117 LangWord.Row row = obj;
118 dictionary[lastWordKey] = obj;
119 row.name = (row.name_JP = (row.name_L = text));
120 return _lastWordKey;
121 }
122 }
Biography bio
Definition: Card.cs:45
Definition: Core.cs:14
static int GetElement(string id)
Definition: Core.cs:743
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:43
SourceThing things
LangWord langWord
SourceElement elements

References _lastWordKey, Card.bio, birthDay, birthLocation, birthMonth, birthPlace, birthYear, dad, SourceManager.elements, Core.GetElement(), SourceManager.langWord, likeHobby, likeThing, CustomFileContent.Load(), mom, EClass.sources, and SourceManager.things.

Member Data Documentation

◆ _lastWordKey

int CustomBiographyContent._lastWordKey
staticprivate

Definition at line 11 of file CustomBiographyContent.cs.

Referenced by RefreshCharaBio().

◆ background

string CustomBiographyContent.background

Definition at line 13 of file CustomBiographyContent.cs.

Referenced by LoadContent().

◆ birthDay

int CustomBiographyContent.birthDay

Definition at line 15 of file CustomBiographyContent.cs.

Referenced by LoadContent(), and RefreshCharaBio().

◆ birthLocation

string CustomBiographyContent.birthLocation

Definition at line 21 of file CustomBiographyContent.cs.

Referenced by LoadContent(), and RefreshCharaBio().

◆ birthMonth

int CustomBiographyContent.birthMonth

Definition at line 17 of file CustomBiographyContent.cs.

Referenced by LoadContent(), and RefreshCharaBio().

◆ birthPlace

string CustomBiographyContent.birthPlace

Definition at line 23 of file CustomBiographyContent.cs.

Referenced by LoadContent(), and RefreshCharaBio().

◆ birthYear

int CustomBiographyContent.birthYear

Definition at line 19 of file CustomBiographyContent.cs.

Referenced by LoadContent(), and RefreshCharaBio().

◆ dad

string CustomBiographyContent.dad

Definition at line 25 of file CustomBiographyContent.cs.

Referenced by LoadContent(), and RefreshCharaBio().

◆ FallbackWordKey

const int CustomBiographyContent.FallbackWordKey = -100
staticprivate

Definition at line 9 of file CustomBiographyContent.cs.

◆ favCategory

string CustomBiographyContent.favCategory

Definition at line 33 of file CustomBiographyContent.cs.

Referenced by LoadContent().

◆ favFood

string CustomBiographyContent.favFood

Definition at line 35 of file CustomBiographyContent.cs.

Referenced by LoadContent().

◆ likeHobby

string CustomBiographyContent.likeHobby

Definition at line 31 of file CustomBiographyContent.cs.

Referenced by LoadContent(), and RefreshCharaBio().

◆ likeThing

string CustomBiographyContent.likeThing

Definition at line 29 of file CustomBiographyContent.cs.

Referenced by LoadContent(), and RefreshCharaBio().

◆ mom

string CustomBiographyContent.mom

Definition at line 27 of file CustomBiographyContent.cs.

Referenced by LoadContent(), and RefreshCharaBio().


The documentation for this class was generated from the following file: