1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class CookingHandler : DlgHandlerBase
{
protected override string FileName
{
get
{
return "Home/CookingHandler";
}
}
protected IXUILabel _upCuisineLevel;
protected IXUILabel _upExpPercent;
protected IXUISlider _upProgress;
protected Transform _middCuisineItem;
protected IXUILabel _middCuisineName;
protected IXUILabel _middCuisineAddExp;
protected IXUILabel _middMakeTimes;
protected IXUILabel _downCuisineDec;
protected Transform _needMats;
protected IXUIButton _makeBtn;
protected IXUIButton _cancelMakingBtn = null;
protected IXUIButton _oneKeyCookingBtn = null;
protected uint _curCookID = 0u;
protected uint _curCookLevel = 0u;
protected Transform _selectedFoodItem;
protected Transform _tabs;
protected IXUITable _tabTable;
protected XUIPool _levelCuisinePool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
protected XUIPool _cuisineChildPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
protected XUIPool _foodItemPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
protected List<Transform> _childCuisineItems = new List<Transform>();
protected List<Transform> _levelItems = new List<Transform>();
protected ulong _preCookID = 0UL;
protected bool _isOneKeyCooking = false;
protected Transform _cookingProgressFrame;
protected IXUISlider _cookingSlider;
protected Transform _cookingItem;
protected Transform _makingTrans;
protected Transform _successEffect;
protected Transform _cookingEffect;
protected IXUIButton _doBtn;
protected Transform _toggleSprite;
protected override void Init()
{
base.Init();
this.InitUIPool();
this.InitProperties();
this.InitClickCallback();
}
public override void RegisterEvent()
{
base.RegisterEvent();
}
protected override void OnShow()
{
base.OnShow();
this.RefreshUI();
}
protected override void OnHide()
{
base.OnHide();
}
public override void OnUnload()
{
base.OnUnload();
}
public void RefreshUI()
{
this._selectedFoodItem = null;
this._curCookLevel = HomeMainDocument.Doc.GetCookingLevel();
this.InitLeftPanel();
this.InitSelectedFood();
this.RefreshRightDetail(this._curCookID);
}
protected void InitSelectedFood()
{
bool flag = this._levelItems.Count <= 0;
if (!flag)
{
bool flag2 = null != this._selectedFoodItem;
IXUICheckBox ixuicheckBox;
if (flag2)
{
ixuicheckBox = (this._selectedFoodItem.GetComponent("XUICheckBox") as IXUICheckBox);
}
else
{
bool flag3 = this._childCuisineItems.Count > 0;
if (flag3)
{
ixuicheckBox = (this._childCuisineItems[0].GetComponent("XUICheckBox") as IXUICheckBox);
}
else
{
IXUITweenTool ixuitweenTool = this._levelItems[0].GetComponent("XUIPlayTween") as IXUITweenTool;
ixuitweenTool.PlayTween(true, -1f);
ixuicheckBox = (this._levelItems[0].Find("Children").GetChild(0).GetComponent("XUICheckBox") as IXUICheckBox);
}
}
bool flag4 = ixuicheckBox == null;
if (!flag4)
{
this._curCookID = (uint)ixuicheckBox.ID;
ixuicheckBox.ForceSetFlag(true);
Transform parent = ixuicheckBox.gameObject.transform.parent.parent;
Transform transform = parent.Find("ToggleSprite");
transform.gameObject.SetActive(true);
this.SwitchToggleSprite(transform);
}
}
}
private void SwitchToggleSprite(Transform spriteToggle)
{
bool flag = this._toggleSprite != null && this._toggleSprite != spriteToggle;
if (flag)
{
this._toggleSprite.gameObject.SetActive(false);
}
this._toggleSprite = spriteToggle;
}
protected void InitProperties()
{
this._cookingProgressFrame = base.transform.Find("Content/CookingProgressFrame");
this._cookingProgressFrame.gameObject.SetActive(true);
Transform transform = this._cookingProgressFrame.Find("Making/Bar");
this._cookingSlider = (transform.GetComponent("XUISlider") as IXUISlider);
this._doBtn = (this._cookingProgressFrame.Find("Do").GetComponent("XUIButton") as IXUIButton);
this._cancelMakingBtn = (this._cookingProgressFrame.Find("Cancel").GetComponent("XUIButton") as IXUIButton);
this._doBtn.gameObject.SetActive(false);
this._cookingItem = this._cookingProgressFrame.Find("Item");
this._successEffect = this._cookingProgressFrame.Find("Suc");
this._cookingEffect = this._cookingProgressFrame.Find("effex");
this._makingTrans = this._cookingProgressFrame.Find("Making");
this._successEffect.gameObject.SetActive(false);
this._cookingProgressFrame.gameObject.SetActive(false);
this._makeBtn = (base.transform.Find("MakeBtn").GetComponent("XUIButton") as IXUIButton);
this._oneKeyCookingBtn = (base.transform.Find("AllMake").GetComponent("XUIButton") as IXUIButton);
this._oneKeyCookingBtn.gameObject.SetActive(true);
this._upCuisineLevel = (base.transform.Find("Content/CookLevel/NameLab").GetComponent("XUILabel") as IXUILabel);
this._upExpPercent = (base.transform.Find("Content/CookLevel/planLab").GetComponent("XUILabel") as IXUILabel);
this._upProgress = (base.transform.Find("Content/CookLevel/Bar").GetComponent("XUISlider") as IXUISlider);
this._middCuisineItem = base.transform.Find("Content/CookItem/Item");
this._middCuisineName = (base.transform.Find("Content/CookItem/Name").GetComponent("XUILabel") as IXUILabel);
this._middCuisineAddExp = (base.transform.Find("Content/CookItem/Exp").GetComponent("XUILabel") as IXUILabel);
this._middMakeTimes = (base.transform.Find("Content/CookItem/Tips").GetComponent("XUILabel") as IXUILabel);
this._downCuisineDec = (base.transform.Find("Content/ContentLab").GetComponent("XUILabel") as IXUILabel);
}
protected void InitUIPool()
{
this._tabs = base.transform.Find("Tabs");
this._tabTable = (this._tabs.Find("UITable").GetComponent("XUITable") as IXUITable);
this._needMats = base.transform.Find("Content/Items");
Transform transform = this._tabs.Find("UITable/TittleTpl");
Transform transform2 = this._tabs.Find("UITable/ChildTpl");
this._levelCuisinePool.SetupPool(this._tabs.gameObject, transform.gameObject, 2u, false);
this._cuisineChildPool.SetupPool(this._tabs.gameObject, transform2.gameObject, 2u, false);
this._foodItemPool.SetupPool(this._needMats.gameObject, this._needMats.Find("Item").gameObject, 2u, false);
}
protected void InitLeftPanel()
{
uint num = Math.Min(this._curCookLevel + 1u, XHomeCookAndPartyDocument.Doc.GetMaxLevel());
this._levelCuisinePool.ReturnAll(false);
this._cuisineChildPool.ReturnAll(true);
this._childCuisineItems.Clear();
this._levelItems.Clear();
XHomeCookAndPartyDocument.Doc.SortFoodTableData();
CookingFoodInfo.RowData[] table = XHomeCookAndPartyDocument.CookingFoolInfoTable.Table;
int num2 = 0;
int num3 = (int)this._levelCuisinePool.TplPos.y;
Transform transform = null;
for (int i = 0; i < table.Length; i++)
{
bool flag = (ulong)table[i].Level != (ulong)((long)num2);
if (flag)
{
num2++;
bool flag2 = (long)num2 > (long)((ulong)num);
if (flag2)
{
break;
}
transform = this.SetLevelItem(ref num3, num2);
this._levelItems.Add(transform);
}
CookingFoodInfo.RowData rowData = table[i];
uint basicTypeID = XSingleton<XAttributeMgr>.singleton.XPlayerData.BasicTypeID;
foreach (uint num4 in rowData.Profession)
{
bool flag3 = num4 == basicTypeID;
if (flag3)
{
this.SetChildItem(ref num3, table[i], transform.Find("Children"));
break;
}
}
}
this._tabTable.Reposition();
}
protected Transform SetLevelItem(ref int height, int level)
{
GameObject gameObject = this._levelCuisinePool.FetchGameObject(false);
gameObject.transform.parent = this._tabs.Find("UITable");
gameObject.transform.localPosition = new Vector3(this._levelCuisinePool.TplPos.x, (float)height, 0f);
IXUISprite ixuisprite = gameObject.GetComponent("XUISprite") as IXUISprite;
ixuisprite.ID = (ulong)((long)level);
ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClicklevel));
height -= this._levelCuisinePool.TplHeight;
IXUILabel ixuilabel = gameObject.transform.Find("NameLab").GetComponent("XUILabel") as IXUILabel;
ixuilabel.SetText(string.Format(XSingleton<XStringTable>.singleton.GetString("FoodLevel"), level));
IXUILabel ixuilabel2 = gameObject.transform.Find("ToggleSprite/NameLab").GetComponent("XUILabel") as IXUILabel;
ixuilabel2.SetText(string.Format(XSingleton<XStringTable>.singleton.GetString("FoodLevel"), level));
Transform transform = gameObject.transform.Find("ToggleSprite");
transform.gameObject.SetActive(false);
return gameObject.transform;
}
protected Transform SetChildItem(ref int height, CookingFoodInfo.RowData info, Transform parent)
{
GameObject gameObject = this._cuisineChildPool.FetchGameObject(false);
gameObject.transform.parent = parent;
gameObject.transform.localPosition = new Vector3(0f, (float)(-(float)this._levelCuisinePool.TplHeight - (parent.childCount - 1) * this._cuisineChildPool.TplHeight), 0f);
height -= this._cuisineChildPool.TplHeight;
Transform transform = gameObject.transform.Find("NewSpr");
transform.gameObject.SetActive(XHomeCookAndPartyDocument.Doc.IsNewAddedCookItem(info.FoodID));
IXUILabel ixuilabel = gameObject.transform.Find("SelectLab").GetComponent("XUILabel") as IXUILabel;
IXUILabel ixuilabel2 = gameObject.transform.Find("UnSelectLab").GetComponent("XUILabel") as IXUILabel;
IXUICheckBox ixuicheckBox = gameObject.GetComponent("XUICheckBox") as IXUICheckBox;
ixuilabel.SetText(info.FoodName);
IXUISprite ixuisprite = gameObject.transform.Find("Sprite").GetComponent("XUISprite") as IXUISprite;
ixuisprite.RegisterSpriteClickEventHandler(null);
ixuisprite.gameObject.GetComponent<BoxCollider>().enabled = false;
ixuicheckBox.SetEnable(true);
bool flag = HomeMainDocument.Doc.IsFoodIDActive(info.FoodID);
if (flag)
{
ixuicheckBox.ID = (ulong)info.FoodID;
ixuilabel2.SetText(info.FoodName);
}
else
{
ixuilabel2.SetText("? ? ? ?");
ixuicheckBox.ID = 0UL;
ixuicheckBox.SetEnable(false);
ixuisprite.gameObject.GetComponent<BoxCollider>().enabled = true;
ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnUnactiveFood));
}
ixuicheckBox.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnCuisineToggleChanged));
gameObject.transform.localScale = Vector3.one;
bool flag2 = this._preCookID != 0UL && (ulong)info.FoodID == this._preCookID;
if (flag2)
{
this._selectedFoodItem = gameObject.transform;
}
bool flag3 = gameObject.transform.parent.localScale.y > 0.02f;
if (flag3)
{
this._childCuisineItems.Add(gameObject.transform);
}
return gameObject.transform;
}
protected void OnClicklevel(IXUISprite uiSprite)
{
foreach (object obj in uiSprite.gameObject.transform)
{
Transform transform = (Transform)obj;
}
}
protected void OnUnactiveFood(IXUISprite sprite)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("CookMenuNotActive"), "fece00");
}
protected void InitClickCallback()
{
this._makeBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.StartToCooking));
this._oneKeyCookingBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OneShotCooking));
this._doBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickCookingButtonOK));
this._cancelMakingBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.CancelCooking));
}
protected bool OnCuisineToggleChanged(IXUICheckBox checkbox)
{
bool bChecked = checkbox.bChecked;
if (bChecked)
{
bool flag = checkbox.ID > 0UL;
if (flag)
{
this._curCookID = (uint)checkbox.ID;
Transform transform = checkbox.gameObject.transform.parent.parent.Find("ToggleSprite");
transform.gameObject.SetActive(true);
this.SwitchToggleSprite(transform);
bool flag2 = XHomeCookAndPartyDocument.Doc.RemoveNewCookItem(this._curCookID);
if (flag2)
{
Transform transform2 = checkbox.gameObject.transform.Find("NewSpr");
transform2.gameObject.SetActive(false);
}
this.RefreshRightDetail(this._curCookID);
return true;
}
}
return false;
}
protected void RefreshRightDetail(uint cuisineId)
{
CookingFoodInfo.RowData cookInfoByCuisineID = XHomeCookAndPartyDocument.Doc.GetCookInfoByCuisineID(cuisineId);
bool flag = cookInfoByCuisineID != null;
if (flag)
{
this._preCookID = (ulong)this._curCookID;
this._upCuisineLevel.SetText(this._curCookLevel.ToString());
uint cookingExp = HomeMainDocument.Doc.GetCookingExp();
uint expByCookLevel = XHomeCookAndPartyDocument.Doc.GetExpByCookLevel(this._curCookLevel);
this._upExpPercent.SetText(cookingExp + "/" + expByCookLevel);
bool flag2 = expByCookLevel == 0u;
if (flag2)
{
this._upProgress.Value = 0f;
}
else
{
this._upProgress.Value = cookingExp / expByCookLevel;
}
XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(this._middCuisineItem.gameObject, (int)cuisineId, 1, false);
IXUISprite ixuisprite = this._middCuisineItem.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite;
ixuisprite.ID = (ulong)cuisineId;
ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton<UiUtility>.singleton.OnItemClick));
this._middCuisineAddExp.SetText(cookInfoByCuisineID.AddExp.ToString());
this._middCuisineName.SetText(cookInfoByCuisineID.FoodName);
string text = "";
bool flag3 = cookInfoByCuisineID.Frequency > 0u;
if (flag3)
{
text = string.Format(XSingleton<XStringTable>.singleton.GetString("CookItemMaxTimes"), cookInfoByCuisineID.Frequency);
}
this._middMakeTimes.SetText(text);
this._downCuisineDec.SetText(cookInfoByCuisineID.Desc);
this._foodItemPool.ReturnAll(false);
for (int i = 0; i < cookInfoByCuisineID.Ingredients.Count; i++)
{
GameObject gameObject = this._foodItemPool.FetchGameObject(false);
IXUILabel ixuilabel = gameObject.transform.Find("Num").GetComponent("XUILabel") as IXUILabel;
uint num = cookInfoByCuisineID.Ingredients[i, 0];
ulong itemCount = XBagDocument.BagDoc.GetItemCount((int)num);
XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(gameObject, (int)num, (int)cookInfoByCuisineID.Ingredients[i, 1], true);
IXUISprite ixuisprite2 = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite;
ixuisprite2.ID = (ulong)num;
ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton<UiUtility>.singleton.OnItemClick));
string text2 = itemCount + "/" + cookInfoByCuisineID.Ingredients[i, 1];
bool flag4 = itemCount < (ulong)cookInfoByCuisineID.Ingredients[i, 1];
if (flag4)
{
text2 = string.Concat(new object[]
{
"[ff0000]",
itemCount,
"/",
cookInfoByCuisineID.Ingredients[i, 1],
"[-]"
});
}
ixuilabel.SetText(text2);
gameObject.transform.localPosition = new Vector3(this._foodItemPool.TplPos.x + (float)(i * this._foodItemPool.TplWidth), this._foodItemPool.TplPos.y, 0f);
}
bool flag5 = cookInfoByCuisineID.Level > this._curCookLevel;
if (flag5)
{
this._oneKeyCookingBtn.SetEnable(false, false);
this._makeBtn.SetEnable(false, false);
}
else
{
this._oneKeyCookingBtn.SetEnable(true, false);
this._makeBtn.SetEnable(true, false);
}
}
}
protected void SendMakeCuisineReq()
{
XHomeCookAndPartyDocument.Doc.ReqGardenCookingFood(this._curCookID);
}
protected bool StartToCooking(IXUIButton cook)
{
bool flag = XHomeCookAndPartyDocument.Doc.IsTimeLimited(this._curCookID);
bool result;
if (flag)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(XSingleton<XStringTable>.singleton.GetString("FoodMakingMaxTimes"), "fece00");
result = false;
}
else
{
bool flag2 = this.IsValidCooking();
if (flag2)
{
XSingleton<XAudioMgr>.singleton.PlayUISound("Audio/UI/Cook_ing", true, AudioChannel.Action);
XHomeCookAndPartyDocument.Doc.StartCreateFood(this._curCookID);
this.RefreshProgressFrame();
result = true;
}
else
{
bool isOneKeyCooking = this._isOneKeyCooking;
if (isOneKeyCooking)
{
this.CancelCooking(null);
}
else
{
XSingleton<UiUtility>.singleton.ShowSystemTip(XSingleton<XStringTable>.singleton.GetString("FoodMatsLack"), "fece00");
}
result = false;
}
}
return result;
}
protected bool OneShotCooking(IXUIButton cook)
{
bool flag = XHomeCookAndPartyDocument.Doc.IsTimeLimited(this._curCookID);
bool result;
if (flag)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(XSingleton<XStringTable>.singleton.GetString("FoodMakingMaxTimes"), "fece00");
result = false;
}
else
{
bool flag2 = this.IsValidCooking();
if (flag2)
{
this.OneKeyContinue(true);
this.StartToCooking(null);
}
else
{
XSingleton<UiUtility>.singleton.ShowSystemTip(XSingleton<XStringTable>.singleton.GetString("FoodMatsLack"), "fece00");
}
result = true;
}
return result;
}
private void OneKeyContinue(bool continueCooking)
{
this._isOneKeyCooking = continueCooking;
this._cancelMakingBtn.gameObject.SetActive(continueCooking);
this._doBtn.gameObject.SetActive(!continueCooking);
}
private bool CancelCooking(IXUIButton button)
{
this.OneKeyContinue(false);
XHomeCookAndPartyDocument.Doc.StopCreateFoodTimer();
XSingleton<XAudioMgr>.singleton.StopUISound();
this._cookingEffect.gameObject.SetActive(false);
this._cookingProgressFrame.gameObject.SetActive(false);
return true;
}
protected void RefreshProgressFrame()
{
this._cookingProgressFrame.gameObject.SetActive(true);
this._successEffect.gameObject.SetActive(false);
this._cookingSlider.Value = 0f;
this._cookingEffect.gameObject.SetActive(true);
this._makingTrans.gameObject.SetActive(true);
this._doBtn.gameObject.SetActive(false);
XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(this._cookingItem.gameObject, (int)this._curCookID, 1, false);
this._cookingItem.gameObject.SetActive(false);
}
protected bool IsValidCooking()
{
CookingFoodInfo.RowData cookInfoByCuisineID = XHomeCookAndPartyDocument.Doc.GetCookInfoByCuisineID(this._curCookID);
bool flag = cookInfoByCuisineID != null;
bool result;
if (flag)
{
for (int i = 0; i < cookInfoByCuisineID.Ingredients.Count; i++)
{
uint itemid = cookInfoByCuisineID.Ingredients[i, 0];
uint num = cookInfoByCuisineID.Ingredients[i, 1];
uint num2 = (uint)XBagDocument.BagDoc.GetItemCount((int)itemid);
bool flag2 = num2 < num;
if (flag2)
{
return false;
}
}
result = true;
}
else
{
result = false;
}
return result;
}
private bool OnClickCookingButtonOK(IXUIButton btn)
{
this._successEffect.gameObject.SetActive(false);
this._cookingProgressFrame.gameObject.SetActive(false);
return true;
}
public void CookingTimeEnd()
{
this._doBtn.gameObject.SetActive(!this._isOneKeyCooking);
this._cookingEffect.gameObject.SetActive(false);
this.SendMakeCuisineReq();
}
public void CookingSuccess()
{
this._successEffect.gameObject.SetActive(true);
this._cookingItem.gameObject.SetActive(true);
this._makingTrans.gameObject.SetActive(false);
this._doBtn.gameObject.SetActive(!this._isOneKeyCooking);
this._curCookLevel = HomeMainDocument.Doc.GetCookingLevel();
this.RefreshRightDetail(this._curCookID);
bool flag = !this._isOneKeyCooking || !this.StartToCooking(null);
if (flag)
{
XSingleton<XAudioMgr>.singleton.StopUISound();
XSingleton<XAudioMgr>.singleton.PlayUISound("Audio/UI/Cook_Over", true, AudioChannel.Action);
}
}
public void SetProgress(float percent)
{
this._cookingSlider.Value = percent;
bool flag = percent >= 1f;
if (flag)
{
this.CookingTimeEnd();
}
}
public void RefreshRightInfo()
{
this.RefreshRightDetail(this._curCookID);
}
}
}
|