Branch: refs/heads/master Home: https://github.com/Warzone2100/warzone2100 Commit: eff9c5cfb0a9d26a3ddd558b1d7c7f3a886c323f https://github.com/Warzone2100/warzone2100/commit/eff9c5cfb0a9d26a3ddd558b1d7c7f3a886c323f Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021)
Changed paths: M src/display.cpp M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- feat: key binding contexts Implemented quick & dirty keybinding contexts, which can be used to categorize the key mappings. For example, I implemented the hardcoded radar scrollwheel zoom as secondary keybinding using separate RADAR context for the kf_RadarZoomXXX actions. The display.cpp sets RADAR context state to ACTIVE or PRIORITIZED based on if the cursor is over the radar. Additionally, debug keybinds are now controlled via DEBUG context, albeit it does not use context states yet. The actual keybind selection uses numeric priorities assigned to each context. Each context can be configured with priority per state. e.g. while ACTIVE, RADAR has lower priority than most regular in-game keybindings. Then, when it gets set to PRIORITIZED state, the priority for the state is higher than for ACTIVE, prioritizing the radar actions over other actions. This should be flexible enough for implementing most hardcoded actions as keybindings. Also, I'd like to change the keybind options screen to better categorize the different keybinds. Commit: bca60301fd6536ba0996c9a80f3e53f3435ff485 https://github.com/Warzone2100/warzone2100/commit/bca60301fd6536ba0996c9a80f3e53f3435ff485 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keymap.cpp Log Message: ----------- chore: clean up the default keymap Commit: f9b279d3ebfc8243e23102613e0b8cc44482a712 https://github.com/Warzone2100/warzone2100/commit/f9b279d3ebfc8243e23102613e0b8cc44482a712 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- feat: added category (context) separators to the keymap editor Commit: bcda5788de229ebb518bbed67d32f74ff8e0c662 https://github.com/Warzone2100/warzone2100/commit/bcda5788de229ebb518bbed67d32f74ff8e0c662 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: clean up duplicated fields from KEY_MAPPING The fixed info on the mapping (name/function) can already be obtained via ptr to info, so no need to keep them in the mapping itself. Now the KEY_MAPPING is merely just container for 'which action' (info), 'which slot' and 'which keys'. Commit: a47ad5b6c608741c084ec1a3fc6cbd3aa0f2c7bf https://github.com/Warzone2100/warzone2100/commit/a47ad5b6c608741c084ec1a3fc6cbd3aa0f2c7bf Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: KEY_ACTION is now scoped enum Commit: 5edec2f1b6e00ace629fdc4873844e24f80d65c2 https://github.com/Warzone2100/warzone2100/commit/5edec2f1b6e00ace629fdc4873844e24f80d65c2 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- fix: clearing keybinds does not work when there are multiple bindings for same key combo in different contexts Commit: 4a4f5af6e83f52930081a702d1bf3ada81319ddd https://github.com/Warzone2100/warzone2100/commit/4a4f5af6e83f52930081a702d1bf3ada81319ddd Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/display.cpp M src/display.h M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: make input contexts constant by moving state handling to separate InputManager Commit: f34c7f96ad54bd8762ac21546669d8905acc24a2 https://github.com/Warzone2100/warzone2100/commit/f34c7f96ad54bd8762ac21546669d8905acc24a2 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/display.cpp M src/display.h M src/ingameop.cpp M src/init.cpp M src/keyedit.cpp M src/keyedit.h M src/keymap.cpp M src/keymap.h M src/titleui/old.cpp Log Message: ----------- refact: encapsulate most input handling to InputManager class Commit: 8e8a547428ebdc8848bdcd51d59393e2d25c3eea https://github.com/Warzone2100/warzone2100/commit/8e8a547428ebdc8848bdcd51d59393e2d25c3eea Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: actually delete mappings instead of setting key to KEY_MAXSCAN Commit: c702cc8962246086039090292e78cbc81e4dd0a2 https://github.com/Warzone2100/warzone2100/commit/c702cc8962246086039090292e78cbc81e4dd0a2 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/display.cpp M src/hci.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: handle disabling keybinds in design screen via contexts Commit: 404ca2dc9f07354911b5cee9ee7505dc38f0c415 https://github.com/Warzone2100/warzone2100/commit/404ca2dc9f07354911b5cee9ee7505dc38f0c415 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keybind.cpp M src/keybind.h M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: store default mappings in the info table This allows getting rid of requiring listing all mappings twice in the 'keymap.cpp', reducing number of lines of required boilderplate quite much. This should also make adding new key mappings a bit easier, if anyone wants to add any in the future. As default mappings were the last bastion of raw funcptrs, this change made it easy to change everything from using raw function pointers to using KeyMapEntries with std::function instead of raw funcptr. The latter allows passing lambdas with capture groups as mappable functions, which should prove to be useful. Commit: ba994b33605975af321f8a43965bd7ff6bcf702b https://github.com/Warzone2100/warzone2100/commit/ba994b33605975af321f8a43965bd7ff6bcf702b Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keybind.cpp M src/keybind.h M src/keymap.cpp Log Message: ----------- refact: replace DEFINE_NUMED_KF with lambda factory functions Now that KFs can be lambdas with captures, we can replace the macro magic with lambda magic. Commit: 4907d556abeaf5210ca5657040647834ab975a06 https://github.com/Warzone2100/warzone2100/commit/4907d556abeaf5210ca5657040647834ab975a06 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: pass keymap infos around as references instead of ptrs as they are never null Most of the time the keymap entries being processed are bulk-processed via getAll -style getters. Also, many of the functions assume that the ptrs are never null (which is mostly correct assumption). Therefore, I changed all remaining info ptrs to info refs and made return values nonstd::optionals in situations where having a null was actually possible. This avoids the constant feeling of 'I am not nullchecking enough' when working with the input processing. Commit: 82bd77c00eaab0eb1a322fbf1bcce823470b6347 https://github.com/Warzone2100/warzone2100/commit/82bd77c00eaab0eb1a322fbf1bcce823470b6347 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: changed non-null keymapping ptrs to refs There are far too may raw pointers all over the place, so I'm attempting making as many functions use refs and const as possible. I should be able to eventually make KeyMappings immutable and use refs/optionals everywhere. Commit: 07fbd95e9348d5cf5ad16c3cd9390a7dc6902b6e https://github.com/Warzone2100/warzone2100/commit/07fbd95e9348d5cf5ad16c3cd9390a7dc6902b6e Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keybind.cpp M src/keybind.h M src/keymap.cpp Log Message: ----------- refact: make zoom and radar zoom in/out factory functions, clean up unused code Commit: ec53ef1506b395a4883e713098bb348383827b56 https://github.com/Warzone2100/warzone2100/commit/ec53ef1506b395a4883e713098bb348383827b56 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keybind.cpp M src/keybind.h M src/keymap.cpp M src/selection.h Log Message: ----------- refact: removed code duplication with KF lambda factories Commit: 4275b6db890c8ff29d3dd0b723323979c371652b https://github.com/Warzone2100/warzone2100/commit/4275b6db890c8ff29d3dd0b723323979c371652b Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keybind.cpp M src/keybind.h M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: capture map marker params in lambdas Changed kf_JumpToMapMarker into a lambda factory which captures the x/z/yaw instead of storing them to a global state variable. This allowed getting rid of the getLastInput, getLastMetaKey, and all getMarker globals. Commit: f8f2aefadef431899f5d51a5f8d8b65c4d010596 https://github.com/Warzone2100/warzone2100/commit/f8f2aefadef431899f5d51a5f8d8b65c4d010596 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keymap.cpp Log Message: ----------- fix: fixing CI errors - Trickery with accessing the mapping in addDefaultMapping to avoid -Wmaybe-uninitialized (this is a GCC bug). Commit: d456531900520dd2dc770df9bce25532e1e08d6b https://github.com/Warzone2100/warzone2100/commit/d456531900520dd2dc770df9bce25532e1e08d6b Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keybind.cpp M src/keymap.cpp Log Message: ----------- chore: remove default bindings with KEY_MAXSCAN as key Commit: 7ca9acaffebace34d9d155370930e6d1eb3aed85 https://github.com/Warzone2100/warzone2100/commit/7ca9acaffebace34d9d155370930e6d1eb3aed85 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keymap.cpp Log Message: ----------- chore: another attempt at fixing the CI build Managed to break newer GCC builds and XCode build with the ignore pragma. Added in condition to disable the ignore if the warning is not present. Commit: ec5fa4cd628c28ba4f2b67842b7aca01964ee186 https://github.com/Warzone2100/warzone2100/commit/ec5fa4cd628c28ba4f2b67842b7aca01964ee186 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keymap.cpp M src/keymap.h Log Message: ----------- feat: do not override missing keybinds with defaults Now that mappings are allowed to be missing, we have no technical reason of forcing the keybinds to use defaults when they are not present in the key map file. Changed the logic to add in the default mappings only if forcing the defaults. Next up, allowing clearing the key mappings in the editor with ESC or sth similar :) Commit: 4e754edde08b016ebfeba6fa2c3d91cba0fa9551 https://github.com/Warzone2100/warzone2100/commit/4e754edde08b016ebfeba6fa2c3d91cba0fa9551 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keymap.cpp Log Message: ----------- fix: always add non-saved mappings when resetting Commit: afa9b46dba338f0e0acd1e9ee4f86fea0a0ad97a https://github.com/Warzone2100/warzone2100/commit/afa9b46dba338f0e0acd1e9ee4f86fea0a0ad97a Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keybind.cpp M src/keybind.h M src/keymap.cpp M src/loop.cpp Log Message: ----------- refact: make 'toggle fullscreen' a hidden keybind Commit: a42c74033e8d40e59f9ba2e17c4b67a6244de763 https://github.com/Warzone2100/warzone2100/commit/a42c74033e8d40e59f9ba2e17c4b67a6244de763 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp M src/keymap.cpp Log Message: ----------- chore: fix incorrect optional unwrapping and other smells Commit: fb643691fd988f03ff4583d83a025c14056e9802 https://github.com/Warzone2100/warzone2100/commit/fb643691fd988f03ff4583d83a025c14056e9802 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/CMakeLists.txt M src/display.cpp M src/display.h M src/hci.cpp M src/init.cpp A src/input/context.cpp A src/input/context.h A src/input/keyconfig.cpp A src/input/keyconfig.h A src/input/manager.cpp A src/input/manager.h A src/input/mapping.cpp A src/input/mapping.h M src/keyedit.cpp M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: move most key processing to new folder input/ This is a bit more controversial change; I'm getting fed up with everything being in a single keymap.h/cpp which is just getting more and more LOC. I wanted to split it to multiple files, but adding another file to src/ didn't feel like a good idea, as there was bound to be naming issues. I know that some people like having everything in single directory, but having background in Java, that feels just a bit too wrong for me :) I ended up creating a new folder for key-processing related code, as most of it is relatively well encapsulated piece of logic anyway. Or maybe not 'encapsulated' due to all the globals, but a meaningful whole on its own, so to say. Commit: b376a96d5847e6c1cbe81c50a91a751c60f03033 https://github.com/Warzone2100/warzone2100/commit/b376a96d5847e6c1cbe81c50a91a751c60f03033 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/display.cpp M src/display.h M src/ingameop.cpp M src/init.cpp M src/input/manager.cpp M src/input/manager.h M src/keyedit.cpp M src/keyedit.h M src/keymap.cpp M src/keymap.h M src/titleui/old.cpp Log Message: ----------- refact: move keymap config to display.h/cpp Commit: 79b357e112c21c7e13cc3c2f4ec83246d8bf1471 https://github.com/Warzone2100/warzone2100/commit/79b357e112c21c7e13cc3c2f4ec83246d8bf1471 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/input/keyconfig.cpp M src/input/keyconfig.h M src/keymap.cpp M src/keymap.h Log Message: ----------- refact: move enum from str functions to mapping.h/cpp Commit: 47ffc5ccfc73b3a41446e8c56de54e37cf9ddf91 https://github.com/Warzone2100/warzone2100/commit/47ffc5ccfc73b3a41446e8c56de54e37cf9ddf91 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/cheat.cpp M src/display.cpp M src/display3d.cpp M src/game.cpp M src/hci.cpp M src/ingameop.cpp M src/init.cpp A src/input/debugmappings.cpp A src/input/debugmappings.h M src/input/manager.cpp M src/input/manager.h M src/keybind.cpp M src/keybind.h M src/keyedit.cpp R src/keymap.cpp R src/keymap.h M src/loadsave.cpp M src/mission.cpp M src/multibot.cpp M src/multigifts.cpp M src/multiint.cpp M src/multimenu.cpp M src/multiplay.cpp M src/multistruct.cpp M src/musicmanager.cpp M src/musicmanager.h M src/structure.cpp M src/titleui/old.cpp M src/wrappers.cpp Log Message: ----------- refact: move debug mapping handling to class DebugInputManager Commit: fab317f93e7e74402e6008e40f8da2fdaed1840d https://github.com/Warzone2100/warzone2100/commit/fab317f93e7e74402e6008e40f8da2fdaed1840d Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M po/POTFILES.in Log Message: ----------- fix: translation files still refer to keymap.cpp Commit: 473155735a7b625235aeb1f9ab69a2f0916d4703 https://github.com/Warzone2100/warzone2100/commit/473155735a7b625235aeb1f9ab69a2f0916d4703 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/display.cpp M src/hci.cpp M src/input/context.cpp M src/input/context.h M src/input/manager.cpp M src/input/manager.h M src/musicmanager.cpp Log Message: ----------- refact: move contexts out of the input manager Commit: cded0640f150d15aabd075ba8567e849348d3207 https://github.com/Warzone2100/warzone2100/commit/cded0640f150d15aabd075ba8567e849348d3207 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/input/manager.cpp M src/input/manager.h M src/input/mapping.cpp M src/input/mapping.h M src/keyedit.cpp Log Message: ----------- refact: move mappings container out of main input manager Commit: e42702a4ba91ed21ae4a1ab05832472d73810ace https://github.com/Warzone2100/warzone2100/commit/e42702a4ba91ed21ae4a1ab05832472d73810ace Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp Log Message: ----------- refact: use mappings directly in getVisibleMappings Commit: ecb598de452788cf2660eb70b2b1ee6ad2842762 https://github.com/Warzone2100/warzone2100/commit/ecb598de452788cf2660eb70b2b1ee6ad2842762 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/input/manager.cpp M src/input/mapping.cpp M src/input/mapping.h M src/keyedit.cpp M src/keyedit.h Log Message: ----------- refact: move keymap saving/loading away from keyedit.h/cpp The save/load I/O for key mappings didn't really feel like it fit into the keyedit.h/cpp. Reason for this, I believe, is that the purpose of this file is more for defining the required UI elements for the keymap editor. Thus, including I/O in there introduces bit of a stretch to its responsibilities, violating the Single Responsibility Principle. However, going as far as introducing separate I/O adapter class seemed a bit overkill, so resorted to just moving the methods over to the mapping.h/cpp. As the KeyMappings class is now responsible for other keymap management anyways, it mostly makes sense to me to have I/O there, too. Commit: 139bdaaba98c07b0d9f5be275c7325f790daa8b9 https://github.com/Warzone2100/warzone2100/commit/139bdaaba98c07b0d9f5be275c7325f790daa8b9 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/input/keyconfig.cpp M src/input/keyconfig.h M src/input/manager.cpp M src/input/mapping.cpp M src/input/mapping.h M src/keyedit.cpp Log Message: ----------- refact: use KeyCombination in KeyMapping Commit: 41d966101c820fff7616bbeab5b534977478b863 https://github.com/Warzone2100/warzone2100/commit/41d966101c820fff7616bbeab5b534977478b863 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/input/keyconfig.cpp M src/input/keyconfig.h Log Message: ----------- chore: use ctor defaults to clean up default mappings Commit: 1ca2af7467f6a96585f727cabf4328d2ec3b5476 https://github.com/Warzone2100/warzone2100/commit/1ca2af7467f6a96585f727cabf4328d2ec3b5476 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/input/keyconfig.cpp Log Message: ----------- chore: outdated comment Commit: f0555b8e1a363af8963a2a58dd0e81dc5c0ff206 https://github.com/Warzone2100/warzone2100/commit/f0555b8e1a363af8963a2a58dd0e81dc5c0ff206 Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/keyedit.cpp Log Message: ----------- chore: remove unused var Commit: de33e81e69808f52fe1b350612389b2a276257ff https://github.com/Warzone2100/warzone2100/commit/de33e81e69808f52fe1b350612389b2a276257ff Author: toilari <ilar...@hotmail.com> Date: 2021-05-24 (Mon, 24 May 2021) Changed paths: M src/input/mapping.cpp M src/input/mapping.h M src/keyedit.cpp Log Message: ----------- fix: disallow conflicts with ALWAYS_ACTIVE bindings Compare: https://github.com/Warzone2100/warzone2100/compare/879cc478aadb...de33e81e6980 _______________________________________________ Warzone2100-commits mailing list Warzone2100-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/warzone2100-commits