added static What's New" popup (see #581) (to get things going :-)

This commit is contained in:
thrust26 2020-07-28 23:47:13 +02:00
parent 3cc7d9b655
commit be21438c92
13 changed files with 158 additions and 100 deletions

View File

@ -16,16 +16,16 @@
* Added autofire.
* Added new interface palette 'Dark'. (TODO: DOC)
* Added new UI theme 'Dark'. (TODO: DOC)
* Extended global hotkeys for debug options.
* Added option to playback a game using the Time Machine.
* Allow taking snapshots from within Time Machine dialog.
* Allow taking snapshots from within the Time Machine dialog.
* Added ability to access most files that Stella uses from within a ZIP
file. This includes the following:
* Added the ability to access most files that Stella uses from within a
ZIP file. This includes the following:
- Per-ROM properties file (so one can distribute a ROM and its
associated properties).
- Debugger symbol (.sym) and list (.lst) files, etc.
@ -39,8 +39,8 @@
* Replaced "Re-disassemble" with "Disassemble @ current line" in debugger.
* Fix bug when taking fullscreen snapshots; the dimensions were sometimes
cut off.
* Fixed bug when taking fullscreen snapshots; the dimensions were
sometimes cut off.
-Have fun!

View File

@ -38,6 +38,7 @@ Settings::Settings()
// If no version is recorded with the persisted settings, we set it to zero
setPermanent(SETTINGS_VERSION_KEY, 0);
setPermanent("stella.version", "6.2.1");
// Video-related options
setPermanent("video", "");

View File

