From 692f85b0c521390a81fe6405a8371dda69d066cc Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 5 Dec 2009 23:01:19 +0000 Subject: [PATCH] Add new demo map --- include/XMLBuilder.hpp | 12 +- maps/goods_demo/goods_demo.bin | Bin 0 -> 4364 bytes maps/goods_demo/goods_demo.xml | 772 +++++++++++++++++++++++++++++++++ src/gui/ContainerWidget.cpp | 5 +- 4 files changed, 785 insertions(+), 4 deletions(-) create mode 100644 maps/goods_demo/goods_demo.bin create mode 100644 maps/goods_demo/goods_demo.xml diff --git a/include/XMLBuilder.hpp b/include/XMLBuilder.hpp index ba4a877..c56f0bf 100644 --- a/include/XMLBuilder.hpp +++ b/include/XMLBuilder.hpp @@ -41,9 +41,15 @@ namespace xml { element& addAttribute(const string& name, T t) { if (hasChildren) - throw runtime_error("Cannot add XML attributes after children"); - else - str += " " + name + "=\"" + lexical_cast(t) + "\""; + throw runtime_error( + "Cannot add XML attributes after children"); + else { + ostringstream ss; + ss << boolalpha; + ss << " " << name << "=\"" << t << "\""; + + str += ss.str(); + } return *this; } diff --git a/maps/goods_demo/goods_demo.bin b/maps/goods_demo/goods_demo.bin new file mode 100644 index 0000000000000000000000000000000000000000..502d61b2b70d1797f6ed0ee967f594eb5aa7d61e GIT binary patch literal 4364 zcmchaJ#y4Q5QSv|?%)VVWCWB95xY`Eq>PA&fI^s<3vd8Z0s%1>Al_XLFgCF-zy$~? zYU!_MTH6{8%NAa6RhLFH{qwr}^{jkWRn?iuWeAJ+!>~jyL#GngA?<~QsNLv~80K5n z;`g+<==bWPk3OWx1xx-lI85(DwC!rSI+2+f1~vtWpr&g&;l-}g(|e{`dS4=^U? zN%cnKe;5YEz}_%iFN4JYKNvdg1vn7mTb~X{;bTh*m4KGv7q!VK~ETiqd-WZ02v()3!53>muUiPWkhHIUg*4bba2LZ>=?PA~tkmJbFN$=+6Mk zhGF22K+xqI!Rxb5lJ{S+V}}iM9sP95YjR0`X0`QLz<{o|Czm|mh+$d>^x!Z(q?Zrt z@A_`};M4kwKk+e}39xWR4)h}8h~G?{xxeE5K+WkNGxctG+TO2g#Q_Fli+$=#Ikx!+ z8~utL;P*`HKEcbm&DFF%9p6(8@qcWewcG8T@s1OJ#ok-o{7F7wwtD3?GYrN}vqzsE z+^b)=&-=$McOCiX_NM=br*g^n&g-Yz=uAxO5Ek4g^ng2-UZ#A!`Jrp&g3V8!2k%H; zhvZzpIq6B9r*aRHk8!?oVEBd)`AnK#?2+^wgoXWyDQ zNUmc!$}{nGo?mYBx9?U5vDbUY{FLfqXUBfpJUA@J4zbrCxq<=SMl9T!yZ>|c8XxJ9 zUXy>in{@u*hSg@rg*dzDGUN99%Pa_#@ecNO(Qo`lL + +No Name + + + + +Station1 + + + +Station2 + + + +Station4 + + + +Station3 + + +goods_demo.bin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gui/ContainerWidget.cpp b/src/gui/ContainerWidget.cpp index 8a349cd..397ad1d 100644 --- a/src/gui/ContainerWidget.cpp +++ b/src/gui/ContainerWidget.cpp @@ -52,8 +52,11 @@ void ContainerWidget::adjustForTheme(const Theme& theme) bool ContainerWidget::handleClick(int x, int y) { + if (!visible()) + return false; + bool accepted = false; - + for (ChildList::const_iterator it = constBegin(); it != constEnd(); ++it) { Widget& w = **it; -- 2.39.2