Commit Message

This commit is contained in:
SilicaAndPina 2020-07-29 11:43:59 +12:00
parent 1f4a8a24be
commit 382fc965d3
2 changed files with 50 additions and 1 deletions

View File

@ -66,7 +66,6 @@ if((mouse_x >= x && mouse_x <= x+424) && (mouse_y >= y
i++;
}
}
</string>
</argument>

View File

@ -8,6 +8,29 @@
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" 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>selected_slot = 0;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="3" enumb="0">
<action>
<libid>1</libid>
@ -27,6 +50,24 @@
<kind>1</kind>
<string>x = view_xview[0]+view_wview[0]/2 - (424/2);
y = view_yview[0]+view_hview[0]/2 - (254/2);
var i = 0;
if((mouse_x &gt;= x &amp;&amp; mouse_x &lt;= x+424) &amp;&amp; (mouse_y &gt;= y &amp;&amp; mouse_y &lt;= y+59))
{
for(yy = 8; yy &lt; (5*44); yy+=45+1)
{
for(xx = 6; xx &lt; (9*45); xx+=45+1)
{
if((mouse_x &gt;= x+xx &amp;&amp; mouse_x &lt;= x+xx+45) &amp;&amp; (mouse_x &gt;= x+yy &amp;&amp; mouse_x &lt;= x+yy+44))
{
selected_slot = i;
}
i++;
}
}
}
</string>
</argument>
</arguments>
@ -59,9 +100,18 @@ for(yy = 8; yy &lt; (5*44); yy+=45+1)
{
draw_sprite(spr_blocks,obj_inv_controller.inventory[i],x+xx+6,y+yy+7);
var count = obj_inv_controller.inventoryCount[i];
if(i == selected_slot)
{
draw_set_color(make_colour_rgb(100,100,100));
draw_rectangle(x+xx,y+yy,x+xx+45,y+yy+44,false)
}
var xoffset = string_width(string(count))
if(count &gt; 1)
{
draw_set_color(c_white);
draw_text(x+xx+45-xoffset,y+yy+30,string(count));
}
i++
}
}