@@ -931,236 +931,10 @@ tControl.addButton("Browse", 0, 150, "Interface\\AddOns\\MultiBot\\Icons\\browse
931931end
932932
933933-- MAIN --
934- local tButton = tMultiBar .addButton (" Main" , 0 , 0 , " inv_gizmo_02" , MultiBot .L (" tips.main.master" ))
935- tButton :RegisterForDrag (" RightButton" )
936- tButton :SetScript (" OnDragStart" , function ()
937- MultiBot .frames [" MultiBar" ]:StartMoving ()
938- end )
939- tButton :SetScript (" OnDragStop" , function ()
940- MultiBot .frames [" MultiBar" ]:StopMovingOrSizing ()
941- end )
942- tButton .doLeft = function (pButton )
943- MultiBot .ShowHideSwitch (pButton .parent .frames [" Main" ])
944- end
945-
946- local tMain = tMultiBar .addFrame (" Main" , - 2 , 38 )
947- tMain :Hide ()
948-
949- tMain .addButton (" Coords" , 0 , 0 , " inv_gizmo_03" , MultiBot .L (" tips.main.coords" ))
950- .doLeft = function (pButton )
951- MultiBot .frames [" MultiBar" ].setPoint (- 262 , 144 )
952- MultiBot .inventory .setPoint (- 700 , - 144 )
953- MultiBot .spellbook .setPoint (- 802 , 302 )
954- MultiBot .talent .setPoint (- 104 , - 276 )
955- MultiBot .reward .setPoint (- 754 , 238 )
956- MultiBot .itemus .setPoint (- 860 , - 144 )
957- MultiBot .iconos .setPoint (- 860 , - 144 )
958- MultiBot .stats .setPoint (- 60 , 560 )
959- end
960-
961- tMain .addButton (" Masters" , 0 , 34 , " mail_gmicon" , MultiBot .L (" tips.main.masters" )).setDisable ()
962- .doLeft = function (pButton )
963- if (MultiBot .GM == false ) then return SendChatMessage (MultiBot .L (" info.rights" ), " SAY" ) end
964- if (MultiBot .OnOffSwitch (pButton )) then
965- MultiBot .doRepos (" Right" , 38 )
966- MultiBot .frames [" MultiBar" ].frames [" Masters" ]:Hide ()
967- MultiBot .frames [" MultiBar" ].buttons [" Masters" ]:Show ()
968- else
969- MultiBot .doRepos (" Right" , - 38 )
970- MultiBot .frames [" MultiBar" ].frames [" Masters" ]:Hide ()
971- MultiBot .frames [" MultiBar" ].buttons [" Masters" ]:Hide ()
972- end
973- end
974-
975- tMain .addButton (" RTSC" , 0 , 68 , " ability_hunter_markedfordeath" , MultiBot .L (" tips.main.rtsc" )).setDisable ()
976- .doLeft = function (pButton )
977- if (MultiBot .OnOffSwitch (pButton )) then
978- MultiBot .frames [" MultiBar" ].setPoint (MultiBot .frames [" MultiBar" ].x , MultiBot .frames [" MultiBar" ].y + 34 )
979- MultiBot .frames [" MultiBar" ].frames [" RTSC" ]:Show ()
980- MultiBot .ActionToGroup (" rtsc" )
981- else
982- MultiBot .frames [" MultiBar" ].setPoint (MultiBot .frames [" MultiBar" ].x , MultiBot .frames [" MultiBar" ].y - 34 )
983- MultiBot .frames [" MultiBar" ].frames [" RTSC" ]:Hide ()
984- MultiBot .ActionToGroup (" rtsc reset" )
985- end
986- end
987-
988- tMain .addButton (" Raidus" , 0 , 102 , " inv_misc_head_dragon_01" , MultiBot .L (" tips.main.raidus" )).setDisable ()
989- .doLeft = function (pButton )
990- if (MultiBot .OnOffSwitch (pButton )) then
991- MultiBot .raidus .setRaidus ()
992- MultiBot .raidus :Show ()
993- else
994- MultiBot .raidus :Hide ()
995- end
996- end
997-
998- tMain .addButton (" Creator" , 0 , 136 , " inv_helmet_145a" , MultiBot .L (" tips.main.creator" )).setDisable ()
999- .doLeft = function (pButton )
1000- if (MultiBot .OnOffSwitch (pButton )) then
1001- MultiBot .doRepos (" Tanker" , - 34 )
1002- MultiBot .doRepos (" Attack" , - 34 )
1003- MultiBot .doRepos (" Mode" , - 34 )
1004- MultiBot .doRepos (" Stay" , - 34 )
1005- MultiBot .doRepos (" Follow" , - 34 )
1006- MultiBot .doRepos (" ExpandStay" , - 34 )
1007- MultiBot .doRepos (" ExpandFollow" , - 34 )
1008- MultiBot .doRepos (" Flee" , - 34 )
1009- MultiBot .doRepos (" Format" , - 34 )
1010- MultiBot .doRepos (" Beast" , - 34 )
1011- MultiBot .frames [" MultiBar" ].frames [" Left" ].frames [" Creator" ]:Hide ()
1012- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" Creator" ]:Show ()
1013- else
1014- MultiBot .doRepos (" Tanker" , 34 )
1015- MultiBot .doRepos (" Attack" , 34 )
1016- MultiBot .doRepos (" Mode" , 34 )
1017- MultiBot .doRepos (" Stay" , 34 )
1018- MultiBot .doRepos (" Follow" , 34 )
1019- MultiBot .doRepos (" ExpandStay" , 34 )
1020- MultiBot .doRepos (" ExpandFollow" , 34 )
1021- MultiBot .doRepos (" Flee" , 34 )
1022- MultiBot .doRepos (" Format" , 34 )
1023- MultiBot .doRepos (" Beast" , 34 )
1024- MultiBot .frames [" MultiBar" ].frames [" Left" ].frames [" Creator" ]:Hide ()
1025- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" Creator" ]:Hide ()
1026- end
1027- end
1028-
1029- tMain .addButton (" Beast" , 0 , 170 , " ability_mount_swiftredwindrider" , MultiBot .L (" tips.main.beast" )).setDisable ()
1030- .doLeft = function (pButton )
1031- if (MultiBot .OnOffSwitch (pButton )) then
1032- MultiBot .doRepos (" Tanker" , - 34 )
1033- MultiBot .doRepos (" Attack" , - 34 )
1034- MultiBot .doRepos (" Mode" , - 34 )
1035- MultiBot .doRepos (" Stay" , - 34 )
1036- MultiBot .doRepos (" Follow" , - 34 )
1037- MultiBot .doRepos (" ExpandStay" , - 34 )
1038- MultiBot .doRepos (" ExpandFollow" , - 34 )
1039- MultiBot .doRepos (" Flee" , - 34 )
1040- MultiBot .doRepos (" Format" , - 34 )
1041- MultiBot .frames [" MultiBar" ].frames [" Left" ].frames [" Beast" ]:Hide ()
1042- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" Beast" ]:Show ()
1043- else
1044- MultiBot .doRepos (" Tanker" , 34 )
1045- MultiBot .doRepos (" Attack" , 34 )
1046- MultiBot .doRepos (" Mode" , 34 )
1047- MultiBot .doRepos (" Stay" , 34 )
1048- MultiBot .doRepos (" Follow" , 34 )
1049- MultiBot .doRepos (" ExpandStay" , 34 )
1050- MultiBot .doRepos (" ExpandFollow" , 34 )
1051- MultiBot .doRepos (" Flee" , 34 )
1052- MultiBot .doRepos (" Format" , 34 )
1053- MultiBot .frames [" MultiBar" ].frames [" Left" ].frames [" Beast" ]:Hide ()
1054- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" Beast" ]:Hide ()
1055- end
1056- end
1057-
1058- tMain .addButton (" Expand" , 0 , 204 , " Interface\\ AddOns\\ MultiBot\\ Icons\\ command_follow.blp" , MultiBot .L (" tips.main.expand" )).setDisable ()
1059- .doLeft = function (pButton )
1060- if (MultiBot .OnOffSwitch (pButton )) then
1061- MultiBot .doRepos (" Tanker" , - 34 )
1062- MultiBot .doRepos (" Attack" , - 34 )
1063- MultiBot .doRepos (" Mode" , - 34 )
1064- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" ExpandFollow" ]:Show ()
1065- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" ExpandStay" ]:Show ()
1066- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" Follow" ]:Hide ()
1067- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" Stay" ]:Hide ()
1068- else
1069- MultiBot .doRepos (" Tanker" , 34 )
1070- MultiBot .doRepos (" Attack" , 34 )
1071- MultiBot .doRepos (" Mode" , 34 )
1072- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" ExpandFollow" ]:Hide ()
1073- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" ExpandStay" ]:Hide ()
1074- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" Follow" ]:Show ()
1075- MultiBot .frames [" MultiBar" ].frames [" Left" ].buttons [" Stay" ]:Show ()
1076- end
1077- end
1078-
1079- tMain .addButton (" Release" , 0 , 238 , " achievement_bg_xkills_avgraveyard" , MultiBot .L (" tips.main.release" )).setDisable ()
1080- .doLeft = function (pButton )
1081- if (MultiBot .OnOffSwitch (pButton )) then
1082- MultiBot .auto .release = true
1083- else
1084- MultiBot .auto .release = false
1085- end
1086- end
1087-
1088- tMain .addButton (" Stats" , 0 , 272 , " inv_scroll_08" , MultiBot .L (" tips.main.stats" )).setDisable ()
1089- .doLeft = function (pButton )
1090- if (GetNumRaidMembers () > 0 ) then return SendChatMessage (MultiBot .L (" info.stats" ), " SAY" ) end
1091- if (MultiBot .OnOffSwitch (pButton )) then
1092- MultiBot .auto .stats = true
1093- for i = 1 , GetNumPartyMembers () do SendChatMessage (" stats" , " WHISPER" , nil , UnitName (" party" .. i )) end
1094- MultiBot .stats :Show ()
1095- else
1096- MultiBot .auto .stats = false
1097- for key , value in pairs (MultiBot .stats .frames ) do value :Hide () end
1098- MultiBot .stats :Hide ()
1099- end
1100- end
1101-
1102- local tButton = tMain .addButton (" Reward" , 0 , 306 , " Interface\\ AddOns\\ MultiBot\\ Icons\\ reward.blp" , MultiBot .L (" tips.main.reward" )).setDisable ()
1103- tButton .doRight = function (pButton )
1104- MultiBot .rewardReopenIfAvailable ()
1105- end
1106-
1107- tButton .doLeft = function (pButton )
1108- local wasSavedEnabled = (MultiBot .GetSavedMainBarValue and MultiBot .GetSavedMainBarValue (" Reward" ) == " true" )
1109- local isEnabled = MultiBot .OnOffSwitch (pButton )
1110-
1111- MultiBot .rewardSetEnabled (isEnabled )
1112-
1113- if (MultiBot .SetSavedMainBarValue ) then
1114- MultiBot .SetSavedMainBarValue (" Reward" , MultiBot .IF (isEnabled , " true" , " false" ))
1115- end
1116-
1117- if (isEnabled and not wasSavedEnabled and MultiBot .rewardShowConfigPopup ) then
1118- MultiBot .rewardShowConfigPopup ()
1119- end
1120- end
1121-
1122- tMain .addButton (" Reset" , 0 , 340 , " inv_misc_tournaments_symbol_gnome" , MultiBot .L (" tips.main.reset" ))
1123- .doLeft = function (pButton )
1124- MultiBot .ActionToTargetOrGroup (" reset botAI" )
1125- end
1126-
1127- tMain .addButton (" Actions" , 0 , 374 , " inv_helmet_02" , MultiBot .L (" tips.main.action" ))
1128- .doLeft = function (pButton )
1129- MultiBot .ActionToTargetOrGroup (" reset" )
934+ if MultiBot .InitializeMainUI then
935+ MultiBot .InitializeMainUI (tMultiBar )
1130936end
1131937
1132- --[[ [ADDED] Options button (opens/closes the sliders panel).
1133- local tBtnOptions = tMain.addButton("Options", 0, 404, "inv_misc_gear_02", MultiBot.L("tips.main.options"))
1134- tBtnOptions._active = false
1135-
1136- -- Dimmed by default (alpha 0.4 + desaturation).
1137- do
1138- local f = tBtnOptions.frame or tBtnOptions
1139- if f and f.SetAlpha then f:SetAlpha(0.4) end
1140- if f and f.GetRegions then
1141- local tex = f:GetRegions()
1142- if tex and tex.SetDesaturated then tex:SetDesaturated(true) end
1143- end
1144- end
1145-
1146- tBtnOptions.doLeft = function(pButton)
1147- -- Toggle panneau d'options
1148- local opened = false
1149- if MultiBot.ToggleOptionsPanel then
1150- opened = MultiBot.ToggleOptionsPanel()
1151- end
1152-
1153- pButton._active = opened
1154-
1155- -- Visuel : dégrise si ouvert, re-grise si fermé
1156- local f = pButton.frame or pButton
1157- if f and f.SetAlpha then f:SetAlpha(opened and 1.0 or 0.4) end
1158- if f and f.GetRegions then
1159- local tex = f:GetRegions()
1160- if tex and tex.SetDesaturated then tex:SetDesaturated(not opened) end
1161- end
1162- end ]] --
1163-
1164938-- Calling the function
1165939MultiBot .BuildGmUI (tMultiBar )
1166940
0 commit comments