Advertisement
Guest User

StuntRally MyGUI patch

a guest
Aug 16th, 2011
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 33.95 KB | None | 0 0
  1. diff -Nur stuntrally.orig/source/CMakeLists.txt stuntrally//source/CMakeLists.txt
  2. --- stuntrally.orig/source/CMakeLists.txt   2011-07-31 09:08:29.000000000 +0200
  3. +++ stuntrally//source/CMakeLists.txt   2011-08-13 01:19:01.000000000 +0200
  4. @@ -15,7 +15,7 @@
  5.  endif()
  6.  
  7.  # Search include files from all source sub directories
  8. -include_directories(btOgre bullet ogre paged-geom road tinyxml vdrift)
  9. +include_directories(btOgre bullet ogre paged-geom road tinyxml vdrift mygui)
  10.  
  11.  # Compile our libraries
  12.  foreach(ourlib   tinyxml bullet oisb paged-geom)
  13. diff -Nur stuntrally.orig/source/editor/Gui_Util.cpp stuntrally//source/editor/Gui_Util.cpp
  14. --- stuntrally.orig/source/editor/Gui_Util.cpp  2011-07-31 09:08:29.000000000 +0200
  15. +++ stuntrally//source/editor/Gui_Util.cpp  2011-08-13 01:32:56.000000000 +0200
  16. @@ -571,7 +571,7 @@
  17.      while (widgets.next())
  18.  
  19.      {
  20.  
  21.          WidgetPtr wp = widgets.current();
  22.  
  23. -       wp->setAlign(Align::Relative);
  24.  
  25. +       wp->setAlign(WidgetInfo::Relative);
  26.  
  27.          bool tip = wp->isUserString("tip");
  28.  
  29.         if (tip)  // if has tooltip string
  30.  
  31.         {  
  32.  
  33. diff -Nur stuntrally.orig/source/editor/OgreApp.h stuntrally//source/editor/OgreApp.h
  34. --- stuntrally.orig/source/editor/OgreApp.h 2011-07-31 09:08:29.000000000 +0200
  35. +++ stuntrally//source/editor/OgreApp.h 2011-08-13 01:24:50.000000000 +0200
  36. @@ -19,6 +19,7 @@
  37.  #include <OgrePageManager.h>
  38.  
  39.  
  40.  
  41.  #include <MyGUI.h>
  42.  
  43. +#include "MessageBox/MessageBox.h"
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  const int ciShadowNumSizes = 4;
  50.  
  51. diff -Nur stuntrally.orig/source/mygui/BaseLayout/Attribute.h stuntrally//source/mygui/BaseLayout/Attribute.h
  52. --- stuntrally.orig/source/mygui/BaseLayout/Attribute.h 1970-01-01 01:00:00.000000000 +0100
  53. +++ stuntrally//source/mygui/BaseLayout/Attribute.h 2011-08-13 01:27:05.000000000 +0200
  54. @@ -0,0 +1,123 @@
  55. +/*!
  56. +   @file
  57. +   @author     Albert Semenov
  58. +   @date       10/2009
  59. +   @module
  60. +*/
  61. +
  62. +#ifndef __ATTRIBUTE_H__
  63. +#define __ATTRIBUTE_H__
  64. +
  65. +namespace attribute
  66. +{
  67. +
  68. +   // êëàññ îáåðòêà äëÿ óäàëåíèÿ äàííûõ èç ñòàòè÷åñêîãî âåêòîðà
  69. +   template <typename Type>
  70. +   struct DataHolder
  71. +   {
  72. +       ~DataHolder()
  73. +       {
  74. +           for (typename Type::iterator item = data.begin(); item != data.end(); ++item)
  75. +               delete (*item).first;
  76. +       }
  77. +
  78. +       Type data;
  79. +   };
  80. +
  81. +   // èíòåðôåéñ äëÿ îáåðòêè ïîëÿ
  82. +   template <typename OwnerType, typename SetterType>
  83. +   struct Field
  84. +   {
  85. +       virtual bool set(OwnerType* _target, typename SetterType::BaseValueType* _value) = 0;
  86. +       virtual const std::string& getFieldTypeName() = 0;
  87. +   };
  88. +
  89. +   // øàáëîí äëÿ îáåðòêè ïîëÿ
  90. +   template <typename OwnerType, typename FieldType, typename SetterType>
  91. +   struct FieldHolder : public Field<OwnerType, SetterType>
  92. +   {
  93. +       FieldHolder(FieldType* OwnerType::* offset) : m_offset(offset) {  }
  94. +       FieldType* OwnerType::* const m_offset;
  95. +
  96. +       virtual bool set(OwnerType* _target, typename SetterType::BaseValueType* _value)
  97. +       {
  98. +           _target->*m_offset = SetterType::template convert<FieldType>(_value);
  99. +           return _target->*m_offset != 0;
  100. +       }
  101. +       virtual const std::string& getFieldTypeName()
  102. +       {
  103. +           return FieldType::getClassTypeName();
  104. +       }
  105. +   };
  106. +
  107. +   // øàáëîí äëÿ àòðèáóòà ïîëÿ
  108. +   template <typename OwnerType, typename ValueType, typename SetterType>
  109. +   struct AttributeField
  110. +   {
  111. +       typedef std::pair<Field<OwnerType, SetterType>*, ValueType> BindPair;
  112. +       typedef std::vector<BindPair> VectorBindPair;
  113. +
  114. +       template <typename FieldType>
  115. +       AttributeField(FieldType* OwnerType::* _offset, const ValueType& _value)
  116. +       {
  117. +           getData().push_back(BindPair(new FieldHolder<OwnerType, FieldType, SetterType>(_offset), _value));
  118. +       }
  119. +       static VectorBindPair& getData()
  120. +       {
  121. +           static DataHolder<VectorBindPair> data;
  122. +           return data.data;
  123. +       }
  124. +   };
  125. +
  126. +   // ìàêðîñ äëÿ èíñòàíñèðîâàíèÿ àòðèáóòà ïîëÿ
  127. +#define DECLARE_ATTRIBUTE_FIELD(_name, _type, _setter) \
  128. +   template <typename OwnerType, typename ValueType = _type, typename SetterType = _setter> \
  129. +   struct _name : public attribute::AttributeField<OwnerType, ValueType, SetterType> \
  130. +   { \
  131. +       template <typename FieldType> \
  132. +       _name(FieldType* OwnerType::* _offset, const ValueType& _value) : \
  133. +           AttributeField<OwnerType, ValueType, SetterType>(_offset, _value) { } \
  134. +   }
  135. +
  136. +   // ìàêðîñ äëÿ èíñòàíñèðîâàíèÿ ýêçåìïëÿðà àòðèáóòà
  137. +#define ATTRIBUTE_FIELD(_attribute, _class, _field, _value) \
  138. +   struct _attribute##_##_field \
  139. +   { \
  140. +       _attribute##_##_field() \
  141. +       { \
  142. +           static attribute::_attribute<_class> bind(&_class::_field, _value); \
  143. +       } \
  144. +   } _attribute##_##_field
  145. +
  146. +
  147. +   // øàáëîí äëÿ àòðèáóòà êëàññà
  148. +   template <typename Type, typename ValueType>
  149. +   struct ClassAttribute
  150. +   {
  151. +       ClassAttribute(const ValueType& _value)
  152. +       {
  153. +           getData() = _value;
  154. +       }
  155. +       static ValueType& getData()
  156. +       {
  157. +           static ValueType data;
  158. +           return data;
  159. +       }
  160. +   };
  161. +
  162. +   // ìàêðîñ äëÿ èíñòàíñèðîâàíèÿ àòðèáóòà êëàññà
  163. +#define DECLARE_ATTRIBUTE_CLASS(_name, _type) \
  164. +   template <typename Type, typename ValueType = _type> \
  165. +   struct _name : public attribute::ClassAttribute<_name<Type>, ValueType> \
  166. +   { \
  167. +       _name(const ValueType& _value) : \
  168. +           ClassAttribute<_name<Type>, ValueType>(_value) { } \
  169. +   }
  170. +
  171. +   // ìàêðîñ äëÿ èíñòàíñèðîâàíèÿ ýêçåìïëÿðà êëàññà
  172. +#define ATTRIBUTE_CLASS(_attribute, _class, _value) \
  173. +   class _class; \
  174. +   static attribute::_attribute<_class> _attribute##_##_class(_value)
  175. +}
  176. +
  177. +#endif // __ATTRIBUTE_H__
  178. diff -Nur stuntrally.orig/source/mygui/BaseLayout/BaseLayout.h stuntrally//source/mygui/BaseLayout/BaseLayout.h
  179. --- stuntrally.orig/source/mygui/BaseLayout/BaseLayout.h    1970-01-01 01:00:00.000000000 +0100
  180. +++ stuntrally//source/mygui/BaseLayout/BaseLayout.h    2011-08-13 01:27:08.000000000 +0200
  181. @@ -0,0 +1,241 @@
  182. +/*!
  183. +   @file
  184. +   @author     Albert Semenov
  185. +   @date       07/2008
  186. +   @module
  187. +*/
  188. +
  189. +#ifndef __BASE_LAYOUT_H__
  190. +#define __BASE_LAYOUT_H__
  191. +
  192. +#include <MyGUI.h>
  193. +#include "WrapsAttribute.h"
  194. +
  195. +namespace wraps
  196. +{
  197. +
  198. +   class BaseLayout
  199. +   {
  200. +   protected:
  201. +       BaseLayout() : mMainWidget(nullptr)
  202. +       {
  203. +       }
  204. +
  205. +       BaseLayout(const std::string& _layout, MyGUI::Widget* _parent = nullptr) : mMainWidget(nullptr)
  206. +       {
  207. +           initialise(_layout, _parent);
  208. +       }
  209. +
  210. +       template <typename T>
  211. +       void assignWidget(T * & _widget, const std::string& _name, bool _throw = true, bool _createFakeWidgets = true)
  212. +       {
  213. +           _widget = nullptr;
  214. +           for (MyGUI::VectorWidgetPtr::iterator iter = mListWindowRoot.begin(); iter != mListWindowRoot.end(); ++iter)
  215. +           {
  216. +               MyGUI::Widget* find = (*iter)->findWidget(mPrefix + _name);
  217. +               if (nullptr != find)
  218. +               {
  219. +                   T* cast = find->castType<T>(false);
  220. +                   if (nullptr != cast)
  221. +                   {
  222. +                       _widget = cast;
  223. +                   }
  224. +                   else
  225. +                   {
  226. +                       MYGUI_LOG(Warning, "Widget with name '" << _name << "' have wrong type ('" <<
  227. +                           find->getTypeName() << "instead of '" << T::getClassTypeName() << "'). [" << mLayoutName << "]");
  228. +                       MYGUI_ASSERT( ! _throw, "Can't assign widget with name '" << _name << "'. [" << mLayoutName << "]");
  229. +                       if (_createFakeWidgets)
  230. +                           _widget = _createFakeWidget<T>(mMainWidget);
  231. +                   }
  232. +
  233. +                   return;
  234. +               }
  235. +           }
  236. +           MYGUI_LOG(Warning, "Widget with name '" << _name << "' not found. [" << mLayoutName << "]");
  237. +           MYGUI_ASSERT( ! _throw, "Can't assign widget with name '" << _name << "'. [" << mLayoutName << "]");
  238. +           if (_createFakeWidgets)
  239. +               _widget = _createFakeWidget<T>(mMainWidget);
  240. +       }
  241. +
  242. +       template <typename T>
  243. +       void assignBase(T * & _widget, const std::string& _name, bool _throw = true, bool _createFakeWidgets = true)
  244. +       {
  245. +           _widget = nullptr;
  246. +           for (MyGUI::VectorWidgetPtr::iterator iter = mListWindowRoot.begin(); iter != mListWindowRoot.end(); ++iter)
  247. +           {
  248. +               MyGUI::Widget* find = (*iter)->findWidget(mPrefix + _name);
  249. +               if (nullptr != find)
  250. +               {
  251. +                   _widget = new T(find);
  252. +                   mListBase.push_back(_widget);
  253. +                   return;
  254. +               }
  255. +           }
  256. +
  257. +           MYGUI_LOG(Warning, "Widget with name '" << _name << "' not found. [" << mLayoutName << "]");
  258. +           MYGUI_ASSERT( ! _throw, "Can't assign base widget with name '" << _name << "'. [" << mLayoutName << "]");
  259. +           if (_createFakeWidgets)
  260. +           {
  261. +               _widget = new T(_createFakeWidget<MyGUI::Widget>(mMainWidget));
  262. +               mListBase.push_back(_widget);
  263. +           }
  264. +       }
  265. +
  266. +       void initialise(const std::string& _layout, MyGUI::Widget* _parent = nullptr, bool _throw = true, bool _createFakeWidgets = true)
  267. +       {
  268. +           const std::string MAIN_WINDOW1 = "_Main";
  269. +           const std::string MAIN_WINDOW2 = "Root";
  270. +           mLayoutName = _layout;
  271. +
  272. +           // îáîðà÷èâàåì
  273. +           if (mLayoutName.empty())
  274. +           {
  275. +               mMainWidget = _parent;
  276. +           }
  277. +           // çàãðóæàåì ëåéàóò íà âèäæåò
  278. +           else
  279. +           {
  280. +               mPrefix = MyGUI::utility::toString(this, "_");
  281. +               mListWindowRoot = MyGUI::LayoutManager::getInstance().loadLayout(mLayoutName, mPrefix, _parent);
  282. +
  283. +               const std::string mainName1 = mPrefix + MAIN_WINDOW1;
  284. +               const std::string mainName2 = mPrefix + MAIN_WINDOW2;
  285. +               for (MyGUI::VectorWidgetPtr::iterator iter = mListWindowRoot.begin(); iter != mListWindowRoot.end(); ++iter)
  286. +               {
  287. +                   if ((*iter)->getName() == mainName1 || (*iter)->getName() == mainName2)
  288. +                   {
  289. +                       mMainWidget = (*iter);
  290. +
  291. +                       snapToParent(mMainWidget);
  292. +
  293. +                       break;
  294. +                   }
  295. +               }
  296. +
  297. +               if (mMainWidget == nullptr)
  298. +               {
  299. +                   MYGUI_LOG(Warning, "Root widget with name '" << MAIN_WINDOW1 << "' or '" << MAIN_WINDOW2 << "'  not found. [" << mLayoutName << "]");
  300. +                   MYGUI_ASSERT(!_throw, "No root widget. ['" << mLayoutName << "]");
  301. +                   if (_createFakeWidgets)
  302. +                       mMainWidget = _createFakeWidget<MyGUI::Widget>(_parent);
  303. +               }
  304. +           }
  305. +       }
  306. +
  307. +       void shutdown()
  308. +       {
  309. +           // óäàëÿåì âñå êëàññû
  310. +           for (VectorBasePtr::reverse_iterator iter = mListBase.rbegin(); iter != mListBase.rend(); ++iter)
  311. +               delete (*iter);
  312. +           mListBase.clear();
  313. +
  314. +           // óäàëÿåì âñå ðóòîâûå âèäæåòû
  315. +           MyGUI::LayoutManager::getInstance().unloadLayout(mListWindowRoot);
  316. +           mListWindowRoot.clear();
  317. +       }
  318. +
  319. +       template <typename Type>
  320. +       void initialiseByAttributes(Type* _owner, MyGUI::Widget* _parent = nullptr, bool _throw = true, bool _createFakeWidgets = true)
  321. +       {
  322. +           initialise(attribute::AttributeLayout<Type>::getData(), _parent, _throw, _createFakeWidgets);
  323. +
  324. +           typename attribute::AttributeFieldWidgetName<Type>::VectorBindPair& data = attribute::AttributeFieldWidgetName<Type>::getData();
  325. +           for (typename attribute::AttributeFieldWidgetName<Type>::VectorBindPair::iterator item = data.begin(); item != data.end(); ++item)
  326. +           {
  327. +               MyGUI::Widget* value = nullptr;
  328. +               assignWidget(value, item->second, _throw, false);
  329. +
  330. +               bool result = item->first->set(_owner, value);
  331. +
  332. +               if (!result && _createFakeWidgets)
  333. +               {
  334. +                   value = _createFakeWidgetT(item->first->getFieldTypeName(), mMainWidget);
  335. +                   item->first->set(_owner, value);
  336. +               }
  337. +           }
  338. +       }
  339. +   private:
  340. +       void snapToParent(MyGUI::Widget* _child)
  341. +       {
  342. +           if (_child->isUserString("SnapTo"))
  343. +           {
  344. +               MyGUI::Align align = MyGUI::Align::parse(_child->getUserString("SnapTo"));
  345. +
  346. +               MyGUI::IntCoord coord = _child->getCoord();
  347. +               MyGUI::IntSize size = _child->getParentSize();
  348. +
  349. +               if (align.isHStretch())
  350. +               {
  351. +                   coord.left = 0;
  352. +                   coord.width = size.width;
  353. +               }
  354. +               else if (align.isLeft())
  355. +               {
  356. +                   coord.left = 0;
  357. +               }
  358. +               else if (align.isRight())
  359. +               {
  360. +                   coord.left = size.width - coord.width;
  361. +               }
  362. +               else
  363. +               {
  364. +                   coord.left = (size.width - coord.width) / 2;
  365. +               }
  366. +
  367. +               if (align.isVStretch())
  368. +               {
  369. +                   coord.top = 0;
  370. +                   coord.height = size.height;
  371. +               }
  372. +               else if (align.isTop())
  373. +               {
  374. +                   coord.top = 0;
  375. +               }
  376. +               else if (align.isBottom())
  377. +               {
  378. +                   coord.top = size.height - coord.height;
  379. +               }
  380. +               else
  381. +               {
  382. +                   coord.top = (size.height - coord.height) / 2;
  383. +               }
  384. +
  385. +               _child->setCoord(coord);
  386. +           }
  387. +       }
  388. +
  389. +       template <typename T>
  390. +       T* _createFakeWidget(MyGUI::Widget* _parent)
  391. +       {
  392. +           return static_cast<T*>(_createFakeWidgetT(T::getClassTypeName(), _parent));
  393. +       }
  394. +
  395. +       MyGUI::Widget* _createFakeWidgetT(const std::string& _typeName, MyGUI::Widget* _parent)
  396. +       {
  397. +           if (_parent)
  398. +               return _parent->createWidgetT(_typeName, MyGUI::SkinManager::getInstance().getDefaultSkin(), MyGUI::IntCoord(), MyGUI::Align::Default);
  399. +
  400. +           return MyGUI::Gui::getInstance().createWidgetT(_typeName, MyGUI::SkinManager::getInstance().getDefaultSkin(), MyGUI::IntCoord(), MyGUI::Align::Default, "");
  401. +       }
  402. +
  403. +   public:
  404. +       virtual ~BaseLayout()
  405. +       {
  406. +           shutdown();
  407. +       }
  408. +
  409. +   protected:
  410. +       MyGUI::Widget* mMainWidget;
  411. +
  412. +   private:
  413. +       std::string mPrefix;
  414. +       std::string mLayoutName;
  415. +       MyGUI::VectorWidgetPtr mListWindowRoot;
  416. +       typedef std::vector<BaseLayout*> VectorBasePtr;
  417. +       VectorBasePtr mListBase;
  418. +   };
  419. +
  420. +} // namespace wraps
  421. +
  422. +#endif // __BASE_LAYOUT_H__
  423. diff -Nur stuntrally.orig/source/mygui/BaseLayout/WrapsAttribute.h stuntrally//source/mygui/BaseLayout/WrapsAttribute.h
  424. --- stuntrally.orig/source/mygui/BaseLayout/WrapsAttribute.h    1970-01-01 01:00:00.000000000 +0100
  425. +++ stuntrally//source/mygui/BaseLayout/WrapsAttribute.h    2011-08-13 01:27:11.000000000 +0200
  426. @@ -0,0 +1,47 @@
  427. +/*!
  428. +   @file
  429. +   @author     Albert Semenov
  430. +   @date       10/2009
  431. +   @module
  432. +*/
  433. +
  434. +#ifndef __WRAPS_ATTRIBUTE_H__
  435. +#define __WRAPS_ATTRIBUTE_H__
  436. +
  437. +#include <MyGUI.h>
  438. +#include "Attribute.h"
  439. +
  440. +namespace attribute
  441. +{
  442. +
  443. +   struct FieldSetterWidget
  444. +   {
  445. +       typedef MyGUI::Widget BaseValueType;
  446. +
  447. +       template <typename Type>
  448. +       static Type* convert(BaseValueType* _value)
  449. +       {
  450. +           return _value == 0 ? 0 : _value->castType<Type>(false);
  451. +       }
  452. +   };
  453. +
  454. +   DECLARE_ATTRIBUTE_FIELD(AttributeFieldWidgetName, std::string, FieldSetterWidget);
  455. +
  456. +#define ATTRIBUTE_FIELD_WIDGET_NAME(_class, _field, _value) \
  457. +   ATTRIBUTE_FIELD(AttributeFieldWidgetName, _class, _field, _value)
  458. +
  459. +
  460. +   DECLARE_ATTRIBUTE_CLASS(AttributeSize, MyGUI::IntSize);
  461. +
  462. +#define ATTRIBUTE_CLASS_SIZE(_class, _value) \
  463. +   ATTRIBUTE_CLASS(AttributeSize, _class, _value)
  464. +
  465. +
  466. +   DECLARE_ATTRIBUTE_CLASS(AttributeLayout, std::string);
  467. +
  468. +#define ATTRIBUTE_CLASS_LAYOUT(_class, _value) \
  469. +   ATTRIBUTE_CLASS(AttributeLayout, _class, _value)
  470. +
  471. +}
  472. +
  473. +#endif // __WRAPS_ATTRIBUTE_H__
  474. diff -Nur stuntrally.orig/source/mygui/MessageBox/MessageBox.h stuntrally//source/mygui/MessageBox/MessageBox.h
  475. --- stuntrally.orig/source/mygui/MessageBox/MessageBox.h    1970-01-01 01:00:00.000000000 +0100
  476. +++ stuntrally//source/mygui/MessageBox/MessageBox.h    2011-08-13 01:16:08.000000000 +0200
  477. @@ -0,0 +1,389 @@
  478. +/*!
  479. +   @file
  480. +   @author     Albert Semenov
  481. +   @date       12/2010
  482. +*/
  483. +#ifndef __MESSAGE_BOX_H__
  484. +#define __MESSAGE_BOX_H__
  485. +
  486. +#include <MyGUI.h>
  487. +#include "MessageBoxStyle.h"
  488. +#include "BaseLayout/BaseLayout.h"
  489. +
  490. +namespace MyGUI
  491. +{
  492. +   class Message;
  493. +
  494. +   typedef delegates::CMultiDelegate2<Message*, MessageBoxStyle> EventHandle_MessageBoxPtrMessageStyle;
  495. +
  496. +   class Message :
  497. +       public wraps::BaseLayout
  498. +   {
  499. +   public:
  500. +       Message() :
  501. +           wraps::BaseLayout("MessageBox.layout"),
  502. +           mWidgetText(nullptr),
  503. +           mInfoOk(MessageBoxStyle::None),
  504. +           mInfoCancel(MessageBoxStyle::None),
  505. +           mSmoothShow(false),
  506. +           mIcon(nullptr),
  507. +           mLeftOffset1(0),
  508. +           mLeftOffset2(0)
  509. +       {
  510. +           assignWidget(mWidgetText, "Text", false);
  511. +           if (mWidgetText != nullptr)
  512. +           {
  513. +               mOffsetText.set(mMainWidget->getClientCoord().width - mWidgetText->getWidth(), mMainWidget->getClientCoord().height - mWidgetText->getHeight());
  514. +               mLeftOffset2 = mLeftOffset1 = mWidgetText->getLeft();
  515. +           }
  516. +
  517. +           assignWidget(mIcon, "Icon", false);
  518. +           if (mIcon != nullptr)
  519. +           {
  520. +               mLeftOffset2 = mIcon->getRight() + 3;
  521. +           }
  522. +
  523. +           mButtonType = Button::getClassTypeName();
  524. +
  525. +           if (mMainWidget->isUserString("ButtonSkin"))
  526. +               mButtonSkin = mMainWidget->getUserString("ButtonSkin");
  527. +
  528. +           Widget* widget = nullptr;
  529. +           assignWidget(widget, "ButtonPlace", false);
  530. +           if (widget != nullptr)
  531. +           {
  532. +               mButtonOffset.set(widget->getLeft(), mMainWidget->getClientCoord().height - widget->getTop());
  533. +               widget->setVisible(false);
  534. +           }
  535. +
  536. +           assignWidget(widget, "ButtonTemplate", false);
  537. +           if (widget != nullptr)
  538. +           {
  539. +               mButtonSize = widget->getSize();
  540. +           }
  541. +       }
  542. +
  543. +       virtual ~Message()
  544. +       {
  545. +           mWidgetText = nullptr;
  546. +           mIcon = nullptr;
  547. +       }
  548. +
  549. +       /** Set caption text*/
  550. +       void setCaption(const UString& _value)
  551. +       {
  552. +           mMainWidget->castType<Window>()->setCaption(_value);
  553. +       }
  554. +
  555. +       /** Set message text*/
  556. +       void setMessageText(const UString& _value)
  557. +       {
  558. +           if (mWidgetText != nullptr)
  559. +               mWidgetText->setCaption(_value);
  560. +           updateSize();
  561. +       }
  562. +
  563. +       /** Create button with specific name*/
  564. +       MessageBoxStyle addButtonName(const UString& _name)
  565. +       {
  566. +           if (mVectorButton.size() >= MessageBoxStyle::_CountUserButtons)
  567. +           {
  568. +               MYGUI_LOG(Warning, "Too many buttons in message box, ignored");
  569. +               return MessageBoxStyle::None;
  570. +           }
  571. +           // áèò, íîìåð êíîïêè + ñìåùåíèå äî Button1
  572. +           MessageBoxStyle info = MessageBoxStyle(MessageBoxStyle::Enum(MYGUI_FLAG(mVectorButton.size() + MessageBoxStyle::_IndexUserButton1)));
  573. +
  574. +           // çàïîìèíàåì êíîïêè äëÿ îòìåíû è ïîäòâåðæäåíèÿ
  575. +           if (mVectorButton.empty())
  576. +               mInfoOk = info;
  577. +           mInfoCancel = info;
  578. +
  579. +           Widget* widget = mMainWidget->createWidgetT(mButtonType, mButtonSkin, IntCoord(), Align::Left | Align::Bottom);
  580. +           Button* button = widget->castType<Button>();
  581. +           button->eventMouseButtonClick += newDelegate(this, &Message::notifyButtonClick);
  582. +           button->setCaption(_name);
  583. +           button->_setInternalData(info);
  584. +           mVectorButton.push_back(button);
  585. +
  586. +           updateSize();
  587. +           return info;
  588. +       }
  589. +
  590. +       /** Set smooth message showing*/
  591. +       void setSmoothShow(bool _value)
  592. +       {
  593. +           mSmoothShow = _value;
  594. +           if (mSmoothShow)
  595. +           {
  596. +               mMainWidget->setAlpha(ALPHA_MIN);
  597. +               mMainWidget->setVisible(true);
  598. +               mMainWidget->castType<Window>()->setVisibleSmooth(true);
  599. +           }
  600. +       }
  601. +
  602. +       /** Set message icon*/
  603. +       void setMessageIcon(MessageBoxStyle _value)
  604. +       {
  605. +           if (nullptr == mIcon)
  606. +               return;
  607. +
  608. +           if (mIcon->getItemResource() != nullptr)
  609. +           {
  610. +               mIcon->setItemName(getIconName(_value.getIconIndex()));
  611. +           }
  612. +           else
  613. +           {
  614. +               mIcon->setImageIndex(_value.getIconIndex());
  615. +           }
  616. +
  617. +           updateSize();
  618. +       }
  619. +
  620. +       void endMessage(MessageBoxStyle _result)
  621. +       {
  622. +           _destroyMessage(_result);
  623. +       }
  624. +
  625. +       void endMessage()
  626. +       {
  627. +           _destroyMessage(mInfoCancel);
  628. +       }
  629. +
  630. +       /** Create button using MessageBoxStyle*/
  631. +       void setMessageButton(MessageBoxStyle _value)
  632. +       {
  633. +           clearButton();
  634. +
  635. +           std::vector<MessageBoxStyle> buttons = _value.getButtons();
  636. +
  637. +           for (size_t index = 0; index < buttons.size(); ++index)
  638. +           {
  639. +               // êîððåêòèðóåì åå íîìåð
  640. +               MessageBoxStyle info = buttons[index];
  641. +
  642. +               // åñëè áèò åñòü òî ñòàâèì êíîïêó
  643. +               addButtonName(getButtonName(info));
  644. +
  645. +               // âíóòðè àää ñáðàñûâàåòñÿ
  646. +               mVectorButton.back()->_setInternalData(info);
  647. +
  648. +               // ïåðâàÿ êíîïêà
  649. +               if (mVectorButton.size() == 1)
  650. +                   mInfoOk = info;
  651. +               // ïîñëåäíÿÿ êíîïêà
  652. +               mInfoCancel = info;
  653. +           }
  654. +
  655. +           updateSize();
  656. +       }
  657. +
  658. +       /** Set message style (button and icon)*/
  659. +       void setMessageStyle(MessageBoxStyle _value)
  660. +       {
  661. +           setMessageButton(_value);
  662. +           setMessageIcon(_value);
  663. +       }
  664. +
  665. +       void setMessageModal(bool _value)
  666. +       {
  667. +           if (_value)
  668. +               InputManager::getInstance().addWidgetModal(mMainWidget);
  669. +           else
  670. +               InputManager::getInstance().removeWidgetModal(mMainWidget);
  671. +       }
  672. +
  673. +       /** Static method for creating message with one command
  674. +           @param
  675. +               _modal if true all other GUI elements will be blocked untill message is closed
  676. +           @param
  677. +               _style any combination of flags from ViewValueInfo
  678. +           @param
  679. +               _button1 ... _button4 specific buttons names
  680. +       */
  681. +       static Message* createMessageBox(
  682. +           const UString& _skinName,
  683. +           const UString& _caption,
  684. +           const UString& _message,
  685. +           MessageBoxStyle _style = MessageBoxStyle::Ok | MessageBoxStyle::IconDefault,
  686. +           const std::string& _layer = "",
  687. +           bool _modal = true,
  688. +           const std::string& _button1 = "",
  689. +           const std::string& _button2 = "",
  690. +           const std::string& _button3 = "",
  691. +           const std::string& _button4 = "")
  692. +       {
  693. +           Message* mess = new Message();
  694. +
  695. +           mess->setCaption(_caption);
  696. +           mess->setMessageText(_message);
  697. +
  698. +           mess->setSmoothShow(true);
  699. +
  700. +           mess->setMessageStyle(_style);
  701. +
  702. +           if (!_button1.empty())
  703. +           {
  704. +               mess->addButtonName(_button1);
  705. +               if (!_button2.empty())
  706. +               {
  707. +                   mess->addButtonName(_button2);
  708. +                   if (!_button3.empty())
  709. +                   {
  710. +                       mess->addButtonName(_button3);
  711. +                   }
  712. +               }
  713. +           }
  714. +
  715. +           if (_modal)
  716. +               InputManager::getInstance().addWidgetModal(mess->mMainWidget);
  717. +
  718. +           return mess;
  719. +       }
  720. +
  721. +   /*events:*/
  722. +       /** Event : button on message window pressed.\n
  723. +           signature : void method(tools::Message* _sender, MessageBoxStyle _result)\n
  724. +           @param _sender widget that called this event
  725. +           @param _result - id of pressed button
  726. +       */
  727. +       EventHandle_MessageBoxPtrMessageStyle
  728. +           eventMessageBoxResult;
  729. +
  730. +   protected:
  731. +       void updateSize()
  732. +       {
  733. +           ISubWidgetText* text = nullptr;
  734. +           if (mWidgetText != nullptr)
  735. +               text = mWidgetText->getSubWidgetText();
  736. +           IntSize size = text == nullptr ? IntSize() : text->getTextSize();
  737. +           // ìèíèìóì âûñîòà èêîíêè
  738. +           if ((nullptr != mIcon) && (mIcon->getImageIndex() != ITEM_NONE))
  739. +           {
  740. +               if (size.height < mIcon->getHeight())
  741. +                   size.height = mIcon->getHeight();
  742. +               size.width += mIcon->getSize().width;
  743. +           }
  744. +           size += mOffsetText;
  745. +           size.width += 3;
  746. +
  747. +           int width = ((int)mVectorButton.size() * mButtonSize.width) + (((int)mVectorButton.size() + 1) * mButtonOffset.width);
  748. +           if (size.width < width)
  749. +               size.width = width;
  750. +
  751. +           int offset = (size.width - width) / 2;
  752. +           offset += mButtonOffset.width;
  753. +
  754. +           size.width += mMainWidget->getWidth() - mMainWidget->getClientCoord().width;
  755. +           size.height += mMainWidget->getHeight() - mMainWidget->getClientCoord().height;
  756. +
  757. +           const IntSize& view = RenderManager::getInstance().getViewSize();
  758. +           mMainWidget->setCoord((view.width - size.width) / 2, (view.height - size.height) / 2, size.width, size.height);
  759. +
  760. +           if (nullptr != mIcon)
  761. +           {
  762. +               if (mWidgetText != nullptr)
  763. +               {
  764. +                   if (mIcon->getImageIndex() != ITEM_NONE)
  765. +                       mWidgetText->setCoord(mLeftOffset2, mWidgetText->getTop(), mWidgetText->getWidth(), mWidgetText->getHeight());
  766. +                   else
  767. +                       mWidgetText->setCoord(mLeftOffset1, mWidgetText->getTop(), mWidgetText->getWidth(), mWidgetText->getHeight());
  768. +               }
  769. +           }
  770. +
  771. +           for (std::vector<Button*>::iterator iter = mVectorButton.begin(); iter != mVectorButton.end(); ++iter)
  772. +           {
  773. +               (*iter)->setCoord(offset, mMainWidget->getClientCoord().height - mButtonOffset.height, mButtonSize.width, mButtonSize.height);
  774. +               offset += mButtonOffset.width + mButtonSize.width;
  775. +           }
  776. +       }
  777. +
  778. +       void notifyButtonClick(Widget* _sender)
  779. +       {
  780. +           _destroyMessage(*_sender->_getInternalData<MessageBoxStyle>());
  781. +       }
  782. +
  783. +       void clearButton()
  784. +       {
  785. +           for (std::vector<Button*>::iterator iter = mVectorButton.begin(); iter != mVectorButton.end(); ++iter)
  786. +               WidgetManager::getInstance().destroyWidget(*iter);
  787. +           mVectorButton.clear();
  788. +       }
  789. +
  790. +       /*void onKeyButtonPressed(KeyCode _key, Char _char)
  791. +       {
  792. +           Base::onKeyButtonPressed(_key, _char);
  793. +
  794. +           if ((_key == KeyCode::Return) || (_key == KeyCode::NumpadEnter))
  795. +               _destroyMessage(mInfoOk);
  796. +           else if (_key == KeyCode::Escape)
  797. +               _destroyMessage(mInfoCancel);
  798. +       }*/
  799. +
  800. +       void _destroyMessage(MessageBoxStyle _result)
  801. +       {
  802. +           eventMessageBoxResult(this, _result);
  803. +
  804. +           delete this;
  805. +       }
  806. +
  807. +       UString getButtonName(MessageBoxStyle _style) const
  808. +       {
  809. +           size_t index = _style.getButtonIndex();
  810. +           const char* tag = getButtonTag(index);
  811. +           UString result = LanguageManager::getInstance().replaceTags(utility::toString("#{", tag, "}"));
  812. +           if (result == tag)
  813. +               return getButtonName(index);
  814. +           return result;
  815. +       }
  816. +
  817. +       const char* getIconName(size_t _index) const
  818. +       {
  819. +           static const size_t CountIcons = 4;
  820. +           static const char* IconNames[CountIcons + 1] = { "Info", "Quest", "Error", "Warning", "" };
  821. +           if (_index >= CountIcons)
  822. +               return IconNames[CountIcons];
  823. +           return IconNames[_index];
  824. +       }
  825. +
  826. +       const char* getButtonName(size_t _index) const
  827. +       {
  828. +           static const size_t Count = 9;
  829. +           static const char * Names[Count + 1] = { "Ok", "Yes", "No", "Abort", "Retry", "Ignore", "Cancel", "Try", "Continue", "" };
  830. +           if (_index >= Count)
  831. +               return Names[Count];
  832. +           return Names[_index];
  833. +       }
  834. +
  835. +       const char* getButtonTag(size_t _index) const
  836. +       {
  837. +           static const size_t Count = 9;
  838. +           static const char* Names[Count + 1] = { "MessageBox_Ok", "MessageBox_Yes", "MessageBox_No", "MessageBox_Abort", "MessageBox_Retry", "MessageBox_Ignore", "MessageBox_Cancel", "MessageBox_Try", "MessageBox_Continue", "" };
  839. +           if (_index >= Count)
  840. +               return Names[Count];
  841. +           return Names[_index];
  842. +       }
  843. +
  844. +   private:
  845. +       IntSize mOffsetText;
  846. +       TextBox* mWidgetText;
  847. +
  848. +       std::string mButtonSkin;
  849. +       std::string mButtonType;
  850. +       IntSize mButtonSize;
  851. +       IntSize mButtonOffset;
  852. +
  853. +       std::vector<Button*> mVectorButton;
  854. +       MessageBoxStyle mInfoOk;
  855. +       MessageBoxStyle mInfoCancel;
  856. +       bool mSmoothShow;
  857. +
  858. +       std::string mDefaultCaption;
  859. +       ImageBox* mIcon;
  860. +       int mLeftOffset1;
  861. +       int mLeftOffset2;
  862. +   };
  863. +
  864. +} // namespace MyGUI
  865. +
  866. +#endif // __MESSAGE_BOX_H__
  867. diff -Nur stuntrally.orig/source/mygui/MessageBox/MessageBoxStyle.h stuntrally//source/mygui/MessageBox/MessageBoxStyle.h
  868. --- stuntrally.orig/source/mygui/MessageBox/MessageBoxStyle.h   1970-01-01 01:00:00.000000000 +0100
  869. +++ stuntrally//source/mygui/MessageBox/MessageBoxStyle.h   2011-08-13 01:16:11.000000000 +0200
  870. @@ -0,0 +1,229 @@
  871. +/*!
  872. +   @file
  873. +   @author     Albert Semenov
  874. +   @date       10/2010
  875. +*/
  876. +#ifndef __MESSAGE_BOX_STYLE_H__
  877. +#define __MESSAGE_BOX_STYLE_H__
  878. +
  879. +#include <MyGUI.h>
  880. +
  881. +namespace MyGUI
  882. +{
  883. +
  884. +   struct MessageBoxStyle
  885. +   {
  886. +       enum Enum
  887. +       {
  888. +           None = MYGUI_FLAG_NONE,
  889. +           Ok = MYGUI_FLAG(0),
  890. +           Yes = MYGUI_FLAG(1),
  891. +           No = MYGUI_FLAG(2),
  892. +           Abort = MYGUI_FLAG(3),
  893. +           Retry = MYGUI_FLAG(4),
  894. +           Ignore = MYGUI_FLAG(5),
  895. +           Cancel = MYGUI_FLAG(6),
  896. +           Try = MYGUI_FLAG(7),
  897. +           Continue = MYGUI_FLAG(8),
  898. +
  899. +           _IndexUserButton1 = 9, // èíäåêñ ïåðâîé êíîïêè þçåðà
  900. +
  901. +           Button1 = MYGUI_FLAG(_IndexUserButton1),
  902. +           Button2 = MYGUI_FLAG(_IndexUserButton1 + 1),
  903. +           Button3 = MYGUI_FLAG(_IndexUserButton1 + 2),
  904. +           Button4 = MYGUI_FLAG(_IndexUserButton1 + 3),
  905. +
  906. +           _CountUserButtons = 4, // êîëëè÷åñòâî êíîïîê þçåðà
  907. +           _IndexIcon1 = _IndexUserButton1 + _CountUserButtons, // èíäåêñ ïåðâîé èêîíêè
  908. +
  909. +           IconDefault = MYGUI_FLAG(_IndexIcon1),
  910. +
  911. +           IconInfo = MYGUI_FLAG(_IndexIcon1),
  912. +           IconQuest = MYGUI_FLAG(_IndexIcon1 + 1),
  913. +           IconError = MYGUI_FLAG(_IndexIcon1 + 2),
  914. +           IconWarning = MYGUI_FLAG(_IndexIcon1 + 3),
  915. +
  916. +           Icon1 = MYGUI_FLAG(_IndexIcon1),
  917. +           Icon2 = MYGUI_FLAG(_IndexIcon1 + 1),
  918. +           Icon3 = MYGUI_FLAG(_IndexIcon1 + 2),
  919. +           Icon4 = MYGUI_FLAG(_IndexIcon1 + 3),
  920. +           Icon5 = MYGUI_FLAG(_IndexIcon1 + 4),
  921. +           Icon6 = MYGUI_FLAG(_IndexIcon1 + 5),
  922. +           Icon7 = MYGUI_FLAG(_IndexIcon1 + 6),
  923. +           Icon8 = MYGUI_FLAG(_IndexIcon1 + 7)
  924. +       };
  925. +
  926. +       MessageBoxStyle(Enum _value = None) :
  927. +           value(_value)
  928. +       {
  929. +       }
  930. +
  931. +       MessageBoxStyle& operator |= (MessageBoxStyle const& _other)
  932. +       {
  933. +           value = Enum(int(value) | int(_other.value));
  934. +           return *this;
  935. +       }
  936. +
  937. +       friend MessageBoxStyle operator | (Enum const& a, Enum const& b)
  938. +       {
  939. +           return MessageBoxStyle(Enum(int(a) | int(b)));
  940. +       }
  941. +
  942. +       MessageBoxStyle operator | (Enum const& a)
  943. +       {
  944. +           return MessageBoxStyle(Enum(int(value) | int(a)));
  945. +       }
  946. +
  947. +       friend bool operator == (MessageBoxStyle const& a, MessageBoxStyle const& b)
  948. +       {
  949. +           return a.value == b.value;
  950. +       }
  951. +
  952. +       friend bool operator != (MessageBoxStyle const& a, MessageBoxStyle const& b)
  953. +       {
  954. +           return a.value != b.value;
  955. +       }
  956. +
  957. +       friend std::ostream& operator << (std::ostream& _stream, const MessageBoxStyle&  _value)
  958. +       {
  959. +           //_stream << _value.print();
  960. +           return _stream;
  961. +       }
  962. +
  963. +       friend std::istream& operator >> (std::istream& _stream, MessageBoxStyle&  _value)
  964. +       {
  965. +           std::string value;
  966. +           _stream >> value;
  967. +           _value = parse(value);
  968. +           return _stream;
  969. +       }
  970. +
  971. +       // âîçâðàùàåò èíäåêñ èêîíêè
  972. +       size_t getIconIndex()
  973. +       {
  974. +           size_t index = 0;
  975. +           int num = value >> _IndexIcon1;
  976. +
  977. +           while (num != 0)
  978. +           {
  979. +               if ((num & 1) == 1)
  980. +                   return index;
  981. +
  982. +               ++index;
  983. +               num >>= 1;
  984. +           }
  985. +
  986. +           return ITEM_NONE;
  987. +       }
  988. +
  989. +       // âîçâðàùàåò èíäåêñ èêîíêè
  990. +       size_t getButtonIndex()
  991. +       {
  992. +           size_t index = 0;
  993. +           int num = value;
  994. +
  995. +           while (num != 0)
  996. +           {
  997. +               if ((num & 1) == 1)
  998. +                   return index;
  999. +
  1000. +               ++index;
  1001. +               num >>= 1;
  1002. +           }
  1003. +
  1004. +           return ITEM_NONE;
  1005. +       }
  1006. +
  1007. +       // âîçâðàùàåò ñïèñîê êíîïîê
  1008. +       std::vector<MessageBoxStyle> getButtons()
  1009. +       {
  1010. +           std::vector<MessageBoxStyle> buttons;
  1011. +
  1012. +           size_t index = 0;
  1013. +           int num = value;
  1014. +           while (index < _IndexIcon1)
  1015. +           {
  1016. +               if ((num & 1) == 1)
  1017. +               {
  1018. +                   buttons.push_back(MessageBoxStyle::Enum( MYGUI_FLAG(index)));
  1019. +               }
  1020. +
  1021. +               ++index;
  1022. +               num >>= 1;
  1023. +           }
  1024. +
  1025. +           return buttons;
  1026. +       }
  1027. +
  1028. +       typedef std::map<std::string, int> MapAlign;
  1029. +
  1030. +       static MessageBoxStyle parse(const std::string& _value)
  1031. +       {
  1032. +           MessageBoxStyle result(MessageBoxStyle::Enum(0));
  1033. +           const MapAlign& map_names = result.getValueNames();
  1034. +           const std::vector<std::string>& vec = utility::split(_value);
  1035. +           for (size_t pos = 0; pos < vec.size(); pos++)
  1036. +           {
  1037. +               MapAlign::const_iterator iter = map_names.find(vec[pos]);
  1038. +               if (iter != map_names.end())
  1039. +               {
  1040. +                   result.value = Enum(int(result.value) | int(iter->second));
  1041. +               }
  1042. +               else
  1043. +               {
  1044. +                   MYGUI_LOG(Warning, "Cannot parse type '" << vec[pos] << "'");
  1045. +               }
  1046. +           }
  1047. +           return result;
  1048. +       }
  1049. +
  1050. +   private:
  1051. +       const MapAlign& getValueNames()
  1052. +       {
  1053. +           static MapAlign map_names;
  1054. +
  1055. +           if (map_names.empty())
  1056. +           {
  1057. +               MYGUI_REGISTER_VALUE(map_names, None);
  1058. +               MYGUI_REGISTER_VALUE(map_names, Ok);
  1059. +               MYGUI_REGISTER_VALUE(map_names, Yes);
  1060. +               MYGUI_REGISTER_VALUE(map_names, No);
  1061. +               MYGUI_REGISTER_VALUE(map_names, Abort);
  1062. +               MYGUI_REGISTER_VALUE(map_names, Retry);
  1063. +               MYGUI_REGISTER_VALUE(map_names, Ignore);
  1064. +               MYGUI_REGISTER_VALUE(map_names, Cancel);
  1065. +               MYGUI_REGISTER_VALUE(map_names, Try);
  1066. +               MYGUI_REGISTER_VALUE(map_names, Continue);
  1067. +
  1068. +               MYGUI_REGISTER_VALUE(map_names, Button1);
  1069. +               MYGUI_REGISTER_VALUE(map_names, Button2);
  1070. +               MYGUI_REGISTER_VALUE(map_names, Button3);
  1071. +               MYGUI_REGISTER_VALUE(map_names, Button4);
  1072. +
  1073. +               MYGUI_REGISTER_VALUE(map_names, IconDefault);
  1074. +
  1075. +               MYGUI_REGISTER_VALUE(map_names, IconInfo);
  1076. +               MYGUI_REGISTER_VALUE(map_names, IconQuest);
  1077. +               MYGUI_REGISTER_VALUE(map_names, IconError);
  1078. +               MYGUI_REGISTER_VALUE(map_names, IconWarning);
  1079. +
  1080. +               MYGUI_REGISTER_VALUE(map_names, Icon1);
  1081. +               MYGUI_REGISTER_VALUE(map_names, Icon2);
  1082. +               MYGUI_REGISTER_VALUE(map_names, Icon3);
  1083. +               MYGUI_REGISTER_VALUE(map_names, Icon4);
  1084. +               MYGUI_REGISTER_VALUE(map_names, Icon5);
  1085. +               MYGUI_REGISTER_VALUE(map_names, Icon6);
  1086. +               MYGUI_REGISTER_VALUE(map_names, Icon7);
  1087. +               MYGUI_REGISTER_VALUE(map_names, Icon8);
  1088. +           }
  1089. +
  1090. +           return map_names;
  1091. +       }
  1092. +
  1093. +   private:
  1094. +       Enum value;
  1095. +   };
  1096. +
  1097. +} // namespace MyGUI
  1098. +
  1099. +#endif // __MESSAGE_BOX_STYLE_H__
  1100. diff -Nur stuntrally.orig/source/ogre/Gui_Events.cpp stuntrally//source/ogre/Gui_Events.cpp
  1101. --- stuntrally.orig/source/ogre/Gui_Events.cpp  2011-07-31 09:08:29.000000000 +0200
  1102. +++ stuntrally//source/ogre/Gui_Events.cpp  2011-08-13 01:19:46.000000000 +0200
  1103. @@ -8,6 +8,7 @@
  1104.  #include "SplitScreenManager.h"
  1105.  
  1106.  
  1107.  
  1108.  #include <MyGUI_PointerManager.h>
  1109.  
  1110. +#include "MessageBox/MessageBox.h"
  1111.  
  1112.  #include <OIS/OIS.h>
  1113.  
  1114.  #include "../oisb/OISB.h"
  1115.  
  1116.  #include <boost/filesystem.hpp>
  1117.  
  1118. @@ -740,7 +741,7 @@
  1119.             TR("#{RplVersion}: ") + toStr(rpl.header.ver) + "     " + toStr(rpl.header.frameSize) + "B";
  1120.  
  1121.         if (valRplInfo2)  valRplInfo2->setCaption(ss);
  1122.  
  1123.     }
  1124.  
  1125. -   //edRplDesc  edRplName
  1126. +   //edRplDesc  edRplName
  1127.  
  1128.  }
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134. @@ -820,17 +821,17 @@
  1135.  {
  1136.  
  1137.     if (!rplList)  return;
  1138.  
  1139.     rplList->removeAllItems();  int ii = 0;  bool bFound = false;
  1140.  
  1141. -
  1142. -   strlist li;
  1143. -   PATHMANAGER::GetFolderIndex((pSet->rpl_listview == 2 ? PATHMANAGER::GetGhostsPath() : PATHMANAGER::GetReplayPath()), li, "rpl");
  1144. -  
  1145. -   for (strlist::iterator i = li.begin(); i != li.end(); ++i)
  1146. -   if (StringUtil::endsWith(*i, ".rpl"))
  1147. -   {
  1148. -       String s = *i;  s = StringUtil::replaceAll(s,".rpl","");
  1149. -       if (pSet->rpl_listview != 1 || StringUtil::startsWith(s,pSet->track, false))
  1150. +
  1151.  
  1152. +   strlist li;
  1153.  
  1154. +   PATHMANAGER::GetFolderIndex((pSet->rpl_listview == 2 ? PATHMANAGER::GetGhostsPath() : PATHMANAGER::GetReplayPath()), li, "rpl");
  1155.  
  1156. +  
  1157.  
  1158. +   for (strlist::iterator i = li.begin(); i != li.end(); ++i)
  1159.  
  1160. +   if (StringUtil::endsWith(*i, ".rpl"))
  1161.  
  1162. +   {
  1163.  
  1164. +       String s = *i;  s = StringUtil::replaceAll(s,".rpl","");
  1165.  
  1166. +       if (pSet->rpl_listview != 1 || StringUtil::startsWith(s,pSet->track, false))
  1167.  
  1168.             rplList->addItem(s);
  1169.  
  1170. -   }
  1171. +   }
  1172.  
  1173.  }
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179. diff -Nur stuntrally.orig/source/ogre/OgreGame.h stuntrally//source/ogre/OgreGame.h
  1180. --- stuntrally.orig/source/ogre/OgreGame.h  2011-07-31 09:08:29.000000000 +0200
  1181. +++ stuntrally//source/ogre/OgreGame.h  2011-08-13 01:21:14.000000000 +0200
  1182. @@ -10,6 +10,7 @@
  1183.  #include "CarReflection.h"
  1184.  
  1185.  
  1186.  
  1187.  #include <MyGUI.h>
  1188.  
  1189. +#include "MessageBox/MessageBox.h"
  1190.  
  1191.  #include <OgreShadowCameraSetup.h>
  1192.  
  1193.  
  1194.  
  1195.  namespace Ogre {  class SceneNode;  class Root;  class SceneManager;  class RenderWindow;  class Viewport;  class Light;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement