Merge lp:~widelands-dev/widelands/bug-1339861 into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 7072
Proposed branch: lp:~widelands-dev/widelands/bug-1339861
Merge into: lp:widelands
Diff against target: 260 lines (+0/-202)
4 files modified
src/wui/CMakeLists.txt (+0/-2)
src/wui/fieldaction.cc (+0/-16)
src/wui/military_box.cc (+0/-105)
src/wui/military_box.h (+0/-79)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1339861
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+226570@code.launchpad.net

Description of the change

Deleted MilitaryBox from wui

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Oversight on my part. Thanks for catching this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/wui/CMakeLists.txt'
2--- src/wui/CMakeLists.txt 2014-07-05 14:39:48 +0000
3+++ src/wui/CMakeLists.txt 2014-07-12 10:37:22 +0000
4@@ -70,8 +70,6 @@
5 mapviewpixelconstants.h
6 mapviewpixelfunctions.cc
7 mapviewpixelfunctions.h
8- military_box.cc
9- military_box.h
10 militarysitewindow.cc
11 minimap.cc
12 minimap.h
13
14=== modified file 'src/wui/fieldaction.cc'
15--- src/wui/fieldaction.cc 2014-07-05 14:22:44 +0000
16+++ src/wui/fieldaction.cc 2014-07-12 10:37:22 +0000
17@@ -29,7 +29,6 @@
18 #include "logic/attackable.h"
19 #include "logic/cmd_queue.h"
20 #include "logic/maphollowregion.h"
21-#include "logic/militarysite.h"
22 #include "logic/player.h"
23 #include "logic/soldier.h"
24 #include "logic/tribe.h"
25@@ -44,7 +43,6 @@
26 #include "wui/attack_box.h"
27 #include "wui/game_debug_ui.h"
28 #include "wui/interactive_player.h"
29-#include "wui/military_box.h"
30 #include "wui/overlay_manager.h"
31 #include "wui/waresdisplay.h"
32 #include "wui/watchwindow.h"
33@@ -241,7 +239,6 @@
34
35 static const char * const pic_tab_buildroad = "pics/menu_tab_buildroad.png";
36 static const char * const pic_tab_watch = "pics/menu_tab_watch.png";
37-static const char * const pic_tab_military = "pics/menu_tab_military.png";
38 static const char * const pic_tab_buildhouse[] = {
39 "pics/menu_tab_buildsmall.png",
40 "pics/menu_tab_buildmedium.png",
41@@ -458,25 +455,12 @@
42 &FieldActionWindow::act_debug,
43 _("Debug window"));
44
45- MilitaryBox * militarybox =
46- m_plr ? new MilitaryBox(&m_tabpanel, m_plr, 0, 0) : nullptr;
47-
48 // Add tabs
49 if (buildbox && buildbox->get_nritems())
50 add_tab("roads", pic_tab_buildroad, buildbox, _("Build road"));
51
52 add_tab("watch", pic_tab_watch, &watchbox, _("Watch"));
53
54- if (militarybox)
55- {
56- if (militarybox->allowed_change())
57- {
58- add_tab
59- ("military", pic_tab_military,
60- militarybox, _("Military settings"));
61- } else
62- delete militarybox;
63- }
64 }
65
66 void FieldActionWindow::add_buttons_attack ()
67
68=== removed file 'src/wui/military_box.cc'
69--- src/wui/military_box.cc 2014-07-05 14:22:44 +0000
70+++ src/wui/military_box.cc 1970-01-01 00:00:00 +0000
71@@ -1,105 +0,0 @@
72-/*
73- * Copyright (C) 2002-2004, 2006-2011 by the Widelands Development Team
74- *
75- * This program is free software; you can redistribute it and/or
76- * modify it under the terms of the GNU General Public License
77- * as published by the Free Software Foundation; either version 2
78- * of the License, or (at your option) any later version.
79- *
80- * This program is distributed in the hope that it will be useful,
81- * but WITHOUT ANY WARRANTY; without even the implied warranty of
82- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
83- * GNU General Public License for more details.
84- *
85- * You should have received a copy of the GNU General Public License
86- * along with this program; if not, write to the Free Software
87- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
88- *
89- */
90-
91-#include "wui/military_box.h"
92-
93-#include "base/macros.h"
94-#include "graphic/graphic.h"
95-#include "logic/editor_game_base.h"
96-#include "logic/game.h"
97-#include "logic/playercommand.h"
98-#include "wui/text_constants.h"
99-
100-using Widelands::Editor_Game_Base;
101-using Widelands::Game;
102-
103-MilitaryBox::MilitaryBox
104- (UI::Panel * parent,
105- Widelands::Player * player,
106- uint32_t const x,
107- uint32_t const y)
108-:
109- UI::Box
110- (parent, x, y, UI::Box::Vertical),
111- m_pl(player),
112- m_map(&m_pl->egbase().map())
113-{
114- init();
115-}
116-
117-MilitaryBox::~MilitaryBox() {
118-}
119-
120-UI::Slider & MilitaryBox::add_slider
121- (UI::Box & parent,
122- uint32_t width,
123- uint32_t height,
124- uint32_t min, uint32_t max, uint32_t initial,
125- char const * picname,
126- char const * hint)
127-{
128- UI::HorizontalSlider & result =
129- *new UI::HorizontalSlider
130- (&parent,
131- 0, 0,
132- width, height,
133- min, max, initial,
134- g_gr->images().get(picname),
135- hint);
136- parent.add(&result, UI::Box::AlignTop);
137- return result;
138-}
139-
140-UI::Textarea & MilitaryBox::add_text
141- (UI::Box & parent,
142- std::string str,
143- uint32_t alignment,
144- const std::string & fontname,
145- uint32_t fontsize)
146-{
147- UI::Textarea & result = *new UI::Textarea(&parent, 0, 0, str.c_str());
148- result.set_textstyle(UI::TextStyle::makebold(UI::Font::get(fontname, fontsize), UI_FONT_CLR_FG));
149- parent.add(&result, alignment);
150- return result;
151-}
152-
153-UI::Button & MilitaryBox::add_button
154- (UI::Box & parent,
155- char const * const name,
156- char const * const text,
157- void (MilitaryBox::*fn)(),
158- const std::string & tooltip_text)
159-{
160- UI::Button * button =
161- new UI::Button
162- (&parent, name,
163- 8, 8, 26, 26,
164- g_gr->images().get("pics/but2.png"),
165- text,
166- tooltip_text);
167- button->sigclicked.connect(boost::bind(fn, boost::ref(*this)));
168- parent.add(button, Box::AlignTop);
169- return *button;
170-}
171-
172-void MilitaryBox::update() {
173-}
174-
175-void MilitaryBox::init() {
176-}
177
178=== removed file 'src/wui/military_box.h'
179--- src/wui/military_box.h 2014-07-05 16:41:51 +0000
180+++ src/wui/military_box.h 1970-01-01 00:00:00 +0000
181@@ -1,79 +0,0 @@
182-/*
183- * Copyright (C) 2002-2004, 2006-2010 by the Widelands Development Team
184- *
185- * This program is free software; you can redistribute it and/or
186- * modify it under the terms of the GNU General Public License
187- * as published by the Free Software Foundation; either version 2
188- * of the License, or (at your option) any later version.
189- *
190- * This program is distributed in the hope that it will be useful,
191- * but WITHOUT ANY WARRANTY; without even the implied warranty of
192- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
193- * GNU General Public License for more details.
194- *
195- * You should have received a copy of the GNU General Public License
196- * along with this program; if not, write to the Free Software
197- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
198- *
199- */
200-
201-#ifndef WL_WUI_MILITARY_BOX_H
202-#define WL_WUI_MILITARY_BOX_H
203-
204-#include <list>
205-
206-#include "logic/attackable.h"
207-#include "logic/player.h"
208-#include "ui_basic/box.h"
209-#include "ui_basic/button.h"
210-#include "ui_basic/slider.h"
211-#include "ui_basic/textarea.h"
212-#include "wui/text_constants.h"
213-
214-/**
215- * Military settings tab that is part of the \ref FieldActionWindow
216- *
217- * Used to configure the player's global military settings.
218- */
219-struct MilitaryBox : public UI::Box {
220- MilitaryBox
221- (UI::Panel * parent,
222- Widelands::Player * player,
223- uint32_t const x,
224- uint32_t const y);
225- ~MilitaryBox();
226-
227- void init();
228- bool allowed_change() const {return m_allowed_change;}
229-
230- private:
231- UI::Slider & add_slider
232- (UI::Box & parent,
233- uint32_t width,
234- uint32_t height,
235- uint32_t min, uint32_t max, uint32_t initial,
236- char const * picname,
237- char const * hint);
238- UI::Textarea & add_text
239- (UI::Box & parent,
240- std::string str,
241- uint32_t alignment = UI::Box::AlignTop,
242- const std::string & fontname = UI_FONT_NAME,
243- uint32_t fontsize = UI_FONT_SIZE_SMALL);
244- UI::Button & add_button
245- (UI::Box & parent,
246- char const *,
247- char const *,
248- void (MilitaryBox::*fn)(),
249- const std::string & tooltip_text);
250-
251- void update();
252-
253- private:
254- Widelands::Player * m_pl;
255- Widelands::Map * m_map;
256-
257- bool m_allowed_change;
258-};
259-
260-#endif // end of include guard: WL_WUI_MILITARY_BOX_H

Subscribers

People subscribed via source and target branches

to status/vote changes: