basic status screen by pressing F6

This commit is contained in:
Lephenixnoir 2022-01-18 13:52:37 +01:00
parent 65b23e83f2
commit 45b13d898c
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
4 changed files with 35 additions and 12 deletions

View File

@ -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

View File

@ -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:

BIN
assets-cg/hud_stars.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

View File

@ -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) {