Skip to content

Commit 0127661

Browse files
author
lofcz
committed
Dokončena výchozí aktualizace UI
- UI minimapy je ve frontě
1 parent ae851bc commit 0127661

File tree

6 files changed

+162
-55
lines changed

6 files changed

+162
-55
lines changed

SimplexRPGEngine/Engine source/objects/oSpellMenu.object.gmx

Lines changed: 80 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@
3030
scrSpellIni();
3131

3232
scrSpellCreate(SpellEnum.spellFlash, 0);
33-
scrSpellCreateDetails("Záblesk", "Posílený záblesk", "Mocný záblesk", "text1", "text2", "text3", 0, 1, 2);
34-
scrSpellCreatePointDetails("detail1", "detail2", "detail3", "detail4", "detail5", "detail6", "detail7", "detail8", "detail9", "detail10", "detail11");
35-
33+
scrSpellCreateDetails("Záblesk", "Posílený záblesk", "Mocný záblesk", "Záblesk", "Posílený záblesk", "Mocný záblesk", 0, 1, 2);
34+
scrSpellCreatePointDetails("Přemístí sesilatele na krátkou vzdálenost ve směru jeho pohybu.", "Přemístí sesílatele na krátkou vzdálenost ve směru jeho pohybu a umístí na něj " + scrColorText("znak přesunu", c_aqua) + ".", "Přemístí sesílatele na krátkou vzdálenost ve směru jeho pohybu a umístí na něj " + scrColorText("znak přesunu", c_aqua) + ". Pokud je kouzlo zdárné a projde nepřátelskou bytostí, způsobí jí záblesk přímé poškození v závisloti na procentu chybějícího zdraví.");
35+
scrSpellCreatePointProperties("detail1", "detail2", "detail3", "detail4", "detail5", "detail6", "detail7", "detail8", "detail9", "detail10", "detail11", "detail12", "Potřebná mana: " + scrColorText("27", c_lime) + "#Přebíjecí doba: " + scrColorText("3,4s", c_lime) + "#Nejvyšší počet znaků přesunu: " + scrColorText("12", c_lime) + "#Poškození při průchodu: " + scrColorText("8%", c_lime) + " chybějícího zdraví.");
36+
3637
scrSpellCreate(SpellEnum.spellFireball, 0);
3738
scrSpellCreateDetails("Ohnivá koule", "Ohnivá bouře", "Inferno", "text1", "text2", "text3", 3, 4, 5);
38-
scrSpellCreatePointDetails("detail1", "detail2", "detail3", "detail4", "detail5", "detail6", "detail7", "detail8", "detail9", "detail10", "detail11");
39+
scrSpellCreatePointDetails("detail1", "detail2", "detail3", "detail4", "detail5", "detail6", "detail7", "detail8", "detail9", "detail10", "detail11", "detail12", "detail13");
3940

4041
scrSpellCreate(SpellEnum.spellVines, 0);
4142
scrSpellCreateDetails("Zákeřné ostny", "Smrtící spoutání", "Divoká pomsta", "text1", "text2", "text3", 6, 7, 8);
42-
scrSpellCreatePointDetails("detail1", "detail2", "detail3", "detail4", "detail5", "detail6", "detail7", "detail8", "detail9", "detail10", "detail11");
43+
scrSpellCreatePointDetails("detail1", "detail2", "detail3", "detail4", "detail5", "detail6", "detail7", "detail8", "detail9", "detail10", "detail11", "detail12", "detail13");
4344

4445
</string>
4546
</argument>
@@ -68,6 +69,31 @@ scrSpellCreate(SpellEnum.spellVines, 0);
6869
part_system_destroy(Sname);
6970
ds_list_destroy(spellList);
7071
ds_list_destroy(spellListAlpha);
72+
</string>
73+
</argument>
74+
</arguments>
75+
</action>
76+
</event>
77+
<event eventtype="2" enumb="0">
78+
<action>
79+
<libid>1</libid>
80+
<id>603</id>
81+
<kind>7</kind>
82+
<userelative>0</userelative>
83+
<isquestion>0</isquestion>
84+
<useapplyto>-1</useapplyto>
85+
<exetype>2</exetype>
86+
<functionname></functionname>
87+
<codestring></codestring>
88+
<whoName>self</whoName>
89+
<relative>0</relative>
90+
<isnot>0</isnot>
91+
<arguments>
92+
<argument>
93+
<kind>1</kind>
94+
<string> mode = "out";
95+
bacAlpha = 0;
96+
7197
</string>
7298
</argument>
7399
</arguments>
@@ -244,33 +270,70 @@ if (mode == "outSlow")
244270
if (bacAlpha &gt; 0) {bacAlpha -= 0.05;} else {draw = false; mode = ""; scrSetActiveComponent(false);}
245271
if (push == 1) {pushValue = lerp(pushValue, 800, 0.1);}
246272
}
247-
273+
248274
clr(c_black, bacAlpha / 4 * 3);
249275
draw_rectangle(x, y, x + 800, y + 600, false);
250276
clr(c_black, bacAlpha);
251-
draw_sprite_ext(sTalentMenuIcons, 0, x + 768 + 16, y + 16, 1, 1, 0, c_white, 1);
277+
//draw_sprite_ext(sTalentMenuIcons, 0, x + 768 + 16, y + 16, 1, 1, 0, c_white, 1);
252278

