vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | function Tetris_OF_Button_Click () |
2 | local button = this:GetName(); |
||
3 | if (button == "Tetris_OF_b_ok") then |
||
4 | Tetris_OF_Save (); |
||
5 | Tetris_OF_Toggle(); |
||
6 | end |
||
7 | |||
8 | if (button == "Tetris_OF_b_exit") then |
||
9 | Tetris_OF_Toggle(); |
||
10 | end |
||
11 | |||
12 | end |
||
13 | |||
14 | function Tetris_OF_Toggle() |
||
15 | if(Tetris_OF:IsVisible()) then |
||
16 | Tetris_OF:Hide(); |
||
17 | Tetris_MF_Toggle(); |
||
18 | else |
||
19 | Tetris_OF_Show(); |
||
20 | Tetris_OF:Show(); |
||
21 | end |
||
22 | end |
||
23 | |||
24 | function Tetris_OF_Show () |
||
25 | --variablen holen |
||
26 | local textur = Tetris["options"]["texturenset"]; |
||
27 | local bgrosse = Tetris["options"]["b_hohe"]; |
||
28 | local gross = Tetris_UBE_OF_s_Text_gross; |
||
29 | local klein = Tetris_UBE_OF_s_Text_klein; |
||
30 | local t_bgrosse = Tetris_UBE_OF_Text_bgrosse; |
||
31 | local gost = Tetris["options"]["gost"]; |
||
32 | local musik_track = Tetris["options"]["musik-track"]; |
||
33 | local sound = Tetris["options"]["sound"]; |
||
34 | local musik = Tetris["options"]["musik"]; |
||
35 | local maus = Tetris["options"]["mous"]; |
||
36 | --dropdownmenu |
||
37 | UIDropDownMenu_Initialize(Tetris_OF_dropdown, Tetris_OF_dropdown_Initialize); |
||
38 | UIDropDownMenu_SetSelectedID(Tetris_OF_dropdown, textur); |
||
39 | UIDropDownMenu_SetWidth(170, Tetris_OF_dropdown); |
||
40 | --m_dropdownmenu |
||
41 | UIDropDownMenu_Initialize(Tetris_OF_mdropdown, Tetris_OF_mdropdown_Initialize); |
||
42 | UIDropDownMenu_SetSelectedID(Tetris_OF_mdropdown, musik_track); |
||
43 | UIDropDownMenu_SetWidth(170, Tetris_OF_mdropdown); |
||
44 | --slider bgrosse |
||
45 | Tetris_OF_s_Text_bgrosse:SetText(t_bgrosse.." "..bgrosse); |
||
46 | Tetris_OF_s_bgrosse:SetMinMaxValues(10, 25); |
||
47 | Tetris_OF_s_bgrosse:SetValueStep(1); |
||
48 | Tetris_OF_s_bgrosse:SetValue(bgrosse); |
||
49 | getglobal("Tetris_OF_s_bgrosseHigh"):SetText(gross); |
||
50 | getglobal("Tetris_OF_s_bgrosseLow"):SetText(klein); |
||
51 | --checkboxen |
||
52 | Tetris_OF_c_gost:SetChecked(gost); |
||
53 | Tetris_OF_c_sound:SetChecked(sound); |
||
54 | Tetris_OF_c_musik:SetChecked(musik); |
||
55 | Tetris_OF_c_mous:SetChecked(maus); |
||
56 | end |
||
57 | |||
58 | function Tetris_OF_mdropdown_Initialize() |
||
59 | local info; |
||
60 | Tetris_musik_list_create(); |
||
61 | for i = 1, getn(Tetris_musik_list), 1 do |
||
62 | info = { |
||
63 | text = Tetris_musik_list[i]; |
||
64 | func = Tetris_OF_mdropdown_OnClick; |
||
65 | }; |
||
66 | UIDropDownMenu_AddButton(info); |
||
67 | end |
||
68 | end |
||
69 | |||
70 | function Tetris_OF_mdropdown_OnClick() |
||
71 | i = this:GetID(); |
||
72 | UIDropDownMenu_SetSelectedID(Tetris_OF_mdropdown, i); |
||
73 | end |
||
74 | |||
75 | function Tetris_OF_dropdown_Initialize() |
||
76 | local info; |
||
77 | Tetris_textur_list_create(); |
||
78 | for i = 1, getn(Tetris_textur_list), 1 do |
||
79 | info = { |
||
80 | text = Tetris_textur_list[i]; |
||
81 | func = Tetris_OF_dropdown_OnClick; |
||
82 | }; |
||
83 | UIDropDownMenu_AddButton(info); |
||
84 | end |
||
85 | end |
||
86 | |||
87 | function Tetris_OF_dropdown_OnClick() |
||
88 | i = this:GetID(); |
||
89 | UIDropDownMenu_SetSelectedID(Tetris_OF_dropdown, i); |
||
90 | end |
||
91 | |||
92 | function Tetris_OF_Save () |
||
93 | --variablen vom frame holen und saven |
||
94 | Tetris["options"]["texturenset"] = UIDropDownMenu_GetSelectedID(Tetris_OF_dropdown); |
||
95 | Tetris["options"]["b_hohe"] = Tetris_OF_s_bgrosse:GetValue(); |
||
96 | Tetris["options"]["b_breite"] = Tetris_OF_s_bgrosse:GetValue(); |
||
97 | if (Tetris_OF_c_gost:GetChecked() == 1) then |
||
98 | Tetris["options"]["gost"]=1; |
||
99 | else |
||
100 | Tetris["options"]["gost"]=0; |
||
101 | end |
||
102 | if (Tetris_OF_c_musik:GetChecked() == 1) then |
||
103 | Tetris["options"]["musik"]=1; |
||
104 | else |
||
105 | Tetris_play_musik ("stop"); |
||
106 | Tetris["options"]["musik"]=0; |
||
107 | end |
||
108 | if (Tetris_OF_c_sound:GetChecked() == 1) then |
||
109 | Tetris["options"]["sound"]=1; |
||
110 | else |
||
111 | Tetris["options"]["sound"]=0; |
||
112 | end |
||
113 | if (Tetris_OF_c_mous:GetChecked() == 1) then |
||
114 | Tetris["options"]["mous"]=1; |
||
115 | else |
||
116 | Tetris["options"]["mous"]=0; |
||
117 | end |
||
118 | Tetris["options"]["musik-track"] = UIDropDownMenu_GetSelectedID(Tetris_OF_mdropdown); |
||
119 | end |
||
120 | |||
121 | function Tetris_OF_Update() |
||
122 | --variablen holen |
||
123 | local textur = Tetris["options"]["texturenset"]; |
||
124 | local t_bgrosse = Tetris_UBE_OF_Text_bgrosse; |
||
125 | local s_name = this:GetName(); |
||
126 | --slider geändert |
||
127 | if (s_name == "Tetris_OF_s_bgrosse") then |
||
128 | local z = getglobal(s_name):GetValue(); |
||
129 | getglobal ("Tetris_OF_s_Text_bgrosse"):SetText(t_bgrosse.." "..z); |
||
130 | end |
||
131 | end |