Commit Graph

297 Commits

Author SHA1 Message Date
Tulio Leao 502a15512b Save mouse differential coords using ScreenCoordsXY 2019-12-17 23:21:12 -03:00
Tulio Leao 6b06b2c578 Use ScreenCoordsXY for Mouse Drag storage (#10380) 2019-12-17 18:38:20 +01:00
Tulio Leao 2cd3add373 Make CursorState store a ScreenCoordsXY object 2019-12-14 23:30:55 -03:00
Tulio Leao 9d09f1b95c Use ScreenCoordsXY on context cursor operations (#10364) 2019-12-14 22:52:18 +01:00
Abd Narane 1ace96ccc4 Add shortcuts for changing the scaling value. (#10341)
Fixes #10305
2019-12-13 17:31:23 +01:00
Tulio Leao c91bdadb47 Use ScreenCoordsXY on viewport interactions 2019-11-21 17:53:28 -03:00
Aaron van Geffen 91f91d4388
Merge pull request #10147 from AaronVanGeffen/implement/1164
Use available translations for shortcut keys
2019-11-04 13:07:34 +01:00
Aaron van Geffen d3b5214f95 Clarify user strings section in comment; add stylistic braces. 2019-11-04 12:09:36 +01:00
Aaron van Geffen 71699543dd Remove obsolete key label strings; update changelog. 2019-11-01 21:14:01 +01:00
Aaron van Geffen e3b0c52086 Use available translations for shortcut keys. 2019-11-01 21:14:01 +01:00
duncanspumpkin 5ca553dd08 Refactor viewport_coord_to_map_coord to return a CoordXY 2019-11-01 20:04:07 +00:00
Tulio Leao d9efd64fea Use ScreenCoordsXY for interface\Widget.h (#10123) 2019-10-29 17:41:19 +01:00
Tulio Leao 96e54519ca Remove comparison of ScreenCoords with MONEY32_UNDEFINED (#10124) 2019-10-29 17:36:57 +01:00
Tulio Leao 5f916b79ae Use ScreenCoordsXY for MouseInput (#10120) 2019-10-20 19:10:30 +02:00
Tulio Leao ce1f38da25 Use ScreenCoordsXY for window functions (#10086)
* Use ScreenCoordsXY for window_create function

* Use ScreenCoordsXY for window_find_from_point function

* Use ScreenCoordsXY for window_find_widget_from_point

* Use ScreenCoordsXY for ride_contruction_tool*

* Use ScreenCoordsXY for window_event_tool*

* Use ScreenCoordsXY for window_event_scroll_mouse*

* Use ScreenCoordsXY for remaining window_event*

* Use ScreenCoordsXY for window_(set|move)_position
2019-10-19 13:07:03 +02:00
Tulio Leao 88dfff5f5e Use ScreenCoordsXY for Keyboard shortcuts 2019-10-18 18:36:18 -03:00
Tulio Leao 2159fd282b Use ScreenCoordsXY for Window functions (#10083) 2019-10-18 17:44:26 +02:00
Matt cc6321048f
Refactor window_invalidate to use rct_window::Invalidate 2019-08-11 17:22:00 +02:00
Hielke Morsink 3ac43114a6 Fix: tile inspector hotkey does not work with debugging tools disabled (#9669)
* Fix: tile inspector hotkey does not work with debugging tools disabled

* Update changelog
2019-07-28 16:55:11 +02:00
Duncan ab5f5b20cd
Use enum class for RCT2_SOUND (#9618)
* Use enum class for RCT2_SOUND

* Fix formatting. Fix mistaken declaration.

* Change name of enum to SoundId

* Fix clang format
2019-07-22 19:02:45 +01:00
ζeh Matt e149722a15 Fix #9467: Crash when windows create new window when being closed (#9470) 2019-06-27 22:28:07 +02:00
Matt 951f5009ef
Refactor window storage to use std::list instead of std::vector 2019-05-29 19:32:18 +02:00
Gymnasiast 72ca5ee3a4 Fix formatting 2019-05-02 22:44:47 +02:00
hokasha2016 6a6465498f Fix #7878: Scroll shortcut keys ignore SHIFT/CTRL/ALT modifiers 2019-05-02 21:42:05 +02:00
Ben Hopkins c537f87fd5 Add scenery picker shortcut 2019-03-24 22:45:42 +01:00
ζeh Matt 5d5373b63c Allow use of numpad enter for console and chat 2019-03-21 21:11:06 +01:00
Aaron van Geffen f4602d0a34 Use SCREEN_FLAGS_EDITOR when appropriate. 2019-03-20 20:58:08 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
duncanspumpkin eadef45ffd Add LoadOrQuiteAction 2019-02-22 09:00:38 +00:00
Aaron van Geffen 3be6137fde
Rename event_07 to periodic_update. (#8684) 2019-02-07 17:46:52 +01:00
Michał Janiszewski ecfbf60cc4 Drop SDL2/ prefix on includes
pkg-config, cmake, all demos and tests define the path with SDL2/
already included.
2019-01-06 17:29:29 +01:00
Hielke Morsink 5ef5e4153d Fix some more implicit and conditional fallthroughs 2019-01-04 22:26:56 +01:00
ζeh Matt c457de1ece Fix #8402: prevent dereferencing invalid iterator (#8504) 2018-12-20 22:25:10 +01:00
Matt 4bc69a0111 Introduce gCurrentRealTimeTicks and refactor some variable names. 2018-12-01 16:36:00 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
youngspe c1cd8619e0 Fix #1496: scrolling on touch devices (#8060)
* Fix #1496: scrolling on touch devices

* correct formatting errors
2018-10-09 20:50:17 +02:00
jensj12 eac9b720ee Add #7726: Shortcut to advance one tick (#7851) 2018-09-23 23:40:47 +02:00
Aaron van Geffen 47eea292b5 Allow assigning a keyboard shortcut for opening the tile inspector (#7994)
* Allow assigning a keyboard shortcut for opening the tile inspector.

* Only open when debug tools are enabled.

* Add changelog entry
2018-09-15 08:57:50 +02:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format 95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +02:00
clang-format 2151b8d75a clang-format UI input 2018-07-23 16:00:13 +02:00
muemart 6365eaba66 Fix #3177: Wrong keys displayed in shortcut menu
SDL_GetScancodeName doesn't actually translate the scancode to the physical key, so first we need to convert the scancode to a keycode and then turn the keycode into a string.
2018-07-03 20:48:28 +02:00
Ted John fe76c807aa Fix #7707: Opening scenario editor closes game
Ensure w is updated after closing the dropdown window.
2018-06-27 11:11:50 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek ec3a1e575e
Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +02:00
Ted John 98905fdbc3 Change g_window_list to use the heap for windows 2018-06-16 16:04:01 +01:00
Ted John 0f6138f8b6 Convert g_window_list to a std::vector 2018-06-16 16:04:01 +01:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Ted John d1d9f0a86a Add debug drawing option for blocked tiles
Replace old unused original drawing code toggle options with new option to show which tiles are blocked by vehicles.
2018-06-10 22:59:58 +01:00
Ted John 92f6ac7333 Rename header files to match renamed source files 2018-06-01 09:38:30 +02:00
Aaron van Geffen bf44007197 Allow fine-tuning the virtual floor style (#7577)
The virtual floor by @JeroenDStout, introduced in the v0.1.2 release, has generally been well-received. However, some players find it too intrusive in its current appearance (cf. #7221). This PR gives them the option of a toned-down version, rather than having to turn it off completely.

![screenshot_20180528_221350](https://user-images.githubusercontent.com/604665/40628292-6e71358e-62c4-11e8-9293-e166e75d0da6.png)

The clear/transparent style, introduced by this PR, looks like the virtual floor as originally introduced in #6338:
![](https://user-images.githubusercontent.com/14242454/31050274-e3f0e62e-a645-11e7-9b10-ec26b733d631.gif)

The glassy/translucent style is the virtual floor as we've come to know it since the v0.1.2 release, and remains the default setting.
2018-05-30 13:09:50 +02:00
Ted John 8eacc3582c Remove PlainContext 2018-05-11 20:39:00 +01:00
Ted John 302fe00805 Always pass shared_ptr by reference 2018-05-11 20:39:00 +01:00
Ted John 7dc170ef85 Use shared_ptr for long-life objects
Use unique_ptr and shared_ptr for IContext, IPlatformEnvironment, IUiContext, and IAudioContext.
2018-05-11 20:37:48 +01:00
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
Hielke Morsink 30063984e6
Delete unused function arguments or mark them so (#7426)
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).

I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.
2018-04-20 13:56:37 +02:00
Ted John a913fd2d4a
Merge pull request #7266 from IntelOrca/feature/interactive-stdinout
Make stdin / stdout a game console
2018-03-23 22:19:08 +00:00
xp4xbox 674e094b3a Add shortcut definition for 'View Path Issues' and 'Cutaway View' 2018-03-23 10:37:13 +01:00
Ted John dd0573b235 Move in game console to UI library 2018-03-22 20:16:58 +00:00
Ted John ec9e812ea7 Replace gConsoleOpen with function 2018-03-22 20:16:58 +00:00
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Michał Janiszewski 4dd0995efb Move cmath out of common.h 2018-03-18 23:29:13 +01:00
Ted John 39a38dc193 Include SDL2 using sub directory 2018-03-09 16:28:47 +01:00
Aaron van Geffen ba1d269227 Move all Virtual Floor code from Map to its own file. 2018-03-04 19:28:56 +01:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Michał Janiszewski 20f95d073a Fix remaining uses of WC_LOADSAVE intent 2018-02-07 23:14:29 +01:00
Gymnasiast cc4f7e144a Remove most usages of 'new Intent' 2018-02-05 23:23:26 +01:00
Gymnasiast e3c0f6606d Clean up Intent.{cpp,h}
This gets rid of the C transfer functions, add licence and does some alignment fixes
2018-02-05 23:23:26 +01:00
Gymnasiast 34a6b5ef92 Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
Gymnasiast 778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Gymnasiast 5cc21fd21b Replace NULL with nullptr in C++ files 2018-01-29 21:33:21 +00:00
Ted John cebe13984f Remove most of remaining memory functions from libopenrct2ui 2018-01-21 11:17:41 +00:00
Marijn van der Werf 4c956def67 Update UI imports 2018-01-18 22:57:55 +01:00
Adakite Systems 0681ba4e04 Read and set edge scrolling speed via config
- For future reference, the default edge scrolling speed
value of 12 is retained.
2018-01-14 00:51:51 +00:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Michael Steenbeek cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
Aaron van Geffen 1d7bec8a11 Make the virtual floor optional, on by default. 2018-01-11 10:37:40 +01:00
Aaron van Geffen 84026529b4 Introduce new variable gMapVirtualFloorVisible to determine visibility.
This addresses compilation issues for projects that contain no UI code.
Also working towards better invalidation for the software renderer.
2018-01-11 10:37:40 +01:00
Jeroen D Stout c8785bac55 Add virtual floor removal check to input 2018-01-11 10:37:40 +01:00
Michał Janiszewski 469e142c7b Change casing of header files 2018-01-11 09:30:09 +01:00
Ted John c3eab7ead6 Refactor window.c to C++ 2018-01-07 12:39:58 +01:00
Ted John 83d1b6eb8f Refactor widget.c to C++ 2018-01-07 12:39:58 +01:00
Ted John f18595a1c1 Refactor viewport.c to C++ 2018-01-07 12:39:58 +01:00
Ted John c974daf467 Refactor console.c to C++ 2018-01-07 12:39:58 +01:00
Ted John b781291b58 Refactor chat.c to C++ 2018-01-07 12:39:58 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Ted John 02c58a6c5a Remove custom base Exception class 2018-01-05 18:11:47 +00:00
Michał Janiszewski 33a94fe1bb Use C++ headers in C++ code 2018-01-04 07:36:54 +01:00
Michał Janiszewski b2bc974fe7
Use nullptr where possible 2018-01-04 06:58:44 +01:00
Michael Steenbeek 91589f57c6 Compile map.c as C++ 2018-01-03 20:40:51 +01:00
Ted John 49f5611bd1 Rename scenario.c|h to cpp 2018-01-03 15:07:17 +01:00
Robert Jordan 907f18fd69 Fix: Following canceling
Stop previewing sequence now unfollows the current sprite.
Using the arrow keys in-game cancels following.
Resizing the window no longer cancels following.
2017-12-31 20:03:09 +01:00
Robert Jordan 298420fd1e Finalize follow sprite command
Added new smart follow variable to window to more intuitively follow
sprites that may not be directly followable at all times.
Follow sprite is now canceled when dragging the screen but not
scrolling. This is only relevant when testing title sequences in game.
Select sprite button is now disabled in the title menu.
Sprites are now identified based on their name. Excess identification
information is not given as it'd clutter up the screen and is not
necissary with the viewbox in the command editor.
2017-12-31 20:03:09 +01:00
Michael Steenbeek c4f44e5e7a Compile files in paint folder as C++ 2017-12-17 17:24:36 +01:00
Marijn van der Werf 00667c81b6 Reformat MouseInput 2017-12-16 15:47:38 +02:00
Marijn van der Werf 1e946fc0fe Move Dropdown to UI project 2017-12-16 15:47:38 +02:00
Marijn van der Werf 0193ea4fdc Move tooltip to UI project 2017-12-16 15:47:38 +02:00
Marijn van der Werf e9ef843619 Move majority of input.c to UI 2017-12-16 15:47:38 +02:00
Michael Steenbeek 1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00
Michael Steenbeek 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
zyliwax 7bffc4ae33 Adding gridlines display toggle shortcut. (#6313)
This feature existed in the original RCT1/2 games but was not present in
the latest development commit.

The original shortcut for this key was '7', placing it between the
"Invisible people toggle" (6) shortcut and the "Height marks on land
toggle" (8). This commit preserves as much as possible, using
placeholder comments that signify the relevant values which this
feature actually uses where this is not possible.
2017-11-22 12:02:23 +00:00
Marijn van der Werf dceb403ca9 Move editor bottom toolbar to UI module 2017-11-18 21:07:21 +01:00
Marijn van der Werf 8b7322ad6e Move bottom toolbar to UI module 2017-11-18 21:07:21 +01:00
Marijn van der Werf bd0bd9e038 Move top toolbar to UI module 2017-11-11 23:57:19 +01:00
Robert Jordan 4c3065619e Fix #996, #2254, #2589, #2875: Viewport scrolling getting stuck or shaking
Shaking while at the edge of the map has been completely eliminated. In
order to do this, comparison with tile height was also removed which
fixed a few outlier cases.

The main cause was viewport axis were only being set if it's respective
isometric axis was at the boundary, instead of either isometric axis.
Viewport no longer gets stuck which was related to the shaking in the
end. (#2875)

Refactored viewport_update_position. I moved
viewport_set_underground_flag above the bounds checking function since
it had no relation to it. (#996, #2589)

Scrolling on the map edge with arrow keys or mouse edge will now go the
same speed in both directions. (#2254)

Added changelog entry.
2017-11-08 17:43:50 +01:00
Marijn van der Werf 59df233669 Move text input window to UI module 2017-11-03 01:54:37 +01:00
Michał Janiszewski 8fd2266bda Refactor includes (#6512)
* Refactor Intent.h inclusion

* Use forward declaration of ITcpSocket

* Remove unused include

* Forward declare rct_ride_entry

* Remove unused headers

* Forward-declare rct_drawpixelinfo

* Remove unused headers

* Lower header include from header to source file

* Reduce included headers

* Reduce includes
2017-10-19 10:01:05 +02:00
Michael Steenbeek bb01699b7d Compile track.c as C++ 2017-10-17 13:51:47 +02:00
Michał Janiszewski 07f7928382 Indent namespace contents in KeyboardShortcut.cpp 2017-10-11 11:30:40 +02:00
Michael Steenbeek 34200848a9 Fix Xcode project; rename input.h 2017-10-11 11:30:38 +02:00
Michał Janiszewski 50fa761fa0 Apply C++ formatting to Input.cpp 2017-10-11 11:30:36 +02:00
Michał Janiszewski f04c871515 Compile input.c as C++ 2017-10-11 11:30:35 +02:00
Michał Janiszewski 83bb8721f8 Apply C++ formatting 2017-10-11 11:30:34 +02:00
Michał Janiszewski b55f966a87 Compile keyboard_shortcut as C++ 2017-10-11 11:30:33 +02:00
Marijn van der Werf ebb4bbe5d5 Move ride list window to UI module (#6412) 2017-10-08 22:15:41 +02:00
Marijn van der Werf d02976695d Move new ride and research windows 2017-10-07 22:24:14 +02:00
Marijn van der Werf 8569a7fe2f Move map window 2017-10-07 22:24:14 +02:00
Marijn van der Werf b7164c5eac Rename intent extra keys 2017-09-24 22:41:49 +02:00
Marijn van der Werf d18e59ff17 Move loadsave dialog 2017-09-24 22:41:49 +02:00
Marijn van der Werf 9b1b2b5c62 WIP window moving 2017-09-24 22:41:49 +02:00
Marijn van der Werf 8503b8e204 Move Finances and Park windows 2017-09-24 22:41:49 +02:00
Michael Steenbeek 1fd1d8c26b Move editor to C++; add defines for object limits 2017-09-22 07:56:24 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
wolfreak99 8e93c69e47 Implement console scrolling by pageup and pagedown 2017-08-26 18:19:03 +02:00
Michał Janiszewski d698ad1100 Convert NULL -> nullptr in C++ 2017-08-15 11:51:56 +02:00
Marijn van der Werf 294cef3c9b Move additional windows to UI project 2017-08-14 23:53:28 +02:00
Marijn van der Werf 4d90940d21 Move windows to UI project 2017-08-10 13:42:27 +02:00
Ted John f3ef92edcb Fix MSVC build errors and warnings 2017-08-10 13:42:27 +02:00
Ted John 8b2eb8a13e Move screen variables to OpenRCT2.h 2017-07-29 20:29:29 +01:00
Kuriibo d0db59e196 Keyboard Shortcut for Scenery Remover - #5835
Added a hotkey for the "clear scenery" window. By default, the hotkey is the "b" key (b/c bulldozer).
2017-07-26 17:23:47 +01:00
Ted John bc88cb9c2b Make TitleScreen a class (#5971) 2017-07-22 23:42:14 +01:00
Ted John 9b2777bc56 Fix read keyboard config error
Do not try to read more keyboard shortcuts than there actually are.
2017-06-30 19:11:32 +01:00
Michał Janiszewski 5a20ab2ffe Add missing newline in input.c
[ci skip]
2017-06-29 23:21:31 +02:00
Ted John f275e5ba9b Remove all platform.h includes from header files
System headers, particularly windows.h polute the namespace too much with macros and unwanted definitions. Do not use them in header files.
2017-06-25 18:59:56 +01:00
wolfreak99 c80e782e67 Add default shortcut 2017-06-24 19:01:00 +02:00
wolfreak99 8364d8d3d8 Implement load game shortcut 2017-06-24 19:01:00 +02:00
Michał Janiszewski 9903c15e2a Remove various trailing whitespaces
[ci skip]
2017-06-17 13:41:40 +02:00
Ted John 20197d50c3 Fix #5595: No longer able to navigate map diagonally using arrow keys 2017-06-13 17:20:50 +01:00
Ted John ee7c97b7be Move scancode to key to openrct2ui 2017-06-11 23:22:32 +01:00
Ted John 31c2b9c6b7 Move remaining SDL in input.c to openrct2ui 2017-06-11 21:18:56 +01:00
Ted John 7a86fc2cb5 Link back shortcut functions
Some of this will be temporary until input and windows move over to libopenrct2ui.
2017-06-11 17:23:52 +01:00
Ted John 89ea9064de Move things in keyboard_shortcut.h into KeyboardShortcuts.h 2017-06-11 17:23:51 +01:00
Ted John cbd53f920c Create IWindowManager to open window from libopenrct2 2017-06-11 17:23:51 +01:00
Ted John dfa1b47a4f Move keyboard shortcut code to libopenrct2ui. 2017-06-11 16:52:15 +01:00