Elin Decompiled Documentation EA 23.345.1 Nightly
Loading...
Searching...
No Matches
SourcePref Class Reference
Inheritance diagram for SourcePref:
EClass SourcePrefCard SourcePrefTile

Public Member Functions

void OnAfterDeserialize ()
 
void OnBeforeSerialize ()
 
void Validate ()
 
void WriteIni (string path)
 

Static Public Member Functions

static SourcePref ReadFromIni (string path)
 
- 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

int[] ints = new int[26]
 
BitArray32 _bits1
 

Static Public Attributes

const int TotalPrefInts = 26
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

int test [get]
 
PrefFlag flags [get, set]
 
int shadow [get, set]
 
float height [get, set]
 
int liquidMod [get, set]
 
int liquidModMax [get, set]
 
float hatY [get, set]
 
float stackX [get, set]
 
float x [get, set]
 
float y [get, set]
 
float z [get, set]
 
int pivotX [get, set]
 
int pivotY [get, set]
 
int shadowX [get, set]
 
int shadowY [get, set]
 
int shadowRX [get, set]
 
int shadowRY [get, set]
 
int shadowBX [get, set]
 
int shadowBY [get, set]
 
int shadowBRX [get, set]
 
int shadowBRY [get, set]
 
int equipX [get, set]
 
int equipY [get, set]
 
int scaleIcon [get, set]
 
int defaultAltitude [get, set]
 
float heightFix [get, set]
 
int scaleTex [get, set]
 
float ScaleTex [get]
 
bool bypassShadow [get, set]
 
bool UsePref [get]
 
bool Float [get]
 
bool Surface [get]
 
bool FloatUnderwater [get]
 
- 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 10 of file SourcePref.cs.

Member Function Documentation

◆ OnAfterDeserialize()

void SourcePref.OnAfterDeserialize ( )
inline

Definition at line 373 of file SourcePref.cs.

374 {
375 Validate();
376 _bits1.SetInt(ints[22]);
377 }
int[] ints
Definition: SourcePref.cs:15
BitArray32 _bits1
Definition: SourcePref.cs:17
void Validate()
Definition: SourcePref.cs:385
void SetInt(int i)
Definition: BitArray32.cs:89

References _bits1, ints, BitArray32.SetInt(), and Validate().

◆ OnBeforeSerialize()

void SourcePref.OnBeforeSerialize ( )
inline

Definition at line 379 of file SourcePref.cs.

380 {
381 Validate();
382 ints[22] = _bits1.ToInt();
383 }
int ToInt()
Definition: BitArray32.cs:84

References _bits1, ints, BitArray32.ToInt(), and Validate().

◆ ReadFromIni()

static SourcePref SourcePref.ReadFromIni ( string  path)
inlinestatic

Definition at line 431 of file SourcePref.cs.

432 {
433 SourcePref sourcePref = new SourcePref();
434 IniData iniData = new FileIniDataParser().ReadFile(path, Encoding.UTF8);
435 sourcePref.ints[4] = iniData.Global["x"].ToInt();
436 sourcePref.ints[5] = iniData.Global["y"].ToInt();
437 sourcePref.ints[2] = iniData.Global["z"].ToInt();
438 sourcePref.pivotX = iniData.Global["pivotX"].ToInt();
439 sourcePref.pivotY = iniData.Global["pivotY"].ToInt();
440 sourcePref.shadow = iniData.Global["shadow"].ToInt();
441 sourcePref.shadowX = iniData.Global["shadowX"].ToInt();
442 sourcePref.shadowY = iniData.Global["shadowY"].ToInt();
443 sourcePref.shadowRX = iniData.Global["shadowRX"].ToInt();
444 sourcePref.shadowRY = iniData.Global["shadowRY"].ToInt();
445 sourcePref.shadowBX = iniData.Global["shadowBX"].ToInt();
446 sourcePref.shadowBY = iniData.Global["shadowBY"].ToInt();
447 sourcePref.shadowBRX = iniData.Global["shadowBRX"].ToInt();
448 sourcePref.shadowBRY = iniData.Global["shadowBRY"].ToInt();
449 sourcePref.ints[3] = iniData.Global["height"].ToInt();
450 sourcePref.ints[24] = iniData.Global["heightFix"].ToInt();
451 sourcePref.scaleIcon = iniData.Global["scaleIcon"].ToInt();
452 sourcePref.scaleTex = iniData.Global["scaleTex"].ToInt();
453 sourcePref.liquidMod = iniData.Global["liquidMod"].ToInt();
454 sourcePref.liquidModMax = iniData.Global["liquidModMax"].ToInt();
455 sourcePref.ints[23] = iniData.Global["hatY"].ToInt();
456 sourcePref.equipX = iniData.Global["equipX"].ToInt();
457 sourcePref.equipY = iniData.Global["equipY"].ToInt();
458 sourcePref.ints[17] = iniData.Global["stackX"].ToInt();
459 sourcePref.ints[1] = iniData.Global["flags"].ToInt();
460 return sourcePref;
461 }

