does NOT compile!

This commit is contained in:
Thomas Jentzsch 2021-08-31 17:04:27 +02:00
parent 79d40d52f8
commit 6c6cd52e42
10 changed files with 96 additions and 1 deletions

View File

@ -169,6 +169,7 @@ class Event
SALeftAxis0Value, SALeftAxis1Value, SARightAxis0Value, SARightAxis1Value,
QTPaddle3AFire, QTPaddle3BFire, QTPaddle4AFire, QTPaddle4BFire,
UIHelp,
InputTextDialogMode,
LastType
};

View File

@ -2153,6 +2153,13 @@ bool EventHandler::changeStateByEvent(Event::Type type)
else
handled = false;
break;
case Event::InputTextDialogMode:
if(myState != EventHandlerState::INPUTMENU)
enterMenuMode(EventHandlerState::INPUTMENU);
else
leaveMenuMode();
break;
#endif
case Event::TimeMachineMode:
@ -2998,6 +3005,11 @@ void EventHandler::setState(EventHandlerState state)
enableTextEvents(true);
break;
case EventHandlerState::INPUTMENU:
myOverlay = &myOSystem.inputMenu();
enableTextEvents(true);
break;
case EventHandlerState::TIMEMACHINE:
myOSystem.timeMachine().requestResize();
myOverlay = &myOSystem.timeMachine();

View File

@ -29,6 +29,7 @@ enum class EventHandlerState {
CMDMENU,
HIGHSCORESMENU,
MESSAGEMENU,
INPUTMENU,
DEBUGGER,
NONE
};

View File

@ -55,6 +55,7 @@
#include "CommandMenu.hxx"
#include "HighScoresMenu.hxx"
#include "MessageMenu.hxx"
#include "InputMenu.hxx"
#include "TimeMachine.hxx"
#endif
@ -446,6 +447,19 @@ void FrameBuffer::update(UpdateMode mode)
break; // EventHandlerState::MESSAGEMENU
}
case EventHandlerState::INPUTMENU:
{
myOSystem.inputMenu().tick();
redraw |= myOSystem.inputMenu().needsRedraw();
if(redraw)
{
clear();
myTIASurface->render(true);
myOSystem.inputMenu().draw(forceRedraw);
}
break; // EventHandlerState::INPUTMENU
}
case EventHandlerState::TIMEMACHINE:
{
myOSystem.timeMachine().tick();

View File

@ -35,6 +35,7 @@
#include "CommandMenu.hxx"
#include "HighScoresMenu.hxx"
#include "MessageMenu.hxx"
#include "InputMenu.hxx"
#include "Launcher.hxx"
#include "TimeMachine.hxx"
#include "Widget.hxx"
@ -181,6 +182,7 @@ bool OSystem::initialize(const Settings::Options& options)
myHighScoresManager = make_unique<HighScoresManager>(*this);
myHighScoresMenu = make_unique<HighScoresMenu>(*this);
myMessageMenu = make_unique<MessageMenu>(*this);
myInputMenu = make_unique<InputMenu>(*this);
myTimeMachine = make_unique<TimeMachine>(*this);
myLauncher = make_unique<Launcher>(*this);
@ -506,6 +508,39 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
<< " - " << myConsole->getFormatString();
myFrameBuffer->showTextMessage(msg.str());
}
// Check for first PlusROM start
if(true)
// myConsole->cartridge().plusROM().isvalid() && Settings
{
//myEventHandler->changeStateByEvent(Event::OptionsMenuMode);
myEventHandler->changeStateByEvent(Event::InputTextDialogMode);
//TODO: Event::InputTextDialogMode
/*
// Inputbox which will pop up when searching RAM
StringList labels = {"Value"};
myInputBox = make_unique<InputTextDialog>(boss, lfont, nfont, labels, " ");
myInputBox->setTarget(this);
// Add inputbox in the middle of the RAM widget
uInt32 x = getAbsX() + ((getWidth() - myInputBox->getWidth()) >> 1);
uInt32 y = getAbsY() + ((getHeight() - myInputBox->getHeight()) >> 1);
myInputBox->show(x, y, dialog().surface().dstRect());
myInputBox->setText("");
myInputBox->setMessage("");
myInputBox->setToolTip(cmd == kSValEntered
? "Enter search value (leave blank for all)."
: "Enter relative or absolute value\nto compare with searched values.");
myInputBox->setFocus(0);
myInputBox->setEmitSignal(cmd);
myInputBox->setTitle(cmd == kSValEntered ? "Search" : "Compare");
*/
}
}
return EmptyString;

