[SCM] Wormux PKG branch, trunk-ups, updated. 0352c121d7d62492ec12e1d47d64c955e30b8e5c
gentildemon
gentildemon at 30ef787d-52ff-0310-b286-e08351bb7647
Wed Aug 27 18:49:05 UTC 2008
The following commit has been merged in the trunk-ups branch:
commit 0352c121d7d62492ec12e1d47d64c955e30b8e5c
Author: gentildemon <gentildemon at 30ef787d-52ff-0310-b286-e08351bb7647>
Date: Wed Aug 27 09:35:29 2008 +0000
task #6134 - translatable shortkeys help menu
Not yet fully finished but a good first step!
git-svn-id: svn+ssh://svn.gna.org/svn/wormux/trunk@4904 30ef787d-52ff-0310-b286-e08351bb7647
diff --git a/data/graphism.xml b/data/graphism.xml
index 55ed3d0..3eb935d 100644
--- a/data/graphism.xml
+++ b/data/graphism.xml
@@ -161,8 +161,7 @@
<section name="help">
<surface name="background" file="menu/background_help.png" />
- <surface name="help_shortkeys_en" file="help/en/shortkeys.png" />
- <surface name="help_shortkeys_es" file="help/es/shortkeys.png" />
+ <surface name="shortkeys" file="menu/help_shortkeys.png" />
</section>
<section name="object">
diff --git a/data/menu/help_shortkeys.png b/data/menu/help_shortkeys.png
new file mode 100644
index 0000000..b22d290
Binary files /dev/null and b/data/menu/help_shortkeys.png differ
diff --git a/src/menu/help_menu.cpp b/src/menu/help_menu.cpp
index b4050ed..26ce73c 100644
--- a/src/menu/help_menu.cpp
+++ b/src/menu/help_menu.cpp
@@ -20,11 +20,12 @@
*****************************************************************************/
#include "include/app.h"
+#include "graphic/text.h"
+#include "graphic/sprite.h"
#include "graphic/video.h"
-#include "gui/box.h"
-#include "gui/picture_widget.h"
#include "menu/help_menu.h"
#include "game/config.h"
+#include "tool/i18n.h"
#include "tool/resource_manager.h"
#include "tool/xml_document.h"
@@ -34,23 +35,10 @@ static const uint CHECKBOX_SIZE = 50;
HelpMenu::HelpMenu() :
Menu("help/background", vOk)
{
- Point2i size = GetMainWindow().GetSize()
- - Point2i(2*BORDER,2*BORDER+CHECKBOX_SIZE);
-
- std::string lang = Config::GetInstance()->GetLanguage();
Profile *res = resource_manager.LoadXMLProfile( "graphism.xml", false);
- const xmlNode *elem = resource_manager.GetElement (res, "surface", "help/help_shortkeys_" + lang);
- std::string filename;
- if (elem == NULL || !res->doc->ReadStringAttr(elem, "file", filename))
- lang = "en";
+ img_keyboard = new Sprite(resource_manager.LoadImage(res, "help/shortkeys"), true);
+ img_keyboard->cache.EnableLastFrameCache();
resource_manager.UnLoadXMLProfile(res);
- PictureWidget *help_image = new PictureWidget(size, "help/help_shortkeys_" + lang, true);
-
- VBox *help = new VBox(size.x);
- help->SetPosition(BORDER, BORDER);
- help->AddWidget(help_image);
- widgets.AddWidget(help);
- widgets.Pack();
}
HelpMenu::~HelpMenu()
@@ -67,6 +55,41 @@ bool HelpMenu::signal_cancel()
return true;
}
+void HelpMenu::DrawBackground()
+{
+ Menu::DrawBackground();
+
+ img_keyboard->Blit(GetMainWindow(), BORDER, BORDER);
+
+ Text tmp(_("Quit game"), dark_gray_color, Font::FONT_SMALL, Font::FONT_NORMAL, false);
+ tmp.SetMaxWidth(130);
+
+ tmp.DrawTopLeft(Point2i(12+BORDER, 31));
+ tmp.Set(_("Show/hide interface")); tmp.DrawTopLeft(Point2i(147+BORDER, 31));
+ tmp.Set(_("Fullscreen / window")); tmp.DrawTopLeft(Point2i(311+BORDER, 31));
+ tmp.Set(_("High jump")); tmp.DrawTopLeft(Point2i(459+BORDER, 31));
+ tmp.Set(_("Talk in network battle")); tmp.DrawTopLeft(Point2i(12+BORDER, 59));
+ tmp.Set(_("Change weapon category")); tmp.DrawTopLeft(Point2i(147+BORDER, 59));
+ tmp.Set(_("Configuration menu")); tmp.DrawTopLeft(Point2i(311+BORDER, 59));
+ tmp.Set(_("Jump")); tmp.DrawTopLeft(Point2i(459+BORDER, 59));
+ tmp.Set(_("Drag&drop: Move camera")); tmp.DrawTopLeft(Point2i(539+BORDER, 108));
+ tmp.Set(_("Click: Center camera on character")); tmp.DrawTopLeft(Point2i(539+BORDER, 137));
+ tmp.Set(_("Change weapon countdown")); tmp.DrawTopLeft(Point2i(539+BORDER, 166));
+ tmp.Set(_("Change aim angle")); tmp.DrawTopLeft(Point2i(539+BORDER, 195));
+ tmp.Set(_("Move character")); tmp.DrawTopLeft(Point2i(539+BORDER, 224));
+ tmp.Set(_("On map: Select a target")); tmp.DrawTopLeft(Point2i(539+BORDER, 253));
+ tmp.Set(_("On a character: Changes active one")); tmp.DrawTopLeft(Point2i(539+BORDER, 281));
+ tmp.Set(_("Show weapons menu")); tmp.DrawTopLeft(Point2i(539+BORDER, 310));
+ tmp.Set(_("Smaller aim angle and walk step")); tmp.DrawTopLeft(Point2i(25+BORDER, 271));
+ tmp.Set(_("Jump backwards")); tmp.DrawTopLeft(Point2i(188+BORDER, 271));
+ tmp.Set(_("Pause")); tmp.DrawTopLeft(Point2i(338+BORDER, 271));
+ tmp.Set(_("Move camera with mouse or arrows")); tmp.DrawTopLeft(Point2i(25+BORDER, 308));
+ tmp.Set(_("Weapon: Fire Bonus box: falls fast")); tmp.DrawTopLeft(Point2i(188+BORDER, 308));
+ tmp.Set(_("Show/hide minimap")); tmp.DrawTopLeft(Point2i(338+BORDER, 308));
+ tmp.Set(_("Change active character")); tmp.DrawTopLeft(Point2i(25+BORDER, 336));
+ tmp.Set(_("Center camera to character")); tmp.DrawTopLeft(Point2i(188+BORDER, 336));
+}
+
void HelpMenu::Draw(const Point2i& /*mousePosition*/)
{
}
diff --git a/src/menu/help_menu.h b/src/menu/help_menu.h
index 5d65cc9..48509dd 100644
--- a/src/menu/help_menu.h
+++ b/src/menu/help_menu.h
@@ -26,14 +26,18 @@
// Forward declarations
class ListBox;
+class Sprite;
class HelpMenu : public Menu
{
private:
+ Sprite* img_keyboard;
+
bool signal_ok();
bool signal_cancel();
void Draw(const Point2i &mousePosition);
+ void DrawBackground();
void OnClick(const Point2i &mousePosition, int button);
void OnClickUp(const Point2i &mousePosition, int button);
--
Wormux PKG
More information about the Pkg-games-commits
mailing list