mirror of
https://github.com/wiiu-env/launchiine.git
synced 2024-11-21 17:29:18 +01:00
Drag&Drop support for multiple screens
This commit is contained in:
parent
0776a13841
commit
11c295b2b5
@ -88,8 +88,12 @@ GuiIconGrid::GuiIconGrid(int32_t w, int32_t h, uint64_t GameIndex,bool sortByNam
|
||||
arrowLeftButton.setTrigger(&touchTrigger);
|
||||
arrowLeftButton.setTrigger(&wpadTouchTrigger);
|
||||
arrowLeftButton.setTrigger(&buttonLTrigger);
|
||||
arrowLeftButton.setHoldable(true);
|
||||
arrowLeftButton.setSoundClick(buttonClickSound);
|
||||
arrowLeftButton.clicked.connect(this, &GuiIconGrid::OnLeftArrowClick);
|
||||
arrowLeftButton.held.connect(this, &GuiIconGrid::OnLeftArrowHeld);
|
||||
arrowLeftButton.released.connect(this, &GuiIconGrid::OnLeftArrowReleased);
|
||||
|
||||
append(&arrowLeftButton);
|
||||
|
||||
arrowRightButton.setImage(&arrowRightImage);
|
||||
@ -99,8 +103,11 @@ GuiIconGrid::GuiIconGrid(int32_t w, int32_t h, uint64_t GameIndex,bool sortByNam
|
||||
arrowRightButton.setTrigger(&touchTrigger);
|
||||
arrowRightButton.setTrigger(&wpadTouchTrigger);
|
||||
arrowRightButton.setTrigger(&buttonRTrigger);
|
||||
arrowRightButton.setHoldable(true);
|
||||
arrowRightButton.setSoundClick(buttonClickSound);
|
||||
arrowRightButton.clicked.connect(this, &GuiIconGrid::OnRightArrowClick);
|
||||
arrowRightButton.held.connect(this, &GuiIconGrid::OnRightArrowHeld);
|
||||
arrowRightButton.released.connect(this, &GuiIconGrid::OnRightArrowReleased);
|
||||
append(&arrowRightButton);
|
||||
|
||||
// at most we are rendering 2 screens at the same time
|
||||
@ -222,14 +229,14 @@ void GuiIconGrid::OnGameTitleListUpdated(GameList * gameList) {
|
||||
}
|
||||
|
||||
void GuiIconGrid::OnLeftArrowClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
||||
//setSelectedGame(0);
|
||||
curPage--;
|
||||
setSelectedGame(0);
|
||||
bUpdatePositions = true;
|
||||
}
|
||||
|
||||
void GuiIconGrid::OnRightArrowClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
||||
//setSelectedGame(0);
|
||||
curPage++;
|
||||
setSelectedGame(0);
|
||||
bUpdatePositions = true;
|
||||
}
|
||||
|
||||
@ -325,6 +332,38 @@ void GuiIconGrid::OnLaunchClick(GuiButton *button, const GuiController *controll
|
||||
}
|
||||
|
||||
|
||||
void GuiIconGrid::OnLeftArrowHeld(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
||||
if(currentlyHeld != NULL) {
|
||||
if(lArrowHeldCounter++ > 30) {
|
||||
OnLeftArrowClick(button,controller,trigger);
|
||||
lArrowHeldCounter = 0;
|
||||
}
|
||||
} else {
|
||||
lArrowHeldCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void GuiIconGrid::OnLeftArrowReleased(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
||||
lArrowHeldCounter = 0;
|
||||
}
|
||||
|
||||
void GuiIconGrid::OnRightArrowHeld(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
||||
if(currentlyHeld != NULL) {
|
||||
if(rArrowHeldCounter++ > 30) {
|
||||
DEBUG_FUNCTION_LINE("CLICK\n");
|
||||
OnRightArrowClick(button,controller,trigger);
|
||||
rArrowHeldCounter = 0;
|
||||
}
|
||||
} else {
|
||||
rArrowHeldCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void GuiIconGrid::OnRightArrowReleased(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
||||
rArrowHeldCounter = 0;
|
||||
}
|
||||
|
||||
|
||||
void GuiIconGrid::OnGameButtonHeld(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) {
|
||||
if(currentlyHeld == NULL) {
|
||||
currentlyHeld = button;
|
||||
|
@ -91,10 +91,19 @@ private:
|
||||
void OnGameButtonPointedOn(GuiButton *button, const GuiController *controller);
|
||||
void OnGameButtonPointedOff(GuiButton *button, const GuiController *controller);
|
||||
void OnDrag(GuiDragListener *button, const GuiController *controller, GuiTrigger *trigger, int32_t dx, int32_t dy);
|
||||
|
||||
void OnLeftArrowHeld(GuiButton *button, const GuiController *controller, GuiTrigger *trigger);
|
||||
void OnRightArrowHeld(GuiButton *button, const GuiController *controller, GuiTrigger *trigger);
|
||||
void OnLeftArrowReleased(GuiButton *button, const GuiController *controller, GuiTrigger *trigger);
|
||||
void OnRightArrowReleased(GuiButton *button, const GuiController *controller, GuiTrigger *trigger);
|
||||
|
||||
void updateButtonPositions();
|
||||
|
||||
int32_t offsetForTitleId(uint64_t titleId);
|
||||
|
||||
uint32_t lArrowHeldCounter = 0;
|
||||
uint32_t rArrowHeldCounter = 0;
|
||||
|
||||
int32_t curPage = 0;
|
||||
int32_t listOffset;
|
||||
uint64_t selectedGame;
|
||||
|
Loading…
Reference in New Issue
Block a user