mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-03 06:01:29 +00:00
GUI: and more mobile UI progress
This commit is contained in:
parent
2c18fe1051
commit
0fd72c53ef
4 changed files with 17 additions and 1 deletions
|
@ -3349,6 +3349,8 @@ bool FurnaceGUI::loop() {
|
|||
if (mobileUI) {
|
||||
globalWinFlags=ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoBringToFrontOnFocus;
|
||||
//globalWinFlags=ImGuiWindowFlags_NoTitleBar;
|
||||
// scene handling goes here!
|
||||
pianoOpen=true;
|
||||
drawMobileControls();
|
||||
drawPattern();
|
||||
drawPiano();
|
||||
|
@ -4882,6 +4884,7 @@ FurnaceGUI::FurnaceGUI():
|
|||
curFileDialog(GUI_FILE_OPEN),
|
||||
warnAction(GUI_WARN_OPEN),
|
||||
postWarnAction(GUI_WARN_GENERIC),
|
||||
mobScene(GUI_SCENE_PATTERN),
|
||||
fileDialog(NULL),
|
||||
scrW(1280),
|
||||
scrH(800),
|
||||
|
|
|
@ -260,6 +260,14 @@ enum FurnaceGUIWindows {
|
|||
GUI_WINDOW_SPOILER
|
||||
};
|
||||
|
||||
enum FurnaceGUIMobileScenes {
|
||||
GUI_SCENE_PATTERN,
|
||||
GUI_SCENE_ORDERS,
|
||||
GUI_SCENE_INSTRUMENT,
|
||||
GUI_SCENE_WAVETABLE,
|
||||
GUI_SCENE_SAMPLE
|
||||
};
|
||||
|
||||
enum FurnaceGUIFileDialogs {
|
||||
GUI_FILE_OPEN,
|
||||
GUI_FILE_SAVE,
|
||||
|
@ -1009,6 +1017,7 @@ class FurnaceGUI {
|
|||
FurnaceGUIFileDialogs curFileDialog;
|
||||
FurnaceGUIWarnings warnAction;
|
||||
FurnaceGUIWarnings postWarnAction;
|
||||
FurnaceGUIMobileScenes mobScene;
|
||||
|
||||
FurnaceGUIFileDialog* fileDialog;
|
||||
|
||||
|
|
|
@ -374,7 +374,7 @@ void FurnaceGUI::drawPattern() {
|
|||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,ImVec2(0.0f,0.0f));
|
||||
if (mobileUI) {
|
||||
patWindowPos=(portrait?ImVec2(0.0f,(mobileMenuPos*-0.65*scrH*dpiScale)):ImVec2((0.16*scrH*dpiScale)+0.5*scrW*dpiScale*mobileMenuPos,0.0f));
|
||||
patWindowSize=(portrait?ImVec2(scrW*dpiScale,scrH*dpiScale-(0.16*scrW*dpiScale)):ImVec2(scrW*dpiScale-(0.16*scrH*dpiScale),scrH*dpiScale));
|
||||
patWindowSize=(portrait?ImVec2(scrW*dpiScale,scrH*dpiScale-(0.16*scrW*dpiScale)-(pianoOpen?(0.3*scrW*dpiScale):0.0f)):ImVec2(scrW*dpiScale-(0.16*scrH*dpiScale),scrH*dpiScale-(pianoOpen?(0.3*scrH*dpiScale):0.0f)));
|
||||
ImGui::SetNextWindowPos(patWindowPos);
|
||||
ImGui::SetNextWindowSize(patWindowSize);
|
||||
}
|
||||
|
|
|
@ -52,6 +52,10 @@ void FurnaceGUI::drawPiano() {
|
|||
nextWindow=GUI_WINDOW_NOTHING;
|
||||
}
|
||||
if (!pianoOpen) return;
|
||||
if (mobileUI) {
|
||||
ImGui::SetNextWindowPos(ImVec2(patWindowPos.x,patWindowPos.y+patWindowSize.y));
|
||||
ImGui::SetNextWindowSize(portrait?ImVec2(scrW*dpiScale,0.5*scrW*dpiScale):ImVec2(scrW*dpiScale-(0.16*scrH*dpiScale),0.3*scrH*dpiScale));
|
||||
}
|
||||
if (ImGui::Begin("Piano",&pianoOpen,((pianoOptions)?0:ImGuiWindowFlags_NoTitleBar)|ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|globalWinFlags)) {
|
||||
bool oldPianoKeyPressed[180];
|
||||
memcpy(oldPianoKeyPressed,pianoKeyPressed,180*sizeof(bool));
|
||||
|
|
Loading…
Reference in a new issue