Age | Commit message (Collapse) | Author |
|
outside of window.c. This makes
it possible to programmatically resize windows specifying a delta x,y.
|
|
WWT_LAST; i++, wi++)' type for loops with 'for (i = 0; i < w->window_count; i++) { wi = &w->widget[i];'-type for loops for better readability.
-Codechange: use IsWindowWidget(Disabled|Hidden) in favor of IsWidget(Disabled|Hidden).
|
|
IsWindowWidget(Lowered|Hidden|Disabled)
|
|
-Codechange: check whether widget indices are valid for all the (Set|Is)WindowWidget(Disabled|Lowered|Hidden) and related functions.
|
|
|
|
a bit:
- using one engine list instead of 3
- removed engine filters (loco, wagons, helicopters, etc.)
- EngineList code isolated from GUI (moved to helpers.cpp - reusing CBlobT code which does exactly what is needed for EngineList)
- removed unnecessary "optimization" (rebuild and sort engine list on each WE_PAINT)
|
|
with the actual window
structs inside their array, and possibly invalidating pointers higher up.
Meaning that any function called within an wndproc could cause unknown/invalid pointers
once control was returned to this function. Solved by the introduction of an extra
abstraction layer, an array of z-window positions that is only concerned with the
pointers.
|
|
(assert_compile + 3)
|
|
use FindWindowById
instead of _windows loop (viewport.c), remove dump-code (mixer.c), MSVC6 borkdness
in stdafx.h, constness (viewport.c), variable localization (win32.c), comments (window.c)
|
|
Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
|
|
high CPU load, handle
mouse input right away instead of waiting for GameLoop. (KUDr)
|
|
load, handle
keyboard input in place instead of global variables magic. (KUDr)
|
|
some (not all) vehicle list windows open for a player, that goes bankrupt would crash the game
-Codechange: closing all windows for a player will now loop all windows and close those, which got the player as caption instead of having a list of windows to close
|
|
desc->left/top settings with
some special values (WDP_) instead of checking window-class. This also fixes FS#172
now that we can position windows arbitrarily and are not restricted to window-classes.
|
|
window's number.
|
|
class of windows,
SendWindowMessageClass().
|
|
originally used to not
to allow clicking if a button was disabled. This has been superseded in r212 with
general code that doesn't allow any click events for disabled buttons.
|
|
WWT_INSET (credits to peter1138
for the aptly found name)
-Codechange: Remove the explicit numbering from WindowWidgetTypes
|
|
is only plain panel,
WWT_IMGBTN must contain an image for drawing. Renamed WWT_PANEL_2 to WWT_IMGBTN_2
because that is what it is. Added WWT_PUSHBTN that is either just a pushable button,
or a textbutton, which text's drawn dynamically independent of widget.
|
|
when the selection
is only a single tile. Seems this was a bit annoying to some ;)
|
|
height
differences of various draggable tools (inspiration, concept and double
checking by MeusH).
|
|
to a file of it's own
Also made some changes to it so it should be easier to unify all the build vehicle windows
|
|
used for all vehicle types
|
|
propeller planes, jet planes or helicopters
-Codechange: the build aircraft window now generates 3 malleced lists and displays based on those list
This is preparation for sorting aircraft
|
|
|
|
when the window data is invalidated or the window is generated, not on each redraw
|
|
or both in the display
-Codechange: [train build window] to get rid of a really ugly hack, the train build list is now generated in one loop and stored in an array
|
|
multiple widgets in one call
|
|
The functions required to do so are to be found in window.h.
Rather then use the old deprecated disabled_state, hidden_state and click_state uint32 variables,
we now need to use accessors like SetWindowWidgetDisabledState, SetWindowWidgetHiddenState or SetWindowWidgetLoweredState.
This is the final commit for the merge of XTDwidget branch.
|
|
This gives the ability to invalidate some window data and recalculate as needed instead of doing it for each WE_PAINT
This event is called right away when using InvalidateWindowData(), so it may be a good idea to set a bool or similar in the window
or similar and then act on that bool in WE_PAINT instead of doing a lot of stuff in WE_INVALIDATE_DATA as it might be called more than once before WE_PAINT is called
InvalidateWindowData() will not automatically repaint the window, so if you want to repaint it as well, you need to mark it dirty as well.
Made the depot windows use WE_INVALIDATE_DATA to set when to generate the engine and wagon lists instead of at each redraw
It makes no sense to regenerate the list when say using the scrollbar if we know that no vehicle have entered or left the list
NOTE: currently there is a piece of code to generate the list when it's not needed and compare it to the stored list and assert if they mismatch
This check is somewhat slow and kills the whole idea of WE_INVALIDATE_DATA, so it's a short lived one to verify that InvalidateWindowData() is used everywhere where it's needed
|
|
|
|
SetWindowWidgetLoweredState, in order to follow pre-established standard
|
|
Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
|
|
(can only be done in goto depot orders)
Example: make a train transport iron ore from A to B, then it visits a depot and refits to steel
It then transport steel back to A or near A if there is a factory and then it visits another depot to refit to iron ore again
This is controlled in the orders. If a goto depot order is lightlighted, then "Unload" changes to "Refit"
Control click "Refit" removes the refit part of the order (as the tooltip says)
The player will still pay the normal refit costs
Known issues:
If a vehicle is not in a depot, then the refit window will fail to tell refitted cargo capacity
Refit costs in the refit window can sometimes print 0 when it should not because the refit calculation is unaware that the vehicle will be refitted in between
Warning: autoreplace got a protection against replacing something so you get a new cargo type, but it can fail here. In the iron ore/steel example, it can see that
the vehicle carries iron ore and the new one can be refitted to iron ore, then it will replace. It will not check to see that it's valid for steel as well.
This is something to look into in the future
|
|
DBsetXL, amongst others. This requires a savegame bump to save the cargo subtype.
|
|
refit window has been altered to support resizing and scrolling. Note that the cargo subtype isn't yet passed for actual refitting yet. (Based on mart3p's patch)
|
|
click/disabled/hidden_state of Window
This is the first step toward merging XTDwidget.
|
|
This change is intended to make it easier to make depot behaviour consistent
and faster to code when adding more features in the future
The user interface should hopefully not be affected by this
|
|
This will ensure that you can always get the same list when checking for vehicles in a depot (no need to duplicate code for each place, that needs such a list)
Since the vehicles are only looped once for each redraw, drawing speed is around twice as fast (measured to be 114%-121% faster depending on the number of vehicles in the game)
|
|
WindowEvent, which is now a struct
|
|
to 'data'.
|
|
superfluous header includes
-Codechange: Unify the Sorting struct both for vehicle-lists and network-lists.
|
|
window_number is set before calling the WE_CREATE event
this allows using the window_number in WE_CREATE window event handlers
|
|
with FR_TRANSPARENT
|
|
(_color_list) which the renderer shouldn't have know about
|
|
{' -> '} else {', tabs between code and comment, etc.
|
|
label
CodeChange : Move almost all fixed strings from ON_PAINT event to Widget array using WWT_LABEL.
Feature : All "Select Refit Cargo" are now centered, instead of been left aligned
|
|
whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
|
|
of a general function that handles that
-Codechange: use always 'e' for WindowsEvent, neverr 'we'
|
|
windows handle them theirself. Added WE_SCROLL for this.
|