mirror of
https://github.com/xtreme8000/CavEX.git
synced 2025-01-22 09:11:55 -05:00
Show control icon if block can be used (e.g. crafting table)
This commit is contained in:
parent
ae23e479b4
commit
1b1a37b1df
1 changed files with 10 additions and 3 deletions
|
@ -370,13 +370,20 @@ static void screen_ingame_render2D(struct screen* s, int width, int height) {
|
|||
icon_offset += gutil_control_icon(icon_offset, IB_JUMP, "Jump");
|
||||
if(gstate.camera_hit.hit) {
|
||||
struct item_data item;
|
||||
if(inventory_get_hotbar_item(
|
||||
windowc_get_latest(gstate.windows[WINDOWC_INVENTORY]), &item)
|
||||
&& item_get(&item)) {
|
||||
struct block_data bd
|
||||
= world_get_block(&gstate.world, gstate.camera_hit.x,
|
||||
gstate.camera_hit.y, gstate.camera_hit.z);
|
||||
if(blocks[bd.type]->onRightClick) {
|
||||
icon_offset += gutil_control_icon(icon_offset, IB_ACTION2, "Use");
|
||||
} else if(inventory_get_hotbar_item(
|
||||
windowc_get_latest(gstate.windows[WINDOWC_INVENTORY]),
|
||||
&item)
|
||||
&& item_get(&item)) {
|
||||
icon_offset
|
||||
+= gutil_control_icon(icon_offset, IB_ACTION2,
|
||||
item_is_block(&item) ? "Place" : "Use");
|
||||
}
|
||||
|
||||
icon_offset += gutil_control_icon(icon_offset, IB_ACTION1, "Mine");
|
||||
} else {
|
||||
icon_offset += gutil_control_icon(icon_offset, IB_ACTION1, "Punch");
|
||||
|
|
Loading…
Reference in a new issue