vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | function Tetris_CF_Toggle() |
2 | if(Tetris_CF:IsVisible()) then |
||
3 | Tetris_CF:Hide(); |
||
4 | else |
||
5 | Tetris_CF_Show(); |
||
6 | Tetris_CF:Show(); |
||
7 | end |
||
8 | end |
||
9 | |||
10 | function Tetris_CF_Show() |
||
11 | --variablen holen und setzen |
||
12 | local x = Tetris["options"]["breite"]; |
||
13 | local y = Tetris["options"]["hohe"]; |
||
14 | local t_y = Tetris_UBE_CF_Text_hohe; |
||
15 | local t_x = Tetris_UBE_CF_Text_breite; |
||
16 | local viel = Tetris_UBE_CF_s_Text_viel; |
||
17 | local wenig = Tetris_UBE_CF_s_Text_wenig; |
||
18 | local r_on = Tetris_UBE_CF_Text_r_lines_on; |
||
19 | local r_off = Tetris_UBE_CF_Text_r_lines_off; |
||
20 | local r_lines = Tetris["options"]["r_lines"]; |
||
21 | local r_act = Tetris["options"]["r_lines_activ"]; |
||
22 | local gametyp = Tetris["options"]["gametyp"]; |
||
23 | |||
24 | --slider höhe |
||
25 | Tetris_CF_s_Text_hohe:SetText(t_y.." "..y); |
||
26 | Tetris_CF_s_hohe:SetMinMaxValues(8, 50); |
||
27 | Tetris_CF_s_hohe:SetValueStep(1); |
||
28 | Tetris_CF_s_hohe:SetValue(y); |
||
29 | getglobal("Tetris_CF_s_hoheHigh"):SetText(viel); |
||
30 | getglobal("Tetris_CF_s_hoheLow"):SetText(wenig); |
||
31 | --slider breite |
||
32 | Tetris_CF_s_Text_breite:SetText(t_x.." "..x); |
||
33 | Tetris_CF_s_breite:SetMinMaxValues(4, 50); |
||
34 | Tetris_CF_s_breite:SetValueStep(1); |
||
35 | Tetris_CF_s_breite:SetValue(x); |
||
36 | getglobal("Tetris_CF_s_breiteHigh"):SetText(viel); |
||
37 | getglobal("Tetris_CF_s_breiteLow"):SetText(wenig); |
||
38 | --slider r_linien und checkbox |
||
39 | --falls r_linien abgeschaltet ist |
||
40 | if (r_act==0) then |
||
41 | Tetris_CF_s_Text_r_lines:SetText(r_off); |
||
42 | Tetris_CF_c_r_lines:SetChecked(0); |
||
43 | else |
||
44 | Tetris_CF_s_Text_r_lines:SetText(r_on.." "..r_lines); |
||
45 | Tetris_CF_c_r_lines:SetChecked(1); |
||
46 | end |
||
47 | Tetris_CF_s_r_lines:SetMinMaxValues(1, y-5); |
||
48 | Tetris_CF_s_r_lines:SetValueStep(1); |
||
49 | Tetris_CF_s_r_lines:SetValue(r_lines); |
||
50 | getglobal("Tetris_CF_s_r_linesHigh"):SetText(viel); |
||
51 | getglobal("Tetris_CF_s_r_linesLow"):SetText(wenig); |
||
52 | --dropdownmenu |
||
53 | UIDropDownMenu_Initialize(Tetris_CF_dropdown, Tetris_CF_dropdown_Initialize); |
||
54 | UIDropDownMenu_SetSelectedID(Tetris_CF_dropdown, gametyp); |
||
55 | UIDropDownMenu_SetWidth(170, Tetris_CF_dropdown); |
||
56 | end |
||
57 | |||
58 | function Tetris_CF_dropdown_Initialize() |
||
59 | local info; |
||
60 | Tetris_gametyp_list_create(); |
||
61 | for i = 1, getn(Tetris_gametyp_list), 1 do |
||
62 | info = { |
||
63 | text = Tetris_gametyp_list[i]; |
||
64 | func = Tetris_CF_dropdown_OnClick; |
||
65 | }; |
||
66 | UIDropDownMenu_AddButton(info); |
||
67 | end |
||
68 | end |
||
69 | |||
70 | function Tetris_CF_dropdown_OnClick() |
||
71 | i = this:GetID(); |
||
72 | UIDropDownMenu_SetSelectedID(Tetris_CF_dropdown, i); |
||
73 | end |
||
74 | |||
75 | function Tetris_CF_Update() |
||
76 | --variablen holen und setzen |
||
77 | local t_y = Tetris_UBE_CF_Text_hohe; |
||
78 | local t_x = Tetris_UBE_CF_Text_breite; |
||
79 | local r_on = Tetris_UBE_CF_Text_r_lines_on; |
||
80 | local r_off = Tetris_UBE_CF_Text_r_lines_off; |
||
81 | local s_name = this:GetName(); |
||
82 | --name des veränderten slider updaten |
||
83 | if (s_name == "Tetris_CF_s_hohe") then |
||
84 | local z = getglobal(s_name):GetValue(); |
||
85 | getglobal ("Tetris_CF_s_Text_hohe"):SetText(t_y.." "..z); |
||
86 | --höhe hat sich geändert, ist die einstellung von r_lines zuläsig? |
||
87 | if (Tetris_CF_s_r_lines:GetValue()>(z-5)) then |
||
88 | Tetris_CF_s_r_lines:SetValue(z-5); |
||
89 | end |
||
90 | Tetris_CF_s_r_lines:SetMinMaxValues(1, z-5); |
||
91 | end |
||
92 | if (s_name == "Tetris_CF_s_breite") then |
||
93 | local z = getglobal(s_name):GetValue(); |
||
94 | getglobal ("Tetris_CF_s_Text_breite"):SetText(t_x.." "..z); |
||
95 | end |
||
96 | if (s_name == "Tetris_CF_s_r_lines") then |
||
97 | local z = getglobal(s_name):GetValue(); |
||
98 | local checkstatus = Tetris_CF_c_r_lines:GetChecked(); |
||
99 | if (checkstatus == 1) then |
||
100 | Tetris_CF_s_Text_r_lines:SetText(r_on.." "..z); |
||
101 | end |
||
102 | end |
||
103 | --wenn c_r_lines geändert wurde |
||
104 | if (s_name == "Tetris_CF_c_r_lines") then |
||
105 | local checkstatus = Tetris_CF_c_r_lines:GetChecked(); |
||
106 | if (checkstatus == 1) then |
||
107 | local value = Tetris_CF_s_r_lines:GetValue(); |
||
108 | Tetris_CF_s_Text_r_lines:SetText(r_on.." "..value); |
||
109 | else |
||
110 | Tetris_CF_s_Text_r_lines:SetText(r_off); |
||
111 | end |
||
112 | end |
||
113 | end |
||
114 | |||
115 | function Tetris_CF_b_Click() |
||
116 | --variablen holen und setzen |
||
117 | local b_name = this:GetName(); |
||
118 | |||
119 | --saven und spiel starten |
||
120 | if (b_name == "Tetris_CF_b_Ok") then |
||
121 | Tetris_CF_Save(); |
||
122 | Tetris_newgame_custom(); |
||
123 | Tetris_CF_Toggle(); |
||
124 | Tetris_GF_Toggle(); |
||
125 | end |
||
126 | --exit ohne save |
||
127 | if (b_name == "Tetris_CF_b_Exit") then |
||
128 | Tetris_CF_Toggle(); |
||
129 | Tetris_MF_Toggle(); |
||
130 | end |
||
131 | --stone menu anzeigen |
||
132 | if (b_name == "Tetris_CF_b_StoneSetup") then |
||
133 | Tetris_CF_Save(); |
||
134 | Tetris_CF_Toggle(); |
||
135 | Tetris_SOF_Toggle(); |
||
136 | end |
||
137 | |||
138 | end |
||
139 | |||
140 | function Tetris_CF_Save() |
||
141 | --variablen vom frame holen und saven |
||
142 | Tetris["options"]["hohe"] = Tetris_CF_s_hohe:GetValue(); |
||
143 | Tetris["options"]["breite"] = Tetris_CF_s_breite:GetValue(); |
||
144 | Tetris["options"]["r_lines"] = Tetris_CF_s_r_lines:GetValue(); |
||
145 | if (Tetris_CF_c_r_lines:GetChecked() == 1) then |
||
146 | Tetris["options"]["r_lines_activ"] = 1; |
||
147 | else |
||
148 | Tetris["options"]["r_lines_activ"] = 0; |
||
149 | end |
||
150 | Tetris["options"]["gametyp"] = UIDropDownMenu_GetSelectedID(Tetris_CF_dropdown); |
||
151 | end |