diff options
author | jacopo grandi <jak.sk8@hotmail.it> | 2021-02-25 12:46:55 +0100 |
---|---|---|
committer | jacopo grandi <jak.sk8@hotmail.it> | 2021-02-25 12:46:55 +0100 |
commit | 23550f8120ebb41b1732d63d6d09c21bdb314c1a (patch) | |
tree | 671fc42497488769a7d747b25bed37aa5aaeed88 /hud | |
parent | dad432566a5c74f86dc4ba874e631115e0f469d1 (diff) |
component representation revolution! Vive la révolution
Diffstat (limited to 'hud')
-rw-r--r-- | hud/hud.c | 30 | ||||
-rw-r--r-- | hud/hud_views.c | 11 |
2 files changed, 33 insertions, 8 deletions
@@ -778,12 +778,30 @@ void hud_render_sel (hud_sel *sc, MKb *mkb, info_unit *u, SDL_RenderFillRect(rend, &r); SDL_SetRenderDrawColor(rend, 0, 0, 0, 255); SDL_RenderDrawRect(rend, &r); - if (sel==0) render_view_chassis(rend, t, x, y, info, i, 0, sprites); - if (sel==1) render_view_battery(rend, t, x, y, info, i, 0); - if (sel==2) render_view_armor_detail(rend, t, x, y, info, i, 0); - if (sel==3) render_view_weapon_detail(rend, t, x, y, info, i, 0); - if (sel==4) render_view_aug_detail(rend, t, x, y, info, i, 0); - if (sel==5) render_view_brain(rend, t, x, y, info, i, 0); + if (sel==0) { + int lvl = u->levels[LEVEL_CHASSIS]; + render_view_chassis(rend, t, x, y, info, i, lvl, sprites); + } + if (sel==1) { + int lvl = u->levels[LEVEL_BATTERY]; + render_view_battery(rend, t, x, y, info, i, lvl); + } + if (sel==2) { + int lvl = u->levels[LEVEL_ARMOR+ind]; + render_view_armor_detail(rend, t, x, y, info, i, lvl); + } + if (sel==3) { + int lvl = u->levels[LEVEL_WEAPONS+ind]; + render_view_weapon_detail(rend, t, x, y, info, i, lvl); + } + if (sel==4) { + int lvl = u->levels[LEVEL_AUGS+ind]; + render_view_aug_detail(rend, t, x, y, info, i, lvl); + } + if (sel==5) { + int lvl = u->levels[LEVEL_BRAIN]; + render_view_brain(rend, t, x, y, info, i, lvl); + } } SDL_RenderSetClipRect(rend, NULL); } diff --git a/hud/hud_views.c b/hud/hud_views.c index 86e0722..c767e68 100644 --- a/hud/hud_views.c +++ b/hud/hud_views.c @@ -12,13 +12,20 @@ #define LABEL_F3(x, y, s, q, v, d) {\ float p[2]={x,y}; char ss[64]; \ - sprintf(ss, "%s: %."#q"f %."#q"f %."#q"f", s, v[0], v[1], v[2]);\ + if (lvl == 0) \ + sprintf(ss, "%s: (%."#q"f) %."#q"f %."#q"f", s, v[0], v[1], v[2]);\ + if (lvl == 1) \ + sprintf(ss, "%s: %."#q"f (%."#q"f) %."#q"f", s, v[0], v[1], v[2]);\ + if (lvl == 2) \ + sprintf(ss, "%s: %."#q"f %."#q"f (%."#q"f)", s, v[0], v[1], v[2]);\ render_text_scaled(rend, ss, p, t, d);\ } #define LABEL_I3(x, y, s, v, d) {\ float p[2]={x,y}; char ss[64]; \ - sprintf(ss, "%s: %d %d %d", s, v[0], v[1], v[2]);\ + if (lvl == 0) sprintf(ss, "%s: (%d) %d %d", s, v[0], v[1], v[2]);\ + if (lvl == 1) sprintf(ss, "%s: %d (%d) %d", s, v[0], v[1], v[2]);\ + if (lvl == 2) sprintf(ss, "%s: %d %d (%d)", s, v[0], v[1], v[2]);\ render_text_scaled(rend, ss, p, t, 1);\ } |