mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Fix main menu UI showing in demo, add menu button (not functional yet)
This commit is contained in:
BIN
ApplicationResourcePatches/PICT/1971.bmp
Normal file
BIN
ApplicationResourcePatches/PICT/1971.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
BIN
ApplicationResourcePatches/PICT/1972.bmp
Normal file
BIN
ApplicationResourcePatches/PICT/1972.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@@ -9,6 +9,8 @@
|
|||||||
"DITL/2004.json" : "ApplicationResourcePatches/DITL/2004.json",
|
"DITL/2004.json" : "ApplicationResourcePatches/DITL/2004.json",
|
||||||
"DITL/2005.json" : "ApplicationResourcePatches/DITL/2005.json",
|
"DITL/2005.json" : "ApplicationResourcePatches/DITL/2005.json",
|
||||||
"DITL/2006.json" : "ApplicationResourcePatches/DITL/2006.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/1973.bmp" : "ApplicationResourcePatches/PICT/1973.bmp",
|
||||||
"PICT/1974.bmp" : "ApplicationResourcePatches/PICT/1974.bmp",
|
"PICT/1974.bmp" : "ApplicationResourcePatches/PICT/1974.bmp",
|
||||||
"PICT/1975.bmp" : "ApplicationResourcePatches/PICT/1975.bmp",
|
"PICT/1975.bmp" : "ApplicationResourcePatches/PICT/1975.bmp",
|
||||||
|
|||||||
@@ -369,7 +369,9 @@ namespace TouchScreenCtrlIDs
|
|||||||
{
|
{
|
||||||
Bands,
|
Bands,
|
||||||
BatteryHelium,
|
BatteryHelium,
|
||||||
Movement,
|
Menu,
|
||||||
|
|
||||||
|
Movement, // Keep this last
|
||||||
|
|
||||||
Count,
|
Count,
|
||||||
|
|
||||||
@@ -432,6 +434,8 @@ namespace touchScreenControlGraphics
|
|||||||
{
|
{
|
||||||
enum touchScreenControlGraphic
|
enum touchScreenControlGraphic
|
||||||
{
|
{
|
||||||
|
MenuActive,
|
||||||
|
MenuIdle,
|
||||||
BandsDisabled,
|
BandsDisabled,
|
||||||
BandsActive,
|
BandsActive,
|
||||||
BandsIdle,
|
BandsIdle,
|
||||||
@@ -451,7 +455,7 @@ namespace touchScreenControlGraphics
|
|||||||
Count,
|
Count,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int kTouchScreenGraphicStartID = 1973;
|
static const int kTouchScreenGraphicStartID = 1971;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef touchScreenControlGraphics::touchScreenControlGraphic touchScreenControlGraphic_t;
|
typedef touchScreenControlGraphics::touchScreenControlGraphic touchScreenControlGraphic_t;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "PLSysCalls.h"
|
#include "PLSysCalls.h"
|
||||||
#include "RenderedFont.h"
|
#include "RenderedFont.h"
|
||||||
#include "GpRenderedFontMetrics.h"
|
#include "GpRenderedFontMetrics.h"
|
||||||
|
#include "MainMenuUI.h"
|
||||||
#include "ResolveCachingColor.h"
|
#include "ResolveCachingColor.h"
|
||||||
#include "PLTimeTaggedVOSEvent.h"
|
#include "PLTimeTaggedVOSEvent.h"
|
||||||
#include "WindowDef.h"
|
#include "WindowDef.h"
|
||||||
@@ -397,9 +398,7 @@ static void HandleMainMenuUISelection(MainMenuUIState::ControlID controlID)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MainMenuUIState::Control_Demo:
|
case MainMenuUIState::Control_Demo:
|
||||||
DismissMainMenuUIPage();
|
DoDemoGame(); // This handles main menu UI by itself
|
||||||
DoOptionsMenu(iHelp);
|
|
||||||
StartMainMenuUI();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MainMenuUIState::Control_AboutApplication:
|
case MainMenuUIState::Control_AboutApplication:
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "Externs.h"
|
#include "Externs.h"
|
||||||
#include "Environ.h"
|
#include "Environ.h"
|
||||||
#include "House.h"
|
#include "House.h"
|
||||||
|
#include "MainMenuUI.h"
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "PLEventQueue.h"
|
#include "PLEventQueue.h"
|
||||||
#include "PLTimeTaggedVOSEvent.h"
|
#include "PLTimeTaggedVOSEvent.h"
|
||||||
@@ -278,9 +279,15 @@ void DoDemoGame (void)
|
|||||||
PasStringCopy(theHousesSpecs[thisHouseIndex].m_name, thisHouseName);
|
PasStringCopy(theHousesSpecs[thisHouseIndex].m_name, thisHouseName);
|
||||||
if (OpenHouse())
|
if (OpenHouse())
|
||||||
{
|
{
|
||||||
|
if (thisMac.isTouchscreen)
|
||||||
|
DismissMainMenuUI();
|
||||||
|
|
||||||
whoCares = ReadHouse();
|
whoCares = ReadHouse();
|
||||||
demoGoing = true;
|
demoGoing = true;
|
||||||
NewGame(kNewGameMode);
|
NewGame(kNewGameMode);
|
||||||
|
|
||||||
|
if (thisMac.isTouchscreen)
|
||||||
|
StartMainMenuUI();
|
||||||
}
|
}
|
||||||
whoCares = CloseHouse();
|
whoCares = CloseHouse();
|
||||||
thisHouseIndex = wasHouseIndex;
|
thisHouseIndex = wasHouseIndex;
|
||||||
@@ -571,6 +578,7 @@ void ResetTouchScreenControlBounds (void)
|
|||||||
points[TouchScreenCtrlIDs::Movement] = Point::Create(mainWindowRect.left, mainWindowRect.top);
|
points[TouchScreenCtrlIDs::Movement] = Point::Create(mainWindowRect.left, mainWindowRect.top);
|
||||||
points[TouchScreenCtrlIDs::BatteryHelium] = Point::Create(mainWindowRect.left + touchScreenControlEdgeSpacing, mainWindowRect.top + touchScreenControlEdgeSpacing);
|
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::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++)
|
for (int i = 0; i < TouchScreenCtrlIDs::Count; i++)
|
||||||
sizes[i] = Point::Create(touchScreenControlSize, touchScreenControlSize);
|
sizes[i] = Point::Create(touchScreenControlSize, touchScreenControlSize);
|
||||||
@@ -628,6 +636,7 @@ void PlayGame (void)
|
|||||||
touchScreen.controls[TouchScreenCtrlIDs::Movement].isEnabled = true;
|
touchScreen.controls[TouchScreenCtrlIDs::Movement].isEnabled = true;
|
||||||
touchScreen.controls[TouchScreenCtrlIDs::Bands].isEnabled = true;
|
touchScreen.controls[TouchScreenCtrlIDs::Bands].isEnabled = true;
|
||||||
touchScreen.controls[TouchScreenCtrlIDs::BatteryHelium].isEnabled = true;
|
touchScreen.controls[TouchScreenCtrlIDs::BatteryHelium].isEnabled = true;
|
||||||
|
touchScreen.controls[TouchScreenCtrlIDs::Menu].isEnabled = true;
|
||||||
|
|
||||||
while ((playing) && (!quitting))
|
while ((playing) && (!quitting))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -622,6 +622,7 @@ void RenderTouchScreenControls (void)
|
|||||||
ctrlGraphics[TouchScreenCtrlIDs::Movement] = nullptr;
|
ctrlGraphics[TouchScreenCtrlIDs::Movement] = nullptr;
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::Bands] = touchScreen.graphics[touchScreenControlGraphics::BandsDisabled];
|
ctrlGraphics[TouchScreenCtrlIDs::Bands] = touchScreen.graphics[touchScreenControlGraphics::BandsDisabled];
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::BatteryHelium] = touchScreen.graphics[touchScreenControlGraphics::BatteryDisabled];
|
ctrlGraphics[TouchScreenCtrlIDs::BatteryHelium] = touchScreen.graphics[touchScreenControlGraphics::BatteryDisabled];
|
||||||
|
ctrlGraphics[TouchScreenCtrlIDs::Menu] = touchScreen.graphics[touchScreenControlGraphics::MenuIdle];
|
||||||
|
|
||||||
if (batteryTotal < 0)
|
if (batteryTotal < 0)
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::BatteryHelium] = touchScreen.graphics[touchScreenControlGraphics::HeliumIdle];
|
ctrlGraphics[TouchScreenCtrlIDs::BatteryHelium] = touchScreen.graphics[touchScreenControlGraphics::HeliumIdle];
|
||||||
@@ -645,6 +646,8 @@ void RenderTouchScreenControls (void)
|
|||||||
if (bandsTotal > 0)
|
if (bandsTotal > 0)
|
||||||
ctrlGraphics[TouchScreenCtrlIDs::Bands] = touchScreen.graphics[touchScreenControlGraphics::BandsActive];
|
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++)
|
for (int i = 0; i < TouchScreenCtrlIDs::Count; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user