Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i = 1, NUM_CHAT_WINDOWS do
- _G["ChatFrame"..i.."EditBox"]:SetAltArrowKeyMode(false)
- end
- -- Lancement de l'addon
- message("lancement de l'addon SollStice_Buff_UI effectue");
- -- /Commands
- function SlashCmdList.HELLOWORLD(msg, editBox)
- ControlPanel();
- end
- SLASH_HELLOWORLD1, SLASH_HELLOWORLD2 = '/sollstice', '/solls';
- --Control Panel
- function ControlPanel()
- local UIConfig = CreateFrame("Frame", "SollStice_Buff_UI_Frame", UIParent, "BasicFrameTemplateWithInset");
- UIConfig:SetSize(300, 360);
- UIConfig:SetPoint("CENTER", UIParent, "CENTER");
- UIConfig.title = UIConfig:CreateFontString(nil, "OVERLAY");
- UIConfig.title:SetFontObject("GameFontHighlight");
- UIConfig.title:SetPoint("LEFT", UIConfig.TitleBg, "LEFT", 5, 0);
- UIConfig.title:SetText("SollStice Buff Options");
- UIConfig:SetMovable(true)
- UIConfig:EnableMouse(true)
- UIConfig:RegisterForDrag("LeftButton")
- UIConfig:SetScript("OnDragStart", UIConfig.StartMoving)
- UIConfig:SetScript("OnDragStop", UIConfig.StopMovingOrSizing)
- -- UI save Button
- UIConfig.saveButton = CreateFrame("Button", nil, UIConfig, "GameMenuButtonTemplate");
- UIConfig.saveButton:SetPoint("CENTER", UIConfig, "TOP", 0, -70);
- UIConfig.saveButton:SetSize(140,40);
- UIConfig.saveButton:SetText("Save");
- UIConfig.saveButton:SetNormalFontObject("GameFontNormalLarge");
- UIConfig.saveButton:SetHighlightFontObject("GameFontHighlightLarge");
- --Reset Button
- UIConfig.resetBtn = CreateFrame("Button", nil, UIConfig, "GameMenuButtonTemplate");
- UIConfig.resetBtn:SetPoint("TOP", UIConfig.saveButton, "BOTTOM", 0, -10);
- UIConfig.resetBtn:SetSize(140, 40);
- UIConfig.resetBtn:SetText("Reset");
- UIConfig.resetBtn:SetNormalFontObject("GameFontNormalLarge");
- UIConfig.resetBtn:SetHighlightFontObject("GameFontHighlightLarge")
- --UI Load Button
- UIConfig.loadBtn = CreateFrame("BUTTON", nil, UIConfig, "GameMenuButtonTemplate");
- UIConfig.loadBtn:SetPoint("TOP", UIConfig.resetBtn, "BOTTOM", 0, -10);
- UIConfig.loadBtn:SetSize(140, 40);
- UIConfig.loadBtn:SetText("Load");
- UIConfig.loadBtn:SetNormalFontObject("GameFontNormalLarge");
- UIConfig.loadBtn:SetHighlightFontObject("GameFontHighlightLarge");
- -- Sliders1:
- UIConfig.slider1 = CreateFrame("slider", nil, UIConfig, "OptionsSliderTemplate");
- UIConfig.slider1:SetPoint("TOP", UIConfig.loadBtn, "BOTTOM", 0, -20);
- UIConfig.slider1:SetMinMaxValues(1, 100);
- UIConfig.slider1:SetValueStep(1);
- UIConfig.slider1:SetValue(50);
- UIConfig.slider1:SetObeyStepOnDrag(true);
- -- Slider2:
- UIConfig.slider2 = CreateFrame("slider", nil, UIConfig, "OptionsSliderTemplate");
- UIConfig.slider2:SetPoint("TOP", UIConfig.slider1, "BOTTOM", 0, -20);
- UIConfig.slider2:SetValueStep(1);
- UIConfig.slider2:SetMinMaxValues(1, 100);
- UIConfig.slider2:SetValue(50);
- -- Check Buttons!
- --check button 1
- UIConfig.checkBtn1 = CreateFrame("CheckButton", nil, UIConfig, "UICheckButtonTemplate");
- UIConfig.checkBtn1:SetPoint("TOPLEFT", UIConfig.slider2, "BOTTOMLEFT", -10, -40);
- UIConfig.checkBtn1.text:SetText("Un exemple de boutons");
- --Check Button 2
- UIConfig.checkBtn2 = CreateFrame("CheckButton", nil, UIConfig, "UICheckButtonTemplate");
- UIConfig.checkBtn2:SetPoint("TOPLEFT", UIConfig.slider2, "BOTTOMLEFT", -10, -10);
- UIConfig.checkBtn2.text:SetText("Un exemple de boutons");
- UIConfig.checkBtn2:SetChecked(true);
- UIConfig.saveButton:SetScript("OnClick", function(self, button, down)
- print("Tu as appuyé sur le bouton Save");
- end)
- UIConfig.loadBtn:SetScript("OnClick", function(self, button, down)
- print("Tu as appuyé sur le bouton Load");
- end)
- UIConfig.resetBtn:SetScript("OnClick", function(self, button, down)
- print("Tu as appuyé sur le bouton Reset");
- end)
- --show(format("OnClick: %s %s", button, upDown[down]), color, color, color) Ligne non comprise bouton
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement