[Scummvm-cvs-logs] SF.net SVN: scummvm:[34537] scummvm/trunk
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Sep 14 22:42:51 CEST 2008
Revision: 34537
http://scummvm.svn.sourceforge.net/scummvm/?rev=34537&view=rev
Author: lordhoto
Date: 2008-09-14 20:42:50 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
Added ScummVM logo to GMM.
Modified Paths:
--------------
scummvm/trunk/engines/dialogs.cpp
scummvm/trunk/engines/dialogs.h
scummvm/trunk/gui/ThemeModern.cpp
scummvm/trunk/gui/ThemeModern.h
scummvm/trunk/gui/theme.h
scummvm/trunk/gui/themes/modern.ini
scummvm/trunk/gui/themes/modern.zip
Modified: scummvm/trunk/engines/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/dialogs.cpp 2008-09-14 20:01:01 UTC (rev 34536)
+++ scummvm/trunk/engines/dialogs.cpp 2008-09-14 20:42:50 UTC (rev 34537)
@@ -35,6 +35,7 @@
#include "gui/eval.h"
#include "gui/newgui.h"
#include "gui/ListWidget.h"
+#include "gui/theme.h"
#include "engines/dialogs.h"
#include "engines/engine.h"
@@ -77,7 +78,18 @@
MainMenuDialog::MainMenuDialog(Engine *engine)
: GlobalDialog("globalmain"), _engine(engine) {
+#ifndef DISABLE_FANCY_THEMES
+ _logo = 0;
+ if (g_gui.evaluator()->getVar("global_logo.visible") == 1 && g_gui.theme()->supportsImages()) {
+ _logo = new GUI::GraphicsWidget(this, "global_logo");
+ _logo->useThemeTransparency(true);
+ _logo->setGfx(g_gui.theme()->getImageSurface(GUI::Theme::kImageLogoSmall));
+ } else {
+ new StaticTextWidget(this, "global_title", "ScummVM");
+ }
+#else
new StaticTextWidget(this, "global_title", "ScummVM");
+#endif
new StaticTextWidget(this, "global_version", gScummVMVersionDate);
@@ -136,6 +148,37 @@
}
}
+void MainMenuDialog::reflowLayout() {
+#ifndef DISABLE_FANCY_THEMES
+ if (g_gui.evaluator()->getVar("global_logo.visible") == 1 && g_gui.theme()->supportsImages()) {
+ if (!_logo)
+ _logo = new GUI::GraphicsWidget(this, "global_logo");
+ _logo->useThemeTransparency(true);
+ _logo->setGfx(g_gui.theme()->getImageSurface(GUI::Theme::kImageLogoSmall));
+
+ GUI::StaticTextWidget *title = (StaticTextWidget *)findWidget("global_title");
+ if (title) {
+ removeWidget(title);
+ title->setNext(0);
+ delete title;
+ }
+ } else {
+ GUI::StaticTextWidget *title = (StaticTextWidget *)findWidget("global_title");
+ if (!title)
+ new StaticTextWidget(this, "global_title", "ScummVM");
+
+ if (_logo) {
+ removeWidget(_logo);
+ _logo->setNext(0);
+ delete _logo;
+ _logo = 0;
+ }
+ }
+#endif
+
+ Dialog::reflowLayout();
+}
+
enum {
kOKCmd = 'ok '
};
Modified: scummvm/trunk/engines/dialogs.h
===================================================================
--- scummvm/trunk/engines/dialogs.h 2008-09-14 20:01:01 UTC (rev 34536)
+++ scummvm/trunk/engines/dialogs.h 2008-09-14 20:42:50 UTC (rev 34537)
@@ -49,9 +49,12 @@
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
+ virtual void reflowLayout();
+
protected:
Engine *_engine;
+ GUI::GraphicsWidget *_logo;
GUI::ButtonWidget *_rtlButton;
GUI::Dialog *_aboutDialog;
GUI::Dialog *_optionsDialog;
Modified: scummvm/trunk/gui/ThemeModern.cpp
===================================================================
--- scummvm/trunk/gui/ThemeModern.cpp 2008-09-14 20:01:01 UTC (rev 34536)
+++ scummvm/trunk/gui/ThemeModern.cpp 2008-09-14 20:42:50 UTC (rev 34537)
@@ -1159,6 +1159,15 @@
return _colors[kColorStateEnabled];
}
+const Graphics::Surface *ThemeModern::getImageSurface(const kThemeImages n) const {
+ if (n == kImageLogo)
+ return _images[kThemeLogo];
+ else if (n == kImageLogoSmall)
+ return _images[kThemeLogoSmall];
+ else
+ return 0;
+}
+
void ThemeModern::resetupGuiRenderer() {
if (_lastUsedBitMask == gBitFormat || !_initOk) {
// ok same format no need to reload
@@ -1334,6 +1343,7 @@
_imageHandles[kWidgetArrow] = _evaluator->getStringVar("pix_widget_arrow");
_imageHandles[kThemeLogo] = _evaluator->getStringVar("pix_theme_logo");
+ _imageHandles[kThemeLogoSmall] = _evaluator->getStringVar("pix_theme_logo_small");
_imageHandles[kGUICursor] = _evaluator->getStringVar("pix_cursor_image");
Modified: scummvm/trunk/gui/ThemeModern.h
===================================================================
--- scummvm/trunk/gui/ThemeModern.h 2008-09-14 20:01:01 UTC (rev 34536)
+++ scummvm/trunk/gui/ThemeModern.h 2008-09-14 20:42:50 UTC (rev 34537)
@@ -82,7 +82,7 @@
int getTabPadding() const;
bool supportsImages() const { return true; }
- const Graphics::Surface *getImageSurface(const kThemeImages n) const { return n == kImageLogo ? _images[kThemeLogo] : 0; }
+ const Graphics::Surface *getImageSurface(const kThemeImages n) const;
private:
void colorFade(const Common::Rect &r, OverlayColor start, OverlayColor end, uint factor = 1);
void drawRect(const Common::Rect &r, const Graphics::Surface *corner, const Graphics::Surface *top,
@@ -193,18 +193,19 @@
kWidgetSmallBkgd = 38,
kThemeLogo = 39,
+ kThemeLogoSmall = 40,
- kPopUpWidgetBkgdCorner = 40,
- kPopUpWidgetBkgdTop = 41,
- kPopUpWidgetBkgdLeft = 42,
- kPopUpWidgetBkgd = 43,
+ kPopUpWidgetBkgdCorner = 41,
+ kPopUpWidgetBkgdTop = 42,
+ kPopUpWidgetBkgdLeft = 43,
+ kPopUpWidgetBkgd = 44,
- kEditTextBkgdCorner = 44,
- kEditTextBkgdTop = 45,
- kEditTextBkgdLeft = 46,
- kEditTextBkgd = 47,
+ kEditTextBkgdCorner = 45,
+ kEditTextBkgdTop = 46,
+ kEditTextBkgdLeft = 47,
+ kEditTextBkgd = 48,
- kGUICursor = 48,
+ kGUICursor = 49,
kImageHandlesMax
};
Modified: scummvm/trunk/gui/theme.h
===================================================================
--- scummvm/trunk/gui/theme.h 2008-09-14 20:01:01 UTC (rev 34536)
+++ scummvm/trunk/gui/theme.h 2008-09-14 20:42:50 UTC (rev 34537)
@@ -356,7 +356,8 @@
//! Special image ids for images used in the GUI
enum kThemeImages {
- kImageLogo = 0 //! ScummVM Logo used in the launcher
+ kImageLogo = 0, //! ScummVM Logo used in the launcher
+ kImageLogoSmall //! ScummVM logo used in the GMM
};
/**
Modified: scummvm/trunk/gui/themes/modern.ini
===================================================================
--- scummvm/trunk/gui/themes/modern.ini 2008-09-14 20:01:01 UTC (rev 34536)
+++ scummvm/trunk/gui/themes/modern.ini 2008-09-14 20:42:50 UTC (rev 34537)
@@ -67,6 +67,7 @@
pix_edittext_bkgd_bkgd="button_bkgd.bmp"
pix_theme_logo="logo.bmp"
+pix_theme_logo_small="logo_small.bmp"
pix_cursor_image="cursor.bmp"
@@ -260,6 +261,30 @@
use=scummmain
+#### Global Main Menu Dialog
+# note that globalmain size depends on overall height
+hBorder=10
+gmW=(scummmainButtonWidth + (2 * scummmainHOffset) + 80)
+global_logo=((gmW - 142) / 2) 25 142 40
+global_logo.visible=true
+global_version=hBorder (prev.y + prev.h) (gmW - 2 * hBorder) kLineHeight
+global_version.align=kTextAlignCenter
+gmY=((scummmainVSpace * 7)+ scummmainVAddOff)
+globalmain_resume=globalmainHOffset gmY scummmainButtonWidth scummmainButtonHeight
+gmY=(gmY + scummmainButtonHeight + scummmainVAddOff)
+gmY=(gmY + scummmainVSpace)
+globalmain_options=prev.x gmY prev.w prev.h
+gmY=(gmY + scummmainButtonHeight + scummmainVAddOff)
+globalmain_about=prev.x gmY prev.w prev.h
+gmY=(gmY + scummmainButtonHeight + scummmainVAddOff)
+gmY=(gmY + scummmainVSpace)
+globalmain_rtl=prev.x gmY prev.w prev.h
+gmY=(gmY + scummmainButtonHeight + scummmainVAddOff)
+globalmain_quit=prev.x gmY prev.w prev.h
+gmY=(gmY + scummmainButtonHeight + scummmainVAddOff)
+gmH=(gmY + scummmainVSpace)
+globalmain=((w - gmW) / 2) ((h - gmH) / 2) gmW gmH
+
### global options
globaloptions=insetX insetY insetW insetH
set_parent=globaloptions
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list