Add unit recruiting

This commit is contained in:
2024-02-05 10:11:54 +01:00
parent ba293b15d9
commit 18dd3e2226
8 changed files with 122 additions and 22 deletions

View File

@@ -257,6 +257,9 @@ void uiGameBuild(const char *label, Rectangle rec, Texture2D tex, bool canAfford
.semanticSize[BZ_UI_AXIS_X] = {BZ_UI_SIZE_CHILD_MAX},
.semanticSize[BZ_UI_AXIS_Y] = {BZ_UI_SIZE_CHILD_SUM},
});
if (rec.height > 16)
rec.y += 16;
rec.height = rec.width;
BzUIInteraction inter = bzUIGetInteraction(UI, btn);
@@ -323,6 +326,9 @@ void uiGameBuild(const char *label, Rectangle rec, Texture2D tex, bool canAfford
bzUIPopParent(UI);
}
bool uiGameUnit(const char *label, i32 count, Rectangle rec, Texture2D tex) {
if (rec.height > 16)
rec.y += 16;
rec.height = rec.width;
f32 scl = uiGetScale();
BzUINode *btn = bzUINodeMake(UI, bzUIKeyFromString(label), &(BzUINodeDesc) {
.flags = BZ_UI_CLICKABLE | BZ_UI_ALIGN_CENTER | BZ_UI_DRAW_BORDER,