vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 function Tetris_SOF_Toggle()
2 if(Tetris_SOF:IsVisible()) then
3 Tetris_SOF:Hide();
4 else
5 Tetris_SOF_clear();
6 Tetris_SOF_update();
7 Tetris_SOF:Show();
8 end
9 end
10  
11  
12 function Tetris_SOF_clear()
13 --variablen holen und setzen
14 local textur = Tetris["options"]["texturenset"];
15 local spalten = 4;
16 local zeilen = 3;
17 --textur ändern
18 for num = 1, 9 do
19 for spalte = 1, spalten do
20 for zeile = 1, zeilen do
21 getglobal("Tetris_SOF_num"..num.."_x"..spalte.."y"..zeile):SetNormalTexture ("Interface\\AddOns\\Tetris\\texturen\\"..textur.."\\0");
22 end
23 end
24 end
25 --verdecken
26 for num = 1, 9 do
27 getglobal("Tetris_SOF_num"..num):Hide();
28 end
29 end
30  
31 function Tetris_SOF_update()
32 --variablen holen und setzen
33 local show_s = Tetris["options"]["SOF_s_show"];
34 local max_s = Tetris["options"]["max_s"];
35 local text = Tetris_UBE_SOF_piece;
36  
37  
38 --stones/text/checkbox in den fenstern anzeigen
39 local num = 1;
40 for stone = show_s, max_s do
41 --stein anzeigen
42 Tetris_SOF_stone_Show (stone, num);
43 --text ändern
44 getglobal("Tetris_SOF_num"..num.."_text"):SetText(text.." "..stone);
45 --checkbox setzen
46 local check = Tetris["options"]["stones"][stone];
47 getglobal("Tetris_SOF_num"..num.."_c"):SetChecked(check);
48 --seitentext ändern
49 local show_s2 = show_s+9-1;
50 if show_s2>max_s then
51 show_s2 = max_s;
52 end
53 Tetris_SOF_s_Text:SetText(show_s.."-"..show_s2);
54 --nächste schlaufe
55 num = num+1;
56 if num > 9 then
57 break;
58 end
59 end
60 end
61  
62 function Tetris_SOF_stone_Show (stein, num)
63 --variablen holen und setzen
64 local stone = stein;
65 local s_lage = 1;
66 local x_pos = 3;
67 local y_pos = 3;
68 local textur = Tetris["options"]["texturenset"];
69 local fenster = num;
70 --anz. steine die dieser baustein hat holen
71 local info_anz_s = Tetris_baustein (stone, 1);
72 local anz_s = info_anz_s[2];
73 --pos der steine über diesen baustein in dieser lage holen
74 local infos = Tetris_baustein (stone, 2, s_lage);
75 --liste erstellen
76 for s = 1, anz_s do
77 --relative pos des steins zum nullpunkt des bausteins als string
78 local r_string_s_pos = infos[s];
79 --zahlen auslesen
80 local r_s_pos = Tetris_return_xy(r_string_s_pos);
81 local r_s_x = r_s_pos["x"];
82 local r_s_y = r_s_pos["y"];
83 --absolute pos des steins im gamewindow
84 local s_x = x_pos+r_s_x;
85 local s_y = y_pos+r_s_y;
86 --pos des steines als string
87 local pos="x"..s_x.."y"..s_y;
88 --textur ändern
89 getglobal("Tetris_SOF_num"..num.."_"..pos):SetNormalTexture ("Interface\\AddOns\\Tetris\\texturen\\"..textur.."\\"..stone);
90 --fenster anzeigen
91 getglobal("Tetris_SOF_num"..num):Show();
92 end
93 end
94  
95 function Tetris_SOF_b_Click()
96 local button = this:GetName();
97 if (button == "Tetris_SOF_b_Ok") then
98 Tetris_SOF_Toggle();
99 Tetris_CF_Toggle();
100 end
101 if (button == "Tetris_SOF_b_Next") then
102 local show_s = Tetris["options"]["SOF_s_show"];
103 local max_s = Tetris["options"]["max_s"];
104 local show_s_next = show_s+9;
105 if show_s_next>max_s then
106 Tetris["options"]["SOF_s_show"] = 1;
107 else
108 Tetris["options"]["SOF_s_show"] = show_s_next;
109 end
110 Tetris_SOF_clear();
111 Tetris_SOF_update();
112 end
113 if (button == "Tetris_SOF_b_Back") then
114 local show_s = Tetris["options"]["SOF_s_show"];
115 local max_s = Tetris["options"]["max_s"];
116 local show_s_next = show_s-9;
117 if show_s_next<1 then
118 Tetris["options"]["SOF_s_show"] = max_s-(math.mod(max_s,9))+1;
119 else
120 Tetris["options"]["SOF_s_show"] = show_s_next;
121 end
122 Tetris_SOF_clear();
123 Tetris_SOF_update();
124 end
125 end
126  
127 function Tetris_SOF_c_Click()
128 local checkbox = this:GetName();
129 local show_s = Tetris["options"]["SOF_s_show"];
130 local checkboxnum = string.sub(checkbox, 15, 15);
131 --für welchen stein galt diese checkbox
132 local s_num = show_s+checkboxnum-1;
133 --was zeigt diese checkbox an
134 local checkstatus = getglobal(checkbox):GetChecked();
135 if (checkstatus == 1) then
136 checkstatus = 1;
137 else
138 checkstatus = 0;
139 end
140 --änderung im stonetable speichern
141 table.remove(Tetris["options"]["stones"],s_num)
142 table.insert(Tetris["options"]["stones"],s_num,checkstatus)
143 end