Elin Modding Docs Doc
Loading...
Searching...
No Matches
TraitMapBoard.cs
1using System;
2using System.Collections.Generic;
3using CreativeSpore.SuperTilemapEditor;
4using UnityEngine;
5using UnityEngine.UI;
6
7// Token: 0x02000419 RID: 1049
8public class TraitMapBoard : Trait
9{
10 // Token: 0x17000949 RID: 2377
11 // (get) Token: 0x06001DDD RID: 7645 RVA: 0x000ACC00 File Offset: 0x000AAE00
12 public override bool IsHomeItem
13 {
14 get
15 {
16 return true;
17 }
18 }
19
20 // Token: 0x06001DDE RID: 7646 RVA: 0x000ACC04 File Offset: 0x000AAE04
21 public override void TrySetAct(ActPlan p)
22 {
23 if (!EClass.debug.enable && !EClass._zone.IsPCFaction)
24 {
25 return;
26 }
27 p.TrySetAct("actChangeHomeIcon", delegate()
28 {
29 UIContextMenu uicontextMenu = EClass.ui.CreateContextMenuInteraction();
30 GridLayoutGroup parent = uicontextMenu.AddGridLayout();
31 HashSet<int> hashSet = new HashSet<int>();
32 foreach (Spatial spatial in EClass.game.spatials.map.Values)
33 {
34 if (spatial.icon > 0)
35 {
36 hashSet.Add(spatial.icon);
37 }
38 }
39 foreach (int num in hashSet)
40 {
41 UIButton uibutton = Util.Instantiate<UIButton>("UI/Element/Button/ButtonContainerIcon", parent);
42 int _i = num;
43 uibutton.icon.sprite = TilemapUtils.GetOrCreateTileSprite(EClass.scene.elomap.actor.tileset, num, 0f);
44 uibutton.icon.Rect().localScale = new Vector3(2f, 2f, 1f);
45 uibutton.SetOnClick(delegate
46 {
47 SE.Click();
48 EClass._zone.icon = _i;
49 EClass.ui.contextMenu.currentMenu.Hide();
50 EClass.scene.elomap.SetZone(EClass._zone.x, EClass._zone.y, EClass._zone, true);
51 });
52 }
53 uicontextMenu.Show();
54 return false;
55 }, this.owner, null, 1, false, true, false);
56 p.TrySetAct("actChangeBlockHeight", delegate()
57 {
58 UIContextMenu uicontextMenu = EClass.ui.CreateContextMenuInteraction();
59 uicontextMenu.AddSlider("adjustment", (float a) => a.ToString() ?? "", EClass._map.config.blockHeight * 10f, delegate(float b)
60 {
61 EClass._map.config.blockHeight = b * 0.1f;
62 }, 0f, 40f, true, false, false);
63 uicontextMenu.Show();
64 return false;
65 }, this.owner, null, 1, false, true, false);
66 p.TrySetAct("actChangeSkyBlockHeight", delegate()
67 {
68 UIContextMenu uicontextMenu = EClass.ui.CreateContextMenuInteraction();
69 uicontextMenu.AddSlider("adjustment", (float a) => a.ToString() ?? "", (float)EClass._map.config.skyBlockHeight, delegate(float b)
70 {
71 EClass._map.config.skyBlockHeight = (int)b;
72 }, 1f, 20f, true, false, false);
73 uicontextMenu.Show();
74 return false;
75 }, this.owner, null, 1, false, true, false);
76 p.TrySetAct("actChangeMapBG", delegate()
77 {
78 LayerList layerList = EClass.ui.AddLayer<LayerList>().SetSize(400f, -1f);
79 List<MapBG> list = Util.EnumToList<MapBG>();
80 Action<int> <>9__13;
81 for (int i = 0; i < list.Count; i++)
82 {
83 LayerList layerList2 = layerList;
84 string lang = list[i].ToString();
85 Action<int> action;
86 if ((action = <>9__13) == null)
87 {
88 action = (<>9__13 = delegate(int a)
89 {
90 EClass._map.config.bg = list[a];
91 EClass.scene.RefreshBG();
92 });
93 }
94 layerList2.Add(lang, action);
95 }
96 layerList.Show(true);
97 return false;
98 }, this.owner, null, 1, false, true, false);
99 p.TrySetAct("actChangeShadowStrength", delegate()
100 {
101 UIContextMenu uicontextMenu = EClass.ui.CreateContextMenuInteraction();
102 uicontextMenu.AddSlider("adjustment", (float a) => a.ToString() + "%", EClass._map.config.shadowStrength * 100f, delegate(float b)
103 {
104 EClass._map.config.shadowStrength = b * 0.01f;
105 EClass.screen.RefreshAll();
106 }, 0f, 400f, true, false, false);
107 uicontextMenu.Show();
108 return false;
109 }, this.owner, null, 1, false, true, false);
110 p.TrySetAct("actChangeFogDensity", delegate()
111 {
112 LayerList layerList = EClass.ui.AddLayer<LayerList>().SetSize(400f, -1f);
113 List<FogType> list = Util.EnumToList<FogType>();
114 Action<int> <>9__16;
115 for (int i = 0; i < list.Count; i++)
116 {
117 LayerList layerList2 = layerList;
118 string lang = list[i].ToString();
119 Action<int> action;
120 if ((action = <>9__16) == null)
121 {
122 action = (<>9__16 = delegate(int a)
123 {
124 EClass._map.config.fog = list[a];
125 EClass.screen.RefreshAll();
126 });
127 }
128 layerList2.Add(lang, action);
129 }
130 layerList.Show(true);
131 return false;
132 }, this.owner, null, 1, false, true, false);
133 p.TrySetAct("actChangeSkyColor", delegate()
134 {
135 EClass.ui.AddLayer<LayerColorPicker>().SetColor(EClass._map.config.colorScreen.Get(), new Color(0f, 0f, 0f, 0f), delegate(PickerState state, Color _c)
136 {
137 EClass._map.config.colorScreen.Set(_c);
138 EClass.screen.RefreshGrading();
139 });
140 return false;
141 }, this.owner, null, 1, false, true, false);
142 p.TrySetAct("actChangeSeaColor", delegate()
143 {
144 EClass.ui.AddLayer<LayerColorPicker>().SetColor(EClass._map.config.colorSea.Get(), new Color(0f, 0f, 0f, 0f), delegate(PickerState state, Color _c)
145 {
146 EClass._map.config.colorSea.Set(_c);
147 EClass.screen.RefreshGrading();
148 });
149 return false;
150 }, this.owner, null, 1, false, true, false);
151 }
152}
Definition Trait.cs:9