From f2052b835b8d7c296caddf5894f91eb4ce3e6d86 Mon Sep 17 00:00:00 2001 From: elasota Date: Sun, 25 Oct 2020 16:32:49 -0400 Subject: [PATCH] Fix main menu UI showing in demo, add menu button (not functional yet) --- ApplicationResourcePatches/PICT/1971.bmp | Bin 0 -> 4174 bytes ApplicationResourcePatches/PICT/1972.bmp | Bin 0 -> 4162 bytes ApplicationResourcePatches/manifest.json | 2 ++ GpApp/GliderStructs.h | 8 ++++++-- GpApp/MainMenuUI.cpp | 5 ++--- GpApp/Play.cpp | 9 +++++++++ GpApp/Render.cpp | 3 +++ 7 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 ApplicationResourcePatches/PICT/1971.bmp create mode 100644 ApplicationResourcePatches/PICT/1972.bmp diff --git a/ApplicationResourcePatches/PICT/1971.bmp b/ApplicationResourcePatches/PICT/1971.bmp new file mode 100644 index 0000000000000000000000000000000000000000..ec6160c5cbb310463eaab3542257a79b2e7a23fe GIT binary patch literal 4174 zcmeHHF%H5o478gTAt9kYpc4}d6B8R^ryGA_V&^~ngohZrX#$wRQi{~YmYnA5UK~4@ zp3Z#>gY`Ua*^i?mEO{2~u?7%dFcfE_{hg@0+-S8q(C+%ArtK((<{WW?$-XDh(fQs# z*H3u|{Qmg;DOV5v{C}$e5UTfz7XH>>-3SI~>bQc1b^ejg3q-z!6~BtvWgJSdFej03 zbG2N1vLG)ltoey7PvKkm-+XJoI>1Le-Ic~8DjY)`5zLRfJR1!PMJ4C>U*bZnX)=^7*w?KfKY zvSK*XH^lQ20)t_+;4j9A&KLcS@-42P`;YtA{bN($`}zm7 zxSr-S9_y#8(GbNEI_~-h?D~_2$N3}4nNFVMBWQTw*L3i-hABb!|IwtA0yO-0{N}(s z6K3^OpI3W-v1qS>nArrVai#QH8|(W8($0sv}nb literal 0 HcmV?d00001 diff --git a/ApplicationResourcePatches/manifest.json b/ApplicationResourcePatches/manifest.json index 9bd1a17..16c863b 100644 --- a/ApplicationResourcePatches/manifest.json +++ b/ApplicationResourcePatches/manifest.json @@ -9,6 +9,8 @@ "DITL/2004.json" : "ApplicationResourcePatches/DITL/2004.json", "DITL/2005.json" : "ApplicationResourcePatches/DITL/2005.json", "DITL/2006.json" : "ApplicationResourcePatches/DITL/2006.json", + "PICT/1971.bmp" : "ApplicationResourcePatches/PICT/1971.bmp", + "PICT/1972.bmp" : "ApplicationResourcePatches/PICT/1972.bmp", "PICT/1973.bmp" : "ApplicationResourcePatches/PICT/1973.bmp", "PICT/1974.bmp" : "ApplicationResourcePatches/PICT/1974.bmp", "PICT/1975.bmp" : "ApplicationResourcePatches/PICT/1975.bmp", diff --git a/GpApp/GliderStructs.h b/GpApp/GliderStructs.h index 3e7ea46..d36c589 100644 --- a/GpApp/GliderStructs.h +++ b/GpApp/GliderStructs.h @@ -369,7 +369,9 @@ namespace TouchScreenCtrlIDs { Bands, BatteryHelium, - Movement, + Menu, + + Movement, // Keep this last Count, @@ -432,6 +434,8 @@ namespace touchScreenControlGraphics { enum touchScreenControlGraphic { + MenuActive, + MenuIdle, BandsDisabled, BandsActive, BandsIdle, @@ -451,7 +455,7 @@ namespace touchScreenControlGraphics Count, }; - static const int kTouchScreenGraphicStartID = 1973; + static const int kTouchScreenGraphicStartID = 1971; } typedef touchScreenControlGraphics::touchScreenControlGraphic touchScreenControlGraphic_t; diff --git a/GpApp/MainMenuUI.cpp b/GpApp/MainMenuUI.cpp index 470e476..1c4a1a5 100644 --- a/GpApp/MainMenuUI.cpp +++ b/GpApp/MainMenuUI.cpp @@ -12,6 +12,7 @@ #include "PLSysCalls.h" #include "RenderedFont.h" #include "GpRenderedFontMetrics.h" +#include "MainMenuUI.h" #include "ResolveCachingColor.h" #include "PLTimeTaggedVOSEvent.h" #include "WindowDef.h" @@ -397,9 +398,7 @@ static void HandleMainMenuUISelection(MainMenuUIState::ControlID controlID) break; case MainMenuUIState::Control_Demo: - DismissMainMenuUIPage(); - DoOptionsMenu(iHelp); - StartMainMenuUI(); + DoDemoGame(); // This handles main menu UI by itself break; case MainMenuUIState::Control_AboutApplication: diff --git a/GpApp/Play.cpp b/GpApp/Play.cpp index 47bbac8..3e66277 100644 --- a/GpApp/Play.cpp +++ b/GpApp/Play.cpp @@ -12,6 +12,7 @@ #include "Externs.h" #include "Environ.h" #include "House.h" +#include "MainMenuUI.h" #include "MainWindow.h" #include "PLEventQueue.h" #include "PLTimeTaggedVOSEvent.h" @@ -278,9 +279,15 @@ void DoDemoGame (void) PasStringCopy(theHousesSpecs[thisHouseIndex].m_name, thisHouseName); if (OpenHouse()) { + if (thisMac.isTouchscreen) + DismissMainMenuUI(); + whoCares = ReadHouse(); demoGoing = true; NewGame(kNewGameMode); + + if (thisMac.isTouchscreen) + StartMainMenuUI(); } whoCares = CloseHouse(); thisHouseIndex = wasHouseIndex; @@ -571,6 +578,7 @@ void ResetTouchScreenControlBounds (void) points[TouchScreenCtrlIDs::Movement] = Point::Create(mainWindowRect.left, mainWindowRect.top); points[TouchScreenCtrlIDs::BatteryHelium] = Point::Create(mainWindowRect.left + touchScreenControlEdgeSpacing, mainWindowRect.top + touchScreenControlEdgeSpacing); points[TouchScreenCtrlIDs::Bands] = Point::Create(mainWindowRect.right - touchScreenControlEdgeSpacing - touchScreenControlSize, mainWindowRect.top + touchScreenControlEdgeSpacing); + points[TouchScreenCtrlIDs::Menu] = Point::Create(points[TouchScreenCtrlIDs::Bands].h - touchScreenControlInterSpacing - touchScreenControlSize, points[TouchScreenCtrlIDs::BatteryHelium].v); for (int i = 0; i < TouchScreenCtrlIDs::Count; i++) sizes[i] = Point::Create(touchScreenControlSize, touchScreenControlSize); @@ -628,6 +636,7 @@ void PlayGame (void) touchScreen.controls[TouchScreenCtrlIDs::Movement].isEnabled = true; touchScreen.controls[TouchScreenCtrlIDs::Bands].isEnabled = true; touchScreen.controls[TouchScreenCtrlIDs::BatteryHelium].isEnabled = true; + touchScreen.controls[TouchScreenCtrlIDs::Menu].isEnabled = true; while ((playing) && (!quitting)) { diff --git a/GpApp/Render.cpp b/GpApp/Render.cpp index be60fc9..46e9f96 100644 --- a/GpApp/Render.cpp +++ b/GpApp/Render.cpp @@ -622,6 +622,7 @@ void RenderTouchScreenControls (void) ctrlGraphics[TouchScreenCtrlIDs::Movement] = nullptr; ctrlGraphics[TouchScreenCtrlIDs::Bands] = touchScreen.graphics[touchScreenControlGraphics::BandsDisabled]; ctrlGraphics[TouchScreenCtrlIDs::BatteryHelium] = touchScreen.graphics[touchScreenControlGraphics::BatteryDisabled]; + ctrlGraphics[TouchScreenCtrlIDs::Menu] = touchScreen.graphics[touchScreenControlGraphics::MenuIdle]; if (batteryTotal < 0) ctrlGraphics[TouchScreenCtrlIDs::BatteryHelium] = touchScreen.graphics[touchScreenControlGraphics::HeliumIdle]; @@ -645,6 +646,8 @@ void RenderTouchScreenControls (void) if (bandsTotal > 0) ctrlGraphics[TouchScreenCtrlIDs::Bands] = touchScreen.graphics[touchScreenControlGraphics::BandsActive]; } + else if (touchScreen.fingers[i].capturingControl == TouchScreenCtrlIDs::Menu) + ctrlGraphics[TouchScreenCtrlIDs::Menu] = touchScreen.graphics[touchScreenControlGraphics::MenuActive]; } for (int i = 0; i < TouchScreenCtrlIDs::Count; i++)