253-
254-
if (point_in_rectangle(mouse_x, mouse_y, x + 768, y, x + 800, y + 32))
255-
{
256-
if (mouse_check_button_pressed(mb_left))
279+
if (keyboard_check_pressed(ord("T")))
257280
{
258281
if (mode == "in") {mode = "out";}
259282
}
260-
}
261283

262284
// Hlavička
263285
clr(c_white, bacAlpha);
264286
alg("center", fntPixelHuge);
265-
draw_text(x + 400, y + 24, "Magie");
287+
draw_text(x + 480, y + 24, "Magie");
266288
alg("center", fntPixel);
267289

268290
bs = "Nemáš žádné body magie";
269-
fnt(fntPixel);
291+
fnt(fntPixelSmall);
270292
if (oPlayer.spellPoints &gt; 0) {bs = "Máš " + string(oPlayer.spellPoints) + " " + scrInflect("bod", oPlayer.talentPoints) + " bodů čarodějnictví.";}
271-
draw_text(x + 400, y + 42, bs);
293+
draw_text(x + 480, y + 48, bs);
272294
alg();
273-
295+
fnt(fntPixelTiny);
296+
297+
c1 = c_white;
298+
c2 = c_white;
299+
300+
if (mouse_in(x + 360, x + 360 + string_width("Talenty &gt;"), y + 4, y + 4 + string_height("Talenty &gt;")))
301+
{
302+
c1 = c_lime;
303+
304+
if (mouse_check_button_pressed(mb_left))
305+
{
306+
mode = "out";
307+
bacAlpha = 0;
308+
draw = false;
309+
oTalentMenu.draw = true;
310+
oTalentMenu.bacAlpha = 1;
311+
oTalentMenu.mode = "in";
312+
}
313+
314+
}
315+
316+
if (mouse_in(x + 540, x + 540 + string_width("&lt; Status"), y + 4, y + 4 + string_height("&lt; Status")))
317+
{
318+
c2 = c_lime;
319+
320+
if (mouse_check_button_pressed(mb_left))
321+
{
322+
mode = "out";
323+
oStatusMenu.activated = true;
324+
oStatusMenu.activatedAlpha = 1;
325+
}
326+
327+
}
328+
329+
clr(c1, -1);
330+
draw_text(x + 360, y + 4, "&lt; Talenty");
331+
clr(c2, -1);
332+
draw_text(x + 540, y + 4, "Status &gt;");
333+
334+
clr(c_white, bacAlpha);
335+
336+
fnt()
274337
// Vykreslování kouzel
275338
var xx, yy;
276339
xx = 466;
@@ -307,7 +370,7 @@ clr();
307370

308371
}
309372

310-
373+
clr();
311374

312375

313376

