Commit Message
This commit is contained in:
parent
382fc965d3
commit
799d450301
3 changed files with 66 additions and 7 deletions
|
@ -94,12 +94,13 @@ var i = 0;
|
|||
var yy = 7;
|
||||
for(var xx = 5; xx < (9*45); xx+=45+1)
|
||||
{
|
||||
draw_sprite(spr_blocks,obj_inv_controller.inventory[i],x+xx+6,y+yy+7);
|
||||
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)
|
||||
}
|
||||
draw_sprite(spr_blocks,obj_inv_controller.inventory[i],x+xx+6,y+yy+7);
|
||||
|
||||
var count = obj_inv_controller.inventoryCount[i];
|
||||
var xoffset = string_width(string(count))
|
||||
if(count > 1)
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>selected_slot = 0;
|
||||
|
||||
move_slot = false;
|
||||
selected_item = 0;
|
||||
selected_total = 0;
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
|
@ -53,13 +57,13 @@ y = view_yview[0]+view_hview[0]/2 - (254/2);
|
|||
|
||||
|
||||
var i = 0;
|
||||
if((mouse_x >= x && mouse_x <= x+424) && (mouse_y >= y && mouse_y <= y+59))
|
||||
if((mouse_x >= x && mouse_x <= x+424) && (mouse_y >= y && mouse_y <= y+239))
|
||||
{
|
||||
for(yy = 8; yy < (5*44); yy+=45+1)
|
||||
for(yy = 8; yy < (5*44); yy+=45)
|
||||
{
|
||||
for(xx = 6; xx < (9*45); xx+=45+1)
|
||||
{
|
||||
if((mouse_x >= x+xx && mouse_x <= x+xx+45) && (mouse_x >= x+yy && mouse_x <= x+yy+44))
|
||||
if((mouse_x >= x+xx && mouse_x <= x+xx+45) && (mouse_y >= y+yy && mouse_y <= y+yy+45))
|
||||
{
|
||||
selected_slot = i;
|
||||
}
|
||||
|
@ -68,6 +72,51 @@ if((mouse_x >= x && mouse_x <= x+424) && (mouse_y >= y
|
|||
}
|
||||
|
||||
}
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="6" enumb="4">
|
||||
<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>if(!move_slot)
|
||||
{
|
||||
selected_item = obj_inv_controller.inventory[selected_slot];
|
||||
if(selected_item == 0)
|
||||
return false;
|
||||
selected_total = obj_inv_controller.inventoryCount[selected_slot];
|
||||
obj_inv_controller.inventory[selected_slot] = 0;
|
||||
obj_inv_controller.inventoryCount[selected_slot] = 0;
|
||||
move_slot = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(obj_inv_controller.inventory[selected_slot] == 0)
|
||||
{
|
||||
|
||||
obj_inv_controller.inventory[selected_slot] = selected_item;
|
||||
obj_inv_controller.inventoryCount[selected_slot] = selected_total;
|
||||
|
||||
move_slot = false;
|
||||
selected_item = 0;
|
||||
|
||||
}
|
||||
}
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
|
@ -94,18 +143,19 @@ if((mouse_x >= x && mouse_x <= x+424) && (mouse_y >= y
|
|||
var xx = 6;
|
||||
var yy = 8;
|
||||
var i = 0;
|
||||
for(yy = 8; yy < (5*44); yy+=45+1)
|
||||
for(yy = 8; yy < (5*44); yy+=45)
|
||||
{
|
||||
for(xx = 6; xx < (9*45); xx+=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)
|
||||
}
|
||||
|
||||
draw_sprite(spr_blocks,obj_inv_controller.inventory[i],x+xx+6,y+yy+7);
|
||||
var count = obj_inv_controller.inventoryCount[i];
|
||||
|
||||
var xoffset = string_width(string(count))
|
||||
if(count > 1)
|
||||
{
|
||||
|
@ -116,6 +166,10 @@ for(yy = 8; yy < (5*44); yy+=45+1)
|
|||
}
|
||||
}
|
||||
|
||||
if(selected_item != 0)
|
||||
{
|
||||
draw_sprite(spr_blocks,selected_item,mouse_x-16,mouse_y-16);
|
||||
}
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
|
|
|
@ -357,6 +357,10 @@ image_angle += 5;
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
if(obj_inv_controller.is_open)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if(energy >= 20)
|
||||
|
|
Reference in a new issue