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

Public Member Functions

override void RefreshCurrentGrid ()
 
override void ClearButtons ()
 
override string GetTextHeader (Window window)
 
override void OnAfterInit ()
 
override void OnKill ()
 
void SetFactory (Thing t)
 
void OnClickCraft ()
 
override List< ThingGetTargets ()
 
override int GetReqIngredient (int index)
 
override void OnEndCraft ()
 
void OnCompleteCraft ()
 
void WaitUntilIdle ()
 
void RefreshInfo ()
 
void RefreshCategory (string cat, bool first=false)
 
void OnChangeIngredient ()
 
void RefreshRecipe (bool first)
 
void RefreshTrackButton ()
 
void RefreshInputNum ()
 
void RefreshProduct ()
 
bool IsQualityMet ()
 
void RefreshQuality ()
 
void OnClickExamine ()
 
virtual List< ThingGetTargets ()
 
virtual int GetReqIngredient (int index)
 
virtual void RefreshCurrentGrid ()
 
virtual void ClearButtons ()
 
virtual void OnEndCraft ()
 
- 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

UIDynamicList list
 
UIRecipeInfo info1
 
UIRecipeInfo info2
 
Vector3 posInfo
 
Thing factory
 
Thing product
 
Recipe recipe
 
UIButton toggleRepeat
 
UIButton toggleCraftTo
 
UIButton buttonTrack
 
UIInputText inputNum
 
UIInputText moldInputNum
 
List< RecipeSourcenewRecipes = new List<RecipeSource>()
 
Window windowList
 
bool showInfo
 
UIButton buttonRefuel
 
UIButton buttonAutoRefuel
 
Transform transFuel
 
UIText textFuel
 
UIText textQualityInvalid
 
UIText textQualityValid
 
Image imageQualityReq
 
Image imageQualityCurrent
 
float waitComplete
 
float qualityBarWidth
 
ButtonGrid lastB
 
- 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
 

Static Public Attributes

static LayerCraft Instance
 
- 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" }
 

Private Member Functions

void Update ()
 

Private Attributes

bool pickaxeCrafted
 
bool workbenchCrafted
 
int wcount
 
bool tabBuilt
 

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)
 
- 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
 
- Properties inherited from LayerBaseCraft
virtual bool CanCancelAI [get]
 
virtual bool RepeatAI [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]
 

Detailed Description

Definition at line 6 of file LayerCraft.cs.

Member Function Documentation

◆ ClearButtons()

override void LayerCraft.ClearButtons ( )
inlinevirtual

Reimplemented from LayerBaseCraft.

Definition at line 75 of file LayerCraft.cs.

76 {
77 RefreshRecipe(first: true);
78 }
void RefreshRecipe(bool first)
Definition: LayerCraft.cs:411

References RefreshRecipe().

◆ GetReqIngredient()

override int LayerCraft.GetReqIngredient ( int  index)
inlinevirtual

Reimplemented from LayerBaseCraft.

Definition at line 209 of file LayerCraft.cs.

210 {
211 return recipe.ingredients[index].req * inputNum.Num;
212 }
UIInputText inputNum
Definition: LayerCraft.cs:30
Recipe recipe
Definition: LayerCraft.cs:22
List< Ingredient > ingredients
Definition: Recipe.cs:164

References Recipe.ingredients, inputNum, UIInputText.Num, and recipe.

◆ GetTargets()

override List< Thing > LayerCraft.GetTargets ( )
inlinevirtual

Reimplemented from LayerBaseCraft.

Definition at line 196 of file LayerCraft.cs.

197 {
198 List<Thing> list = new List<Thing>();
199 foreach (Recipe.Ingredient ingredient in recipe.ingredients)
200 {
201 if (!ingredient.optional || (ingredient.thing != null && !ingredient.thing.isDestroyed))
202 {
203 list.Add(ingredient.thing);
204 }
205 }
206 return list;
207 }
UIDynamicList list
Definition: LayerCraft.cs:10
Definition: Recipe.cs:7
override void Add(object o)

References UIDynamicList.Add(), Recipe.ingredients, list, and recipe.

◆ GetTextHeader()

