Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// @description
- if(!show_inventory) exit; // Don't run anything under this if the inventory is shut
- // ----- Inventory Background
- inv_ui_sprite = draw_sprite_part_ext(s_inventory_ui, 0, cell_size, 0, inv_ui_width, inv_ui_height, inv_ui_x, inv_ui_y, scale, scale, c_white, inv_alpha);
- // ----- Player Info
- var info_grid = ds_player_info;
- //Player's Name
- draw_set_font(fnt_manaspace_medium);
- var c = c_white;
- draw_text_colour(info_x, info_y, info_grid[# 1, 3], c, c, c, c, 1);
- //Player's Money
- draw_set_font(fnt_manaspace_small);
- var yy = 0; repeat(3) {
- draw_text_colour(info_x + (192*scale) + ((15+18)*scale*yy), info_y+2, string(info_grid[# 1, yy]), c, c, c, c, 1);
- yy++;
- }
- // ----- Inventory
- var ii, ix, iy, xx, yy, sx, sy, iitem, inv_grid;
- ii = 0; ix = 0; iy = 0; inv_grid = ds_inventory;
- repeat(inv_slots) {
- // Slot's x, y
- xx = slots_x + ((cell_size+x_buffer)*ix*scale);
- yy = slots_y + ((cell_size+y_buffer)*iy*scale);
- // Get Item From Grid
- iitem = inv_grid[# 0, ii];
- //Get Item's Sprite Location on Item Sprite Sheet
- sx = (iitem mod s_inv_items_columns)*cell_size;
- sy = (iitem div s_inv_items_columns)*cell_size;
- // Draw Slot
- draw_sprite_part_ext(s_inv_ui, 0, 0, 0, cell_size, cell_size, xx, yy, scale, scale, c_white, inv_alpha/2);
- // Draw Item
- switch(ii) {
- case selected_slot: // Draw when the mouse is over this slot
- if(iitem > 0) draw_sprite_part_ext(s_inv_items, 0, sx, sy, cell_size, cell_size, xx, yy, scale, scale, c_white, 1);
- gpu_set_blendmode(bm_add);
- draw_sprite_part_ext(s_inv_ui, 0, 0, 0, cell_size, cell_size, xx, yy, scale, scale, c_white, .3);
- gpu_set_blendmode(bm_normal);
- break;
- case pickup_slot:
- //Do Nothing atm
- break;
- default: // Draw the item normally
- if(iitem > 0) draw_sprite_part_ext(s_inv_items, 0, sx, sy, cell_size, cell_size, xx, yy, scale, scale, c_white, 1);
- break;
- }
- //Draw Item Count
- switch(ii) {
- case pickup_slot:
- //Do Nothing atm
- break;
- default:
- if(iitem > 0) {
- c = c_white
- draw_set_font(fnt_manaspace_small);
- var inum = inv_grid[# 1, ii];
- draw_set_halign(fa_right);
- if(inum > 1) draw_text_colour(xx+(cell_size*scale)-2, yy+2, string(inum), c, c, c, c, 1);
- draw_set_halign(fa_left);
- }
- break;
- }
- // Increment
- ii++; // Selects next Slot
- ix = ii mod inv_slots_width; // Finds what slot in the row to be on (0 - 8)
- iy = ii div inv_slots_width; // Finds what row to be on
- }
- if(pickup_slot != -1) {
- // Get Item From Grid
- iitem = inv_grid[# 0, pickup_slot];
- //Get Item's Sprite Location on Item Sprite Sheet
- sx = (iitem mod s_inv_items_columns)*cell_size;
- sy = (iitem div s_inv_items_columns)*cell_size;
- if(iitem > 0) draw_sprite_part_ext(s_inv_items, 0, sx, sy, cell_size, cell_size, mousex, mousey, scale, scale, c_white, inv_alpha);
- var inum = inv_grid[# 1, pickup_slot];
- draw_set_halign(fa_right);
- if(inum > 1) draw_text_colour(mousex+(cell_size*scale)-2, mousey+2, string(inum), c, c, c, c, inv_alpha);
- draw_set_halign(fa_left);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement