vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 -- balken neu darstellen und einstellen
2 -- z.b. balkengrösse und textur ändert sich
3 function wowon_UI_sf_balken_update ()
4  
5 -- balken variablen setzten lassen
6 wowon_balk ()
7  
8 wowon_sf_balken:SetHeight(wowon.game.balken.h)
9 wowon_sf_balken:SetWidth(wowon.game.balken.b)
10 if (wowon.game.balken.t == nil) then
11 wowon_sf_balken:SetTexture(wowon.game.balken.vc.r, wowon.game.balken.vc.g, wowon.game.balken.vc.b, wowon.game.balken.vc.a)
12 else
13 wowon_sf_balken:SetTexture (wowon.game.balken.t)
14 wowon_sf_balken:SetVertexColor(wowon.game.balken.vc.r, wowon.game.balken.vc.g, wowon.game.balken.vc.b, wowon.game.balken.vc.a)
15 end
16  
17 end
18  
19 -- balken bewegen
20 function wowon_UI_sf_balken_move ()
21 local x = wowon.game.balken.x
22 local o = wowon.game.feld.o
23 wowon_sf_balken:SetPoint("TOP", "wowon_sf", "BOTTOMLEFT", x, o);
24 end
25  
26  
27 -- balken auf startposition setzen
28 function wowon_UI_sf_balken_start ()
29  
30 local x = wowon.game.feld.x
31 local y = wowon.game.feld.y
32 local o = wowon.game.feld.o
33  
34 wowon_sf_balken:SetPoint("TOP", "wowon_sf", "BOTTOMLEFT", x/2, o)
35  
36 end
37  
38 -- ball erstellen
39 -- wird nur aufgerufen wenn kein ball frei ist
40 function wowon_UI_sf_ball_creat ()
41 -- wieviele bälle existieren schon?
42 local b = nil
43 if (wowon.game.balle == nil) then
44 b = 0
45 else
46 b = table.getn(wowon.game.balle)
47 end
48 b = b+1
49 -- ball erstellen
50 wowon_sf:CreateTexture("wowon_sf_b"..b, "OVERLAY")
51 -- parent zuweisen
52 getglobal("wowon_sf_b"..b):SetParent("wowon_sf")
53 -- neuer ball hinzufügen
54 table.insert(wowon.game.ballfrei, b)
55 end
56  
57 -- ball updaten
58 function wowon_UI_sf_ball_update (b)
59 -- b = ballnummer
60 -- ball variablen setzen
61 wowon_ball (b)
62 getglobal("wowon_sf_b"..b):SetHeight(wowon.game.ball[b].r*2)
63 getglobal("wowon_sf_b"..b):SetWidth(wowon.game.ball[b].r*2)
64 if (wowon.game.ball[b].t == nil) then
65 getglobal("wowon_sf_b"..b):SetTexture(wowon.game.ball[b].vc.r, wowon.game.ball[b].vc.g, wowon.game.ball[b].vc.b, wowon.game.ball[b].vc.a)
66 else
67 getglobal("wowon_sf_b"..b):SetTexture (wowon.game.ball[b].t)
68 getglobal("wowon_sf_b"..b):SetVertexColor(wowon.game.ball[b].vc.r, wowon.game.ball[b].vc.g, wowon.game.ball[b].vc.b, wowon.game.ball[b].vc.a)
69 end
70 end
71  
72 -- ball auf startposition setzen
73 function wowon_UI_sf_ball_start (b)
74 -- b = ballnummer
75 getglobal("wowon_sf_b"..b):SetPoint("CENTER", "wowon_sf_balken", "TOP", 0, wowon.game.ball[b].r)
76 getglobal("wowon_sf_b"..b):Show()
77 end
78  
79 -- f-ball auf startposition setzen
80 function wowon_UI_sf_feldball_start (b)
81 -- b = ballnummer
82 getglobal("wowon_sf_b"..b):SetPoint("CENTER", "wowon_sf", "BOTTOMLEFT", wowon.game.ball[b].x, wowon.game.ball[b].y)
83 getglobal("wowon_sf_b"..b):Show()
84 end
85  
86 -- ball bewegen
87 function wowon_UI_ball_move (b)
88 -- b = ballnummer
89 getglobal("wowon_sf_b"..b):SetPoint("CENTER", "wowon_sf", "BOTTOMLEFT", wowon.game.ball[b].x, wowon.game.ball[b].y)
90 end
91  
92 -- ball verdecken
93 function wowon_UI_sf_ball_hide (b)
94 -- b = ballnummer
95 getglobal("wowon_sf_b"..b):Hide()
96 end
97  
98 -- feld verdecken
99 function wowon_UI_sf_feld_hide (f)
100 -- f = feldnummer
101 getglobal("wowon_sf_f"..f):Hide()
102 end
103  
104 -- feld erstellen
105 -- wird nur aufgerufen wenn kein feld frei ist
106 function wowon_UI_sf_feld_creat ()
107 -- wieviele felder existieren schon?
108 local f = nil
109 if (wowon.game.felder == nil) then
110 f = 0
111 else
112 f = table.getn(wowon.game.felder)
113 end
114 f = f+1
115 -- feld erstellen
116 wowon_sf:CreateTexture("wowon_sf_f"..f, "ARTWORK")
117 -- parent zuweisen
118 getglobal("wowon_sf_f"..f):SetParent("wowon_sf")
119 -- neues feld hinzufügen
120 table.insert(wowon.game.feldfrei, f)
121 end
122  
123 -- feld updaten
124 function wowon_UI_sf_feld_update (f)
125 -- f = feldnummer
126  
127 -- feld variablen setzen
128 wowon_feld (f)
129  
130 getglobal("wowon_sf_f"..f):SetHeight(wowon.game.feld[f].h)
131 getglobal("wowon_sf_f"..f):SetWidth(wowon.game.feld[f].b)
132 if (wowon.game.feld[f].t == nil) then
133 getglobal("wowon_sf_f"..f):SetTexture(wowon.game.feld[f].vc.r, wowon.game.feld[f].vc.g, wowon.game.feld[f].vc.b, wowon.game.feld[f].vc.a)
134 else
135 getglobal("wowon_sf_f"..f):SetTexture (wowon.game.feld[f].t)
136 getglobal("wowon_sf_f"..f):SetVertexColor(wowon.game.feld[f].vc.r, wowon.game.feld[f].vc.g, wowon.game.feld[f].vc.b, wowon.game.feld[f].vc.a)
137 end
138 end
139  
140 -- feld zeigen und setzen
141 function wowon_UI_sf_feld_start (f)
142 -- f = feldnummer
143  
144 local x = wowon.game.feld[f].x
145 local y = wowon.game.feld[f].y
146  
147 getglobal("wowon_sf_f"..f):SetPoint("BOTTOMLEFT", "wowon_sf", "BOTTOMLEFT", x, y)
148 getglobal("wowon_sf_f"..f):Show()
149 end
150  
151  
152 function wowon_UI_sf_string (x)
153 -- x = false = gameover
154 -- x = true = done
155 wowon_sf_text:Show()
156 if (x == false) then
157 wowon_sf_text:SetText("Game Over")
158 elseif (x == true) then
159 wowon_sf_text:SetText("Level Done!")
160 end
161 end