References ints.

Referenced by SpriteData.LoadPref().

◆ Validate()

void SourcePref.Validate ( )
inline

Definition at line 385 of file SourcePref.cs.

386 {
387 if (ints.Length < 26)
388 {
389 Array.Resize(ref ints, 26);
390 }
391 }

References ints.

Referenced by OnAfterDeserialize(), OnBeforeSerialize(), RenderRow.SetImage(), SourceBlock.ValidatePref(), SourceChara.ValidatePref(), SourceDeco.ValidatePref(), SourceFloor.ValidatePref(), SourceObj.ValidatePref(), and WriteIni().

◆ WriteIni()

void SourcePref.WriteIni ( string  path)
inline

Definition at line 393 of file SourcePref.cs.

394 {
395 Validate();
396 FileIniDataParser fileIniDataParser = new FileIniDataParser();
397 if (File.Exists(path))
398 {
399 EClass.ui.Say("Ini file already exists.");
400 return;
401 }
402 File.CreateText(path).Close();
403 IniData iniData = fileIniDataParser.ReadFile(path, Encoding.UTF8);
404 iniData.Global["x"] = ints[4].ToString();
405 iniData.Global["y"] = ints[5].ToString();
406 iniData.Global["z"] = ints[2].ToString();
407 iniData.Global["pivotX"] = pivotX.ToString();
408 iniData.Global["pivotY"] = pivotY.ToString();
409 iniData.Global["shadow"] = shadow.ToString();
410 iniData.Global["shadowX"] = shadowX.ToString();
411 iniData.Global["shadowY"] = shadowY.ToString();
412 iniData.Global["shadowRX"] = shadowRX.ToString();
413 iniData.Global["shadowRY"] = shadowRY.ToString();
414 iniData.Global["shadowBX"] = shadowBX.ToString();
415 iniData.Global["shadowBY"] = shadowBY.ToString();
416 iniData.Global["shadowBRX"] = shadowBRX.ToString();
417 iniData.Global["shadowBRY"] = shadowBRY.ToString();
418 iniData.Global["height"] = ints[3].ToString();
419 iniData.Global["heightFix"] = ints[24].ToString();
420 iniData.Global["scaleIcon"] = scaleIcon.ToString();
421 iniData.Global["scaleTex"] = scaleTex.ToString();
422 iniData.Global["liquidMod"] = liquidMod.ToString();
423 iniData.Global["liquidModMax"] = liquidModMax.ToString();
424 iniData.Global["hatY"] = ints[23].ToString();
425 iniData.Global["equipX"] = equipX.ToString();
426 iniData.Global["equipY"] = equipY.ToString();
427 iniData.Global["stackX"] = ints[17].ToString();
428 fileIniDataParser.WriteFile(path, iniData);
429 }
Definition: EClass.cs:6
static UI ui
Definition: EClass.cs:17
int liquidModMax
Definition: SourcePref.cs:77
int shadowBRY
Definition: SourcePref.cs:257
int liquidMod
Definition: SourcePref.cs:65
int shadowBRX
Definition: SourcePref.cs:245
int shadowRX
Definition: SourcePref.cs:197
int shadowRY
Definition: SourcePref.cs:209
int shadowBY
Definition: SourcePref.cs:233
int scaleTex
Definition: SourcePref.cs:329
int shadowBX
Definition: SourcePref.cs:221
int scaleIcon
Definition: SourcePref.cs:293
int shadow
Definition: SourcePref.cs:41

References equipX, equipY, ints, liquidMod, liquidModMax, pivotX, pivotY, scaleIcon, scaleTex, shadow, shadowBRX, shadowBRY, shadowBX, shadowBY, shadowRX, shadowRY, shadowX, shadowY, EClass.ui, and Validate().

Member Data Documentation

◆ _bits1

BitArray32 SourcePref._bits1

Definition at line 17 of file SourcePref.cs.

Referenced by OnAfterDeserialize(), and OnBeforeSerialize().

◆ ints

int [] SourcePref.ints = new int[26]

Definition at line 15 of file SourcePref.cs.

Referenced by OnAfterDeserialize(), OnBeforeSerialize(), ReadFromIni(), Validate(), and WriteIni().

◆ TotalPrefInts

const int SourcePref.TotalPrefInts = 26
static

Definition at line 12 of file SourcePref.cs.

Property Documentation

◆ bypassShadow

bool SourcePref.bypassShadow
getset

Definition at line 353 of file SourcePref.cs.

354 {
355 get
356 {
357 return _bits1[0];
358 }
359 set
360 {
361 _bits1[0] = value;
362 }
363 }

Referenced by BaseTileMap.DrawTile().

◆ defaultAltitude

int SourcePref.defaultAltitude
getset

Definition at line 304 of file SourcePref.cs.

305 {
306 get
307 {
308 return ints[23];
309 }
310 set
311 {
312 ints[23] = value;
313 }
314 }

Referenced by HotItemHeld.OnSetCurrentItem(), and AM_Build.StartBuild().

◆ equipX

int SourcePref.equipX
getset

Definition at line 268 of file SourcePref.cs.

269 {
270 get
271 {
272 return ints[18];
273 }
274 set
275 {
276 ints[18] = value;
277 }
278 }

Referenced by CharaRenderer.DrawHat(), CharaRenderer.DrawHeld(), CharaActorPCC.OnRender(), and WriteIni().

◆ equipY

int SourcePref.equipY
getset

Definition at line 280 of file SourcePref.cs.

281 {
282 get
283 {
284 return ints[19];
285 }
286 set
287 {
288 ints[19] = value;
289 }
290 }

Referenced by CharaRenderer.DrawHat(), CharaRenderer.DrawHeld(), CharaActorPCC.OnRender(), and WriteIni().

◆ flags

PrefFlag SourcePref.flags
getset

Definition at line 28 of file SourcePref.cs.

29 {
30 get
31 {
32 return ints[1].ToEnum<PrefFlag>();
33 }
34 set
35 {
36 ints[1] = (int)value;
37 }
38 }
PrefFlag
Definition: PrefFlag.cs:5

Referenced by SourcePrefInspector.ToggleUsePref().

◆ Float

bool SourcePref.Float
get

◆ FloatUnderwater

bool SourcePref.FloatUnderwater
get

Definition at line 371 of file SourcePref.cs.

Referenced by BaseTileMap.DrawTile().

◆ hatY

float SourcePref.hatY
getset

Definition at line 88 of file SourcePref.cs.

89 {
90 get
91 {
92 return (float)ints[23] * 0.01f;
93 }
94 set
95 {
96 ints[23] = (int)(value * 100f);
97 }
98 }

Referenced by CharaRenderer.DrawHat().

◆ height

float SourcePref.height
getset

Definition at line 52 of file SourcePref.cs.