@ -767,6 +767,28 @@ Widget* Dialog::findWidget(int x, int y) const
return Widget::findWidgetInChain(_firstWidget, x, y);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::addOKBGroup(WidgetArray& wid, const GUI::Font& font,
const string& okText, int buttonWidth)
{
const int fontWidth = font.getMaxCharWidth(),
fontHeight = font.getFontHeight(),
buttonHeight = font.getLineHeight() * 1.25;
const int VBORDER = fontHeight / 2;
const int HBORDER = fontWidth * 1.25;
const int BTN_BORDER = fontWidth * 2.5;
const int BUTTON_GAP = fontWidth;
buttonWidth = fontWidth * 6 + BTN_BORDER;
buttonWidth = std::max(buttonWidth, font.getStringWidth(okText) + BTN_BORDER);
_w = std::max(HBORDER * 2 + buttonWidth * 2 + BUTTON_GAP, _w);
addOKWidget(new ButtonWidget(this, font, (_w - buttonWidth) / 2,
_h - buttonHeight - VBORDER, buttonWidth, buttonHeight, okText, GuiObject::kCloseCmd));
wid.push_back(_okWidget);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::addOKCancelBGroup(WidgetArray& wid, const GUI::Font& font,
const string& okText, const string& cancelText,

View File

@ -146,6 +146,11 @@ class Dialog : public GuiObject
Widget* findWidget(int x, int y) const; // Find the widget at pos x,y if any
void addOKBGroup(WidgetArray& wid, const GUI::Font& font,
const string& okText = "OK",
int buttonWidth = 0);
void addOKCancelBGroup(WidgetArray& wid, const GUI::Font& font,
const string& okText = "OK",
const string& cancelText = "Cancel",
@ -158,7 +163,7 @@ class Dialog : public GuiObject
const string& defaultsText = "Defaults",
bool focusOKButton = true);
// NOTE: This method, and the two above it, are due to be refactored at some
// NOTE: This method, and the three above it, are due to be refactored at some
// point, since the parameter list is kind of getting ridiculous
void addDefaultsExtraOKCancelBGroup(WidgetArray& wid, const GUI::Font& font,
const string& extraText, int extraCmd,
@ -167,7 +172,7 @@ class Dialog : public GuiObject
const string& defaultsText = "Defaults",
bool focusOKButton = true);
void processCancelWithoutWidget(bool state) { _processCancel = state; }
void processCancelWithoutWidget(bool state = true) { _processCancel = state; }
virtual void processCancel() { close(); }
/** Define the size (allowed) for the dialog. */

View File

@ -28,6 +28,7 @@
#include "OptionsDialog.hxx"
#include "GlobalPropsDialog.hxx"
#include "StellaSettingsDialog.hxx"
#include "WhatsNewDialog.hxx"
#include "MessageBox.hxx"
#include "OSystem.hxx"
#include "FrameBuffer.hxx"
@ -287,6 +288,14 @@ void LauncherDialog::loadConfig()
const string& tmpromdir = instance().settings().getString("tmpromdir");
const string& romdir = tmpromdir != "" ? tmpromdir :
instance().settings().getString("romdir");
const string& version = instance().settings().getString("stella.version");
// Show "What's New" message when a new version of Stella is run for the first time
if(version != STELLA_VERSION)
{
openWhatsNew();
instance().settings().setValue("stella.version", STELLA_VERSION);
}
// Assume that if the list is empty, this is the first time that loadConfig()
// has been called (and we should reload the list)
@ -675,3 +684,11 @@ void LauncherDialog::openSettings()
myOptionsDialog->open();
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherDialog::openWhatsNew()
{
if(myWhatsNewDialog == nullptr)
myWhatsNewDialog = make_unique<WhatsNewDialog>(instance(), parent(), _font, _w, _h);
myWhatsNewDialog->open();
}

View File

@ -26,6 +26,7 @@ class BrowserDialog;
class OptionsDialog;
class GlobalPropsDialog;
class StellaSettingsDialog;
class WhatsNewDialog;
class OSystem;
class Properties;
class EditTextWidget;
@ -122,6 +123,7 @@ class LauncherDialog : public Dialog
void showOnlyROMs(bool state);
void setDefaultDir();
void openSettings();
void openWhatsNew();
private:
unique_ptr<OptionsDialog> myOptionsDialog;
@ -129,6 +131,8 @@ class LauncherDialog : public Dialog
unique_ptr<ContextMenu> myMenu;
unique_ptr<GlobalPropsDialog> myGlobalProps;
unique_ptr<BrowserDialog> myRomDir;
unique_ptr<WhatsNewDialog> myWhatsNewDialog;
unique_ptr<GUI::MessageBox> myWhatsNewMsg;
// automatically sized font for ROM info viewer
unique_ptr<GUI::Font> myROMInfoFont;

View File

@ -222,16 +222,16 @@ static const uInt16 stella12x24t_font_bits[] = { // NOLINT : too complicated to
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| **** |
| ******** |
| ******** |
| ********** |
| ********** |
| ********** |
| ********** |
| ******** |
| ******** |
| **** |
| |
| |
| |
@ -248,16 +248,16 @@ static const uInt16 stella12x24t_font_bits[] = { // NOLINT : too complicated to
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0b0000111100000000,
0b0011111110000000,
0b0011111110000000,
0b0111111111000000,
0b0111111111000000,
0b0111111111000000,
0b0111111111000000,
0b0011111110000000,
0b0011111110000000,
0b0000111100000000,
0x0000,
0x0000,
0x0000,

View File

@ -247,20 +247,20 @@ static const uInt16 stella14x28t_font_bits[] = { // NOLINT : too complicated to
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| **** |
| ******** |
| ********** |
| ********** |
| ************ |
| ************ |
| ************ |
| ************ |
| ************ |
| ************ |
| ********** |
| ********** |
| ******** |
| **** |
| |
| |
| |
@ -277,20 +277,20 @@ static const uInt16 stella14x28t_font_bits[] = { // NOLINT : too complicated to
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0b0000011110000000,
0b0001111111100000,
0b0011111111110000,
0b0011111111110000,
0b0111111111111000,
0b0111111111111000,
0b0111111111111000,
0b0111111111111000,
0b0111111111111000,
0b0111111111111000,
0b0011111111110000,
0b0011111111110000,
0b0001111111100000,
0b0000011110000000,
0x0000,
0x0000,
0x0000,

View File

@ -272,20 +272,20 @@ static const uInt16 stella16x32t_font_bits[] = { // NOLINT : too complicated to
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ***** |
| ********* |
| *********** |
| *********** |
| ************* |
| ************* |
| ************* |
| ************* |
| ************* |
| ************* |
| *********** |
| *********** |
| ********* |
| ***** |
| |
| |
| |
@ -306,20 +306,20 @@ static const uInt16 stella16x32t_font_bits[] = { // NOLINT : too complicated to
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0b0000011111000000,
0b0001111111110000,
0b0011111111111000,
0b0011111111111000,
0b0111111111111100,
0b0111111111111100,
0b0111111111111100,
0b0111111111111100,
0b0111111111111100,
0b0111111111111100,
0b0011111111111000,
0b0011111111111000,
0b0001111111110000,
0b0000011111000000,
0x0000,
0x0000,
0x0000,

View File

@ -202,14 +202,14 @@ static const uInt16 stellaLarge_font_bits[] = { // NOLINT : too complicated to
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| **** |
| ****** |
| ******** |
| ******** |
| ******** |
| ******** |
| ****** |
| **** |
| |
| |
| |
@ -224,14 +224,14 @@ static const uInt16 stellaLarge_font_bits[] = { // NOLINT : too complicated to
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0b0001111000000000,
0b0011111100000000,
0b0111111110000000,
0b0111111110000000,
0b0111111110000000,
0b0111111110000000,
0b0011111100000000,
0b0001111000000000,
0x0000,
0x0000,
0x0000,

View File

@ -50,6 +50,7 @@ MODULE_OBJS := \
src/gui/TimeMachine.o \
src/gui/UIDialog.o \
src/gui/VideoAudioDialog.o \
src/gui/WhatsNewDialog.o \
src/gui/Widget.o
MODULE_DIRS += \

View File

@ -777,6 +777,7 @@
<ClCompile Include="..\gui\TimeLineWidget.cxx" />
<ClCompile Include="..\gui\TimeMachine.cxx" />
<ClCompile Include="..\gui\TimeMachineDialog.cxx" />
<ClCompile Include="..\gui\WhatsNewDialog.cxx" />
<ClCompile Include="FSNodeWINDOWS.cxx" />
<ClCompile Include="OSystemWINDOWS.cxx" />
<ClCompile Include="..\common\PNGLibrary.cxx" />
@ -1818,6 +1819,7 @@
<ClInclude Include="..\gui\TimeLineWidget.hxx" />
<ClInclude Include="..\gui\TimeMachine.hxx" />
<ClInclude Include="..\gui\TimeMachineDialog.hxx" />
<ClInclude Include="..\gui\WhatsNewDialog.hxx" />
<ClInclude Include="..\libpng\pngdebug.h" />
<ClInclude Include="..\libpng\pnginfo.h" />
<ClInclude Include="..\libpng\pnglibconf.h" />

View File

@ -1014,6 +1014,9 @@
<ClCompile Include="..\emucore\CartCreator.cxx">
<Filter>Source Files\emucore</Filter>
</ClCompile>
<ClCompile Include="..\gui\WhatsNewDialog.cxx">
<Filter>Source Files\gui</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\common\bspf.hxx">
@ -2081,6 +2084,9 @@
<ClInclude Include="..\emucore\CartCreator.hxx">
<Filter>Header Files\emucore</Filter>
</ClInclude>
<ClInclude Include="..\gui\WhatsNewDialog.hxx">
<Filter>Header Files\gui</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="stella.ico">