override string LayerCraft.GetTextHeader ( Window  window)
inlinevirtual

Reimplemented from Layer.

Definition at line 80 of file LayerCraft.cs.

81 {
82 return null;
83 }

◆ IsQualityMet()

bool LayerCraft.IsQualityMet ( )
inline

Definition at line 497 of file LayerCraft.cs.

498 {
499 return true;
500 }

◆ OnAfterInit()

override void LayerCraft.OnAfterInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 85 of file LayerCraft.cs.

86 {
87 info1.searchMode = StockSearchMode.AroundPC;
88 info1.ddList.pivot.SetActive(enable: true);
89 Instance = this;
90 }
StockSearchMode
RectTransform pivot
Definition: DropdownGrid.cs:20
static LayerCraft Instance
Definition: LayerCraft.cs:8
UIRecipeInfo info1
Definition: LayerCraft.cs:12
DropdownGrid ddList
Definition: UIRecipeInfo.cs:62

References UIRecipeInfo.ddList, info1, Instance, and DropdownGrid.pivot.

◆ OnChangeIngredient()

void LayerCraft.OnChangeIngredient ( )
inline

Definition at line 406 of file LayerCraft.cs.

407 {
408 RefreshRecipe(first: true);
409 }

References RefreshRecipe().

Referenced by DropdownGrid.Activate(), and ButtonGrid.SetIngredient().

◆ OnClickCraft()

void LayerCraft.OnClickCraft ( )
inline

Definition at line 138 of file LayerCraft.cs.

139 {
140 Dictionary<Thing, int> dictionary = new Dictionary<Thing, int>();
141 foreach (Recipe.Ingredient ingredient in recipe.ingredients)
142 {
143 if (ingredient.thing != null)
144 {
145 if (!dictionary.ContainsKey(ingredient.thing))
146 {
147 dictionary.Add(ingredient.thing, 0);
148 }
149 dictionary[ingredient.thing] += ingredient.req * inputNum.Num;
150 }
151 }
152 foreach (KeyValuePair<Thing, int> item in dictionary)
153 {
154 if (item.Key.Num < item.Value)
155 {
156 SE.Beep();
157 Msg.Say("craftDupError");
158 return;
159 }
160 }
161 if (inputNum.Num == 0)
162 {
163 SE.Beep();
164 return;
165 }
166 TraitCrafter traitCrafter = factory?.trait as TraitCrafter;
167 if (traitCrafter == null)
168 {
169 traitCrafter = Trait.SelfFactory;
170 traitCrafter.owner = ELayer.pc;
171 }
172 (traitCrafter as TraitFactory).recipe = recipe;
173 switch (recipe.id)
174 {
175 case "workbench":
176 workbenchCrafted = true;
177 break;
178 case "axe":
179 case "hammer":
180 case "pickaxe":
181 pickaxeCrafted = true;
182 break;
183 }
186 {
187 crafter = traitCrafter,
188 layer = this,
189 recipe = recipe,
190 num = inputNum.Num
191 });
193 base.gameObject.SetActive(value: false);
194 }
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1040
static AM_Adv Adv
Definition: ActionMode.cs:15
Trait trait
Definition: Card.cs:49
AIAct SetAI(AIAct g)
Definition: Chara.cs:8045
Definition: ELayer.cs:4
static Chara pc
Definition: ELayer.cs:15
bool pickaxeCrafted
Definition: LayerCraft.cs:40
Thing factory
Definition: LayerCraft.cs:18
bool workbenchCrafted
Definition: LayerCraft.cs:42
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
string id
Definition: Recipe.cs:161
void SaveLastIngredients()
Definition: Recipe.cs:975
Definition: Trait.cs:7
static TraitSelfFactory SelfFactory
Definition: Trait.cs:24

References ActionMode.Adv, factory, Recipe.id, Recipe.ingredients, inputNum, item, UIInputText.Num, ELayer.pc, pickaxeCrafted, recipe, Recipe.SaveLastIngredients(), Msg.Say(), Trait.SelfFactory, Chara.SetAI(), AM_Adv.SetTurbo(), Card.trait, and workbenchCrafted.

◆ OnClickExamine()

void LayerCraft.OnClickExamine ( )
inline

Definition at line 506 of file LayerCraft.cs.

507 {
508 ELayer.ui.AddLayer<LayerInfo>().Set(product);
509 }
static UI ui
Definition: ELayer.cs:21
Thing product
Definition: LayerCraft.cs:20

References product, and ELayer.ui.

◆ OnCompleteCraft()

void LayerCraft.OnCompleteCraft ( )
inline

Definition at line 219 of file LayerCraft.cs.

220 {
221 CancelInvoke("WaitUntilIdle");
222 EInput.haltInput = true;
223 TweenUtil.Tween(waitComplete, null, delegate
224 {
225 EInput.haltInput = false;
226 base.gameObject.SetActive(value: true);
227 foreach (Window window in windows)
228 {
229 window.SetInteractable(enable: true);
230 }
231 list.Redraw();
232 RefreshRecipe(first: true);
234 list.Select((Recipe r) => recipe.id == r.id);
235 });
236 }
Window windowList
Definition: LayerCraft.cs:36
float waitComplete
Definition: LayerCraft.cs:60
List< Window > windows
Definition: Layer.cs:116
override void Redraw()
bool Select(object o, bool invoke=false)
Definition: Window.cs:13
UISelectableGroup groupTab
Definition: Window.cs:658
void SetInteractable(bool enable, float alpha=0.5f)
Definition: Window.cs:1525

References Window.groupTab, Recipe.id, list, recipe, UIDynamicList.Redraw(), UISelectableGroup.RefreshButtons(), RefreshRecipe(), UIDynamicList.Select(), Window.SetInteractable(), waitComplete, windowList, and Layer.windows.

Referenced by OnEndCraft(), and TaskCraft.Run().

◆ OnEndCraft()

override void LayerCraft.OnEndCraft ( )
inlinevirtual

Reimplemented from LayerBaseCraft.

Definition at line 214 of file LayerCraft.cs.

215 {
217 }
void OnCompleteCraft()
Definition: LayerCraft.cs:219

References OnCompleteCraft().

Referenced by SetFactory().

◆ OnKill()

override void LayerCraft.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 92 of file LayerCraft.cs.

93 {
95 {
96 Tutorial.Play("middle_click");
97 }
99 {
100 Tutorial.Play("hardness");
101 }
102 string key = ((factory == null) ? "hand" : factory.id);
104 }
string id
Definition: Card.cs:31
static Player player
Definition: ELayer.cs:13
Dictionary< string, string > lastRecipes
Definition: Player.cs:850
static void Play(string idStep)
Definition: Tutorial.cs:7

References factory, Card.id, Recipe.id, Player.lastRecipes, pickaxeCrafted, Tutorial.Play(), ELayer.player, recipe, and workbenchCrafted.

◆ RefreshCategory()

void LayerCraft.RefreshCategory ( string  cat,
bool  first = false 
)
inline

Definition at line 281 of file LayerCraft.cs.