SimplexRPGEngine/Engine source/objects/oTalentMenu.object.gmx

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -110,51 +110,68 @@ part_system_destroy(Sname);
110110
{
111111
x = view_xview;
112112
y = view_yview;
113-
114-
// Talenty
115-
if (drawType = "talents")
116-
{
117113
hover = false;
114+
clr();
118115

119116
if (mode == "in")
120117
{
121-
if (bacAlpha &lt; 1) {bacAlpha += 0.1; oHUD.draw = false;}
118+
if (bacAlpha &lt; 1) {bacAlpha += 0.1;}
122119
}
123120
if (mode == "out")
124121
{
125-
if (bacAlpha &gt; 0) {bacAlpha -= 0.1;} else {draw = false; mode = ""; oHUD.draw = true;}
122+
if (bacAlpha &gt; 0) {bacAlpha -= 0.1;} else {draw = false; mode = "";}
126123
}
127124

128-
clr(c_black, bacAlpha / 2);
125+
clr(c_black, bacAlpha / 4 * 3);
129126
draw_rectangle(x, y, x + 800, y + 600, false);
130127
clr(c_black, bacAlpha);
131-
draw_sprite_ext(sTalentMenuIcons, 0, x + 768 + 16, y + 16, ico3S, ico3S, 0, c_white, 1);
128+
//draw_sprite_ext(sTalentMenuIcons, 0, x + 768 + 16, y + 16, ico3S, ico3S, 0, c_white, 1);
132129
if (mouse_in(x + 768, x + 768 + 32, y, y + 32)) {if (ico3S &lt; 1.3) {ico3S = lerp(ico3S, 1.3, 0.1);}} else {if (ico3S &gt; 1) {ico3S = lerp(ico3S, 1, 0.1);}}
133130

134-
135-
if (point_in_rectangle(mouse_x, mouse_y, x + 768, y, x + 800, y + 32))
136-
{
137-
if (mouse_check_button_pressed(mb_left))
131+
if (keyboard_check_pressed(ord("T")))
138132
{
139133
if (mode == "in") {mode = "out";}
140134
scrSetActiveComponent(false);
141135
}
142-
}
143-
144136

145137
// Hlavička
146138
clr(c_white, bacAlpha);
147139
alg("center", fntPixelHuge);
148-
draw_text(x + 400, y + 16, treeName[selectedTree]);
140+
draw_text(x + 400, y + 24, treeName[selectedTree]);
149141
alg("center", fntPixel);
150142

151143
bs = "Nemáš žádné body talentů";
152144
if (oPlayer.talentPoints &gt; 0) {bs = "Máš " + string(oPlayer.talentPoints) + " " + scrInflect("bod", oPlayer.talentPoints) + " talentů";}
153-
draw_text(x + 400, y + 36, bs);
145+
draw_text(x + 400, y + 52, bs);
154146
alg();
147+
148+
fnt(fntPixelTiny);
149+
150+
c1 = c_white;
151+
c2 = c_white;
152+
153+
if (mouse_in(x + 280, x + 280 + string_width("&lt; Status"), y + 4, y + 4 + string_height("&lt; Status")))
154+
{
155+
c2 = c_lime;
156+
157+
if (mouse_check_button_pressed(mb_left))
158+
{
159+
mode = "out";
160+
oStatusMenu.activated = true;
161+
oStatusMenu.activatedAlpha = 1;
162+
}
163+
}
164+
165+
clr(c2, -1);
166+
draw_text(x + 280, y + 4, "&lt; Status");
167+
clr(c1, -1);
168+
draw_text(x + 480, y + 4, "Magie &gt;");
169+
fnt();
170+
clr(c_white, bacAlpha);
171+
155172
// Navigace
156-
draw_sprite_ext(sTalentMenuIcons, 2, x + 266, y + 32, ico1S, ico1S, 0, c_white, 1);
157-
draw_sprite_ext(sTalentMenuIcons, 1, x + 536, y + 32, ico2S, ico2S, 0, c_white, 1);
173+
//draw_sprite_ext(sTalentMenuIcons, 2, x + 266, y + 32, ico1S, ico1S, 0, c_white, 1);
174+
//draw_sprite_ext(sTalentMenuIcons, 1, x + 536, y + 32, ico2S, ico2S, 0, c_white, 1);
158175

159176
if (mouse_in(x + 266 - 16, x + 266 + 16, y + 16, y + 48)) {if (ico1S &lt; 1.3) {ico1S = lerp(ico1S, 1.3, 0.1);}} else {if (ico1S &gt; 1) {ico1S = lerp(ico1S, 1, 0.1);}}
160177
if (mouse_in(x + 536 - 16, x + 536 + 16, y + 16, y + 48)) {if (ico2S &lt; 1.3) {ico2S = lerp(ico2S, 1.3, 0.1);}} else {if (ico2S &gt; 1) {ico2S = lerp(ico2S, 1, 0.1);}}
@@ -185,13 +202,7 @@ draw_set_font(fntPixelSmall);
185202
draw_text_colored(x + 546, y + 100, drawText);
186203

187204
clr();
188-
}
189-
190-
// Kouzla
191-
if (drawType = "spells")
192-
{
193205

194-
}
195206
}
196207

197208
</string>

SimplexRPGEngine/Engine source/scripts/playerAPI.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,8 @@ if (can_move2)
928928
// Pause game
929929
if (keyboard_check_pressed(vk_escape)) {scrPauseGame();}
930930

931+
// Hide HUD [TEMP]
932+
if (keyboard_check_pressed(ord("Y"))) {oHUD.draw = !oHUD.draw}
931933

932934
#define apiPlayerSpellCast
933935
/// apiPlayerSpellCast()

SimplexRPGEngine/Engine source/scripts/scrSpellCreate.gml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,17 @@ spellDetails[tempSpell,8] = i3;
6060

6161

6262
#define scrSpellCreatePointDetails
63-
/// scrSpellCreatePointDetails(detail1Level0... detail5Level2)
63+
/// scrSpellCreatePointDetails(detail1Level0.. detail1Level3)
6464

