root/GHI/AdvancedItemMenu/GHI_AdvancedItemMenu.lua
| 600 | 611 | ||
|---|---|---|---|
40 | menuFrame.ForceLabel("consumed",item.IsConsumed()); | 40 | menuFrame.ForceLabel("consumed",item.IsConsumed()); |
41 | menuFrame.ForceLabel("cooldown",item.GetCooldown()); | 41 | menuFrame.ForceLabel("cooldown",item.GetCooldown()); |
42 | 42 | ||
43 | menuFrame.GetLabelFrame("dynamicActions").SetDynamicActionInstanceSet(set); | 43 | menuFrame.GetLabelFrame("dynamicActions").SetDynamicActionInstanceSet(item.GetDynamicActionSet()); |
44 | end | 44 | end |
45 | 45 | ||
46 | local SetupWithEditItem = function() | 46 | local SetupWithEditItem = function() |
47 | inUse = true; | 47 | inUse = true; |
48 | edit = true; | 48 | edit = true; |
49 | 49 | ||
50 | if not(item.IsAdvanced()) then | ||
51 | item.ConvertToAdvanced(); | ||
52 | end | ||
53 | |||
50 | UpdateMenu(); | 54 | UpdateMenu(); |
51 | UpdateTooltip(); | 55 | UpdateTooltip(); |
52 | end | 56 | end |
... | ... | ||
54 | local SetupWithNewItem = function() | 58 | local SetupWithNewItem = function() |
55 | inUse = true; | 59 | inUse = true; |
56 | edit = false; | 60 | edit = false; |
57 | item = GHI_ItemInfo({ | 61 | item.ConvertToAdvanced(); |
58 | authorName = UnitName("player"), | 62 | |
59 | authorGuid = UnitGUID("player"), | 63 | |
60 | guid = guidCreator.MakeGUID(); | 64 | |
61 | }); | ||
62 | set = GHI_DynamicActionInstanceSet(); | ||
63 | UpdateMenu(); | 65 | UpdateMenu(); |
64 | UpdateTooltip(); | 66 | UpdateTooltip(); |
65 | end | 67 | end |
... | ... | ||
433 | }, | 435 | }, |
434 | 436 | ||
435 | }, | 437 | }, |
436 | title = GHI_CREATE_TITLE, | 438 | title = GHI_CREATE_TITLE_ADV, |
437 | name = "GHI_Advanced_Item_Menu"..menuIndex, | 439 | name = "GHI_Advanced_Item_Menu"..menuIndex, |
438 | theme = "BlankWizardTheme", | 440 | theme = "BlankWizardTheme", |
439 | width = 500, | 441 | width = 500, |
... | ... | ||
450 | 452 | ||
451 | class.IsInUse = function() return inUse end | 453 | class.IsInUse = function() return inUse end |
452 | 454 | ||
453 | class.New = function() | 455 | class.New = function(itemInProgress) |
454 | menuFrame:AnimatedShow(); | 456 | menuFrame.SetPage(1); |
457 | menuFrame:Show(); | ||
458 | item = itemInProgress; | ||
455 | 459 | ||
456 | |||
457 | SetupWithNewItem(); | 460 | SetupWithNewItem(); |
458 | end | 461 | end |
459 | 462 | ||
460 | class.Edit = function(guid) | 463 | class.Edit = function(editItem) |
461 | local editItem = itemList.GetItemInfo(guid); | ||
462 | if not(editItem.IsEditable() or editItem.IsCreatedByPlayer()) then | 464 | if not(editItem.IsEditable() or editItem.IsCreatedByPlayer()) then |
463 | miscApi.GHI_Message(GHI_CAN_NOT_EDIT); | 465 | miscApi.GHI_Message(GHI_CAN_NOT_EDIT); |
464 | menuFrame:Hide(); | 466 | menuFrame:Hide(); |
... | ... | ||
467 | 469 | ||
468 | item = editItem.CloneItem(); | 470 | item = editItem.CloneItem(); |
469 | 471 | ||
472 | menuFrame.SetPage(1); | ||
470 | menuFrame:AnimatedShow(); | 473 | menuFrame:AnimatedShow(); |
471 | 474 | ||
475 | edit = true; | ||
472 | SetupWithEditItem(); | 476 | SetupWithEditItem(); |
473 | end | 477 | end |
474 | 478 |
Download diff