282 {
283 Dictionary<string, int> cats = new Dictionary<string, int>();
285 list.callbacks = new UIList.Callback<Recipe, ButtonGrid>
286 {
287 onClick = delegate(Recipe a, ButtonGrid b)
288 {
289 if (recipe != null)
290 {
292 }
293 recipe = a;
294 SE.Play("click_recipe");
295 RefreshRecipe(first: true);
297 b.Dettach("recipe_new");
298 list.Select(a);
299 },
300 onRedraw = delegate(Recipe a, ButtonGrid b, int i)
301 {
302 if (a.ingredients.Count == 0)
303 {
305 }
306 b.SetCraftRecipe(a, ButtonGrid.Mode.Recipe);
307 if (!ELayer.player.recipes.hoveredRecipes.Contains(a.id))
308 {
309 b.Attach("recipe_new", rightAttach: false);
310 }
311 if (a.HasFirstTimeBonus())
312 {
313 b.Attach("recipe_firstTime", rightAttach: false).GetComponent<Image>().SetAlpha((a.idSkin == 0) ? 1f : 0.5f);
314 }
315 },
316 onList = delegate
317 {
318 newRecipes.Clear();
320 {
321 if (cat == "all" || item.row.Category.IsChildOf(cat))
322 {
323 Recipe o2 = Recipe.Create(item);
324 list.Add(o2);
325 if (item.row.skins != null && item.row.skins.Length != 0)
326 {
327 for (int j = 0; j < item.row.skins.Length; j++)
328 {
329 o2 = Recipe.Create(item);
330 o2.idSkin = j + 1;
331 list.Add(o2);
332 }
333 }
334 }
335 SourceCategory.Row row = item.row.Category.GetSecondRoot();
336 if (row.id != "lightsource" && row.IsChildOf("armor"))
337 {
338 row = ELayer.sources.categories.map["armor"];
339 }
340 if (!cats.ContainsKey(row.id))
341 {
342 cats.Add(row.id, 1);
343 }
344 else
345 {
346 cats[row.id]++;
347 }
348 }
349 list.objects.Sort((object a, object b) => (b as Recipe).GetSortVal() - (a as Recipe).GetSortVal());
350 _ = newRecipes.Count;
351 },
352 onSort = (Recipe a, UIList.SortMode m) => a.GetSortVal()
353 };
354 list.sortMode = UIList.SortMode.ByLevel;
355 list.List();
356 if (cats.Count > 1 && !tabBuilt)
357 {
358 windowList.AddTab("all", null, delegate
359 {
360 RefreshCategory("all");
361 });
362 foreach (KeyValuePair<string, int> c in cats)
363 {
364 windowList.AddTab(ELayer.sources.categories.map[c.Key].GetName() + "(" + c.Value + ")", null, delegate
365 {
366 RefreshCategory(c.Key);
367 });
368 }
369 tabBuilt = true;
371 }
372 list.Scroll();
373 if (list.rows.Count <= 0)
374 {
375 return;
376 }
377 object o = list.rows[0].objects[0];
378 if (first)
379 {
380 string key = ((factory == null) ? "hand" : factory.id);
381 if (ELayer.player.lastRecipes.ContainsKey(key))
382 {
383 string text = ELayer.player.lastRecipes[key];
384 foreach (object @object in list.objects)
385 {
386 if ((@object as Recipe).id == text)
387 {
388 o = @object;
389 break;
390 }
391 }
392 }
393 list.Scroll(o);
394 if (!list.Select(o, invoke: true))
395 {
396 list.Scroll();
397 list.Select(list.rows[0].objects[0]);
398 }
399 }
400 else
401 {
402 list.Select(o, invoke: true);
403 }
404 }
void SetCraftRecipe(Recipe r, Mode mode, bool tooltip=false)
Definition: ButtonGrid.cs:585
Transform Attach(string id, bool rightAttach=true)
Definition: ButtonGrid.cs:63
void Dettach(string id)
Definition: ButtonGrid.cs:78
static SourceManager sources
Definition: ELayer.cs:37
List< RecipeSource > newRecipes
Definition: LayerCraft.cs:34
void RefreshCategory(string cat, bool first=false)
Definition: LayerCraft.cs:281
bool tabBuilt
Definition: LayerCraft.cs:68
RecipeManager recipes
Definition: Player.cs:898
static void BuildList()
List< RecipeSource > ListSources(Thing factory, List< RecipeSource > newRecipes=null)
HashSet< string > hoveredRecipes
int GetSortVal()
Definition: Recipe.cs:944
static Recipe Create(RecipeSource _source, int idMat=-1, Thing ing=null)
Definition: Recipe.cs:308
bool HasFirstTimeBonus()
Definition: Recipe.cs:950
int idSkin
Definition: Recipe.cs:181
virtual void BuildIngredientList()
Definition: Recipe.cs:509
bool IsChildOf(string id)
SourceCategory categories
override void List()
List< Row > rows
List< object > objects
void Scroll(int index=0)
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27
void BuildTabs(int index=-1)
Definition: Window.cs:1396
Setting.Tab AddTab(string idLang, UIContent content=null, Action action=null, Sprite sprite=null, string langTooltip=null)
Definition: Window.cs:1443

