Fixed CSV Parsing on tools

This commit is contained in:
2023-01-28 21:01:30 -08:00
parent 104af8ff45
commit 9ebd4eb6ad
16 changed files with 345 additions and 18 deletions

View File

@ -30,7 +30,6 @@ set(DIR_GAME_ASSETS games/pokergame)
tool_texture(texture_test texture_test.png)
tool_language(language_en ${DIR_GAME_ASSETS}/locale/en.csv)
tool_language(language_jp ${DIR_GAME_ASSETS}/locale/jp.csv)
tool_tileset(tileset_death texture_death ${DIR_GAME_ASSETS}/characters/death/sheet.png 1 3)
@ -40,7 +39,6 @@ tool_audio(audio_test borrowed/sample_short.wav)
add_dependencies(${DAWN_TARGET_NAME}
language_en
language_jp
tileset_death

View File

@ -46,6 +46,8 @@ void TestUIScene::stage() {
auto grid = this->canvas->addElement<UIGrid>();
grid->setTransform(UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_STRETCH, glm::vec4(0, 0, 0, 0), 0);
grid->setGridSize(4, 4, 8, 8);
auto menu = new UIMenu(this->canvas, grid->getColumns(), grid->getRows());
for(int32_t x = 0; x < grid->getColumns(); x++) {
for(int32_t y = 0; y < grid->getRows(); y++) {
@ -54,6 +56,15 @@ void TestUIScene::stage() {
label->setText("test.1");
label->setFontSize(24);
grid->addToGrid(label, x, y, UI_COMPONENT_ALIGN_END, UI_COMPONENT_ALIGN_END);
auto menuItem = new TestMenuItem;
menuItem->label = label;
menu->setItem(x, y, menuItem);
}
menu->setPosition(0, 0);
this->canvas->setCurrentMenu(menu);
}
this->canvas->setCurrentMenu(menu);
}

View File

@ -12,8 +12,33 @@
#include "ui/UIGrid.hpp"
#include "ui/UISprite.hpp"
#include "prefabs/SimpleSpinningCubePrefab.hpp"
#include "ui/UIMenu.hpp"
namespace Dawn {
class TestMenuItem : public UIMenuItem {
public:
UILabel *label;
void onItemSelected() {
}
void onItemOver() {
this->label->setText("test.2");
}
void onItemOff() {
this->label->setText("test.1");
}
bool_t canBeOvered() {
return true;
}
bool_t canBeSelected() {
return true;
}
};
class TestUIScene : public Scene {
private:
Camera *camera = nullptr;