Added image UI element.

This commit is contained in:
2021-09-02 10:10:00 -07:00
parent 5c4fc01b43
commit c2aea93766
17 changed files with 215 additions and 45 deletions

View File

@ -35,7 +35,7 @@ void pokerDiscussionGet(
// Round Start Conversations
case POKER_DISCUSSION_REASON_BLINDS_TAKEN:
discussion->count++;
discussion->messages[0] = "Blinds have been taken.";
discussion->messages[0] = "Blinds\nhave been taken.";
discussion->players[0] = POKER_DEALER_INDEX;
discussion->emotions[0] = VN_CHARACTER_EMOTION_BORED;
break;

View File

@ -7,8 +7,7 @@
#include "pokergame.h"
menu_t menu;
frame_t frame;
menulist_t ml;
bool pokerGameInit(game_t *game) {
pokergame_t *pokerGame = &game->pokerGame;
@ -32,18 +31,10 @@ bool pokerGameInit(game_t *game) {
pokerGameActionStartAdd(pokerGame);
queueNext(&pokerGame->scene.conversation.actionQueue);
frameInit(&frame);
frame.texture = &pokerGame->assets.testTexture;
menuitem_t *item;
menuInit(&menu);
item = menuAdd(&menu);
item->x = 0;
item->y = 0;
item = menuAdd(&menu);
item->x = 1;
item->y = 0;
// TESTING
menuListInit(&ml, &pokerGame->assets.testTexture);
menuListAdd(&ml, &pokerGame->assets.font, "One");
menuListAdd(&ml, &pokerGame->assets.font, "Two");
return true;
}
@ -68,21 +59,8 @@ void pokerGameUpdate(game_t *game) {
vnSceneRenderGui(&pokerGame->scene, &game->engine, &pokerGame->assets.shader);
pokerUiRender(pokerGame);
uint8_t i;
menuUpdate(&menu, &game->engine);
for(i = 0; i < menu.itemCount; i++) {
menuitem_t *item = menu.items + i;
frame.x = (float)item->x * (FRAME_BORDER_SIZE + FRAME_BORDER_SIZE);
frame.y = (float)item->y * (FRAME_BORDER_SIZE + FRAME_BORDER_SIZE);
if(menu.selected == i) frame.y -= FRAME_BORDER_SIZE;
frameSetSize(&frame,
(float)item->width * (FRAME_BORDER_SIZE + FRAME_BORDER_SIZE),
(float)item->height * (FRAME_BORDER_SIZE + FRAME_BORDER_SIZE)
);
frameRender(&frame, &pokerGame->assets.shader);
}
menuListUpdate(&ml, &game->engine);
menuListRender(&ml, &game->pokerGame.assets.shader);
}
void pokerGameDispose(game_t *game) {

View File

@ -17,8 +17,7 @@
#include "pokerworld.h"
#include "actions/start.h"
#include "../../ui/menu.h"
#include "../../ui/frame.h"
#include "../../ui/menulist.h"
/**
* Initializes the game state for the poker game.