Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TraitPaintBoard.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2
4{
6
7 public override bool IsHomeItem => true;
8
9 public override bool ShowContextOnPick => true;
10
11 public override bool RenderExtra
12 {
13 get
14 {
15 if (owner.refVal != 0)
16 {
17 if (!owner.IsInstalled)
18 {
19 return owner.isRoofItem;
20 }
21 return true;
22 }
23 return false;
24 }
25 }
26
27 public override void TrySetAct(ActPlan p)
28 {
30 {
31 return;
32 }
33 p.TrySetAct("actChangePaint", delegate
34 {
35 List<int> list = new List<int>();
36 foreach (SourceThing.Row row in EClass.sources.things.rows)
37 {
38 if (!row.isOrigin && row.model.trait is TraitPaint)
39 {
40 list.Add(row._tiles[0]);
41 }
42 }
43 int num = ((owner.refVal != 0) ? list.IndexOf(owner.refVal) : 0);
44 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
45 uIContextMenu.AddSlider("sliderPaint", (float a) => a.ToString() ?? "", num, delegate(float b)
46 {
47 owner.refVal = list[(int)b];
48 paintPos = null;
49 }, 0f, list.Count - 1, isInt: true, hideOther: false);
50 uIContextMenu.Show();
51 return false;
52 }, owner);
53 }
54
55 public override void OnRenderExtra(RenderParam p)
56 {
57 if (owner != EClass.pc.held)
58 {
59 if (paintPos == null)
60 {
62 }
63 int num = ((!owner.flipX) ? 1 : (-1)) * ((!paintPos.flip) ? 1 : (-1));
64 p.x += paintPos.pos.x * (float)num;
65 p.y += paintPos.pos.y;
66 p.z += paintPos.pos.z;
67 p.tile = owner.refVal * num;
68 p.matColor = 104025f;
70 }
71 }
72}
bool altAction
Definition: ActPlan.cs:155
bool TrySetAct(string lang, Func< bool > onPerform, Card tc, CursorInfo cursor=null, int dist=1, bool isHostileAct=false, bool localAct=true, bool canRepeat=false)
Definition: ActPlan.cs:344
string id
Definition: Card.cs:31
bool isRoofItem
Definition: Card.cs:550
int refVal
Definition: Card.cs:190
bool IsInstalled
Definition: Card.cs:2241
virtual bool flipX
Definition: Card.cs:1992
Card held
Definition: Chara.cs:67
bool enable
Definition: CoreDebug.cs:285
RenderData obj_paint
Definition: CoreRef.cs:302
Renderers renderers
Definition: CoreRef.cs:341
CoreRef refs
Definition: Core.cs:51
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:20
static SourceManager sources
Definition: EClass.cs:42
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static UI ui
Definition: EClass.cs:16
static GameSetting setting
Definition: EClass.cs:34
UD_String_PaintPosition paintPos
Definition: GameSetting.cs:218
RenderSetting render
Definition: GameSetting.cs:301
void Draw(RenderParam p, int tile)
Definition: RenderData.cs:128
SourceThing things
override bool IsHomeItem
override bool RenderExtra
override void OnRenderExtra(RenderParam p)
PaintPosition paintPos
override void TrySetAct(ActPlan p)
override bool ShowContextOnPick
Card owner
Definition: Trait.cs:26
bool TryGetValue(TKey key, out TValue value)
Definition: UDictionary.cs:178
void Show(UIItem i)
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
bool IsPCFaction
Definition: Zone.cs:464