6565
for (i = 0; i < 16; i++)
6666
{
67-
if (argument_count > i) {spellDetails[tempSpell, (9 + i)] = argument[i];}
68-
}
67+
if (argument_count > i) {spellDetails[tempSpell, (9 + i)] = scrWordwrap(argument[i], 550, fntPixelSmall);}
68+
}
69+
70+
#define scrSpellCreatePointProperties
71+
/// scrSpellCreatePointProperties(detail1Level0.. detail1Level3)
72+
73+
for (i = 0; i < 16; i++)
74+
{
75+
if (argument_count > i) {spellProperties[tempSpell, (9 + i)] = argument[i];}
76+
}

SimplexRPGEngine/Engine source/scripts/scrSpellDraw.gml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if (argument_count > 1) {yy = argument[2];}
1212

1313
scrSpellDrawSurface();
1414
fnt();
15-
clr(c_white, draw_get_alpha());
16-
draw_text(view_xview + xx, view_yview + yy - 24, spellDetails[spell, 0]); // Spell name
15+
clr(c_white, -1);
16+
//draw_text(view_xview + xx, view_yview + yy - 24, spellDetails[spell, 0]); // Spell name
1717

1818
if (surface_exists(front_surface) && surface_exists(back_surface))
1919
{
@@ -48,11 +48,15 @@ draw_roundrect(200, 400, 790, 590, false);
4848
clr(c_black, choosenSpellAlpha * 3);
4949
draw_roundrect(200, 400, 790, 590, true);
5050
clr(c_white, choosenSpellAlpha * 3);
51-
draw_text_colored(210, 410, spellDetails[spell, 1]);
52-
53-
index = spellDetails[spell, 9 + spellLevel[spell, 0] + (spellLevel[spell, 1] * 5)];
54-
draw_text_colored(210, 410 + string_height(spellDetails[spell, 1]) + 32, index);
55-
51+
fnt();
52+
draw_text_colored(210, 410, spellDetails[spell, 0]);
53+
index = spellDetails[spell, 9 + (spellLevel[spell, 1])];
54+
fnt(fntPixelSmall);
55+
draw_text_colored(210, 380 + 64, index);
56+
indexH = string_height(index);
57+
fnt(fntPixelTiny);
58+
draw_text_colored(210, 390 + indexH + 64, spellProperties[9 + spellLevel[spell, 0] + (spellLevel[spell, 1] * 5) + (spellLevel[spell, 1])]);
59+
fnt();
5660

5761
maxVerticles = 360;
5862
choosenSpellScale = lerp(choosenSpellScale, 1.2, 0.1);
@@ -99,7 +103,16 @@ if (mouse_in(xx + view_xview - 128, xx + 128 + view_xview, yy + view_yview - 64,
99103

100104
if (mouse_check_button_pressed(mb_left) && mode == "in")
101105
{
102-
event_user(0);
106+
if (oPlayer.spellPoints > 0 && spellLevel[spell, 1] < 2 && spellLevel[spell, 0] < 5)
107+
{
108+
spellLevel[spell, 0]++;
109+
oPlayer.spellPoints--;
110+
audio_play_sound(sndSpellUpgrade, 0, false);
111+
levelUpSpell = spell;
112+
level = spellLevel[spell, 1];
113+
points = spellLevel[spell, 0];
114+
event_user(2);
115+
}
103116
}
104117
if (mouse_check_button_pressed(mb_right) && mode == "in")
105118
{
@@ -162,6 +175,10 @@ draw_roundrect(xx, yy + 10, xx + 196, yy + 590, true);
162175
clr(c_white, draw_get_alpha() * 2);
163176
fnt();
164177

178+
clr(c_black, draw_get_alpha() * 2);
179+
//draw_circle(xx + 196, yy + 196, 16, false);
180+
181+
clr(c_white, draw_get_alpha() * 2);
165182
xx += 8;
166183
yy += 48;
167184

@@ -190,8 +207,14 @@ for (i = 0; i < ds_list_size(spellList); i++)
190207
// On-click LMB
191208
if (mouse_check_button_pressed(mb_left))
192209
{
193-
spell = i;
194-
event_user(0);
210+
if (choosenSpell != i)
211+
{
212+
choosenSpell = i;
213+
flip_angle = 0;
214+
}
215+
choosenSpellScale = 1;
216+
verticles = 0;
217+
realVerticles = 0;
195218
}
196219
}
197220
else {spellListAlpha[| i] = lerp(spellListAlpha[| i], 0, 0.1);}

SimplexRPGEngine/Engine source/scripts/scrSpellIni.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ upgradeAlpha = 0;
1717
hoverAlpha = 0;
1818
spellList = ds_list_create();
1919
spellListAlpha = ds_list_create();
20-
choosenSpell = -1;
20+
choosenSpell = 0;
2121
choosenSpellScale = 1;
2222
choosenSpellAlpha = 0;
2323
realVerticles = 0;

0 commit comments

Comments
 (0)