53 {
54 get
55 {
56 return (float)ints[3] * 0.01f;
57 }
58 set
59 {
60 ints[3] = (int)(value * 100f);
61 }
62 }

Referenced by BaseTileMap.DrawTile(), TileMapElona.DrawTile(), Cell.GetSurfaceHeight(), BaseTileMap.GetThingPosition(), and CoreDebug.UpdateInput().

◆ heightFix

float SourcePref.heightFix
getset

Definition at line 316 of file SourcePref.cs.

317 {
318 get
319 {
320 return (float)ints[24] * 0.01f;
321 }
322 set
323 {
324 ints[24] = (int)(value * 100f);
325 }
326 }

Referenced by CardRenderer.Draw(), TCOrbitChara.OnSetOwner(), TCOrbitThing.OnSetOwner(), and CardRenderer.PositionCenter().

◆ liquidMod

int SourcePref.liquidMod
getset

Definition at line 64 of file SourcePref.cs.

65 {
66 get
67 {
68 return ints[16];
69 }
70 set
71 {
72 ints[16] = value;
73 }
74 }

Referenced by BaseTileMap.DrawTile(), and WriteIni().

◆ liquidModMax

int SourcePref.liquidModMax
getset

Definition at line 76 of file SourcePref.cs.

77 {
78 get
79 {
80 return ints[21];
81 }
82 set
83 {
84 ints[21] = value;
85 }
86 }

Referenced by BaseTileMap.DrawTile(), and WriteIni().

◆ pivotX

int SourcePref.pivotX
getset

Definition at line 148 of file SourcePref.cs.

149 {
150 get
151 {
152 return ints[6];
153 }
154 set
155 {
156 ints[6] = value;
157 }
158 }

Referenced by Portrait.SetChara(), RenderRow.SetImage(), and WriteIni().

◆ pivotY

int SourcePref.pivotY
getset

Definition at line 160 of file SourcePref.cs.

161 {
162 get
163 {
164 return ints[7];
165 }
166 set
167 {
168 ints[7] = value;
169 }
170 }

Referenced by Portrait.SetChara(), RenderRow.SetImage(), and WriteIni().

◆ scaleIcon

int SourcePref.scaleIcon
getset

Definition at line 292 of file SourcePref.cs.

293 {
294 get
295 {
296 return ints[20];
297 }
298 set
299 {
300 ints[20] = value;
301 }
302 }

Referenced by RenderRow.SetImage(), and WriteIni().

◆ scaleTex

int SourcePref.scaleTex
getset

Definition at line 328 of file SourcePref.cs.

329 {
330 get
331 {
332 return ints[25];
333 }
334 set
335 {
336 ints[25] = value;
337 }
338 }

Referenced by WriteIni().

◆ ScaleTex

float SourcePref.ScaleTex
get

Definition at line 340 of file SourcePref.cs.

341 {
342 get
343 {
344 Validate();
345 if (ints[25] > 0)
346 {
347 return (float)ints[25] * 0.01f;
348 }
349 return 1f;
350 }
351 }

Referenced by SpriteData.LoadPrefAndFixDensity(), and SpriteData.LoadSprites().

◆ shadow

int SourcePref.shadow
getset

Definition at line 40 of file SourcePref.cs.

41 {
42 get
43 {
44 return ints[0];
45 }
46 set
47 {
48 ints[0] = value;
49 }
50 }

Referenced by CardRenderer.Draw(), BaseTileMap.DrawTile(), TileMapElona.DrawTile(), GrowSystem.OnRenderTileMap(), and WriteIni().

◆ shadowBRX

int SourcePref.shadowBRX
getset

Definition at line 244 of file SourcePref.cs.

245 {
246 get
247 {
248 return ints[14];
249 }
250 set
251 {
252 ints[14] = value;
253 }
254 }

Referenced by MeshPass.AddShadow(), and WriteIni().

◆ shadowBRY

int SourcePref.shadowBRY
getset

