|
55 | 55 |
|
56 | 56 | local exportEditbox
|
57 | 57 |
|
| 58 | +-- options |
| 59 | +do |
| 60 | + local b = CreateFrame("Button", nil, f, "GameMenuButtonTemplate") |
| 61 | + b:SetWidth(100) |
| 62 | + b:SetHeight(25) |
| 63 | + b:SetPoint("BOTTOMRIGHT", -145, 15) |
| 64 | + b:SetText(OPTIONS) |
| 65 | + b:SetScript("OnClick", function() |
| 66 | + Settings.OpenToCategory(MySlot.settingcategory.ID) |
| 67 | + end) |
| 68 | +end |
| 69 | + |
58 | 70 | -- close
|
59 | 71 | do
|
60 | 72 | local b = CreateFrame("Button", nil, f, "GameMenuButtonTemplate")
|
61 | 73 | b:SetWidth(100)
|
62 | 74 | b:SetHeight(25)
|
63 | 75 | b:SetPoint("BOTTOMRIGHT", -40, 15)
|
64 |
| - b:SetText(L["Close"]) |
| 76 | + b:SetText(CLOSE) |
65 | 77 | b:SetScript("OnClick", function() f:Hide() end)
|
66 | 78 | end
|
67 | 79 |
|
|
396 | 408 |
|
397 | 409 | MySlot:Print(L["Starting backup..."])
|
398 | 410 | local backup = MySlot:Export(actionOpt)
|
| 411 | + |
| 412 | + if not backup then |
| 413 | + MySlot:Print(L["Backup failed"]) |
| 414 | + |
| 415 | + if not forceImport then |
| 416 | + return |
| 417 | + end |
| 418 | + end |
| 419 | + |
399 | 420 | table.insert(MyslotExports["backups"], backup)
|
400 | 421 | while #MyslotExports["backups"] > IMPORT_BACKUP_COUNT do
|
401 | 422 | table.remove(MyslotExports["backups"], 1)
|
|
437 | 458 |
|
438 | 459 | tAppendAll(settings, CreateSettingMenu(actionOpt))
|
439 | 460 |
|
| 461 | + local clearbegin = #settings + 1 |
440 | 462 | tAppendAll(settings, {
|
441 | 463 | {
|
442 | 464 | isTitle = true,
|
|
447 | 469 | tAppendAll(settings, CreateSettingMenu(clearOpt))
|
448 | 470 |
|
449 | 471 | table.remove(settings) -- remove pet action bar clearOpt, will support it later
|
| 472 | + local clearend = #settings |
450 | 473 |
|
451 | 474 | tAppendAll(settings, {
|
452 | 475 | {
|
|
467 | 490 | }
|
468 | 491 | })
|
469 | 492 |
|
| 493 | + local settingswithoutclear = {} |
| 494 | + tAppendAll(settingswithoutclear, settings) |
| 495 | + for i = clearend, clearbegin, -1 do |
| 496 | + table.remove(settingswithoutclear, i) |
| 497 | + end |
| 498 | + |
| 499 | + |
470 | 500 | ba:SetScript("OnClick", function(self, button)
|
471 |
| - EasyMenu(settings, menuFrame, "cursor", 0 , 0, "MENU"); |
| 501 | + EasyMenu(MyslotSettings.allowclearonimport and settings or settingswithoutclear, menuFrame, "cursor", 0 , 0, "MENU"); |
472 | 502 | end)
|
473 | 503 | end
|
474 | 504 |
|
|
0 commit comments