Merge lp:~mxsscott/widelands/984197 into lp:widelands

Proposed by Mark Scott on 2013-01-16
Status: Merged
Merged at revision: 6489
Proposed branch: lp:~mxsscott/widelands/984197
Merge into: lp:widelands
Diff against target: 60 lines (+15/-12)
2 files modified
src/wui/fieldaction.cc (+15/-6)
src/wui/fieldaction.h (+0/-6)
To merge this branch: bzr merge lp:~mxsscott/widelands/984197
Reviewer Review Type Date Requested Status
SirVer 2013-01-16 Approve on 2013-01-17
Review via email: mp+143601@code.launchpad.net

Description of the change

Added check for Ctrl key before showing confirmation window regarding destruction of building that will result from ripping a flag.

To post a comment you must log in.
SirVer (sirver) wrote :

Lgtm.

SirVer (sirver) wrote :

forgot to approve :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/wui/fieldaction.cc'
2--- src/wui/fieldaction.cc 2012-12-14 20:09:35 +0000
3+++ src/wui/fieldaction.cc 2013-01-16 21:56:41 +0000
4@@ -20,6 +20,7 @@
5 #include "fieldaction.h"
6
7 #include "attack_box.h"
8+#include "buildingconfirm.h"
9 #include "logic/attackable.h"
10 #include "logic/cmd_queue.h"
11 #include "economy/economy.h"
12@@ -163,7 +164,8 @@
13
14 ==============================================================================
15 */
16-struct FieldActionWindow : public UI::UniqueWindow {
17+class FieldActionWindow : public UI::UniqueWindow {
18+public:
19 FieldActionWindow
20 (Interactive_Base * ibase,
21 Widelands::Player * plr,
22@@ -763,11 +765,18 @@
23 Widelands::Editor_Game_Base & egbase = ibase().egbase();
24 if (upcast(Widelands::Flag, flag, m_node.field->get_immovable())) {
25 if (Building * const building = flag->get_building()) {
26- if (building->get_playercaps() & Building::PCap_Bulldoze)
27- show_bulldoze_confirm
28- (ref_cast<Interactive_Player, Interactive_Base>(ibase()),
29- *building,
30- flag);
31+ if (building->get_playercaps() & Building::PCap_Bulldoze) {
32+ if (get_key_state(SDLK_LCTRL) or get_key_state(SDLK_RCTRL)) {
33+ ref_cast<Game, Editor_Game_Base>(egbase).send_player_bulldoze
34+ (*flag);
35+ }
36+ else {
37+ show_bulldoze_confirm
38+ (ref_cast<Interactive_Player, Interactive_Base>(ibase()),
39+ *building,
40+ flag);
41+ }
42+ }
43 } else {
44 ref_cast<Game, Editor_Game_Base>(egbase).send_player_bulldoze
45 (*flag, get_key_state(SDLK_LCTRL) or get_key_state(SDLK_RCTRL));
46
47=== modified file 'src/wui/fieldaction.h'
48--- src/wui/fieldaction.h 2012-02-15 21:25:34 +0000
49+++ src/wui/fieldaction.h 2013-01-16 21:56:41 +0000
50@@ -36,10 +36,4 @@
51 Widelands::Player * player,
52 UI::UniqueWindow::Registry * registry);
53
54-// building_ui.cc
55-void show_bulldoze_confirm
56- (Interactive_Player & parent,
57- Widelands::Building & building,
58- Widelands::PlayerImmovable * const todestroy);
59-
60 #endif

Subscribers

People subscribed via source and target branches

to status/vote changes: