Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerEditHouse Class Reference
Inheritance diagram for LayerEditHouse:
ELayer Layer IUISkin

Public Member Functions

override void OnInit ()
 
void SetBoard (TraitHouseBoard b)
 
void RefreshTemplates ()
 
void ApplyData ()
 
override void OnKill ()
 
- Public Member Functions inherited from ELayer
override void OnBeforeAddLayer ()
 
void InitInspector ()
 
sealed override void Init ()
 
override void OnAfterAddLayer ()
 
void TryShowHelp ()
 
void AddLayerToUI (string id)
 
void TryShowHint (string _langHint=null)
 
void TalkHomeMemeber (string id)
 
void TalkMaid (string id)
 
override void OnRightClick ()
 
- Public Member Functions inherited from Layer
virtual string GetTextHeader (Window window)
 
virtual bool HeaderIsListOf (int id)
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void OnAfterInit ()
 
virtual void ApplySkin ()
 
void ShowScreenLock (string id)
 
void UpdateInput ()
 
virtual void OnUpdateInput ()
 
virtual void OnRightClick ()
 
virtual bool OnBack ()
 
virtual void OnChangeLayer ()
 
virtual void OnCreate ()
 
void _AddLayer (string id)
 
Layer AddLayer (string id)
 
AddLayer< T > ()
 
AddLayer< T > (string id)
 
AddLayerDontCloseOthers< T > ()
 
Layer AddLayerDontCloseOthers (Layer l)
 
GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
ToggleLayer< T > (string id=null)
 
void WaitAndClose ()
 
void OnClickClose ()
 
virtual void Close ()
 
void CloseLayers ()
 
void RemoveLayers (bool removeImportant=false)
 
bool RemoveLayer< T > ()
 
void RemoveLayer (Layer l)
 
virtual void OnKill ()
 
Layer SetOnKill (Action action)
 
void DisableClose ()
 
void Delay (float duration=0.05f)
 
Layer SetDelay (float d)
 
Layer GetLayer (string id)
 
GetLayer< T > (bool fromTop=false)
 
Layer GetTopLayer ()
 
void SwitchContent (int idWindow, int i)
 
virtual void OnSwitchContent (Window window)
 
Layer SetTitles (string langList, string idHeaderRow=null)
 
bool IsBlockWidgetClick ()
 
bool IsHideHud ()
 
bool IsAllowGeneralInput ()
 
bool IsUseBlur ()
 
bool IsPointerOnLayer ()
 
void ApplySkin ()
 

Public Attributes

TraitHouseBoard board
 
UISlider sliderBlock
 
UISlider sliderRoof
 
UISlider sliderRamp
 
UISlider sliderWallHeight
 
UISlider sliderHeightFix
 
UISlider sliderDeco
 
UISlider sliderDeco2
 
UISlider sliderDecoFix
 
UISlider sliderDecoFix2
 
UIDropdown ddRoofStyle
 
UIDropdown ddTemplate
 
UIButton toggleReverse
 
UIButton toggleAltRoof
 
UIButton buttonColorRoof
 
UIButton buttonColorBlock
 
UIButton buttonColorDeco
 
UIButton buttonColorDeco2
 
UIButton toggleAtrium
 
int maxWallDeco
 
- Public Attributes inherited from Layer
Option option
 
UnityEvent onKill
 
Anime animeIn
 
Anime animeOut
 
bool closeOthers
 
bool defaultActionMode = true
 
Button screenLock
 
Layer parent
 
string idLayer
 
List< Layerlayers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Windowwindows = new List<Window>()
 
string langHint
 

Properties

TraitHouseBoard.Data data [get]
 
- Properties inherited from ELayer
static Core core [get]
 
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static FactionBranch Branch [get]
 
static Faction Home [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static CoreConfig config [get]
 
static GameSetting setting [get]
 
static ColorProfile Colors [get]
 
static SourceManager sources [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
bool IsFloat [get]
 
virtual string IdHelp [get]
 
- Properties inherited from Layer
Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Private Member Functions

void RefreshBlockList ()
 

Private Attributes

bool first = true
 

Additional Inherited Members

- Static Public Member Functions inherited from ELayer
static int rnd (int a)
 
- Static Public Member Functions inherited from Layer
static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 
- Static Public Attributes inherited from Layer
static int skipInput
 
static bool closeOnRightClick
 
static bool rightClicked
 
static bool cancelKeyDown
 
static bool ignoreSounds
 
static Transform blurStopInstance
 
static string[] searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
 
- Protected Member Functions inherited from ELayer
sealed override void _Close ()
 
sealed override void Kill ()
 
- Protected Member Functions inherited from Layer
virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 
- Protected Attributes inherited from Layer
RectTransform _rect
 
bool isDestroyed
 

Detailed Description

Definition at line 7 of file LayerEditHouse.cs.

Member Function Documentation

◆ ApplyData()

void LayerEditHouse.ApplyData ( )
inline

◆ OnInit()

override void LayerEditHouse.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 53 of file LayerEditHouse.cs.

54 {
55 windows[0].AddBottomButton("save", delegate
56 {
58 {
59 string text = StandaloneFileBrowser.SaveFilePanel("Save Template", CorePath.LotTemplate, "new house", "tpl");
60 if (!string.IsNullOrEmpty(text))
61 {
62 IO.SaveFile(text, board.data);
64 }
65 });
66 });
67 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
void WaitForEndOfFrame(Action action)
Definition: BaseCore.cs:61
static string LotTemplate
Definition: CorePath.cs:192
Definition: ELayer.cs:4
static Core core
Definition: ELayer.cs:7
Definition: IO.cs:11
static void SaveFile(string path, object obj, bool compress=false, JsonSerializerSettings setting=null)
Definition: IO.cs:89
void RefreshTemplates()
List< Window > windows
Definition: Layer.cs:116
static string SaveFilePanel(string title, string directory, string defaultName, string extension)

References board, ELayer.core, TraitHouseBoard.data, if(), CorePath.LotTemplate, RefreshTemplates(), SFB.StandaloneFileBrowser.SaveFilePanel(), BaseCore.WaitForEndOfFrame(), and Layer.windows.

◆ OnKill()

override void LayerEditHouse.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 269 of file LayerEditHouse.cs.

270 {
271 ELayer.screen.tileMap.usingHouseBoard = false;
272 if ((bool)BuildMenu.Instance)
273 {
274 BuildMenu.Instance.SetActive(enable: true);
275 }
276 }
static BuildMenu Instance
Definition: BuildMenu.cs:77

References BuildMenu.Instance.

◆ RefreshBlockList()

void LayerEditHouse.RefreshBlockList ( )
inlineprivate

Definition at line 175 of file LayerEditHouse.cs.

176 {
177 bool num = ELayer.screen.tileMap.roofStyles[data.idRoofStyle].type != RoofStyle.Type.FlatFloor;
178 List<int> blocks = new List<int>();
179 if (num)
180 {
181 foreach (SourceBlock.Row row in ELayer.sources.blocks.rows)
182 {
183 if (row.tileType == TileType.Block)
184 {
185 blocks.Add(row.id);
186 }
187 }
188 }
189 else
190 {
191 foreach (SourceFloor.Row row2 in ELayer.sources.floors.rows)
192 {
193 blocks.Add(row2.id);
194 }
195 }
196 int num2 = blocks.IndexOf(data.idBlock);
197 if (num2 == -1)
198 {
199 num2 = 0;
200 }
201 sliderBlock.SetList(num2, blocks, delegate(int a, int b)
202 {
203 data.idBlock = b;
204 ApplyData();
205 }, (int a) => blocks.IndexOf(a).ToString() ?? "");
206 buttonColorRoof.icon.color = IntColor.FromInt(data.colRoof);
207 buttonColorRoof.SetOnClick(delegate
208 {
209 ELayer.ui.AddLayer<LayerColorPicker>().SetColor(IntColor.FromInt(data.colRoof), IntColor.FromInt(data.colRoof), delegate(PickerState state, Color c)
210 {
211 data.colRoof = IntColor.ToInt(c);
212 buttonColorRoof.icon.color = c;
214 });
215 });
216 buttonColorBlock.icon.color = IntColor.FromInt(data.colBlock);
217 buttonColorBlock.SetOnClick(delegate
218 {
219 ELayer.ui.AddLayer<LayerColorPicker>().SetColor(IntColor.FromInt(data.colBlock), IntColor.FromInt(data.colBlock), delegate(PickerState state, Color c)
220 {
221 data.colBlock = IntColor.ToInt(c);
222 buttonColorBlock.icon.color = c;
224 });
225 });
226 buttonColorDeco.icon.color = IntColor.FromInt(data.colDeco);
227 buttonColorDeco.SetOnClick(delegate
228 {
229 ELayer.ui.AddLayer<LayerColorPicker>().SetColor(IntColor.FromInt(data.colDeco), IntColor.FromInt(data.colDeco), delegate(PickerState state, Color c)
230 {
231 data.colDeco = IntColor.ToInt(c);
232 buttonColorDeco.icon.color = c;
234 });
235 });
236 buttonColorDeco2.icon.color = IntColor.FromInt(data.colDeco2);
237 buttonColorDeco2.SetOnClick(delegate
238 {
239 ELayer.ui.AddLayer<LayerColorPicker>().SetColor(IntColor.FromInt(data.colDeco2), IntColor.FromInt(data.colDeco2), delegate(PickerState state, Color c)
240 {
241 data.colDeco2 = IntColor.ToInt(c);
242 buttonColorDeco2.icon.color = c;
244 });
245 });
246 }
PickerState
Definition: PickerState.cs:2
BaseTileMap tileMap
RoofStyle[] roofStyles
Definition: BaseTileMap.cs:500
static SourceManager sources
Definition: ELayer.cs:37
static UI ui
Definition: ELayer.cs:21
static BaseGameScreen screen
Definition: ELayer.cs:29
static int ToInt(ref Color c)
Definition: IntColor.cs:24
static Color32 FromInt(int i)
Definition: IntColor.cs:15
UIButton buttonColorBlock
UIButton buttonColorDeco
UISlider sliderBlock
TraitHouseBoard.Data data
UIButton buttonColorRoof
UIButton buttonColorDeco2
Type type
Definition: RoofStyle.cs:17
SourceBlock blocks
SourceFloor floors
static TileTypeBlock Block
Definition: TileType.cs:19

References ApplyData(), TraitHouseBoard.ApplyData(), TileType.Block, SourceManager.blocks, board, buttonColorBlock, buttonColorDeco, buttonColorDeco2, buttonColorRoof, Color, data, SourceManager.floors, IntColor.FromInt(), BaseTileMap.roofStyles, ELayer.screen, sliderBlock, ELayer.sources, BaseGameScreen.tileMap, IntColor.ToInt(), RoofStyle.type, and ELayer.ui.

Referenced by SetBoard().

◆ RefreshTemplates()

void LayerEditHouse.RefreshTemplates ( )
inline

Definition at line 248 of file LayerEditHouse.cs.

249 {
250 FileInfo[] list = (from a in new DirectoryInfo(CorePath.LotTemplate).GetFiles()
251 where a.Name.EndsWith(".tpl")
252 select a).ToArray();
253 ddTemplate.SetList(0, list, (FileInfo a, int b) => a.Name, delegate(int a, FileInfo b)
254 {
255 int idBGM = board.data.idBGM;
256 board.data = IO.LoadFile<TraitHouseBoard.Data>(b.FullName);
257 board.data.idBGM = idBGM;
258 ApplyData();
260 });
261 }
void SetBoard(TraitHouseBoard b)
UIDropdown ddTemplate

References ApplyData(), board, TraitHouseBoard.data, ddTemplate, TraitHouseBoard.Data.idBGM, CorePath.LotTemplate, and SetBoard().

Referenced by OnInit(), and SetBoard().

◆ SetBoard()

void LayerEditHouse.SetBoard ( TraitHouseBoard  b)
inline

Definition at line 69 of file LayerEditHouse.cs.

70 {
71 if ((bool)BuildMenu.Instance)
72 {
73 BuildMenu.Instance.SetActive(enable: false);
74 }
75 ELayer.screen.tileMap.usingHouseBoard = true;
76 board = b;
77 ddRoofStyle.SetList(data.idRoofStyle, ELayer.screen.tileMap.roofStyles, (RoofStyle a, int b) => a.GetName(b).lang(), delegate(int a, RoofStyle b)
78 {
79 data.idRoofStyle = a;
80 ApplyData();
82 });
83 toggleReverse.SetToggle(data.reverse, delegate(bool on)
84 {
85 data.reverse = on;
86 ApplyData();
87 });
88 toggleAltRoof.SetToggle(data.altRoof, delegate(bool on)
89 {
90 data.altRoof = on;
91 ApplyData();
92 });
93 List<int> blocks = new List<int>();
94 int num = 0;
95 blocks.Add(0);
96 foreach (SourceObj.Row row in ELayer.sources.objs.rows)
97 {
98 if (row.tileType == TileType.Roof && !row.tag.Contains("hidden"))
99 {
100 blocks.Add(row.id);
101 }
102 }
103 num = blocks.IndexOf(data.idRoofTile);
104 if (num == -1)
105 {
106 num = 0;
107 }
108 sliderRoof.SetList(num, blocks, delegate(int a, int b)
109 {
110 data.idRoofTile = b;
111 ApplyData();
112 }, (int a) => blocks.IndexOf(a).ToString() ?? "");
113 List<int> ramps = new List<int>();
114 foreach (SourceBlock.Row row2 in ELayer.sources.blocks.rows)
115 {
116 if (row2.tileType == TileType.Stairs || row2.tileType == TileType.Slope)
117 {
118 ramps.Add(row2.id);
119 }
120 }
121 int num2 = ramps.IndexOf(data.idRamp);
122 if (num2 == -1)
123 {
124 num2 = 0;
125 }
126 sliderRamp.SetList(num2, ramps, delegate(int a, int b)
127 {
128 data.idRamp = b;
129 ApplyData();
130 }, (int a) => ramps.IndexOf(a).ToString() ?? "");
131 sliderWallHeight.SetSlider(data.height, delegate(float a)
132 {
133 data.height = (int)a;
134 ApplyData();
135 return a.ToString() ?? "";
136 }, 1, 20);
137 sliderHeightFix.SetSlider(data.heightFix, delegate(float a)
138 {
139 data.heightFix = (int)a;
140 ApplyData();
141 return a.ToString() ?? "";
142 }, 0, 60);
143 sliderDecoFix.SetSlider(data.decoFix, delegate(float a)
144 {
145 data.decoFix = (int)a;
146 ApplyData();
147 return a.ToString() ?? "";
148 }, -20, 20);
149 sliderDecoFix2.SetSlider(data.decoFix2, delegate(float a)
150 {
151 data.decoFix2 = (int)a;
152 ApplyData();
153 return a.ToString() ?? "";
154 }, -20, 400);
155 sliderDeco.SetSlider(data.idDeco, delegate(float a)
156 {
157 data.idDeco = (int)a;
158 ApplyData();
159 return a.ToString() ?? "";
160 }, 0, maxWallDeco);
161 sliderDeco2.SetSlider(data.idDeco2, delegate(float a)
162 {
163 data.idDeco2 = (int)a;
164 ApplyData();
165 return a.ToString() ?? "";
166 }, 0, maxWallDeco);
167 if (first)
168 {
170 }
172 first = false;
173 }
UISlider sliderHeightFix
UISlider sliderRamp
UISlider sliderDecoFix
UISlider sliderDeco
UIButton toggleReverse
UIDropdown ddRoofStyle
UISlider sliderWallHeight
UISlider sliderRoof
UISlider sliderDeco2
UISlider sliderDecoFix2
void RefreshBlockList()
string GetName(int i)
Definition: RoofStyle.cs:45
SourceObj objs
static TileTypeSlope Slope
Definition: TileType.cs:23
static TileTypeRoof Roof
Definition: TileType.cs:105
static TileTypeStairs Stairs
Definition: TileType.cs:29
void SetToggle(bool isOn, Action< bool > onToggle=null)
Definition: UIButton.cs:341

References ApplyData(), SourceManager.blocks, board, data, ddRoofStyle, first, RoofStyle.GetName(), BuildMenu.Instance, maxWallDeco, SourceManager.objs, RefreshBlockList(), RefreshTemplates(), TileType.Roof, BaseTileMap.roofStyles, ELayer.screen, UIButton.SetToggle(), sliderDeco, sliderDeco2, sliderDecoFix, sliderDecoFix2, sliderHeightFix, sliderRamp, sliderRoof, sliderWallHeight, TileType.Slope, ELayer.sources, TileType.Stairs, BaseGameScreen.tileMap, toggleAltRoof, and toggleReverse.

Referenced by RefreshTemplates().

Member Data Documentation

◆ board

TraitHouseBoard LayerEditHouse.board

Definition at line 9 of file LayerEditHouse.cs.

Referenced by ApplyData(), OnInit(), RefreshBlockList(), RefreshTemplates(), and SetBoard().

◆ buttonColorBlock

UIButton LayerEditHouse.buttonColorBlock

Definition at line 39 of file LayerEditHouse.cs.

Referenced by RefreshBlockList().

◆ buttonColorDeco

UIButton LayerEditHouse.buttonColorDeco

Definition at line 41 of file LayerEditHouse.cs.

Referenced by RefreshBlockList().

◆ buttonColorDeco2

UIButton LayerEditHouse.buttonColorDeco2

Definition at line 43 of file LayerEditHouse.cs.

Referenced by RefreshBlockList().

◆ buttonColorRoof

UIButton LayerEditHouse.buttonColorRoof

Definition at line 37 of file LayerEditHouse.cs.

Referenced by RefreshBlockList().

◆ ddRoofStyle

UIDropdown LayerEditHouse.ddRoofStyle

Definition at line 29 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ ddTemplate

UIDropdown LayerEditHouse.ddTemplate

Definition at line 31 of file LayerEditHouse.cs.

Referenced by RefreshTemplates().

◆ first

bool LayerEditHouse.first = true
private

Definition at line 49 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ maxWallDeco

int LayerEditHouse.maxWallDeco

Definition at line 47 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ sliderBlock

UISlider LayerEditHouse.sliderBlock

Definition at line 11 of file LayerEditHouse.cs.

Referenced by RefreshBlockList().

◆ sliderDeco

UISlider LayerEditHouse.sliderDeco

Definition at line 21 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ sliderDeco2

UISlider LayerEditHouse.sliderDeco2

Definition at line 23 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ sliderDecoFix

UISlider LayerEditHouse.sliderDecoFix

Definition at line 25 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ sliderDecoFix2

UISlider LayerEditHouse.sliderDecoFix2

Definition at line 27 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ sliderHeightFix

UISlider LayerEditHouse.sliderHeightFix

Definition at line 19 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ sliderRamp

UISlider LayerEditHouse.sliderRamp

Definition at line 15 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ sliderRoof

UISlider LayerEditHouse.sliderRoof

Definition at line 13 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ sliderWallHeight

UISlider LayerEditHouse.sliderWallHeight

Definition at line 17 of file LayerEditHouse.cs.

Referenced by SetBoard().

◆ toggleAltRoof

UIButton LayerEditHouse.toggleAltRoof

Definition at line 35 of file LayerEditHouse.cs.

Referenced by ApplyData(), and SetBoard().

◆ toggleAtrium

UIButton LayerEditHouse.toggleAtrium

Definition at line 45 of file LayerEditHouse.cs.

◆ toggleReverse

UIButton LayerEditHouse.toggleReverse

Definition at line 33 of file LayerEditHouse.cs.

Referenced by SetBoard().

Property Documentation

◆ data

TraitHouseBoard.Data LayerEditHouse.data
get

Definition at line 51 of file LayerEditHouse.cs.

Referenced by RefreshBlockList(), and SetBoard().


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