|
From: Tapio V. <aa...@us...> - 2010-08-21 18:03:43
|
Module: performous
Branch: master
Commit: 94319ff930e7384f4776fce3fe233151f848772a
Author: Tapio Vierros <tap...@gm...>
Date: Fri Jul 16 21:32:23 2010 +0300
Hack together a crude background for menus.
---
game/instrumentgraph.cc | 4 ++
game/screen_sing.cc | 4 ++
game/theme.cc | 2 +-
themes/default/instrumentmenu_bg.svg | 81 ++++++++++++++++++++++++++++++++++
win32/setup.nsi | 1 +
5 files changed, 91 insertions(+), 1 deletions(-)
diff --git a/game/instrumentgraph.cc b/game/instrumentgraph.cc
index 1ac25ab..2177dde 100644
--- a/game/instrumentgraph.cc
+++ b/game/instrumentgraph.cc
@@ -62,9 +62,13 @@ void InstrumentGraph::drawMenu() {
double offsetX = 0.5 * (dimensions.x1() + dimensions.x2());
float step = 0.05;
float y = -0.6 * m_menu.getOptions().size() * step;
+ float h = m_menu.getOptions().size() * step + step;
// Some helper vars
ThemeInstrumentMenu& th = *m_menuTheme;
MenuOptions::const_iterator cur = static_cast<MenuOptions::const_iterator>(&m_menu.current());
+ // Background
+ th.bg.dimensions.middle(.05 + offsetX).center((y+step)*.5).stretch(.45, h);
+ th.bg.draw();
// Loop through menu items
for (MenuOptions::const_iterator it = m_menu.begin(); it != m_menu.end(); ++it) {
SvgTxtTheme* txt = &th.option;
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index a367263..0fb6dd9 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -485,9 +485,13 @@ void ScreenSing::drawMenu() {
if (m_menu.empty()) return;
float step = 0.075;
float y = -0.6 * m_menu.getOptions().size() * step;
+ float h = m_menu.getOptions().size() * step + step;
// Some helper vars
ThemeInstrumentMenu& th = *m_menuTheme;
MenuOptions::const_iterator cur = static_cast<MenuOptions::const_iterator>(&m_menu.current());
+ // Background
+ th.bg.dimensions.middle(.05).center((y+step)*.5).stretch(.45, h);
+ th.bg.draw();
// Loop through menu items
for (MenuOptions::const_iterator it = m_menu.begin(); it != m_menu.end(); ++it) {
SvgTxtTheme* txt = &th.option;
diff --git a/game/theme.cc b/game/theme.cc
index a70e5fd..ac90a57 100644
--- a/game/theme.cc
+++ b/game/theme.cc
@@ -58,7 +58,7 @@ ThemeIntro::ThemeIntro():
}
ThemeInstrumentMenu::ThemeInstrumentMenu():
- Theme(getThemePath("warning.svg")),
+ Theme(getThemePath("instrumentmenu_bg.svg")),
back_h(getThemePath("instrumentmenu_back_highlight.svg")),
option(getThemePath("instrumentmenu_option.svg"), config["graphic/text_lod"].f()),
option_selected(getThemePath("instrumentmenu_option_selected.svg"), config["graphic/text_lod"].f()),
diff --git a/themes/default/instrumentmenu_bg.svg b/themes/default/instrumentmenu_bg.svg
new file mode 100644
index 0000000..248fe4e
--- /dev/null
+++ b/themes/default/instrumentmenu_bg.svg
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="300"
+ height="400"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ version="1.0"
+ sodipodi:docname="instrumentmenu_bg.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective2963"
+ inkscape:persp3d-origin="88 : 58.666667 : 1"
+ inkscape:vp_z="176 : 88 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 88 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="55.32752"
+ inkscape:cy="231.31119"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1313"
+ inkscape:window-height="722"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Calque 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,80)">
+ <rect
+ style="fill:#ffffff;fill-opacity:0.66810346;stroke:#000000;stroke-width:1.50000000000000000;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect2383"
+ width="278.5"
+ height="378.5"
+ x="10.75"
+ y="-69.25"
+ rx="31.357962"
+ ry="55.004662" />
+ </g>
+</svg>
diff --git a/win32/setup.nsi b/win32/setup.nsi
index 41c59e0..1c05a35 100644
--- a/win32/setup.nsi
+++ b/win32/setup.nsi
@@ -168,6 +168,7 @@ Section "SezionePrincipale" SEC01
File "${FILES_PATH}\themes\default\instrument_cover.svg"
File "${FILES_PATH}\themes\default\instrumenthelp.svg"
File "${FILES_PATH}\themes\default\instrumentmenu_back_highlight.svg"
+ File "${FILES_PATH}\themes\default\instrumentmenu_bg.svg"
File "${FILES_PATH}\themes\default\instrumentmenu_comment.svg"
File "${FILES_PATH}\themes\default\instrumentmenu_option.svg"
File "${FILES_PATH}\themes\default\instrumentmenu_option_selected.svg"
|