ui: improve inventory code

isolation_bkp/dynres
Dominik Madarász 2022-08-08 13:57:03 +02:00
parent 68b57468a4
commit 4164e62a7b
3 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,8 @@
static bool build_submit_placements = false;
static bool build_is_in_draw_mode = false;
extern bool inv_is_inside;
static uint8_t build_num_placements = 0;
static item_placement build_placements[BUILD_MAX_PLACEMENTS] = {0};
@ -14,6 +16,7 @@ void buildmode_clear_buffers(void) {
}
void buildmode_draw(void) {
if (inv_is_inside) return;
camera cam = camera_get();
camera old_cam = cam;
Vector2 mpos = GetMousePosition();

View File

@ -9,6 +9,7 @@ static ItemDrop inv_held_item = {0};
static bool inv_swap = false;
static uint8_t inv_swap_from = 0;
static uint8_t inv_swap_to = 0;
bool inv_is_inside = false;
void inventory_draw() {
inv_drop_item = false;
@ -32,6 +33,8 @@ void inventory_draw() {
float x = sx;
float y = sy;
inv_is_inside = check_mouse_area(sx, sy, 64*3, 64*3) != DAREA_OUTSIDE;
for (int32_t i = 0; i < ITEMS_INVENTORY_SIZE; i += 1) {
{
debug_area_status area = check_mouse_area(x, y, 64, 64);

View File

@ -4,6 +4,7 @@
#include "modules/components.h"
#include "modules/systems.h"
#include "world/world.h"
#include "entity.h"
#include "debug_replay.h"
@ -61,6 +62,7 @@ int32_t pkt_send_keystate_handler(pkt_header *header) {
}
}
debug_replay_record_keystate(table);
entity_wake(e);
}
return 0;