Merge lp:~widelands-dev/widelands/add_animation_option into lp:widelands

Proposed by SirVer
Status: Merged
Merged at revision: 8451
Proposed branch: lp:~widelands-dev/widelands/add_animation_option
Merge into: lp:widelands
Diff against target: 174 lines (+21/-3)
8 files modified
src/scripting/lua_ui.cc (+1/-1)
src/ui_fsmenu/options.cc (+8/-1)
src/ui_fsmenu/options.h (+2/-0)
src/wlapplication.cc (+1/-0)
src/wlapplication_messages.cc (+3/-0)
src/wui/CMakeLists.txt (+1/-0)
src/wui/mapview.cc (+4/-1)
src/wui/mapview.h (+1/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/add_animation_option
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+330126@code.launchpad.net

Commit message

Adds a new option "animate_map_panning".

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

As discussed in the attached bug, I added an option to disable map animating.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2651. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/271567733.
Appveyor build 2473. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_add_animation_option-2473.

Revision history for this message
kaputtnik (franku) wrote :

I am unhappy with this change.

There are two different map movement features:
1. Move the map without zooming (just move the map)
2. Move the map with zooming (zoom out, move, zoom in)

I thought this change will only affect the 2. feature. I totally agree that this feature is an option, but disagree disabling feature 1 with this option.

Revision history for this message
SirVer (sirver) wrote :

In the bug and the forum, people expressed unhappiness with any animation and asked for an option to completely turn them off, so this is what this is implementing.

Adding anther option for just paning and no zooming seems even worse than adding this option in the first place. My feeling is that people will get used to zooming and paning (and virtually nobody will turn off the option, very similar to how nobody uses the window snapping feature or turns off quickbuild) or they will complain in a bug and we can remove the feature then completely.

Revision history for this message
kaputtnik (franku) wrote :

I have window snapping turned on :)

We should make a poll for the options: "Which options do you use?" If there are less than 10% (or so) for an option it could be removed.

What is 'quickbuild'?

Revision history for this message
SirVer (sirver) wrote :

> I have window snapping turned on :)

I'd venture you are an exception to the rule.

> We should make a poll for the options: "Which options do you use?" If there are less than 10% (or so) for an option it could be removed.

I think this would not be representative - we have many more players than are active in the forums.

> What is 'quickbuild'?

"Start building a road after placing a flag" is the option name in english.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I don't think that anybody would switch quick build off.

I thin the snap window option is a case of finding it - I liked it once I found it.

ad yes, the switch here should be all animations on/off at the same time.

One nit: paning -> panning

review: Approve
Revision history for this message
SirVer (sirver) wrote :

> One nit: paning -> panning

Done.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I'm in favour of merging this.

Revision history for this message
kaputtnik (franku) wrote :

Why not...

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scripting/lua_ui.cc'
2--- src/scripting/lua_ui.cc 2017-08-31 10:55:45 +0000
3+++ src/scripting/lua_ui.cc 2017-09-11 08:09:23 +0000
4@@ -555,7 +555,7 @@
5 /* RST
6 .. attribute:: is_animating
7
8- (RO) True if this MapView is currently paning or zooming.
9+ (RO) True if this MapView is currently panning or zooming.
10 */
11 int LuaMapView::get_is_animating(lua_State* L) {
12 lua_pushboolean(L, get()->map_view()->is_animating());
13
14=== modified file 'src/ui_fsmenu/options.cc'
15--- src/ui_fsmenu/options.cc 2017-08-08 17:39:40 +0000
16+++ src/ui_fsmenu/options.cc 2017-09-11 08:09:23 +0000
17@@ -150,7 +150,8 @@
18 // Windows options
19 snap_win_overlap_only_(
20 &box_windows_, Vector2i::zero(), _("Snap windows only when overlapping"), "", 0),
21- dock_windows_to_edges_(&box_windows_, Vector2i::zero(), _("Dock windows to edges"), "", 0),
22+ dock_windows_to_edges_(&box_windows_, Vector2i::zero(), _("Dock windows to edges"), "", 0),
23+ animate_map_panning_(&box_windows_, Vector2i::zero(), _("Animate automatic map movements"), "", 0),
24
25 sb_dis_panel_(&box_windows_,
26 0,
27@@ -266,6 +267,7 @@
28 // Windows
29 box_windows_.add(&snap_win_overlap_only_);
30 box_windows_.add(&dock_windows_to_edges_);
31+ box_windows_.add(&animate_map_panning_);
32 box_windows_.add(&sb_dis_panel_);
33 box_windows_.add(&sb_dis_border_);
34
35@@ -336,6 +338,7 @@
36 // Windows options
37 snap_win_overlap_only_.set_state(opt.snap_win_overlap_only);
38 dock_windows_to_edges_.set_state(opt.dock_windows_to_edges);
39+ animate_map_panning_.set_state(opt.animate_map_panning);
40
41 // Sound options
42 music_.set_state(opt.music);
43@@ -399,6 +402,7 @@
44 // Windows options
45 snap_win_overlap_only_.set_desired_size(column_width_, snap_win_overlap_only_.get_h());
46 dock_windows_to_edges_.set_desired_size(column_width_, dock_windows_to_edges_.get_h());
47+ animate_map_panning_.set_desired_size(column_width_, animate_map_panning_.get_h());
48 sb_dis_panel_.set_unit_width(200);
49 sb_dis_panel_.set_desired_size(column_width_, sb_dis_panel_.get_h());
50 sb_dis_border_.set_unit_width(200);
51@@ -501,6 +505,7 @@
52 // Windows options
53 os_.snap_win_overlap_only = snap_win_overlap_only_.get_state();
54 os_.dock_windows_to_edges = dock_windows_to_edges_.get_state();
55+ os_.animate_map_panning = animate_map_panning_.get_state();
56 os_.panel_snap_distance = sb_dis_panel_.get_value();
57 os_.border_snap_distance = sb_dis_border_.get_value();
58
59@@ -561,6 +566,7 @@
60 // Windows options
61 opt.snap_win_overlap_only = opt_section_.get_bool("snap_windows_only_when_overlapping", false);
62 opt.dock_windows_to_edges = opt_section_.get_bool("dock_windows_to_edges", false);
63+ opt.animate_map_panning = opt_section_.get_bool("animate_map_panning", true);
64 opt.panel_snap_distance = opt_section_.get_int("panel_snap_distance", 0);
65 opt.border_snap_distance = opt_section_.get_int("border_snap_distance", 0);
66
67@@ -602,6 +608,7 @@
68 // Windows options
69 opt_section_.set_bool("snap_windows_only_when_overlapping", opt.snap_win_overlap_only);
70 opt_section_.set_bool("dock_windows_to_edges", opt.dock_windows_to_edges);
71+ opt_section_.set_bool("animate_map_panning", opt.animate_map_panning);
72 opt_section_.set_int("panel_snap_distance", opt.panel_snap_distance);
73 opt_section_.set_int("border_snap_distance", opt.border_snap_distance);
74
75
76=== modified file 'src/ui_fsmenu/options.h'
77--- src/ui_fsmenu/options.h 2017-06-24 08:47:46 +0000
78+++ src/ui_fsmenu/options.h 2017-09-11 08:09:23 +0000
79@@ -54,6 +54,7 @@
80 bool dock_windows_to_edges;
81 int32_t panel_snap_distance;
82 int32_t border_snap_distance;
83+ bool animate_map_panning;
84
85 // Sound options
86 bool music;
87@@ -137,6 +138,7 @@
88 // Windows options
89 UI::Checkbox snap_win_overlap_only_;
90 UI::Checkbox dock_windows_to_edges_;
91+ UI::Checkbox animate_map_panning_;
92 UI::SpinBox sb_dis_panel_;
93 UI::SpinBox sb_dis_border_;
94
95
96=== modified file 'src/wlapplication.cc'
97--- src/wlapplication.cc 2017-08-15 20:37:51 +0000
98+++ src/wlapplication.cc 2017-09-11 08:09:23 +0000
99@@ -734,6 +734,7 @@
100 // Profile needs support for a Syntax definition to solve this in a
101 // sensible way
102 s.get_bool("fullscreen");
103+ s.get_bool("animate_map_panning");
104 s.get_int("xres");
105 s.get_int("yres");
106 s.get_int("border_snap_distance");
107
108=== modified file 'src/wlapplication_messages.cc'
109--- src/wlapplication_messages.cc 2017-08-17 06:21:30 +0000
110+++ src/wlapplication_messages.cc 2017-09-11 08:09:23 +0000
111@@ -130,6 +130,9 @@
112 textdomain */
113 << endl
114 << _("Options for the internal window manager:") << endl
115+ << _(" --animate_map_panning=[yes|no]\n"
116+ " Should automatic map movements be animated.")
117+ << endl
118 << _(" --border_snap_distance=[0 ...]\n"
119 " Move a window to the edge of the screen\n"
120 " when the edge of the window comes within\n"
121
122=== modified file 'src/wui/CMakeLists.txt'
123--- src/wui/CMakeLists.txt 2017-08-28 08:33:02 +0000
124+++ src/wui/CMakeLists.txt 2017-09-11 08:09:23 +0000
125@@ -110,6 +110,7 @@
126 graphic_game_renderer
127 logic
128 logic_widelands_geometry
129+ profile
130 ui_basic
131 widelands_ball_of_mud
132 wui_mapview_pixelfunctions
133
134=== modified file 'src/wui/mapview.cc'
135--- src/wui/mapview.cc 2017-09-01 18:59:42 +0000
136+++ src/wui/mapview.cc 2017-09-11 08:09:23 +0000
137@@ -25,6 +25,7 @@
138 #include "base/math.h"
139 #include "graphic/graphic.h"
140 #include "graphic/rendertarget.h"
141+#include "profile/profile.h"
142 #include "wlapplication.h"
143 #include "wui/mapviewpixelfunctions.h"
144
145@@ -291,6 +292,7 @@
146 MapView::MapView(
147 UI::Panel* parent, const Widelands::Map& map, int32_t x, int32_t y, uint32_t w, uint32_t h)
148 : UI::Panel(parent, x, y, w, h),
149+ animate_map_panning_(g_options.pull_section("global").get_bool("animate_map_panning", true)),
150 map_(map),
151 view_(),
152 last_mouse_pos_(Vector2i::zero()),
153@@ -382,7 +384,8 @@
154 return &fields_to_draw_;
155 }
156
157-void MapView::set_view(const View& target_view, const Transition& transition) {
158+void MapView::set_view(const View& target_view, const Transition& passed_transition) {
159+ const Transition transition = animate_map_panning_ ? passed_transition : Transition::Jump;
160 switch (transition) {
161 case Transition::Jump: {
162 view_ = target_view;
163
164=== modified file 'src/wui/mapview.h'
165--- src/wui/mapview.h 2017-08-28 07:35:34 +0000
166+++ src/wui/mapview.h 2017-09-11 08:09:23 +0000
167@@ -187,6 +187,7 @@
168 Vector2f to_panel(const Vector2f& map_pixel) const;
169 Vector2f to_map(const Vector2i& panel_pixel) const;
170
171+ const bool animate_map_panning_;
172 const Widelands::Map& map_;
173
174 // This is owned and handled by us, but handed to the RenderQueue, so we

Subscribers

People subscribed via source and target branches

to status/vote changes: