From 143bf1bffa9e1df1a52199125a0045b8d53dead5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Sun, 16 Oct 2022 13:10:21 +0200 Subject: [PATCH] dont show item proxies in item spawner --- code/foundation/src/debug/debug_ui_actions.c | 6 ++++-- code/foundation/src/lists/items_list.c | 2 +- code/foundation/src/models/items.c | 8 ++++++++ code/foundation/src/models/items.h | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/foundation/src/debug/debug_ui_actions.c b/code/foundation/src/debug/debug_ui_actions.c index c27433d..ed6185b 100644 --- a/code/foundation/src/debug/debug_ui_actions.c +++ b/code/foundation/src/debug/debug_ui_actions.c @@ -25,7 +25,8 @@ void ActSpawnItemPrev(void) { while (true) { --sel_item_id; - if (sel_item_id > 0 && item_find(sel_item_id) != ASSET_INVALID) { + item_id id = item_find_no_proxy(sel_item_id); + if (sel_item_id > 0 && id != ASSET_INVALID && (item_get_usage(id) != UKIND_PROXY)) { break; } } @@ -35,7 +36,8 @@ void ActSpawnItemNext(void) { while (true) { ++sel_item_id; - if (sel_item_id > 0 && item_find(sel_item_id) != ASSET_INVALID) { + item_id id = item_find_no_proxy(sel_item_id); + if (sel_item_id > 0 && id != ASSET_INVALID && (item_get_usage(id) != UKIND_PROXY)) { break; } } diff --git a/code/foundation/src/lists/items_list.c b/code/foundation/src/lists/items_list.c index b864ef6..e380e10 100644 --- a/code/foundation/src/lists/items_list.c +++ b/code/foundation/src/lists/items_list.c @@ -7,7 +7,7 @@ static item_desc items[] = { ITEM_INGREDIENT(ASSET_COAL, 64, ASSET_FURNACE, ASSET_BELT, 0), ITEM_SELF(ASSET_FENCE, 64), ITEM_ENERGY(ASSET_WOOD, ASSET_FURNACE, 64, 15.0f), - ITEM_HOLD(ASSET_TREE, 64), + ITEM_SELF(ASSET_TREE, 64), ITEM_SELF(ASSET_TEST_TALL, 64), // ITEM_BLUEPRINT(ASSET_BLUEPRINT, 1, 4, 4, "]]]]]CF] ]]]]]"), diff --git a/code/foundation/src/models/items.c b/code/foundation/src/models/items.c index 8b9e649..6d6d6e1 100644 --- a/code/foundation/src/models/items.c +++ b/code/foundation/src/models/items.c @@ -77,6 +77,14 @@ item_id item_find(asset_id kind) { return ASSET_INVALID; } +item_id item_find_no_proxy(asset_id kind) { + for (item_id i=0; i