From cc874888cc3770374e75d8d71f24ddd3fb66ef62 Mon Sep 17 00:00:00 2001 From: Doyle Thai Date: Sat, 20 Aug 2016 14:24:42 +1000 Subject: [PATCH] Add spacing in debug display stack, center all button text --- src/Debug.c | 5 +++++ src/UserInterface.c | 14 ++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Debug.c b/src/Debug.c index 180636e..408add6 100644 --- a/src/Debug.c +++ b/src/Debug.c @@ -422,12 +422,14 @@ void debug_drawUi(GameState *state, f32 dt) DEBUG_PUSH_STRING(" [: Spawn a mob"); DEBUG_PUSH_STRING(": Switch UI element"); DEBUG_PUSH_STRING(": Close program"); + DEBUG_PUSH_STRING(""); DEBUG_PUSH_STRING("== Config == "); DEBUG_PUSH_VAR("Toggle World Audio: %d", state->config.playWorldAudio, "i32"); DEBUG_PUSH_VAR("Toggle Debug Display: %d", state->config.showDebugDisplay, "i32"); + DEBUG_PUSH_STRING(""); DEBUG_PUSH_STRING("== Hero Properties == "); DEBUG_PUSH_VAR("Hero Pos: %06.2f, %06.2f", hero->pos, "v2"); @@ -438,6 +440,7 @@ void debug_drawUi(GameState *state, f32 dt) char *heroQueuedAttackStr = debug_entityattack_string(hero->stats->queuedAttack); DEBUG_PUSH_VAR("Hero QueuedAttack: %s", *heroQueuedAttackStr, "char"); + DEBUG_PUSH_STRING(""); DEBUG_PUSH_STRING("== State Properties == "); DEBUG_PUSH_VAR("FreeEntityIndex: %d", world->freeEntityIndex, "i32"); @@ -449,6 +452,7 @@ void debug_drawUi(GameState *state, f32 dt) DEBUG_PUSH_VAR("TotalMemoryAllocated: %db", debug_bAllocated, "i32"); i32 debug_kbAllocated = state->arena.bytesAllocated / 1024; DEBUG_PUSH_VAR("TotalMemoryAllocated: %dkb", debug_kbAllocated, "i32"); + DEBUG_PUSH_STRING(""); AudioManager *audioManager = &state->audioManager; DEBUG_PUSH_STRING("== Audio System =="); @@ -459,6 +463,7 @@ void debug_drawUi(GameState *state, f32 dt) audioManager->sourceList[i].isFree); DEBUG_PUSH_VAR("Source ID[%02.0f].id[%02.0f].isFree: %1.0f", tmp, "v3"); } + DEBUG_PUSH_STRING(""); DEBUG_PUSH_STRING("== EntityIDs in Battle List == "); DEBUG_PUSH_VAR("NumEntitiesInBattle: %d", world->numEntitiesInBattle, diff --git a/src/UserInterface.c b/src/UserInterface.c index 41db0b1..966aafc 100644 --- a/src/UserInterface.c +++ b/src/UserInterface.c @@ -65,15 +65,13 @@ i32 userInterface_button(UiState *const uiState, { v2 labelDim = asset_stringDimInPixels(font, label); v2 labelPos = rect.pos; - if (labelDim.w < rect.size.w) - { - // Initially position the label to half the width of the button - labelPos.x += (rect.size.w * 0.5f); - // Move the label pos back half the length of the string (i.e. - // center it) - labelPos.x -= (CAST(f32)labelDim.w * 0.5f); - } + // Initially position the label to half the width of the button + labelPos.x += (rect.size.w * 0.5f); + + // Move the label pos back half the length of the string (i.e. + // center it) + labelPos.x -= (CAST(f32) labelDim.w * 0.5f); if (labelDim.h < rect.size.h) {