mirror of
https://github.com/risingPhil/PokeMe64.git
synced 2026-04-25 07:26:57 -05:00
Feature/add icons to selectfilescene (#9)
* Create PokemonPartyIconWidget for displaying the party menu icon in the distribution event pokemon menu (untested)
* Integrate PokemonPartyIconWidget into the DistributionPokemonListScene
* Do some visual changes to the DistributionPokemonListScene
* Revert "Undo README.md changes because they were already shown in github after merging the feature branch"
This reverts commit dc8d9bb00d.
* Update docs
* Add file and folder icon to SelectFileScene
This commit is contained in:
parent
5f353d6a1c
commit
d3b11b90d5
|
|
@ -4,7 +4,7 @@ This project lets you acquire past Distribution Event Pokémon in Gen1/Gen2 Pok
|
|||
|
||||
The rom is based on [libpokemegb](https://github.com/risingPhil/libpokemegb) and [libdragon](https://github.com/DragonMinded/libdragon).
|
||||
|
||||

|
||||

|
||||
|
||||
Right now the UI is still barebones. I aim to improve this in future versions.
|
||||
|
||||
|
|
|
|||
BIN
assets/ui-icon-file.png
Normal file
BIN
assets/ui-icon-file.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
BIN
assets/ui-icon-folder.png
Normal file
BIN
assets/ui-icon-folder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
BIN
docs/images/screen8.png
Normal file
BIN
docs/images/screen8.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
|
|
@ -52,6 +52,8 @@ private:
|
|||
sprite_t* dialogWidgetBackgroundSprite_;
|
||||
sprite_t* uiArrowUpSprite_;
|
||||
sprite_t* uiArrowDownSprite_;
|
||||
sprite_t* uiIconFile_;
|
||||
sprite_t* uiIconDirectory_;
|
||||
bool bButtonPressed_;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ typedef struct FileBrowserWidgetStyle
|
|||
MenuItemStyle itemStyle;
|
||||
ImageWidgetStyle scrollArrowUpStyle;
|
||||
ImageWidgetStyle scrollArrowDownStyle;
|
||||
sprite_t* fileIconSprite;
|
||||
sprite_t* directoryIconSprite;
|
||||
} FileBrowserWidgetStyle;
|
||||
|
||||
typedef struct FileBrowserWidgetStatus
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ SelectFileScene::SelectFileScene(SceneDependencies& deps, void* context)
|
|||
, dialogWidgetBackgroundSprite_(nullptr)
|
||||
, uiArrowUpSprite_(nullptr)
|
||||
, uiArrowDownSprite_(nullptr)
|
||||
, uiIconFile_(nullptr)
|
||||
, uiIconDirectory_(nullptr)
|
||||
, bButtonPressed_(false)
|
||||
{
|
||||
}
|
||||
|
|
@ -51,6 +53,8 @@ void SelectFileScene::init()
|
|||
dialogWidgetBackgroundSprite_ = sprite_load("rom://menu-bg-9slice.sprite");
|
||||
uiArrowUpSprite_ = sprite_load("rom://ui-arrow-up.sprite");
|
||||
uiArrowDownSprite_ = sprite_load("rom://ui-arrow-down.sprite");
|
||||
uiIconFile_ = sprite_load("rom://ui-icon-file.sprite");
|
||||
uiIconDirectory_ = sprite_load("rom://ui-icon-folder.sprite");
|
||||
|
||||
SceneWithDialogWidget::init();
|
||||
|
||||
|
|
@ -69,7 +73,10 @@ void SelectFileScene::init()
|
|||
}
|
||||
},
|
||||
.itemStyle = {
|
||||
.size = {280, 16},
|
||||
.size = {280, 20},
|
||||
.icon = {
|
||||
.spriteBounds = { 5, 2, 16, 16}
|
||||
},
|
||||
.titleNotFocused = {
|
||||
.fontId = arialId_,
|
||||
.fontStyleId = fontStyleWhiteId_
|
||||
|
|
@ -78,8 +85,8 @@ void SelectFileScene::init()
|
|||
.fontId = arialId_,
|
||||
.fontStyleId = fontStyleYellowId_
|
||||
},
|
||||
.leftMargin = 10,
|
||||
.topMargin = 1
|
||||
.leftMargin = 24,
|
||||
.topMargin = 4
|
||||
},
|
||||
.scrollArrowUpStyle = {
|
||||
.image = {
|
||||
|
|
@ -92,7 +99,9 @@ void SelectFileScene::init()
|
|||
.sprite = uiArrowDownSprite_,
|
||||
.spriteBounds = Rectangle{0, 0, uiArrowDownSprite_->width, uiArrowDownSprite_->height}
|
||||
}
|
||||
}
|
||||
},
|
||||
.fileIconSprite = uiIconFile_,
|
||||
.directoryIconSprite = uiIconDirectory_
|
||||
};
|
||||
|
||||
setFocusChain(&fileBrowserFocusSegment_);
|
||||
|
|
@ -107,6 +116,18 @@ void SelectFileScene::destroy()
|
|||
{
|
||||
SceneWithDialogWidget::destroy();
|
||||
|
||||
if(uiIconDirectory_)
|
||||
{
|
||||
sprite_free(uiIconDirectory_);
|
||||
uiIconDirectory_ = nullptr;
|
||||
}
|
||||
|
||||
if(uiIconFile_)
|
||||
{
|
||||
sprite_free(uiIconFile_);
|
||||
uiIconFile_ = nullptr;
|
||||
}
|
||||
|
||||
if(dialogWidgetBackgroundSprite_)
|
||||
{
|
||||
sprite_free(dialogWidgetBackgroundSprite_);
|
||||
|
|
|
|||
|
|
@ -277,6 +277,8 @@ void FileBrowserWidget::loadDirectoryItems()
|
|||
itemData.context = this;
|
||||
itemData.itemParam = titleString;
|
||||
|
||||
itemStyle.icon.sprite = (dirEnt.d_type == DT_REG) ? style_.fileIconSprite : style_.directoryIconSprite;
|
||||
|
||||
itemWidget = new MenuItemWidget();
|
||||
itemWidget->setData(itemData);
|
||||
itemWidget->setStyle(itemStyle);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user