forked from Mirrors/openclonk
InitializePlayerControl callback
parent
9cd0ff49c4
commit
d5f947b912
|
@ -1715,6 +1715,16 @@ void C4Player::InitControl()
|
|||
if (ControlSet && ControlSet->HasMouse() && PrefMouse)
|
||||
if (!::Players.MouseControlTaken())
|
||||
MouseControl=true;
|
||||
// Some controls such as gamepad control need special synced GUI elements
|
||||
// Do a script callback for selected control
|
||||
if (ControlSet)
|
||||
{
|
||||
::Control.DoInput(CID_Script, new C4ControlScript(FormatString("%s(%d,\"%s\",%d,%d,%d)", (const char *)PSF_InitializePlayerControl, (int)Number, ControlSet->GetName(), (int)ControlSet->HasKeyboard(), (int)ControlSet->HasMouse(), (int)ControlSet->HasGamepad()).getData()), CDT_Queue);
|
||||
}
|
||||
else
|
||||
{
|
||||
::Control.DoInput(CID_Script, new C4ControlScript(FormatString("%s(%d)", (const char *)PSF_InitializePlayerControl, (int)Number).getData()), CDT_Queue);
|
||||
}
|
||||
}
|
||||
// clear old control method and register new
|
||||
Control.RegisterKeyset(Number, ControlSet);
|
||||
|
|
|
@ -80,6 +80,7 @@ bool C4ValueToMatrix(const C4ValueArray& array, StdMeshMatrix* matrix);
|
|||
#define PSF_InitializePlayer "~InitializePlayer" // iPlayer, iX, iY, pBase, iTeam, idExtra
|
||||
#define PSF_InitializeScriptPlayer "~InitializeScriptPlayer" // iPlayer, idTeam
|
||||
#define PSF_PreInitializePlayer "~PreInitializePlayer" // iPlayer
|
||||
#define PSF_InitializePlayerControl "~InitializePlayerControl" // iPlayer, szControlSet, hasKeyboard, hasMouse, hasGamepad
|
||||
#define PSF_RemovePlayer "~RemovePlayer" // iPlayer
|
||||
#define PSF_Time1 "~Time1"
|
||||
#define PSF_Hit "~Hit"
|
||||
|
|
Loading…
Reference in New Issue