Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIPlaceHelper.cs
Go to the documentation of this file.
1using UnityEngine;
2
3public class UIPlaceHelper : EMono
4{
6
8
10
12
13 public void Refresh()
14 {
15 Recipe recipe = HotItemHeld.recipe;
16 bool flag = recipe != null;
18 {
19 flag = false;
20 }
21 base.gameObject.SetActive(flag);
22 if (flag)
23 {
24 ActionMode.Build.recipe = recipe;
25 buttonAutoWall.SetActive(enable: false);
26 buttonAutoWall.mainText.text = (EMono.game.config.autoWall ? "On" : "Off");
27 buttonAutoWall.icon.SetAlpha(EMono.game.config.autoWall ? 1f : 0.4f);
28 buttonAutoWall.SetOnClick(delegate
29 {
30 SE.Tab();
31 EMono.game.config.autoWall = !EMono.game.config.autoWall;
32 Refresh();
33 });
34 buttonFreePlace.SetActive(enable: false);
35 buttonFreePlace.mainText.text = (EMono.game.config.freePos ? "On" : "Off");
36 buttonFreePlace.icon.SetAlpha(EMono.game.config.freePos ? 1f : 0.4f);
37 buttonFreePlace.SetOnClick(delegate
38 {
39 SE.Tab();
40 EMono.game.config.freePos = !EMono.game.config.freePos;
41 Refresh();
42 });
43 buttonHeight.SetActive(recipe.MaxAltitude != 0);
44 buttonHeight.mainText.text = ((ActionMode.Build.altitude >= 0) ? "+" : "") + ActionMode.Build.altitude;
45 buttonHeight.SetOnClick(delegate
46 {
47 SE.Tab();
49 Refresh();
50 });
51 buttonHeight.onRightClick = delegate
52 {
53 SE.Tab();
55 Refresh();
56 };
57 buttonHeight.onInputWheel = delegate(int a)
58 {
59 SE.Tab();
61 Refresh();
62 };
63 bgGrid.uvRect = new Rect(1f, 1f, this.GetComponentsInDirectChildren<ButtonGrid>(includeInactive: false).Count, 1f);
64 this.RebuildLayout();
65 }
66 }
67}
int altitude
Definition: AM_Build.cs:8
void ModAltitude(int a)
Definition: AM_Build.cs:366
static AM_Build Build
Definition: ActionMode.cs:49
Trait trait
Definition: Card.cs:49
Definition: EMono.cs:4
static Player player
Definition: EMono.cs:11
static Game game
Definition: EMono.cs:7
bool autoWall
Definition: Game.cs:42
bool freePos
Definition: Game.cs:30
Config config
Definition: Game.cs:215
static Recipe recipe
Definition: HotItemHeld.cs:9
static bool disableTool
Definition: HotItemHeld.cs:11
virtual Thing Thing
Definition: HotItem.cs:38
HotItem currentHotItem
Definition: Player.cs:901
Definition: Recipe.cs:7
int MaxAltitude
Definition: Recipe.cs:212
virtual bool IsTool
Definition: Trait.cs:355
Image icon
Definition: UIButton.cs:110
ButtonGrid buttonHeight
Definition: UIPlaceHelper.cs:7
ButtonGrid buttonAutoWall
ButtonGrid buttonFreePlace
Definition: UIPlaceHelper.cs:9
UIRawImage bgGrid
Definition: UIPlaceHelper.cs:5