diff libmlk-rpg/mlk/rpg/battle-bar-default.c @ 505:6100c643dba0

ui: finally ditch theme
author David Demelier <markand@malikania.fr>
date Wed, 01 Mar 2023 16:24:07 +0100
parents 52a305833381
children
line wrap: on
line diff
--- a/libmlk-rpg/mlk/rpg/battle-bar-default.c	Wed Mar 01 14:07:10 2023 +0100
+++ b/libmlk-rpg/mlk/rpg/battle-bar-default.c	Wed Mar 01 16:24:07 2023 +0100
@@ -30,7 +30,6 @@
 #include <mlk/core/window.h>
 
 #include <mlk/ui/align.h>
-#include <mlk/ui/theme.h>
 
 #include "battle-bar-default.h"
 #include "battle-bar.h"
@@ -141,6 +140,7 @@
 static void
 switch_selection_spell(struct battle_bar_default *bar, struct battle *bt)
 {
+#if 0
 	const struct character *ch = battle_current(bt)->ch;
 	const struct spell *sp = ch->spells[bar->grid.selected];
 	struct selection sel = {0};
@@ -157,11 +157,13 @@
 	/* A cursor should be present. */
 	if (!mlk_sprite_ok(BATTLE_THEME(bt)->sprites[MLK_THEME_SPRITE_CURSOR]))
 		mlk_tracef("battle: no cursor sprite in theme");
+#endif
 }
 
 static void
 switch_selection_item(struct battle *bt)
 {
+#if 0
 	const struct selection slt = {
 		.allowed_kinds = SELECTION_KIND_ONE,
 		.allowed_sides = SELECTION_SIDE_TEAM | SELECTION_SIDE_ENEMY,
@@ -170,6 +172,7 @@
 	};
 
 	battle_state_selection(bt, &slt);
+#endif
 }
 
 /*
@@ -180,15 +183,16 @@
 static void
 draw_help(const struct battle_bar_default *bar, const char *what)
 {
+#if 0
 	struct mlk_label label = {0};
 	unsigned int lw = 0, lh = 0;
 
-	label.flags = MLK_LABEL_FLAGS_SHADOW;
 	label.text = what;
 	mlk_label_query(&label, &lw, &lh);
 	label.x = bar->grid.x + (bar->grid.w / 2) - (lw / 2);
 	label.y = bar->grid.y - lh - THEME(bar)->padding;
 	mlk_label_draw(&label);
+#endif
 }
 
 static void
@@ -228,6 +232,7 @@
                             int y,
                             unsigned int h)
 {
+#if 0
 	const struct mlk_theme *theme = THEME(bar);
 	struct mlk_label label;
 	unsigned int spacing, lw, lh;
@@ -264,6 +269,7 @@
 
 	/* Status. */
 	/* TODO: list all status. */
+#endif
 }
 
 static void
@@ -317,6 +323,7 @@
 static void
 draw_menu(const struct battle_bar_default *bar, const struct geo *geo)
 {
+#if 0
 	struct {
 		unsigned int w, h;
 		enum mlk_align align;
@@ -326,28 +333,24 @@
 			.align = MLK_ALIGN_TOP,
 			.label = {
 				.text = "Attack",
-				.flags = MLK_LABEL_FLAGS_SHADOW
 			}
 		},
 		{
 			.align = MLK_ALIGN_RIGHT,
 			.label = {
 				.text = "Magic",
-				.flags = MLK_LABEL_FLAGS_SHADOW
 			}
 		},
 		{
 			.align = MLK_ALIGN_BOTTOM,
 			.label = {
 				.text = "Objects",
-				.flags = MLK_LABEL_FLAGS_SHADOW
 			}
 		},
 		{
 			.align = MLK_ALIGN_LEFT,
 			.label = {
 				.text = "Special",
-				.flags = MLK_LABEL_FLAGS_SHADOW
 			}
 		}
 	};
@@ -386,6 +389,7 @@
 		    bx, by, bw, bh);
 		mlk_label_draw(&buttons[i].label);
 	}
+#endif
 }
 
 /*
@@ -528,6 +532,7 @@
 void
 battle_bar_default_init(struct battle_bar_default *bar)
 {
+#if 0
 	assert(bar);
 
 	struct geo geo[2];
@@ -544,6 +549,7 @@
 	mlk_gridmenu_init(&bar->grid, 2, 2, NULL, 0);
 	mlk_gridmenu_resize(&bar->grid, bar->x, geo[0].y, geo[1].w, bar->h);
 	bar->grid.theme = bar->theme;
+#endif
 }
 
 void