准备制作食材预处理流程,为lua直接读data table做基建
...
This commit is contained in:
		| @ -0,0 +1,11 @@ | ||||
| local CookPrepStationEntry = {} | ||||
| local Emitter = require("Utils.Emitter") | ||||
|  | ||||
| function CookPrepStationEntry:OnInitialized() | ||||
|     self.MainBtn.OnClicked:Add(function() | ||||
|         Emitter.EmitEvent("switch_to_prep_station") | ||||
|     end) | ||||
| end | ||||
|  | ||||
|  | ||||
| return Class(nil, nil, CookPrepStationEntry) | ||||
| @ -88,11 +88,11 @@ end | ||||
|  | ||||
| function CookingBench:UpdateCookState() | ||||
|     if self.temperature > 0 then | ||||
|         self.WBP_CookingProcess:SetVisible(true) | ||||
|         self.WBP_CookingProcess:BP_SetVisible(true) | ||||
|         local percent = self.temperature / self.max_temperature | ||||
|         self.WBP_CookingProcess.TemperatureProcess:SetPercent(percent) | ||||
|     else | ||||
|         self.WBP_CookingProcess:SetVisible(false) | ||||
|         self.WBP_CookingProcess:BP_SetVisible(false) | ||||
|     end | ||||
| end | ||||
|  | ||||
|  | ||||
							
								
								
									
										35
									
								
								Content/Lua/HomeLand/UI/Hearth/Widgets/PreCookSlot.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								Content/Lua/HomeLand/UI/Hearth/Widgets/PreCookSlot.lua
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,35 @@ | ||||
| local DataTableUtils = require("Utils.DataTableUtils") | ||||
| local PreCookSlot = {} | ||||
|  | ||||
| function PreCookSlot:OnInitialized() | ||||
|  | ||||
| end | ||||
|  | ||||
| function PreCookSlot:Construct() | ||||
|  | ||||
| end | ||||
|  | ||||
| function PreCookSlot:Destruct() | ||||
|  | ||||
| end | ||||
|  | ||||
| function PreCookSlot:Reset() | ||||
|  | ||||
|  | ||||
| end | ||||
|  | ||||
| function PreCookSlot:SetPreCookToolID(pre_cook_tool_id) | ||||
|     self:Reset() | ||||
|     if not pre_cook_tool_id then return end | ||||
|  | ||||
|     local row_data = DataTableUtils.GetDataTableRow("PreCookItemConfig", pre_cook_tool_id) | ||||
|     if not row_data then | ||||
|         return | ||||
|     end | ||||
|  | ||||
|     self.SlotImg:SetBrushFromSoftTexture(row_data.DisplayResource, true) | ||||
|     print("PreCookSlot:SetPreCookToolID", row_data) | ||||
| end | ||||
|  | ||||
|  | ||||
| return Class(nil, nil, PreCookSlot) | ||||
		Reference in New Issue
	
	Block a user