Elin Modding Docs Doc
Loading...
Searching...
No Matches
UIPlaceHelper.cs
1using System;
2using UnityEngine;
3
4// Token: 0x020005F0 RID: 1520
5public class UIPlaceHelper : EMono
6{
7 // Token: 0x060029CC RID: 10700 RVA: 0x000EBC9C File Offset: 0x000E9E9C
8 public void Refresh()
9 {
10 Recipe recipe = HotItemHeld.recipe;
11 bool flag = recipe != null;
12 if (EMono.player.currentHotItem.Thing == null || (EMono.player.currentHotItem.Thing.trait.IsTool && !HotItemHeld.disableTool))
13 {
14 flag = false;
15 }
16 base.gameObject.SetActive(flag);
17 if (!flag)
18 {
19 return;
20 }
21 this.buttonAutoWall.SetActive(false);
22 this.buttonAutoWall.mainText.text = (EMono.game.config.autoWall ? "On" : "Off");
23 this.buttonAutoWall.icon.SetAlpha(EMono.game.config.autoWall ? 1f : 0.4f);
24 this.buttonAutoWall.SetOnClick(delegate
25 {
26 SE.Tab();
27 EMono.game.config.autoWall = !EMono.game.config.autoWall;
28 this.Refresh();
29 });
30 this.buttonFreePlace.SetActive(false);
31 this.buttonFreePlace.mainText.text = (EMono.game.config.freePos ? "On" : "Off");
32 this.buttonFreePlace.icon.SetAlpha(EMono.game.config.freePos ? 1f : 0.4f);
33 this.buttonFreePlace.SetOnClick(delegate
34 {
35 SE.Tab();
36 EMono.game.config.freePos = !EMono.game.config.freePos;
37 this.Refresh();
38 });
39 this.buttonHeight.SetActive(recipe.MaxAltitude != 0);
40 this.buttonHeight.mainText.text = ((ActionMode.Build.altitude >= 0) ? "+" : "") + ActionMode.Build.altitude.ToString();
41 this.buttonHeight.SetOnClick(delegate
42 {
43 SE.Tab();
44 ActionMode.Build.ModAltitude(1);
45 this.Refresh();
46 });
47 this.buttonHeight.onRightClick = delegate()
48 {
49 SE.Tab();
50 ActionMode.Build.ModAltitude(-1);
51 this.Refresh();
52 };
53 this.buttonHeight.onInputWheel = delegate(int a)
54 {
55 SE.Tab();
56 ActionMode.Build.ModAltitude(a);
57 this.Refresh();
58 };
59 this.bgGrid.uvRect = new Rect(1f, 1f, (float)this.GetComponentsInDirectChildren(false).Count, 1f);
60 this.RebuildLayout(false);
61 }
62
63 // Token: 0x040017A7 RID: 6055
64 public UIRawImage bgGrid;
65
66 // Token: 0x040017A8 RID: 6056
67 public ButtonGrid buttonHeight;
68
69 // Token: 0x040017A9 RID: 6057
70 public ButtonGrid buttonFreePlace;
71
72 // Token: 0x040017AA RID: 6058
73 public ButtonGrid buttonAutoWall;
74}
Definition EMono.cs:6