Merge lp:~widelands-dev/widelands/can_act into lp:widelands
Proposed by
GunChleoc
Status: | Merged |
---|---|
Merged at revision: | 8525 |
Proposed branch: | lp:~widelands-dev/widelands/can_act |
Merge into: | lp:widelands |
Diff against target: |
36 lines (+3/-3) 1 file modified
src/wui/economy_options_window.cc (+3/-3) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands/can_act |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
SirVer | Approve | ||
GunChleoc | Needs Resubmitting | ||
Review via email: mp+334633@code.launchpad.net |
Commit message
Remove buttons from economy options window for spectators.
Description of the change
A small cosmetic change.
To post a comment you must log in.
Make the diff smaller with an early return?
If (!canact) {Return;}
> Am 02.12.2017 um 12:17 schrieb GunChleoc <email address hidden>: /bugs.launchpad .net/widelands/ +bug/1735090 /code.launchpad .net/~widelands -dev/widelands/ can_act/ +merge/ 334633 economy_ options_ window. cc' --- src/wui/ economy_ options_ window. cc 2017-11-29 21:40:56 +0000 +++ src/wui/ economy_ options_ window. cc 2017-12-02 11:16:37 +0000 @@ -128,31 +128,30 @@ display_(this, 0, 0, type_, can_act_, economy) { add(&display_, UI::Box: :Resizing: :kFullSize) ; - UI::Box* buttons = new UI::Box(this, 0, 0, UI::Box: :Horizontal) ; - add(buttons); - - UI::Button* b = - new UI::Button(buttons, "decrease_target", 0, 0, 34, 34, - g_gr->images( ).get(" images/ ui_basic/ but4.png" ), "-", _("Decrease target")); - b->set_ enabled( can_act_ ); - b->sigclicked. connect( boost:: bind(&EconomyOp tionsPanel: :change_ target, this, -1)); - buttons->add(b); - b->set_ repeating( true); - buttons- >add_space( 8); - - b = new UI::Button(buttons, "increase_target", 0, 0, 34, 34, - g_gr->images( ).get(" images/ ui_basic/ but4.png" ), "+", _("Increase target")); - b->set_ enabled( can_act_ ); - b->sigclicked. connect( boost:: bind(&EconomyOp tionsPanel: :change_ target, this, 1)); - buttons->add(b); - b->set_ repeating( true); - buttons- >add_space( 8); - - b = new UI::Button(buttons, "reset_target", 0, 0, 34, 34, - g_gr->images( ).get(" images/ ui_basic/ but4.png" ), "R", _("Reset to default")); - b->set_ enabled( can_act_ ); - b->sigclicked. connect( boost:: bind(&EconomyOp tionsPanel: :reset_ target, this)); - buttons->add(b); + if (can_act_) { + UI::Box* buttons = new UI::Box(this, 0, 0, UI::Box: :Horizontal) ; + add(buttons); + + UI::Button* b = + new UI::Button(buttons, "decrease_target", 0, 0, 34, 34, + g_gr->images( ).get(" images/ ui_basic/ but4.png" ), "-", _("Decrease target")); + b->sigclicked. connect( boost:: bind(&EconomyOp tionsPanel: :change_ target, this, -1)); + buttons->add(b); + b->set_ repeating( true); + buttons- >add_space( 8); + + b = new UI::Button(buttons, "increase_target", 0, 0, 34, 34, + g_gr->images( ).get(" images/ ui_basic/ but4.png" ), "+", _("Increase target")); + b->sigclicked. connect( boost:: bind(&EconomyOp tionsPanel: :change_ target, this, 1)); + buttons->add(b); + b->set_ repeating( true); + buttons- >add_space( 8); + + b = new UI::Button(buttons, "reset_target", 0, 0, 34, 34, + g_gr->images( ).get(" images/ ui_basic/ but4.png" ), "R", _("Reset to default")); + b->sigclicked. connect( boost:: bind(&EconomyOp tionsPanel: :reset_ target, this)); + buttons->add(b); + } } void EconomyOptionsW indow:: EconomyOptionsP anel::set_ economy( Widelands: :Economy* economy) {
>
> GunChleoc has proposed merging lp:~widelands-dev/widelands/can_act into lp:widelands.
>
> Commit message:
> Remove buttons from economy options window for spectators.
>
> Requested reviews:
> Widelands Developers (widelands-dev)
> Related bugs:
> Bug #1735090 in widelands: "Replays crash when a training site construction window is open"
> https:/
>
> For more details, see:
> https:/
>
> A small cosmetic change.
> --
> You are subscribed to branch lp:widelands.
> === modified file 'src/wui/