Definition at line 256 of file SourcePref.cs.

257 {
258 get
259 {
260 return ints[15];
261 }
262 set
263 {
264 ints[15] = value;
265 }
266 }

Referenced by MeshPass.AddShadow(), and WriteIni().

◆ shadowBX

int SourcePref.shadowBX
getset

Definition at line 220 of file SourcePref.cs.

221 {
222 get
223 {
224 return ints[12];
225 }
226 set
227 {
228 ints[12] = value;
229 }
230 }

Referenced by MeshPass.AddShadow(), and WriteIni().

◆ shadowBY

int SourcePref.shadowBY
getset

Definition at line 232 of file SourcePref.cs.

233 {
234 get
235 {
236 return ints[13];
237 }
238 set
239 {
240 ints[13] = value;
241 }
242 }

Referenced by MeshPass.AddShadow(), and WriteIni().

◆ shadowRX

int SourcePref.shadowRX
getset

Definition at line 196 of file SourcePref.cs.

197 {
198 get
199 {
200 return ints[10];
201 }
202 set
203 {
204 ints[10] = value;
205 }
206 }

Referenced by WriteIni().

◆ shadowRY

int SourcePref.shadowRY
getset

Definition at line 208 of file SourcePref.cs.

209 {
210 get
211 {
212 return ints[11];
213 }
214 set
215 {
216 ints[11] = value;
217 }
218 }

Referenced by WriteIni().

◆ shadowX

int SourcePref.shadowX
getset

Definition at line 172 of file SourcePref.cs.

173 {
174 get
175 {
176 return ints[8];
177 }
178 set
179 {
180 ints[8] = value;
181 }
182 }

Referenced by MeshPass.AddShadow(), and WriteIni().

◆ shadowY

int SourcePref.shadowY
getset

Definition at line 184 of file SourcePref.cs.

185 {
186 get
187 {
188 return ints[9];
189 }
190 set
191 {
192 ints[9] = value;
193 }
194 }

Referenced by MeshPass.AddShadow(), and WriteIni().

◆ stackX

float SourcePref.stackX
getset

Definition at line 100 of file SourcePref.cs.

101 {
102 get
103 {
104 return (float)ints[17] * 0.01f;
105 }
106 set
107 {
108 ints[17] = (int)(value * 100f);
109 }
110 }

◆ Surface

bool SourcePref.Surface
get

Definition at line 369 of file SourcePref.cs.

Referenced by Chara._Move(), and Cell.GetSurfaceHeight().

◆ test

int SourcePref.test
get

Definition at line 19 of file SourcePref.cs.

20 {
21 get
22 {
23 Validate();
24 return ints[0];
25 }
26 }

◆ UsePref

bool SourcePref.UsePref
get

Definition at line 365 of file SourcePref.cs.

Referenced by CardRow.GetPref().

◆ x

float SourcePref.x
getset

Definition at line 112 of file SourcePref.cs.

113 {
114 get
115 {
116 return (float)ints[4] * 0.01f;
117 }
118 set
119 {
120 ints[4] = (int)(value * 100f);
121 }
122 }

Referenced by CharaRenderer.DrawHeld().

◆ y

float SourcePref.y
getset

Definition at line 124 of file SourcePref.cs.

125 {
126 get
127 {
128 return (float)ints[5] * 0.01f;
129 }
130 set
131 {
132 ints[5] = (int)(value * 100f);
133 }
134 }

Referenced by CardRenderer.Draw(), BaseTileMap.DrawTile(), and GrowSystem.OnRenderTileMap().

◆ z

float SourcePref.z
getset

Definition at line 136 of file SourcePref.cs.

137 {
138 get
139 {
140 return (float)ints[2] * 0.01f;
141 }
142 set
143 {
144 ints[2] = (int)(value * 100f);
145 }
146 }

Referenced by CardRenderer.Draw(), BaseTileMap.DrawTile(), BaseTileMap.GetThingPosition(), and GrowSystem.OnRenderTileMap().


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