-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Options menu with interface type switching and shutdown.
- Loading branch information
1 parent
52aafff
commit f0f6ee4
Showing
6 changed files
with
98 additions
and
10 deletions.
There are no files selected for viewing
Submodule stompbox
updated
2 files
+1 −1 | stompbox-jack/stompbox-jack.cpp | |
+10 −0 | stompbox/PluginProcessor.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using UILayout; | ||
|
||
namespace Stompbox | ||
{ | ||
public class InterfaceBase : Dock | ||
{ | ||
} | ||
|
||
public class ExtraOptionsButton : ImageButton | ||
{ | ||
public ExtraOptionsButton(EStompboxInterfaceType currentInterfaceType) | ||
: base("MoreButton") | ||
{ | ||
ClickAction = delegate | ||
{ | ||
Layout.Current.ShowPopup(new ExtraOptionsMenu(currentInterfaceType), ContentBounds.Center); | ||
}; | ||
} | ||
} | ||
|
||
public class ExtraOptionsMenu : Menu | ||
{ | ||
public ExtraOptionsMenu(EStompboxInterfaceType currentInterfaceType) | ||
{ | ||
List<MenuItem> menuItems = new(); | ||
|
||
foreach (EStompboxInterfaceType type in Enum.GetValues(typeof(EStompboxInterfaceType))) | ||
{ | ||
if (type != currentInterfaceType) | ||
{ | ||
menuItems.Add(new ContextMenuItem() | ||
{ | ||
Text = "Switch to " + type.ToString() + " interface", | ||
AfterCloseAction = delegate | ||
{ | ||
StompboxGame.Instance.SetInterfaceType(type); | ||
StompboxClient.Instance.NeedUIReload = true; | ||
} | ||
}); | ||
} | ||
} | ||
|
||
menuItems.Add(new ContextMenuItem() | ||
{ | ||
Text = "Shut down stompbox", | ||
AfterCloseAction = delegate | ||
{ | ||
Layout.Current.ShowConfirmationPopup("Shut down!\n\nAre you sure?", | ||
delegate | ||
{ | ||
StompboxClient.Instance.SendCommand("Shutdown"); | ||
}); | ||
} | ||
}); | ||
|
||
SetMenuItems(menuItems); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters