aboutsummaryrefslogtreecommitdiff
path: root/src/client/game.cpp
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-05-11 21:40:45 +0200
committerGitHub <noreply@github.com>2020-05-11 21:40:45 +0200
commit6e1372bd894d955300c40d69e5c882e9cc7d7523 (patch)
tree6273a8c2ddfec5efbc5b69fa49b088368dd78c15 /src/client/game.cpp
parent88bb8e57e6780130df1877e7a89bb56c9561ea6a (diff)
downloadminetest-6e1372bd894d955300c40d69e5c882e9cc7d7523.tar.gz
minetest-6e1372bd894d955300c40d69e5c882e9cc7d7523.tar.bz2
minetest-6e1372bd894d955300c40d69e5c882e9cc7d7523.zip
Add support for statbar “off state” icons (#9462)
This adds support for optional “off state” icons for statbars. “off state icons” can be used to denote the lack of something, like missing hearts or bubbles. Add "off state" textures to the builtin statbars. Co-authored-by: SmallJoker <mk939@ymail.com>
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r--src/client/game.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index 4d7a85526..422e17d4f 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -2672,6 +2672,7 @@ void Game::handleClientEvent_HudAdd(ClientEvent *event, CameraOrientation *cam)
delete event->hudadd.offset;
delete event->hudadd.world_pos;
delete event->hudadd.size;
+ delete event->hudadd.text2;
return;
}
@@ -2689,6 +2690,7 @@ void Game::handleClientEvent_HudAdd(ClientEvent *event, CameraOrientation *cam)
e->world_pos = *event->hudadd.world_pos;
e->size = *event->hudadd.size;
e->z_index = event->hudadd.z_index;
+ e->text2 = *event->hudadd.text2;
hud_server_to_client[server_id] = player->addHud(e);
delete event->hudadd.pos;
@@ -2699,6 +2701,7 @@ void Game::handleClientEvent_HudAdd(ClientEvent *event, CameraOrientation *cam)
delete event->hudadd.offset;
delete event->hudadd.world_pos;
delete event->hudadd.size;
+ delete event->hudadd.text2;
}
void Game::handleClientEvent_HudRemove(ClientEvent *event, CameraOrientation *cam)
@@ -2771,6 +2774,10 @@ void Game::handleClientEvent_HudChange(ClientEvent *event, CameraOrientation *ca
case HUD_STAT_Z_INDEX:
e->z_index = event->hudchange.data;
break;
+
+ case HUD_STAT_TEXT2:
+ e->text2 = *event->hudchange.sdata;
+ break;
}
delete event->hudchange.v3fdata;