Age | Commit message (Collapse) | Author |
|
|
|
widgets, not hide them
|
|
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
|
|
Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
|
|
WindowEvent, which is now a struct
|
|
more uniform.
-Cleanup: whitespace alignment of a few tables.
|
|
window_number is set before calling the WE_CREATE event
this allows using the window_number in WE_CREATE window event handlers
|
|
of a general function that handles that
-Codechange: use always 'e' for WindowsEvent, neverr 'we'
|
|
windows handle them theirself. Added WE_SCROLL for this.
|
|
- New optional landscape generator (TerraGenesis Perlin)
- Load heightmaps (either BMP or PNG)
- Progress dialog while generating worlds (no longer a 'hanging' screen)
- New dialogs for NewGame, Create Scenario and Play Heightmap
- Easier to configure your landscape
- More things to configure (tree-placer, ..)
- Speedup of world generation
- New console command 'restart': restart the map EXACTLY as it was when you
first started it (needs a game made after or with this commit)
- New console command 'getseed': get the seed of your map and share it with
others (of course only works with generated maps)
- Many new, world generation related, things
- Many internal cleanups and rewrites
Many tnx to those people who helped making this:
Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
Many tnx to those who helped testing:
Arnau, Bjarni, and tokai (alfabetic)
And to all other people who helped testing and sending comments / bugs
Stats: 673 lines changed, 3534 new lines, 79 new strings
|
|
|
|
|
|
scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
|
|
by TILE_HEIGHT. Reverted one change from the previous commit because it was faulty
|
|
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
|
|
|
|
|
|
structure to prevent crashes in all the other cases where it is not guarded against sufficiently
|
|
|
|
AllocateWindowAutoPlace, AllocateWindowAutoPlace2)
|
|
|
|
Determine clicked status of sticky icon from window flags rather than the widget click state. This keeps the status in one place where it can't get out of sync.
|
|
direction (Requested by manx)
|
|
|
|
|
|
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
|
|
Also align short cases nicely
|
|
|
|
- remove long unused stuff and bogus comments
- complement struct typedefs
- remove read-only (_demo_mode) and unused (_fix_mouse_at) global variables
|
|
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
|
|
sprite list
|
|
functions that don't change their pointer parameters
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
|
|
disabled items
|
|
|
|
|
|
|
|
|
|
|
|
|
|
failed to detect the most-right and most-bottom pixels of a widget. If scrollwheel is used on a not-found widget (such as the background of the toolbar), it will now fail correctly (glx)
|
|
TileVirtXY
|
|
|
|
request if the requested widget is invisible or otherwise not visible (type WWT_EMPTY)
|
|
dedicated server (only reset _thd.pos, not the whole structure; as done in revision 2241 to fix another crash)
|
|
highlighting. Without shutting down OpenTTD some possibly 'invalid' data in TileHighLightData (_thd) is left behind; reset it.
|
|
- CodeChange: Use images as arrows in the scenario-date scroller, looks better
- Feature: Clicked buttons with images/text now visibly depress their contents when pressed (eg it really seems like the button is moving)
- Fix: Fix sprite offsets of the arrow sprites in openttd.grf
|
|
- CodeChange: Introduction of SendWindowMessage() where a window can send another window a message (ala windows style msg, wparam, lparam). Messages can be sent by windowclass and by windowpointer.
- CodeChange: IsVitalWindow() simplifies a lot of checks for window handling that need to know what windows it can close, or be on top of, etc.
|
|
not have "focus", keyinput went to game. A quick fix for the horrid inputkey-handling.
|