Mercurial > molko
diff src/libmlk-rpg/rpg/battle-entity.c @ 398:14ce7c4871e3
rpg: overhaul of battle bar
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 27 Feb 2022 10:08:51 +0100 |
parents | b944cd41e8f9 |
children | 8f59201dc76b |
line wrap: on
line diff
--- a/src/libmlk-rpg/rpg/battle-entity.c Fri Feb 18 16:16:38 2022 +0100 +++ b/src/libmlk-rpg/rpg/battle-entity.c Sun Feb 27 10:08:51 2022 +0100 @@ -32,14 +32,14 @@ static void draw_name(const struct battle_entity *et, const struct battle *bt) { - struct theme theme; struct label label = et->name; - if (et == bt->order_cur) { - theme_shallow(&theme, bt->theme); - label.theme = &theme; - theme.colors[THEME_COLOR_NORMAL] = theme.colors[THEME_COLOR_SELECTED]; - } + label.theme = BATTLE_THEME(bt); + + if (et == battle_current(bt)) + label.flags |= LABEL_FLAGS_SELECTED; + else + label.flags &= ~LABEL_FLAGS_SELECTED; label_draw(&label); }