References UIDynamicList.Add(), Window.AddTab(), ButtonGrid.Attach(), Recipe.BuildIngredientList(), RecipeManager.BuildList(), Window.BuildTabs(), SourceManager.categories, Recipe.Create(), ButtonGrid.Dettach(), factory, Recipe.GetSortVal(), Recipe.HasFirstTimeBonus(), RecipeManager.hoveredRecipes, Card.id, Recipe.id, SourceCategory.Row.id, Recipe.idSkin, Recipe.ingredients, SourceCategory.Row.IsChildOf(), item, Player.lastRecipes, list, UIDynamicList.List(), RecipeManager.ListSources(), newRecipes, UIDynamicList.objects, ELayer.player, recipe, Player.recipes, RefreshCategory(), RefreshRecipe(), UIDynamicList.rows, Recipe.SaveLastIngredients(), UIDynamicList.Scroll(), UIDynamicList.Select(), ButtonGrid.SetCraftRecipe(), ELayer.sources, tabBuilt, and windowList.

Referenced by RefreshCategory(), and SetFactory().

◆ RefreshCurrentGrid()

override void LayerCraft.RefreshCurrentGrid ( )
inlinevirtual

Reimplemented from LayerBaseCraft.

Definition at line 70 of file LayerCraft.cs.

71 {
72 RefreshRecipe(first: true);
73 }

References RefreshRecipe().

◆ RefreshInfo()

void LayerCraft.RefreshInfo ( )
inline

Definition at line 268 of file LayerCraft.cs.

269 {
270 ButtonGrid buttonGrid = InputModuleEX.GetComponentOf<ButtonGrid>();
271 if ((bool)buttonGrid && buttonGrid.recipe == null)
272 {
273 buttonGrid = null;
274 }
275 if (!(buttonGrid == lastB))
276 {
277 lastB = buttonGrid;
278 }
279 }
ButtonGrid lastB
Definition: LayerCraft.cs:66

References lastB.

Referenced by Update().

◆ RefreshInputNum()

void LayerCraft.RefreshInputNum ( )
inline

Definition at line 445 of file LayerCraft.cs.

446 {
448 inputNum.onValueChanged = delegate
449 {
451 };
453 }
void RefreshProduct()
Definition: LayerCraft.cs:455
int GetMaxCount()
Definition: Recipe.cs:913
void SetMinMax(int _min, int _max)
Definition: UIInputText.cs:74
void Validate()
Definition: UIInputText.cs:113

References Recipe.GetMaxCount(), inputNum, recipe, RefreshProduct(), UIInputText.SetMinMax(), and UIInputText.Validate().

Referenced by RefreshProduct().

◆ RefreshProduct()

void LayerCraft.RefreshProduct ( )
inline

Definition at line 455 of file LayerCraft.cs.

