From ea36d5289a20ffa1fcbbc5cfef8bf1e5a551a5da Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Tue, 12 Dec 2017 05:13:46 +0000 Subject: [PATCH] New event "EVENT_SETDEFAULTS". Use this event to change the value of userdefs when initializing cfg settings with defaults. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6554 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/config.cpp | 2 ++ source/duke3d/src/events_defs.h | 1 + source/duke3d/src/gamedef.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/source/duke3d/src/config.cpp b/source/duke3d/src/config.cpp index 6676aea11..c22646be8 100644 --- a/source/duke3d/src/config.cpp +++ b/source/duke3d/src/config.cpp @@ -323,6 +323,8 @@ void CONFIG_SetDefaults(void) ud.config.JoystickAnalogueAxes[i] = CONFIG_AnalogNameToNum(joystickanalogdefaults[i]); CONTROL_MapAnalogAxis(i, ud.config.JoystickAnalogueAxes[i], controldevice_joystick); } + + VM_OnEvent(EVENT_SETDEFAULTS, g_player[myconnectindex].ps->i, myconnectindex); } diff --git a/source/duke3d/src/events_defs.h b/source/duke3d/src/events_defs.h index c55308c06..3da1d84ef 100644 --- a/source/duke3d/src/events_defs.h +++ b/source/duke3d/src/events_defs.h @@ -134,6 +134,7 @@ enum GameEvent_t { EVENT_RECOGSOUND, EVENT_UPDATESCREENAREA, EVENT_DISPLAYBORDER, + EVENT_SETDEFAULTS, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index d60245682..7a790f58f 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -730,6 +730,7 @@ const char *EventNames[MAXEVENTS] = "EVENT_RECOGSOUND", "EVENT_UPDATESCREENAREA", "EVENT_DISPLAYBORDER", + "EVENT_SETDEFAULTS", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif