Split mouse wheel scroll handling into horizontal and vertical. Keep
vertical scroll for zooming and use horizontal to rotate around the y
axis replicating the behaviour of the main game.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
We don't need to use pointers because we know lifetimes of all
renderers. And its list statically defined. A new renderer should follow
DOD and use a separate submission list with a separate inplace renderer.
Separates submitted models and moder renderer and makes relations
explicit. Now it's clear that we don't need separate ModelRenderer and
ModelVertexRenderer.
We use only shaders to render models so we don't need a separate class.
BatchModelRenderer was renamed in 6bc33fe8bd.
m_Renderer became unused in 0346ba1b18.
CSimulation2 used , CSimulation2Impl mixed /, and
CTurnManager used for the same turn-count concept, forcing a
static_cast<int64_t> at the one place these types already met
(rejoin-test comparison).
Add (alias for std::int32_t) in SimulationCommand.h and use
it consistently for every turn counter in CSimulation2/Impl,
CTurnManager and its subclasses (CLocalTurnManager,
CReplayTurnManager), CNetServerTurnManager/CNetClientTurnManager, and
the network wire format (m_Turn in CEndCommandBatchMessage,
CSimulationMessage, CSyncCheckMessage, CSyncErrorMessage, and
m_CurrentTurn in CLoadedGameMessage).
Turn *duration* fields (m_TurnLength, m_CommandDelay,
DEFAULT_TURN_LENGTH, COMMAND_DELAY_SP/MP, SetTurnLength,
GetSavedTurnLength return type) are left as u32 — they're milliseconds,
not a counter, and out of scope here.
Remaining turn_id_t vs size_t comparisons use std::cmp_equal or
explicit casts, matching the existing pattern in Simulation2.cpp.
Fixes#8718
Doesn't make sense to have the Paths StaticBox inside the Common
settings StaticBox so make it a top-level item as well.
While at it dissolve nested constructors to make the creation of the
widgets more readable.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
To follow coding convention rename the vector Node to m_Nodes,
MaxDistance to m_MaxDistance and NodeCount to m_NodeCount.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Commit 81c57e8a28 added support for adding and removing paths.
Reloading path list stores the current selection but it's unused, assume
the idea was to restore it again.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Commit 309ed5ef28 used dynamic events
which prevents some other menu items from working properly. So don't mix
static and dynamic events for top window.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The issue was introduced by 8a2a450686.
It affected GUI text objects (CText) with `scrollbar` set to true; when
their caption was long enough for a scrollbar to be visible and then the
size changed (got bigger) so that no scrollbar was needed anymore, then
for a single frame the text was completely misaligned. This happened
because in `CText::Draw` the scrollbar wasn't updated yet, so the newly
added `GetScrollBar(0).IsVisible()` check still returned true, even
though it wouldn't end up being rendered anyway -- it was updated in
`IGUITextOwner::DrawText` eventually.
This happened to the tutorial info panel in the starting economy
walkthrough, for example. Note: in that case the scrollbar wasn't ever
drawn, but it was temporarily set visible within a frame by the JS
object resizing logic.
966727b52e made the player state an enum and introduced more descriptive
functions to achieve the same thing, but it seems they were forgotten to
be replaced in a few places, which this patch fixes.
WX may still generate mouse events after calling CVideoMode::Shutdown(),
so don't create SDL events triggering assertions.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
If we catch the signal we'd have to communicate that we terminated by
signal, which might depend on shell. There is also the issue of various
dialogs blocking regular quit which we don't want, so that would need
extra work as well.
As such just let the SIGINT/SIGTERM do there default action and forgo
cleanup and let the OS handle it.
Fixes: #198
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add a fullscreen toggle to the View menu and with a global hotkey,
reusing the default one from the main game.
Unlike the current implementation this one doesn't need the game canvas
to be focused and also works on GTK.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Commit fe192fe58f made it possible for
events to properly propagate to the top window. As on Windows Enter is
also used for navigation, i.e. used to trigger the dialogs default action,
which in our case seems to be quit.
Tell the wxSpinCtrl to fire wxEVT_TEXT_ENTER instead and handle it.
The wxCommandEvent wxEVT_TEXT_ENTER doesn't carry the value, so need to
use dynamic event binding (which is preferred way anyway).
Also show the numPlayerSpinner as a spinner instead of a text field to
match visuals to actual behaviour.
Fixes: #9026
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Use dynamic event bindings allowing to bind all events in all sort of
ways. Addionally no need for subclassing wx widgets.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>