456 {
458 ELayer.screen.tileSelector.summary.countValid = inputNum.Num;
459 ELayer.screen.tileSelector.summary.factory = factory;
461 if (factory != null)
462 {
463 textFuel.text = "craftFuel".lang(((int)((float)factory.c_charges / (float)factory.trait.MaxFuel * 100f)).ToString() ?? "");
464 buttonAutoRefuel.mainText.text = (factory.autoRefuel ? "On" : "Off");
465 buttonAutoRefuel.icon.SetAlpha(factory.autoRefuel ? 1f : 0.4f);
466 }
468 List<Thing> list = new List<Thing>();
469 foreach (Recipe.Ingredient ingredient in recipe.ingredients)
470 {
471 if (ingredient.thing != null)
472 {
473 list.Add(ingredient.thing);
474 }
475 }
476 Thing thing = recipe.Craft(BlessedState.Normal, sound: false, list, null, model: true);
477 thing.SetNum(inputNum.Num);
478 if (thing.sockets != null)
479 {
480 thing.sockets.Clear();
481 }
483 {
484 foreach (Element item in thing.elements.dict.Values.ToList())
485 {
486 if (!item.IsTrait)
487 {
488 thing.elements.Remove(item.id);
489 }
490 }
491 }
493 thing.WriteNote(info1.note, null, IInspect.NoteMode.Product, recipe);
494 product = thing;
495 }
BlessedState
Definition: BlessedState.cs:2
void SetCard(Card c, Mode mode=Mode.Default, Action< UINote > onWriteNote=null)
Definition: ButtonGrid.cs:184
ElementContainerCard elements
Definition: Card.cs:37
bool IsEquipmentOrRangedOrAmmo
Definition: Card.cs:2090
Thing SetNum(int a)
Definition: Card.cs:3242
bool autoRefuel
Definition: Card.cs:598
int c_charges
Definition: Card.cs:1205
List< int > sockets
Definition: Card.cs:43
Dictionary< int, Element > dict
void Remove(int id)
void RefreshInputNum()
Definition: LayerCraft.cs:445
void RefreshQuality()
Definition: LayerCraft.cs:502
UIButton buttonAutoRefuel
Definition: LayerCraft.cs:46
virtual Thing Craft(BlessedState blessed, bool sound=false, List< Thing > ings=null, TraitCrafter crafter=null, bool model=false)
Definition: Recipe.cs:536
Definition: Thing.cs:8
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
Definition: Thing.cs:837
virtual int MaxFuel
Definition: Trait.cs:436
Image icon
Definition: UIButton.cs:110
void RefreshBalance()
ButtonGrid buttonProduct
Definition: UIRecipeInfo.cs:66
NoteMode
Definition: IInspect.cs:7

References UIDynamicList.Add(), Card.autoRefuel, buttonAutoRefuel, UIRecipeInfo.buttonProduct, Card.c_charges, Recipe.Craft(), ElementContainer.dict, Card.elements, factory, UIButton.icon, info1, Recipe.ingredients, inputNum, Card.IsEquipmentOrRangedOrAmmo, item, list, Trait.MaxFuel, UIRecipeInfo.note, UIInputText.Num, product, recipe, UIRecipeInfo.RefreshBalance(), RefreshInputNum(), RefreshQuality(), ElementContainer.Remove(), ButtonGrid.SetCard(), Card.SetNum(), Card.sockets, Card.trait, and Thing.WriteNote().

Referenced by RefreshInputNum(), RefreshRecipe(), SetFactory(), and DropdownGrid.TrySelect().

◆ RefreshQuality()

void LayerCraft.RefreshQuality ( )
inline

Definition at line 502 of file LayerCraft.cs.

503 {
504 }

Referenced by RefreshProduct().

◆ RefreshRecipe()

void LayerCraft.RefreshRecipe ( bool  first)
inline

Definition at line 411 of file LayerCraft.cs.

412 {
413 foreach (Recipe.Ingredient ingredient in recipe.ingredients)
414 {
415 if (info1.recipe != recipe || (!ingredient.optional && (ingredient.thing == null || ingredient.thing.isDestroyed)))
416 {
417 ingredient.SetThing();
418 }
419 }
420 if (first)
421 {
422 toggleCraftTo.SetToggle(isOn: false);
423 toggleRepeat.SetToggle(isOn: false);
424 inputNum.Num = 1;
425 info1.recipe = null;
426 }
427 info1.factory = factory;
432 }
UIButton toggleRepeat
Definition: LayerCraft.cs:24
void RefreshTrackButton()
Definition: LayerCraft.cs:434
UIButton toggleCraftTo
Definition: LayerCraft.cs:26
virtual void OnChangeIngredient()
Definition: Recipe.cs:532
void SetToggle(bool isOn, Action< bool > onToggle=null)
Definition: UIButton.cs:341
void SetRecipe(Recipe r)
Recipe recipe
Definition: UIRecipeInfo.cs:32

References factory, info1, Recipe.ingredients, Recipe.OnChangeIngredient(), recipe, UIRecipeInfo.recipe, RefreshProduct(), RefreshTrackButton(), UIRecipeInfo.SetRecipe(), UIButton.SetToggle(), toggleCraftTo, and toggleRepeat.

Referenced by ClearButtons(), OnChangeIngredient(), OnCompleteCraft(), RefreshCategory(), and RefreshCurrentGrid().

◆ RefreshTrackButton()

void LayerCraft.RefreshTrackButton ( )
inline

Definition at line 434 of file LayerCraft.cs.

435 {
437 buttonTrack.SetOnClick(delegate
438 {
439 recipe.ToggleTrack(quest);
441 });
442 buttonTrack.icon.SetActive(quest != null && quest.idRecipe == recipe.id);
443 }
UIButton buttonTrack
Definition: LayerCraft.cs:28
QuestTrackCraft GetQuestTrack()
Definition: Recipe.cs:986
void ToggleTrack(QuestTrackCraft quest)
Definition: Recipe.cs:1000

References buttonTrack, Recipe.GetQuestTrack(), UIButton.icon, Recipe.id, QuestTrackCraft.idRecipe, recipe, RefreshTrackButton(), and Recipe.ToggleTrack().

Referenced by ItemQuestTracker.OnClickClose(), RefreshRecipe(), and RefreshTrackButton().

◆ SetFactory()

void LayerCraft.SetFactory ( Thing  t)
inline

Definition at line 106 of file LayerCraft.cs.

107 {
108 factory = t;
109 RefreshCategory("all", first: true);
110 bool flag = t != null && t.trait.IsRequireFuel;
111 transFuel.SetActive(flag);
112 if (!flag)
113 {
114 return;
115 }
116 buttonRefuel.SetOnClick(delegate
117 {
118 foreach (Window window in windows)
119 {
120 window.SetInteractable(enable: false, 0f);
121 }
123 {
124 if (!isDestroyed)
125 {
126 OnEndCraft();
127 }
128 });
129 });
130 buttonAutoRefuel.SetOnClick(delegate
131 {
132 SE.Click();
133 t.autoRefuel = !t.autoRefuel;
135 });
136 }
override void OnEndCraft()
Definition: LayerCraft.cs:214
Transform transFuel
Definition: LayerCraft.cs:48
UIButton buttonRefuel
Definition: LayerCraft.cs:44
static LayerDragGrid Create(InvOwnerDraglet owner, bool refuelFromLayerDragGrid=false)
bool isDestroyed
Definition: Layer.cs:98
Layer SetOnKill(Action action)
Definition: Layer.cs:579
bool IsRequireFuel
Definition: Trait.cs:451

References Card.autoRefuel, buttonAutoRefuel, buttonRefuel, LayerDragGrid.Create(), factory, Layer.isDestroyed, Trait.IsRequireFuel, OnEndCraft(), RefreshCategory(), RefreshProduct(), Window.SetInteractable(), Layer.SetOnKill(), Card.trait, transFuel, and Layer.windows.

◆ Update()

void LayerCraft.Update ( )
inlineprivate

Definition at line 247 of file LayerCraft.cs.

248 {
249 float axis = Input.GetAxis("Mouse ScrollWheel");
250 if (Input.GetMouseButton(0))
251 {
252 wcount = 2;
253 }
254 if (axis != 0f)
255 {
256 wcount = 2;
257 }
258 else if (wcount > 0)
259 {
260 wcount--;
261 }
262 else
263 {
264 RefreshInfo();
265 }
266 }
int wcount
Definition: LayerCraft.cs:64
void RefreshInfo()
Definition: LayerCraft.cs:268

References RefreshInfo(), and wcount.

◆ WaitUntilIdle()

void LayerCraft.WaitUntilIdle ( )
inline

Definition at line 238 of file LayerCraft.cs.

239 {
241 {
242 CancelInvoke();
243 Close();
244 }
245 }
bool IsActive
Definition: ActionMode.cs:121
bool HasNoGoal
Definition: Chara.cs:821
virtual void Close()
Definition: Layer.cs:463

References ActionMode.Adv, Layer.Close(), Chara.HasNoGoal, ActionMode.IsActive, and ELayer.pc.

Member Data Documentation

◆ buttonAutoRefuel

UIButton LayerCraft.buttonAutoRefuel

Definition at line 46 of file LayerCraft.cs.

Referenced by RefreshProduct(), and SetFactory().

◆ buttonRefuel

UIButton LayerCraft.buttonRefuel

Definition at line 44 of file LayerCraft.cs.

