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

Proposed by Mark Scott
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 Approve
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.
Revision history for this message
SirVer (sirver) wrote :

Lgtm.

Revision history for this message
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
=== modified file 'src/wui/fieldaction.cc'
--- src/wui/fieldaction.cc 2012-12-14 20:09:35 +0000
+++ src/wui/fieldaction.cc 2013-01-16 21:56:41 +0000
@@ -20,6 +20,7 @@
20#include "fieldaction.h"20#include "fieldaction.h"
2121
22#include "attack_box.h"22#include "attack_box.h"
23#include "buildingconfirm.h"
23#include "logic/attackable.h"24#include "logic/attackable.h"
24#include "logic/cmd_queue.h"25#include "logic/cmd_queue.h"
25#include "economy/economy.h"26#include "economy/economy.h"
@@ -163,7 +164,8 @@
163164
164==============================================================================165==============================================================================
165*/166*/
166struct FieldActionWindow : public UI::UniqueWindow {167class FieldActionWindow : public UI::UniqueWindow {
168public:
167 FieldActionWindow169 FieldActionWindow
168 (Interactive_Base * ibase,170 (Interactive_Base * ibase,
169 Widelands::Player * plr,171 Widelands::Player * plr,
@@ -763,11 +765,18 @@
763 Widelands::Editor_Game_Base & egbase = ibase().egbase();765 Widelands::Editor_Game_Base & egbase = ibase().egbase();
764 if (upcast(Widelands::Flag, flag, m_node.field->get_immovable())) {766 if (upcast(Widelands::Flag, flag, m_node.field->get_immovable())) {
765 if (Building * const building = flag->get_building()) {767 if (Building * const building = flag->get_building()) {
766 if (building->get_playercaps() & Building::PCap_Bulldoze)768 if (building->get_playercaps() & Building::PCap_Bulldoze) {
767 show_bulldoze_confirm769 if (get_key_state(SDLK_LCTRL) or get_key_state(SDLK_RCTRL)) {
768 (ref_cast<Interactive_Player, Interactive_Base>(ibase()),770 ref_cast<Game, Editor_Game_Base>(egbase).send_player_bulldoze
769 *building,771 (*flag);
770 flag);772 }
773 else {
774 show_bulldoze_confirm
775 (ref_cast<Interactive_Player, Interactive_Base>(ibase()),
776 *building,
777 flag);
778 }
779 }
771 } else {780 } else {
772 ref_cast<Game, Editor_Game_Base>(egbase).send_player_bulldoze781 ref_cast<Game, Editor_Game_Base>(egbase).send_player_bulldoze
773 (*flag, get_key_state(SDLK_LCTRL) or get_key_state(SDLK_RCTRL));782 (*flag, get_key_state(SDLK_LCTRL) or get_key_state(SDLK_RCTRL));
774783
=== modified file 'src/wui/fieldaction.h'
--- src/wui/fieldaction.h 2012-02-15 21:25:34 +0000
+++ src/wui/fieldaction.h 2013-01-16 21:56:41 +0000
@@ -36,10 +36,4 @@
36 Widelands::Player * player,36 Widelands::Player * player,
37 UI::UniqueWindow::Registry * registry);37 UI::UniqueWindow::Registry * registry);
3838
39// building_ui.cc
40void show_bulldoze_confirm
41 (Interactive_Player & parent,
42 Widelands::Building & building,
43 Widelands::PlayerImmovable * const todestroy);
44
45#endif39#endif

Subscribers

People subscribed via source and target branches

to status/vote changes: