Advertisement
Guest User

Untitled

a guest
May 11th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. for i = 1, NUM_CHAT_WINDOWS do
  2. _G["ChatFrame"..i.."EditBox"]:SetAltArrowKeyMode(false)
  3. end
  4.  
  5.  
  6. -- Lancement de l'addon
  7.  
  8. message("lancement de l'addon SollStice_Buff_UI effectue");
  9.  
  10.  
  11. -- /Commands
  12. function SlashCmdList.HELLOWORLD(msg, editBox)
  13. ControlPanel();
  14. end
  15. SLASH_HELLOWORLD1, SLASH_HELLOWORLD2 = '/sollstice', '/solls';
  16.  
  17. --Control Panel
  18. function ControlPanel()
  19. local UIConfig = CreateFrame("Frame", "SollStice_Buff_UI_Frame", UIParent, "BasicFrameTemplateWithInset");
  20. UIConfig:SetSize(300, 360);
  21. UIConfig:SetPoint("CENTER", UIParent, "CENTER");
  22. UIConfig.title = UIConfig:CreateFontString(nil, "OVERLAY");
  23. UIConfig.title:SetFontObject("GameFontHighlight");
  24. UIConfig.title:SetPoint("LEFT", UIConfig.TitleBg, "LEFT", 5, 0);
  25. UIConfig.title:SetText("SollStice Buff Options");
  26.  
  27. UIConfig:SetMovable(true)
  28. UIConfig:EnableMouse(true)
  29. UIConfig:RegisterForDrag("LeftButton")
  30. UIConfig:SetScript("OnDragStart", UIConfig.StartMoving)
  31. UIConfig:SetScript("OnDragStop", UIConfig.StopMovingOrSizing)
  32.  
  33.  
  34. -- UI save Button
  35. UIConfig.saveButton = CreateFrame("Button", nil, UIConfig, "GameMenuButtonTemplate");
  36. UIConfig.saveButton:SetPoint("CENTER", UIConfig, "TOP", 0, -70);
  37. UIConfig.saveButton:SetSize(140,40);
  38. UIConfig.saveButton:SetText("Save");
  39. UIConfig.saveButton:SetNormalFontObject("GameFontNormalLarge");
  40. UIConfig.saveButton:SetHighlightFontObject("GameFontHighlightLarge");
  41.  
  42.  
  43. --Reset Button
  44. UIConfig.resetBtn = CreateFrame("Button", nil, UIConfig, "GameMenuButtonTemplate");
  45. UIConfig.resetBtn:SetPoint("TOP", UIConfig.saveButton, "BOTTOM", 0, -10);
  46. UIConfig.resetBtn:SetSize(140, 40);
  47. UIConfig.resetBtn:SetText("Reset");
  48. UIConfig.resetBtn:SetNormalFontObject("GameFontNormalLarge");
  49. UIConfig.resetBtn:SetHighlightFontObject("GameFontHighlightLarge")
  50.  
  51.  
  52.  
  53. --UI Load Button
  54. UIConfig.loadBtn = CreateFrame("BUTTON", nil, UIConfig, "GameMenuButtonTemplate");
  55. UIConfig.loadBtn:SetPoint("TOP", UIConfig.resetBtn, "BOTTOM", 0, -10);
  56. UIConfig.loadBtn:SetSize(140, 40);
  57. UIConfig.loadBtn:SetText("Load");
  58. UIConfig.loadBtn:SetNormalFontObject("GameFontNormalLarge");
  59. UIConfig.loadBtn:SetHighlightFontObject("GameFontHighlightLarge");
  60.  
  61.  
  62. -- Sliders1:
  63. UIConfig.slider1 = CreateFrame("slider", nil, UIConfig, "OptionsSliderTemplate");
  64. UIConfig.slider1:SetPoint("TOP", UIConfig.loadBtn, "BOTTOM", 0, -20);
  65. UIConfig.slider1:SetMinMaxValues(1, 100);
  66. UIConfig.slider1:SetValueStep(1);
  67. UIConfig.slider1:SetValue(50);
  68.  
  69.  
  70. UIConfig.slider1:SetObeyStepOnDrag(true);
  71.  
  72. -- Slider2:
  73. UIConfig.slider2 = CreateFrame("slider", nil, UIConfig, "OptionsSliderTemplate");
  74. UIConfig.slider2:SetPoint("TOP", UIConfig.slider1, "BOTTOM", 0, -20);
  75. UIConfig.slider2:SetValueStep(1);
  76. UIConfig.slider2:SetMinMaxValues(1, 100);
  77. UIConfig.slider2:SetValue(50);
  78.  
  79. -- Check Buttons!
  80.  
  81. --check button 1
  82. UIConfig.checkBtn1 = CreateFrame("CheckButton", nil, UIConfig, "UICheckButtonTemplate");
  83. UIConfig.checkBtn1:SetPoint("TOPLEFT", UIConfig.slider2, "BOTTOMLEFT", -10, -40);
  84. UIConfig.checkBtn1.text:SetText("Un exemple de boutons");
  85.  
  86. --Check Button 2
  87. UIConfig.checkBtn2 = CreateFrame("CheckButton", nil, UIConfig, "UICheckButtonTemplate");
  88. UIConfig.checkBtn2:SetPoint("TOPLEFT", UIConfig.slider2, "BOTTOMLEFT", -10, -10);
  89. UIConfig.checkBtn2.text:SetText("Un exemple de boutons");
  90. UIConfig.checkBtn2:SetChecked(true);
  91.  
  92. UIConfig.saveButton:SetScript("OnClick", function(self, button, down)
  93. print("Tu as appuyé sur le bouton Save");
  94. end)
  95. UIConfig.loadBtn:SetScript("OnClick", function(self, button, down)
  96. print("Tu as appuyé sur le bouton Load");
  97. end)
  98. UIConfig.resetBtn:SetScript("OnClick", function(self, button, down)
  99. print("Tu as appuyé sur le bouton Reset");
  100. end)
  101. --show(format("OnClick: %s %s", button, upDown[down]), color, color, color) Ligne non comprise bouton
  102.  
  103. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement