mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 05:43:42 -07:00
Controller Configuration UI and JSON Config (#760)
* Initial controller hud ui * Reverted fbdemo changes * Moved config to json and implemented controller config * fix build on linux, gitignore new config file * fix build * Fix compilation and file directory paths * Call save on cvar save * Fixed cvar loading and added deck slots to the config * Changed control deck port 0 to use a physical device by default * Added gyro and rumble & fixed loading errors * Save config on toggle menubar * fix linux build * Fixed drift calculation * Controller config now saves when pressing F1 * Removed ExitGame hook from ImGuiImpl * Moved mappings to a map * Added GetKeyName * untranslate scancodes * Fixed hud layout on keyboard device * Fixed keyboard read on hud * Fixed crash when reloading controllers * Removed ConfigFile and changed file extension * Changed Dummy to Disconnected and fixed filters * Removed function leftover * Changed ControllerHud to InputEditor Co-authored-by: briaguya <briaguya@alice> Co-authored-by: David Chavez <david@dcvz.io>
This commit is contained in:
parent
cb6876792e
commit
219804cbe4
49 changed files with 1841 additions and 896 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "gfx_pc.h"
|
||||
#include "../../ImGuiImpl.h"
|
||||
#include "../../Cvar.h"
|
||||
#include "../../Hooks.h"
|
||||
|
||||
#define DECLARE_GFX_DXGI_FUNCTIONS
|
||||
#include "gfx_dxgi.h"
|
||||
|
@ -240,6 +241,7 @@ static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_par
|
|||
dxgi.current_height = (uint32_t)(l_param >> 16);
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
ModInternal::ExecuteHooks<ModInternal::ExitGame>();
|
||||
exit(0);
|
||||
case WM_PAINT:
|
||||
if (dxgi.in_paint) {
|
||||
|
@ -718,6 +720,12 @@ void ThrowIfFailed(HRESULT res, HWND h_wnd, const char *message) {
|
|||
}
|
||||
}
|
||||
|
||||
const char* gfx_dxgi_get_key_name(int scancode) {
|
||||
TCHAR* Text = new TCHAR[64];
|
||||
GetKeyNameText(scancode << 16, Text, 64);
|
||||
return (char*) Text;
|
||||
}
|
||||
|
||||
extern "C" struct GfxWindowManagerAPI gfx_dxgi_api = {
|
||||
gfx_dxgi_init,
|
||||
gfx_dxgi_set_keyboard_callbacks,
|
||||
|
@ -734,6 +742,7 @@ extern "C" struct GfxWindowManagerAPI gfx_dxgi_api = {
|
|||
gfx_dxgi_set_target_fps,
|
||||
gfx_dxgi_set_maximum_frame_latency,
|
||||
gfx_dxgi_get_detected_hz,
|
||||
gfx_dxgi_get_key_name
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue