Skip to content

Commit

Permalink
Dokončena výchozí aktualizace UI
Browse files Browse the repository at this point in the history
- UI minimapy je ve frontě
  • Loading branch information
lofcz committed Dec 12, 2016
1 parent ae851bc commit 0127661
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 55 deletions.
97 changes: 80 additions & 17 deletions SimplexRPGEngine/Engine source/objects/oSpellMenu.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@
scrSpellIni();

scrSpellCreate(SpellEnum.spellFlash, 0);
scrSpellCreateDetails("Záblesk", "Posílený záblesk", "Mocný záblesk", "text1", "text2", "text3", 0, 1, 2);
scrSpellCreatePointDetails("detail1", "detail2", "detail3", "detail4", "detail5", "detail6", "detail7", "detail8", "detail9", "detail10", "detail11");

scrSpellCreateDetails("Záblesk", "Posílený záblesk", "Mocný záblesk", "Záblesk", "Posílený záblesk", "Mocný záblesk", 0, 1, 2);
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í.");
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í.");

scrSpellCreate(SpellEnum.spellFireball, 0);
scrSpellCreateDetails("Ohnivá koule", "Ohnivá bouře", "Inferno", "text1", "text2", "text3", 3, 4, 5);
scrSpellCreatePointDetails("detail1", "detail2", "detail3", "detail4", "detail5", "detail6", "detail7", "detail8", "detail9", "detail10", "detail11");
scrSpellCreatePointDetails("detail1", "detail2", "detail3", "detail4", "detail5", "detail6", "detail7", "detail8", "detail9", "detail10", "detail11", "detail12", "detail13");

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

</string>
</argument>
Expand Down Expand Up @@ -68,6 +69,31 @@ scrSpellCreate(SpellEnum.spellVines, 0);
part_system_destroy(Sname);
ds_list_destroy(spellList);
ds_list_destroy(spellListAlpha);
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string> mode = "out";
bacAlpha = 0;

</string>
</argument>
</arguments>
Expand Down Expand Up @@ -244,33 +270,70 @@ if (mode == "outSlow")
if (bacAlpha &gt; 0) {bacAlpha -= 0.05;} else {draw = false; mode = ""; scrSetActiveComponent(false);}
if (push == 1) {pushValue = lerp(pushValue, 800, 0.1);}
}

clr(c_black, bacAlpha / 4 * 3);
draw_rectangle(x, y, x + 800, y + 600, false);
clr(c_black, bacAlpha);
draw_sprite_ext(sTalentMenuIcons, 0, x + 768 + 16, y + 16, 1, 1, 0, c_white, 1);
//draw_sprite_ext(sTalentMenuIcons, 0, x + 768 + 16, y + 16, 1, 1, 0, c_white, 1);


if (point_in_rectangle(mouse_x, mouse_y, x + 768, y, x + 800, y + 32))
{
if (mouse_check_button_pressed(mb_left))
if (keyboard_check_pressed(ord("T")))
{
if (mode == "in") {mode = "out";}
}
}

// Hlavička
clr(c_white, bacAlpha);
alg("center", fntPixelHuge);
draw_text(x + 400, y + 24, "Magie");
draw_text(x + 480, y + 24, "Magie");
alg("center", fntPixel);

bs = "Nemáš žádné body magie";
fnt(fntPixel);
fnt(fntPixelSmall);
if (oPlayer.spellPoints &gt; 0) {bs = "Máš " + string(oPlayer.spellPoints) + " " + scrInflect("bod", oPlayer.talentPoints) + " bodů čarodějnictví.";}
draw_text(x + 400, y + 42, bs);
draw_text(x + 480, y + 48, bs);
alg();

fnt(fntPixelTiny);

c1 = c_white;
c2 = c_white;

if (mouse_in(x + 360, x + 360 + string_width("Talenty &gt;"), y + 4, y + 4 + string_height("Talenty &gt;")))
{
c1 = c_lime;

if (mouse_check_button_pressed(mb_left))
{
mode = "out";
bacAlpha = 0;
draw = false;
oTalentMenu.draw = true;
oTalentMenu.bacAlpha = 1;
oTalentMenu.mode = "in";
}

}

if (mouse_in(x + 540, x + 540 + string_width("&lt; Status"), y + 4, y + 4 + string_height("&lt; Status")))
{
c2 = c_lime;

if (mouse_check_button_pressed(mb_left))
{
mode = "out";
oStatusMenu.activated = true;
oStatusMenu.activatedAlpha = 1;
}

}

clr(c1, -1);
draw_text(x + 360, y + 4, "&lt; Talenty");
clr(c2, -1);
draw_text(x + 540, y + 4, "Status &gt;");

clr(c_white, bacAlpha);

fnt()
// Vykreslování kouzel
var xx, yy;
xx = 466;
Expand Down Expand Up @@ -307,7 +370,7 @@ clr();

}


clr();



Expand Down
59 changes: 35 additions & 24 deletions SimplexRPGEngine/Engine source/objects/oTalentMenu.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -110,51 +110,68 @@ part_system_destroy(Sname);
{
x = view_xview;
y = view_yview;

// Talenty
if (drawType = "talents")
{
hover = false;
clr();

if (mode == "in")
{
if (bacAlpha &lt; 1) {bacAlpha += 0.1; oHUD.draw = false;}
if (bacAlpha &lt; 1) {bacAlpha += 0.1;}
}
if (mode == "out")
{
if (bacAlpha &gt; 0) {bacAlpha -= 0.1;} else {draw = false; mode = ""; oHUD.draw = true;}
if (bacAlpha &gt; 0) {bacAlpha -= 0.1;} else {draw = false; mode = "";}
}

clr(c_black, bacAlpha / 2);
clr(c_black, bacAlpha / 4 * 3);
draw_rectangle(x, y, x + 800, y + 600, false);
clr(c_black, bacAlpha);
draw_sprite_ext(sTalentMenuIcons, 0, x + 768 + 16, y + 16, ico3S, ico3S, 0, c_white, 1);
//draw_sprite_ext(sTalentMenuIcons, 0, x + 768 + 16, y + 16, ico3S, ico3S, 0, c_white, 1);
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);}}


if (point_in_rectangle(mouse_x, mouse_y, x + 768, y, x + 800, y + 32))
{
if (mouse_check_button_pressed(mb_left))
if (keyboard_check_pressed(ord("T")))
{
if (mode == "in") {mode = "out";}
scrSetActiveComponent(false);
}
}


// Hlavička
clr(c_white, bacAlpha);
alg("center", fntPixelHuge);
draw_text(x + 400, y + 16, treeName[selectedTree]);
draw_text(x + 400, y + 24, treeName[selectedTree]);
alg("center", fntPixel);

bs = "Nemáš žádné body talentů";
if (oPlayer.talentPoints &gt; 0) {bs = "Máš " + string(oPlayer.talentPoints) + " " + scrInflect("bod", oPlayer.talentPoints) + " talentů";}
draw_text(x + 400, y + 36, bs);
draw_text(x + 400, y + 52, bs);
alg();

fnt(fntPixelTiny);

c1 = c_white;
c2 = c_white;

if (mouse_in(x + 280, x + 280 + string_width("&lt; Status"), y + 4, y + 4 + string_height("&lt; Status")))
{
c2 = c_lime;

if (mouse_check_button_pressed(mb_left))
{
mode = "out";
oStatusMenu.activated = true;
oStatusMenu.activatedAlpha = 1;
}
}

clr(c2, -1);
draw_text(x + 280, y + 4, "&lt; Status");
clr(c1, -1);
draw_text(x + 480, y + 4, "Magie &gt;");
fnt();
clr(c_white, bacAlpha);

// Navigace
draw_sprite_ext(sTalentMenuIcons, 2, x + 266, y + 32, ico1S, ico1S, 0, c_white, 1);
draw_sprite_ext(sTalentMenuIcons, 1, x + 536, y + 32, ico2S, ico2S, 0, c_white, 1);
//draw_sprite_ext(sTalentMenuIcons, 2, x + 266, y + 32, ico1S, ico1S, 0, c_white, 1);
//draw_sprite_ext(sTalentMenuIcons, 1, x + 536, y + 32, ico2S, ico2S, 0, c_white, 1);

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);}}
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);}}
Expand Down Expand Up @@ -185,13 +202,7 @@ draw_set_font(fntPixelSmall);
draw_text_colored(x + 546, y + 100, drawText);

clr();
}

// Kouzla
if (drawType = "spells")
{

}
}

</string>
Expand Down
2 changes: 2 additions & 0 deletions SimplexRPGEngine/Engine source/scripts/playerAPI.gml
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,8 @@ if (can_move2)
// Pause game
if (keyboard_check_pressed(vk_escape)) {scrPauseGame();}

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

#define apiPlayerSpellCast
/// apiPlayerSpellCast()
Expand Down
14 changes: 11 additions & 3 deletions SimplexRPGEngine/Engine source/scripts/scrSpellCreate.gml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,17 @@ spellDetails[tempSpell,8] = i3;


#define scrSpellCreatePointDetails
/// scrSpellCreatePointDetails(detail1Level0... detail5Level2)
/// scrSpellCreatePointDetails(detail1Level0.. detail1Level3)

for (i = 0; i < 16; i++)
{
if (argument_count > i) {spellDetails[tempSpell, (9 + i)] = argument[i];}
}
if (argument_count > i) {spellDetails[tempSpell, (9 + i)] = scrWordwrap(argument[i], 550, fntPixelSmall);}
}

#define scrSpellCreatePointProperties
/// scrSpellCreatePointProperties(detail1Level0.. detail1Level3)

for (i = 0; i < 16; i++)
{
if (argument_count > i) {spellProperties[tempSpell, (9 + i)] = argument[i];}
}
43 changes: 33 additions & 10 deletions SimplexRPGEngine/Engine source/scripts/scrSpellDraw.gml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if (argument_count > 1) {yy = argument[2];}

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

if (surface_exists(front_surface) && surface_exists(back_surface))
{
Expand Down Expand Up @@ -48,11 +48,15 @@ draw_roundrect(200, 400, 790, 590, false);
clr(c_black, choosenSpellAlpha * 3);
draw_roundrect(200, 400, 790, 590, true);
clr(c_white, choosenSpellAlpha * 3);
draw_text_colored(210, 410, spellDetails[spell, 1]);

index = spellDetails[spell, 9 + spellLevel[spell, 0] + (spellLevel[spell, 1] * 5)];
draw_text_colored(210, 410 + string_height(spellDetails[spell, 1]) + 32, index);

fnt();
draw_text_colored(210, 410, spellDetails[spell, 0]);
index = spellDetails[spell, 9 + (spellLevel[spell, 1])];
fnt(fntPixelSmall);
draw_text_colored(210, 380 + 64, index);
indexH = string_height(index);
fnt(fntPixelTiny);
draw_text_colored(210, 390 + indexH + 64, spellProperties[9 + spellLevel[spell, 0] + (spellLevel[spell, 1] * 5) + (spellLevel[spell, 1])]);
fnt();

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

if (mouse_check_button_pressed(mb_left) && mode == "in")
{
event_user(0);
if (oPlayer.spellPoints > 0 && spellLevel[spell, 1] < 2 && spellLevel[spell, 0] < 5)
{
spellLevel[spell, 0]++;
oPlayer.spellPoints--;
audio_play_sound(sndSpellUpgrade, 0, false);
levelUpSpell = spell;
level = spellLevel[spell, 1];
points = spellLevel[spell, 0];
event_user(2);
}
}
if (mouse_check_button_pressed(mb_right) && mode == "in")
{
Expand Down Expand Up @@ -162,6 +175,10 @@ draw_roundrect(xx, yy + 10, xx + 196, yy + 590, true);
clr(c_white, draw_get_alpha() * 2);
fnt();

clr(c_black, draw_get_alpha() * 2);
//draw_circle(xx + 196, yy + 196, 16, false);

clr(c_white, draw_get_alpha() * 2);
xx += 8;
yy += 48;

Expand Down Expand Up @@ -190,8 +207,14 @@ for (i = 0; i < ds_list_size(spellList); i++)
// On-click LMB
if (mouse_check_button_pressed(mb_left))
{
spell = i;
event_user(0);
if (choosenSpell != i)
{
choosenSpell = i;
flip_angle = 0;
}
choosenSpellScale = 1;
verticles = 0;
realVerticles = 0;
}
}
else {spellListAlpha[| i] = lerp(spellListAlpha[| i], 0, 0.1);}
Expand Down
2 changes: 1 addition & 1 deletion SimplexRPGEngine/Engine source/scripts/scrSpellIni.gml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ upgradeAlpha = 0;
hoverAlpha = 0;
spellList = ds_list_create();
spellListAlpha = ds_list_create();
choosenSpell = -1;
choosenSpell = 0;
choosenSpellScale = 1;
choosenSpellAlpha = 0;
realVerticles = 0;
Expand Down

0 comments on commit 0127661

Please sign in to comment.