mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-24 03:29:22 +01:00
changin image preview with plus button
This commit is contained in:
parent
85cc152ca9
commit
73cd9b9c74
@ -949,8 +949,15 @@ static int MenuGameSelection()
|
||||
gameBrowser.SetPosition(20, 98);
|
||||
ResetBrowser();
|
||||
|
||||
GuiTrigger trigPlusMinus;
|
||||
trigPlusMinus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, PAD_TRIGGER_Z, WIIDRC_BUTTON_PLUS);
|
||||
|
||||
GuiImage bgPreview(&bgPreviewImg);
|
||||
bgPreview.SetPosition(365, 98);
|
||||
GuiButton bgPreviewBtn(bgPreview.GetWidth(), bgPreview.GetHeight());
|
||||
bgPreviewBtn.SetImage(&bgPreview);
|
||||
bgPreviewBtn.SetPosition(365, 98);
|
||||
bgPreviewBtn.SetTrigger(&trigPlusMinus);
|
||||
int previousPreviewImg = GCSettings.PreviewImage;
|
||||
|
||||
GuiImage preview;
|
||||
preview.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
@ -965,7 +972,7 @@ static int MenuGameSelection()
|
||||
mainWindow->Append(&titleTxt);
|
||||
mainWindow->Append(&gameBrowser);
|
||||
mainWindow->Append(&buttonWindow);
|
||||
mainWindow->Append(&bgPreview);
|
||||
mainWindow->Append(&bgPreviewBtn);
|
||||
mainWindow->Append(&preview);
|
||||
ResumeGui();
|
||||
|
||||
@ -1039,9 +1046,10 @@ static int MenuGameSelection()
|
||||
}
|
||||
|
||||
//update gamelist image
|
||||
if(previousBrowserIndex != browser.selIndex)
|
||||
if(previousBrowserIndex != browser.selIndex || previousPreviewImg != GCSettings.PreviewImage)
|
||||
{
|
||||
previousBrowserIndex = browser.selIndex;
|
||||
previousPreviewImg = GCSettings.PreviewImage;
|
||||
snprintf(imagePath, MAXJOLIET, "%s%s/%s.png", pathPrefix[GCSettings.LoadMethod], ImageFolder(), browserList[browser.selIndex].displayname);
|
||||
|
||||
AllocSaveBuffer();
|
||||
@ -1069,6 +1077,11 @@ static int MenuGameSelection()
|
||||
menu = MENU_SETTINGS;
|
||||
else if(exitBtn.GetState() == STATE_CLICKED)
|
||||
ExitRequested = 1;
|
||||
else if(bgPreviewBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
GCSettings.PreviewImage = (GCSettings.PreviewImage + 1) % 3;
|
||||
bgPreviewBtn.ResetState();
|
||||
}
|
||||
}
|
||||
|
||||
HaltParseThread(); // halt parsing
|
||||
@ -1077,7 +1090,7 @@ static int MenuGameSelection()
|
||||
mainWindow->Remove(&titleTxt);
|
||||
mainWindow->Remove(&buttonWindow);
|
||||
mainWindow->Remove(&gameBrowser);
|
||||
mainWindow->Remove(&bgPreview);
|
||||
mainWindow->Remove(&bgPreviewBtn);
|
||||
mainWindow->Remove(&preview);
|
||||
MEM_DEALLOC(imgBuffer);
|
||||
return menu;
|
||||
|
Loading…
Reference in New Issue
Block a user