From 45b13d898c7dd1fbdb5194fea058e8ab6114a737 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Tue, 18 Jan 2022 13:52:37 +0100 Subject: [PATCH] basic status screen by pressing F6 --- CMakeLists.txt | 1 + assets-cg/fxconv-metadata.txt | 10 +--------- assets-cg/hud_stars.png | Bin 0 -> 275 bytes src/main.c | 36 +++++++++++++++++++++++++++++++--- 4 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 assets-cg/hud_stars.png diff --git a/CMakeLists.txt b/CMakeLists.txt index a48cf7c..8ac93d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ set(ASSETS # HUD assets-cg/hud.png assets-cg/hud_life.png + assets-cg/hud_stars.png assets-cg/hud_window.png assets-cg/hud_xp.png assets-cg/skillicons.png diff --git a/assets-cg/fxconv-metadata.txt b/assets-cg/fxconv-metadata.txt index c18c6d3..5f2a435 100644 --- a/assets-cg/fxconv-metadata.txt +++ b/assets-cg/fxconv-metadata.txt @@ -3,15 +3,7 @@ name_regex: (.*)\.png img_\1 profile: p8 -hud.png: - profile: p4 -hud_life.png: - profile: p4 -hud_window.png: - profile: p4 -hud_xp.png: - profile: p4 -skillicons.png: +hud*.png: profile: p4 font_rogue.png: diff --git a/assets-cg/hud_stars.png b/assets-cg/hud_stars.png new file mode 100644 index 0000000000000000000000000000000000000000..36339d9d2bffbdc04d569bf93372693a94db7231 GIT binary patch literal 275 zcmV+u0qp*XP)Px#%}GQ-R7i>4l_3rSK@3IzOy&-YB?wr7BS?b5z)d(1Hvxko$PErLyMkbMP63M9 zrlGsYAHHgSUuyc(0!pj(=B2%FV&c38QfdbWvT;rtDYdy#6r)^UFK22l$cB{mnK=gl z({gUEv59y0sad&RP!3||JYZi2?Xz+L=<=mkXyucY`!78o`=6c;6X!J$>uPWy8|S1E z>nb+vLU5?X3hb?>9{c0xZU0IMPTK6K{<$-^MHLBw9m=~pv#wDp_NZI Z?hVl!x1asG0DJ%d002ovPDHLkV1lKVaPI&B literal 0 HcmV?d00001 diff --git a/src/main.c b/src/main.c index 17bd805..96bfec5 100644 --- a/src/main.c +++ b/src/main.c @@ -191,9 +191,39 @@ int main(void) render_window(48, 24, 300, 154); extern font_t font_rogue; font_t const *old_font = dfont(&font_rogue); - dprint(54, 40, C_WHITE, "Player"); - dprint(54, 55, C_WHITE, "HP:%d ATK:%d MAG:%d DEF:%d", - player_f->HP_max, player_f->ATK, player_f->MAG, player_f->DEF); + anim_frame_render(62, 50, anims_player_Idle.start[RIGHT]); + dprint(74, 39, C_WHITE, "Rogue"); + dprint(60, 58, C_WHITE, "Level %d", player_data.xp_level); + dprint(60, 72, C_WHITE, "XP to next level: %d/%d", + player_data.xp_current, player_data.xp_to_next_level); + dprint(60, 93, C_WHITE, "HP"); + dprint(100, 93, C_WHITE, "%d/%d", player_f->HP, player_f->HP_max);; + dprint(60, 108, C_WHITE, "ATK"); + dprint(100, 108, C_WHITE, "%d", player_f->ATK); + dprint(60, 123, C_WHITE, "MAG"); + dprint(100, 123, C_WHITE, "%d", player_f->MAG); + dprint(60, 138, C_WHITE, "DEF"); + dprint(100, 138, C_WHITE, "%d", player_f->DEF); + + extern bopti_image_t img_hud_stars; + int w = img_hud_stars.width; + int h = img_hud_stars.height / 2; + dsubimage(182, 94, &img_hud_stars, 0, 0, w, h, DIMAGE_NONE); + dsubimage(182, 94, &img_hud_stars, 0, h+1, + w * player_data.stat_model.HP / fix(5.0), h, + DIMAGE_NONE); + dsubimage(182, 109, &img_hud_stars, 0, 0, w, h, DIMAGE_NONE); + dsubimage(182, 109, &img_hud_stars, 0, h+1, + w * player_data.stat_model.ATK / fix(5.0), h, + DIMAGE_NONE); + dsubimage(182, 124, &img_hud_stars, 0, 0, w, h, DIMAGE_NONE); + dsubimage(182, 124, &img_hud_stars, 0, h+1, + w * player_data.stat_model.MAG / fix(5.0), h, + DIMAGE_NONE); + dsubimage(182, 139, &img_hud_stars, 0, 0, w, h, DIMAGE_NONE); + dsubimage(182, 139, &img_hud_stars, 0, h+1, + w * player_data.stat_model.DEF / fix(5.0), h, + DIMAGE_NONE); dfont(old_font); } else if(menu_inventory_open) {