View File

@ -42,6 +42,7 @@ class AudioSettings;
class Launcher;
class Menu;
class MessageMenu;
class InputMenu;
class TimeMachine;
class VideoAudioDialog;
#endif
@ -226,6 +227,13 @@ class OSystem
*/
MessageMenu& messageMenu() const { return *myMessageMenu; }
/**
Get the input menu of the system.
@return The input menu object
*/
InputMenu& inputMenu() const { return *myInputMenu; }
/**
Get the ROM launcher of the system.
@ -523,6 +531,9 @@ class OSystem
// Pointer to the MessageMenu object
unique_ptr<MessageMenu> myMessageMenu;
// Pointer to the InputMenu object
unique_ptr<InputMenu> myInputMenu;
// Pointer to the TimeMachine object
unique_ptr<TimeMachine> myTimeMachine;
#endif

View File

@ -46,6 +46,16 @@ InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& lfont,
initialize(lfont, nfont, labels);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
InputTextDialog::InputTextDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, const StringList& labels, const string& title)
: Dialog(osystem, parent, font, title),
CommandSender(nullptr)
{
initialize(font, font, labels);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void InputTextDialog::initialize(const GUI::Font& lfont, const GUI::Font& nfont,
const StringList& labels)

View File

@ -34,6 +34,9 @@ class InputTextDialog : public Dialog, public CommandSender
InputTextDialog(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, const StringList& labels,
const string& title = "");
InputTextDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font,
const StringList& labels, const string& title = "");
~InputTextDialog() override = default;
/** Place the input dialog onscreen and center it */

View File

@ -797,6 +797,7 @@
<ClCompile Include="..\gui\FileListWidget.cxx" />
<ClCompile Include="..\gui\HighScoresDialog.cxx" />
<ClCompile Include="..\gui\HighScoresMenu.cxx" />
<ClCompile Include="..\gui\InputMenu.cxx" />
<ClCompile Include="..\gui\JoystickDialog.cxx" />
<ClCompile Include="..\gui\LoggerDialog.cxx" />
<ClCompile Include="..\gui\MessageDialog.cxx" />
@ -1885,6 +1886,7 @@
<ClInclude Include="..\gui\FileListWidget.hxx" />
<ClInclude Include="..\gui\HighScoresDialog.hxx" />
<ClInclude Include="..\gui\HighScoresMenu.hxx" />
<ClInclude Include="..\gui\InputMenu.hxx" />
<ClInclude Include="..\gui\JoystickDialog.hxx" />
<ClInclude Include="..\gui\LoggerDialog.hxx" />
<ClInclude Include="..\gui\MessageDialog.hxx" />

View File

@ -1119,6 +1119,9 @@
<ClCompile Include="..\debugger\gui\CartARMWidget.cxx">
<Filter>Source Files\debugger</Filter>
</ClCompile>
<ClCompile Include="..\gui\InputMenu.cxx">
<Filter>Source Files\gui</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\common\bspf.hxx">
@ -2300,6 +2303,9 @@
<ClInclude Include="..\debugger\gui\CartARMWidget.hxx">
<Filter>Header Files\debugger</Filter>
</ClInclude>
<ClInclude Include="..\gui\InputMenu.hxx">
<Filter>Header Files\gui</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="stella.ico">
@ -2312,4 +2318,4 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>