Skip to content

Commit 06f3328

Browse files
committed
feat(startFrame): Add Bag command
1 parent cd56f66 commit 06f3328

4 files changed

Lines changed: 31 additions & 3 deletions

File tree

Commands/Commands_Main.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ function ShowBank()
118118
MangAdmin:ChatMsg(".character check bank")
119119
end
120120

121+
function ShowBag()
122+
local param = ma_parameter:GetText()
123+
MangAdmin:ChatMsg(".character check bag "..param)
124+
end
125+
121126
function DismountPlayer()
122127
if MangAdmin:Selection("player") or MangAdmin:Selection("self") or MangAdmin:Selection("none") then
123128
local player = UnitName("target") or UnitName("player")

Frames/MangFrames_SectionMain.lua

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,26 @@ function MangAdmin:CreateMainSection()
454454
text = Locale["ma_BankButton"]
455455
})
456456

457+
FrameLib:BuildButton({
458+
name = "ma_bagbutton",
459+
group = "main",
460+
parent = ma_midframe,
461+
texture = {
462+
name = "ma_bagbutton_texture",
463+
color = {color.btn.r, color.btn.g, color.btn.b, transparency.btn}
464+
},
465+
size = {
466+
width = 80,
467+
height = 20
468+
},
469+
setpoint = {
470+
pos = "TOPLEFT",
471+
offX = 660,
472+
offY = -54
473+
},
474+
text = Locale["ma_BagButton"]
475+
})
476+
457477
FrameLib:BuildButton({
458478
name = "ma_dismountbutton",
459479
group = "main",
@@ -469,7 +489,7 @@ function MangAdmin:CreateMainSection()
469489
setpoint = {
470490
pos = "TOPLEFT",
471491
offX = 660,
472-
offY = -54
492+
offY = -75
473493
},
474494
text = Locale["ma_DismountButton"]
475495
})
@@ -489,7 +509,7 @@ function MangAdmin:CreateMainSection()
489509
setpoint = {
490510
pos = "TOPLEFT",
491511
offX = 660,
492-
offY = -75
512+
offY = -97
493513
},
494514
text = Locale["ma_SetJail_A_Button"]
495515
})
@@ -509,7 +529,7 @@ function MangAdmin:CreateMainSection()
509529
setpoint = {
510530
pos = "TOPLEFT",
511531
offX = 660,
512-
offY = -97
532+
offY = -119
513533
},
514534
text = Locale["ma_SetJail_H_Button"]
515535
})

FunctionInit.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function InitControls()
4141
MangAdmin:PrepareScript(ma_scaleslider , Locale["tt_ScaleSlider"] , {{"OnMouseUp", function() SetScale() end},{"OnValueChanged", function() ma_scalesliderText:SetText("Scale: "..string.format("%.1f", ma_scaleslider:GetValue())) end}})
4242
MangAdmin:PrepareScript(ma_screenshotbutton , Locale["tt_ScreenButton"] , function() Screenie() end)
4343
MangAdmin:PrepareScript(ma_bankbutton , Locale["tt_BankButton"] , function() ShowBank() end)
44+
MangAdmin:PrepareScript(ma_bagbutton , Locale["tt_BagButton"] , function() ShowBag() end)
4445
MangAdmin:PrepareScript(ma_dismountbutton , Locale["tt_Dismount"] , function() DismountPlayer() end)
4546
MangAdmin:PrepareScript(ma_setjail_a_button , Locale["tt_SetJail_A_Button"] , function() SetJail_A() end)
4647
MangAdmin:PrepareScript(ma_setjail_h_button , Locale["tt_SetJail_H_Button"] , function() SetJail_H() end)

Locales/enUS.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function Return_enUS()
109109
["tt_instakill"] = "When checked, clicking an enemy creature kills it.",
110110
["tt_ScreenButton"] = "Make a screenshot.",
111111
["tt_BankButton"] = "Show your bank.",
112+
["tt_BagButton"] = "Show the bag of the selected character or yours [[Parameters: $bagSlot: 1-4]]",
112113
["tt_Dismount"] = "Dismounts you, if you are mounted",
113114
["tt_SetJail_A_Button"] = "Sets the location of the Alliance Jail to your current location.",
114115
["tt_SetJail_H_Button"] = "Sets the location of the Horde Jail to your current location.",
@@ -165,6 +166,7 @@ function Return_enUS()
165166
["ma_instakill"] = "Insta-kill enemy creatures by targeting them",
166167
["ma_ScreenshotButton"] = "Screenshot",
167168
["ma_BankButton"] = "Bank",
169+
["ma_BagButton"] = "Bag",
168170
["ma_DismountButton"] = "Dismount",
169171
["ma_SetJail_A_Button"] = "SetJail A",
170172
["ma_SetJail_H_Button"] = "SetJail H",

0 commit comments

Comments
 (0)