Referenced by SetFactory().

◆ buttonTrack

UIButton LayerCraft.buttonTrack

Definition at line 28 of file LayerCraft.cs.

Referenced by RefreshTrackButton().

◆ factory

Thing LayerCraft.factory

◆ imageQualityCurrent

Image LayerCraft.imageQualityCurrent

Definition at line 58 of file LayerCraft.cs.

◆ imageQualityReq

Image LayerCraft.imageQualityReq

Definition at line 56 of file LayerCraft.cs.

◆ info1

UIRecipeInfo LayerCraft.info1

Definition at line 12 of file LayerCraft.cs.

Referenced by OnAfterInit(), RefreshProduct(), and RefreshRecipe().

◆ info2

UIRecipeInfo LayerCraft.info2

Definition at line 14 of file LayerCraft.cs.

◆ inputNum

UIInputText LayerCraft.inputNum

Definition at line 30 of file LayerCraft.cs.

Referenced by GetReqIngredient(), OnClickCraft(), RefreshInputNum(), and RefreshProduct().

◆ Instance

◆ lastB

ButtonGrid LayerCraft.lastB

Definition at line 66 of file LayerCraft.cs.

Referenced by RefreshInfo().

◆ list

UIDynamicList LayerCraft.list

Definition at line 10 of file LayerCraft.cs.

Referenced by GetTargets(), OnCompleteCraft(), RefreshCategory(), and RefreshProduct().

◆ moldInputNum

UIInputText LayerCraft.moldInputNum

Definition at line 32 of file LayerCraft.cs.

◆ newRecipes

List<RecipeSource> LayerCraft.newRecipes = new List<RecipeSource>()

Definition at line 34 of file LayerCraft.cs.

Referenced by RefreshCategory().

◆ pickaxeCrafted

bool LayerCraft.pickaxeCrafted
private

Definition at line 40 of file LayerCraft.cs.

Referenced by OnClickCraft(), and OnKill().

◆ posInfo

Vector3 LayerCraft.posInfo

Definition at line 16 of file LayerCraft.cs.

◆ product

Thing LayerCraft.product

Definition at line 20 of file LayerCraft.cs.

Referenced by OnClickExamine(), RefreshProduct(), and ActionMode.UpdateInput().

◆ qualityBarWidth

float LayerCraft.qualityBarWidth

Definition at line 62 of file LayerCraft.cs.

◆ recipe

◆ showInfo

bool LayerCraft.showInfo

Definition at line 38 of file LayerCraft.cs.

◆ tabBuilt

bool LayerCraft.tabBuilt
private

Definition at line 68 of file LayerCraft.cs.

Referenced by RefreshCategory().

◆ textFuel

UIText LayerCraft.textFuel

Definition at line 50 of file LayerCraft.cs.

◆ textQualityInvalid

UIText LayerCraft.textQualityInvalid

Definition at line 52 of file LayerCraft.cs.

◆ textQualityValid

UIText LayerCraft.textQualityValid

Definition at line 54 of file LayerCraft.cs.

◆ toggleCraftTo

UIButton LayerCraft.toggleCraftTo

Definition at line 26 of file LayerCraft.cs.

Referenced by RefreshRecipe().

◆ toggleRepeat

UIButton LayerCraft.toggleRepeat

Definition at line 24 of file LayerCraft.cs.

Referenced by RefreshRecipe().

◆ transFuel

Transform LayerCraft.transFuel

Definition at line 48 of file LayerCraft.cs.

Referenced by SetFactory().

◆ waitComplete

float LayerCraft.waitComplete

Definition at line 60 of file LayerCraft.cs.

Referenced by OnCompleteCraft().

◆ wcount

int LayerCraft.wcount
private

Definition at line 64 of file LayerCraft.cs.

Referenced by Update().

◆ windowList

Window LayerCraft.windowList

Definition at line 36 of file LayerCraft.cs.

Referenced by OnCompleteCraft(), and RefreshCategory().

◆ workbenchCrafted

bool LayerCraft.workbenchCrafted
private

Definition at line 42 of file LayerCraft.cs.

Referenced by OnClickCraft(), and OnKill().


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