Skip to content

Commit cbf4bb1

Browse files
Merge pull request #255 from ICantReadYourMind/master
Update CControllerConfigManager (GTA3)
2 parents 2092b8c + 27ca475 commit cbf4bb1

File tree

2 files changed

+321
-0
lines changed

2 files changed

+321
-0
lines changed

plugin_III/game_III/CControllerConfigManager.cpp

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,253 @@
77
#include "CControllerConfigManager.h"
88

99
CControllerConfigManager& ControlsManager = *(CControllerConfigManager*)0x8F43A4;
10+
11+
void CControllerConfigManager::MakeControllerActionsBlank()
12+
{
13+
plugin::CallMethodDynGlobal(0x58B7A0, this);
14+
}
15+
16+
int32_t CControllerConfigManager::GetJoyButtonJustDown()
17+
{
18+
return plugin::CallMethodAndReturnDynGlobal<int32_t>(0x58B7D0, this);
19+
}
20+
21+
void CControllerConfigManager::SaveSettings(int32_t file)
22+
{
23+
plugin::CallMethodDynGlobal(0x58B800, this, file);
24+
}
25+
26+
void CControllerConfigManager::LoadSettings(int32_t file)
27+
{
28+
plugin::CallMethodDynGlobal(0x58B870, this, file);
29+
}
30+
31+
void CControllerConfigManager::InitDefaultControlConfiguration()
32+
{
33+
plugin::CallMethodDynGlobal(0x58B930, this);
34+
}
35+
36+
void CControllerConfigManager::InitDefaultControlConfigMouse(CMouseControllerState const& availableButtons)
37+
{
38+
plugin::CallMethodDynGlobal(0x58BD00, this, availableButtons);
39+
}
40+
41+
void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32_t buttons)
42+
{
43+
plugin::CallMethodDynGlobal(0x58BD90, this, buttons);
44+
}
45+
46+
void CControllerConfigManager::InitialiseControllerActionNameArray()
47+
{
48+
plugin::CallMethodDynGlobal(0x58C060, this);
49+
}
50+
51+
void CControllerConfigManager::UpdateJoyInConfigMenus_ButtonDown(int32_t button, int32_t padnumber)
52+
{
53+
plugin::CallMethodDynGlobal(0x58C5E0, this, button, padnumber);
54+
}
55+
56+
void CControllerConfigManager::AffectControllerStateOn_ButtonDown(int32_t button, eControllerType type)
57+
{
58+
plugin::CallMethodDynGlobal(0x58C730, this, button, type);
59+
}
60+
61+
void CControllerConfigManager::AffectControllerStateOn_ButtonDown_Driving(int32_t button, eControllerType type, CControllerState& state)
62+
{
63+
plugin::CallMethodDynGlobal(0x58C880, this, button, type, state);
64+
}
65+
66+
void CControllerConfigManager::AffectControllerStateOn_ButtonDown_FirstPersonOnly(int32_t button, eControllerType type, CControllerState& state)
67+
{
68+
plugin::CallMethodDynGlobal(0x58CAD0, this, button, type, state);
69+
}
70+
71+
void CControllerConfigManager::AffectControllerStateOn_ButtonDown_ThirdPersonOnly(int32_t button, eControllerType type, CControllerState& state)
72+
{
73+
plugin::CallMethodDynGlobal(0x58CB10, this, button, type, state);
74+
}
75+
76+
void CControllerConfigManager::AffectControllerStateOn_ButtonDown_FirstAndThirdPersonOnly(int32_t button, eControllerType type, CControllerState& state)
77+
{
78+
plugin::CallMethodDynGlobal(0x58CBD0, this, button, type, state);
79+
}
80+
81+
void CControllerConfigManager::AffectControllerStateOn_ButtonDown_AllStates(int32_t button, eControllerType type, CControllerState& state)
82+
{
83+
plugin::CallMethodDynGlobal(0x58CD70, this, button, type, state);
84+
}
85+
86+
void CControllerConfigManager::AffectControllerStateOn_ButtonDown_VehicleAndThirdPersonOnly(int32_t button, eControllerType type, CControllerState& state)
87+
{
88+
plugin::CallMethodDynGlobal(0x58CE50, this, button, type, state);
89+
}
90+
91+
void CControllerConfigManager::UpdateJoyInConfigMenus_ButtonUp(int32_t button, int32_t padnumber)
92+
{
93+
plugin::CallMethodDynGlobal(0x58CE80, this, button, padnumber);
94+
}
95+
96+
void CControllerConfigManager::AffectControllerStateOn_ButtonUp(int32_t button, eControllerType type)
97+
{
98+
plugin::CallMethodDynGlobal(0x58CFD0, this, button, type);
99+
}
100+
101+
void CControllerConfigManager::AffectControllerStateOn_ButtonUp_All_Player_States(int32_t button, eControllerType type, CControllerState& state)
102+
{
103+
plugin::CallMethodDynGlobal(0x58D090, this, button, type, state);
104+
}
105+
106+
void CControllerConfigManager::AffectPadFromKeyBoard()
107+
{
108+
plugin::CallMethodDynGlobal(0x58D0C0, this);
109+
}
110+
111+
void CControllerConfigManager::AffectPadFromMouse()
112+
{
113+
plugin::CallMethodDynGlobal(0x58D1A0, this);
114+
}
115+
116+
void CControllerConfigManager::ClearSimButtonPressCheckers()
117+
{
118+
plugin::CallMethodDynGlobal(0x58D220, this);
119+
}
120+
121+
bool CControllerConfigManager::GetIsKeyboardKeyDown(RsKeyCodes keycode)
122+
{
123+
return plugin::CallMethodAndReturnDynGlobal<bool>(0x58D2A0, this, keycode);
124+
}
125+
126+
bool CControllerConfigManager::GetIsKeyboardKeyJustDown(RsKeyCodes keycode)
127+
{
128+
return plugin::CallMethodAndReturnDynGlobal<bool>(0x58D8A0, this, keycode);
129+
}
130+
131+
bool CControllerConfigManager::GetIsMouseButtonDown(RsKeyCodes keycode)
132+
{
133+
return plugin::CallMethodAndReturnDynGlobal<bool>(0x58E280, this, keycode);
134+
}
135+
136+
bool CControllerConfigManager::GetIsMouseButtonUp(RsKeyCodes keycode)
137+
{
138+
return plugin::CallMethodAndReturnDynGlobal<bool>(0x58E360, this, keycode);
139+
}
140+
141+
void CControllerConfigManager::DeleteMatchingCommonControls(e_ControllerAction action, int32_t key, eControllerType type)
142+
{
143+
plugin::CallMethodDynGlobal(0x58E440, this, action, key, type);
144+
}
145+
146+
void CControllerConfigManager::DeleteMatching3rdPersonControls(e_ControllerAction action, int32_t key, eControllerType type)
147+
{
148+
plugin::CallMethodDynGlobal(0x58E540, this, action, key, type);
149+
}
150+
151+
void CControllerConfigManager::DeleteMatching1rst3rdPersonControls(e_ControllerAction action, int32_t key, eControllerType type)
152+
{
153+
plugin::CallMethodDynGlobal(0x58E630, this, action, key, type);
154+
}
155+
156+
void CControllerConfigManager::DeleteMatchingVehicleControls(e_ControllerAction action, int32_t key, eControllerType type)
157+
{
158+
plugin::CallMethodDynGlobal(0x58E710, this, action, key, type);
159+
}
160+
161+
void CControllerConfigManager::DeleteMatchingVehicle_3rdPersonControls(e_ControllerAction action, int32_t key, eControllerType type)
162+
{
163+
plugin::CallMethodDynGlobal(0x58E890, this, action, key, type);
164+
}
165+
166+
void CControllerConfigManager::DeleteMatching1rstPersonControls(e_ControllerAction action, int32_t key, eControllerType type)
167+
{
168+
plugin::CallMethodDynGlobal(0x58E8D0, this, action, key, type);
169+
}
170+
171+
void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction action, int32_t key, eControllerType type)
172+
{
173+
plugin::CallMethodDynGlobal(0x58E920, this, action, key, type);
174+
}
175+
176+
bool CControllerConfigManager::GetIsKeyBlank(int32_t key, eControllerType type)
177+
{
178+
return plugin::CallMethodAndReturnDynGlobal<bool>(0x58EA70, this, key, type);
179+
}
180+
181+
e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerAction action)
182+
{
183+
return plugin::CallMethodAndReturnDynGlobal<e_ControllerActionType>(0x58EAD0, this, action);
184+
}
185+
186+
void CControllerConfigManager::ClearSettingsAssociatedWithAction(e_ControllerAction action, eControllerType type)
187+
{
188+
plugin::CallMethodDynGlobal(0x58EB40, this, action, type);
189+
}
190+
191+
wchar_t* CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_ControllerAction action, eContSetOrder setorder)
192+
{
193+
return plugin::CallMethodAndReturnDynGlobal<wchar_t*>(0x58EBF0, this, action, setorder);
194+
}
195+
196+
wchar_t* CControllerConfigManager::GetControllerSettingTextKeyBoard(e_ControllerAction action, eControllerType type)
197+
{
198+
return plugin::CallMethodAndReturnDynGlobal<wchar_t*>(0x58EC50, this, action, type);
199+
}
200+
201+
wchar_t* CControllerConfigManager::GetControllerSettingTextMouse(e_ControllerAction action)
202+
{
203+
return plugin::CallMethodAndReturnDynGlobal<wchar_t*>(0x58F320, this, action);
204+
}
205+
206+
wchar_t* CControllerConfigManager::GetControllerSettingTextJoystick(e_ControllerAction action)
207+
{
208+
return plugin::CallMethodAndReturnDynGlobal<wchar_t*>(0x58F3D0, this, action);
209+
}
210+
211+
int32_t CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction action)
212+
{
213+
return plugin::CallMethodAndReturnDynGlobal<int32_t>(0x58F420, this, action);
214+
}
215+
216+
void CControllerConfigManager::GetWideStringOfCommandKeys(uint16_t action, wchar_t* text, uint16_t length)
217+
{
218+
plugin::CallMethodDynGlobal(0x58F460, this, action, text, length);
219+
}
220+
221+
int32_t CControllerConfigManager::GetControllerKeyAssociatedWithAction(e_ControllerAction action, eControllerType type)
222+
{
223+
return plugin::CallMethodAndReturnDynGlobal<int32_t>(0x58F590, this, action, type);
224+
}
225+
226+
void CControllerConfigManager::UpdateJoyButtonState(int32_t padnumber)
227+
{
228+
plugin::CallMethodDynGlobal(0x58F5B0, this, padnumber);
229+
}
230+
231+
bool CControllerConfigManager::GetIsActionAButtonCombo(e_ControllerAction action)
232+
{
233+
return plugin::CallMethodAndReturnDynGlobal<bool>(0x58F660, this, action);
234+
}
235+
236+
wchar_t* CControllerConfigManager::GetButtonComboText(e_ControllerAction action)
237+
{
238+
return plugin::CallMethodAndReturnDynGlobal<wchar_t*>(0x58F690, this, action);
239+
}
240+
241+
void CControllerConfigManager::SetControllerKeyAssociatedWithAction(e_ControllerAction action, int32_t key, eControllerType type)
242+
{
243+
plugin::CallMethodDynGlobal(0x58F700, this, action, key, type);
244+
}
245+
246+
int32_t CControllerConfigManager::GetMouseButtonAssociatedWithAction(e_ControllerAction action)
247+
{
248+
return plugin::CallMethodAndReturnDynGlobal<int32_t>(0x58F740, this, action);
249+
}
250+
251+
void CControllerConfigManager::SetMouseButtonAssociatedWithAction(e_ControllerAction action, int32_t button)
252+
{
253+
plugin::CallMethodDynGlobal(0x58F760, this, action, button);
254+
}
255+
256+
void CControllerConfigManager::ResetSettingOrder(e_ControllerAction action)
257+
{
258+
plugin::CallMethodDynGlobal(0x58F790, this, action);
259+
}

plugin_III/game_III/CControllerConfigManager.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,26 @@ enum eControllerType {
6262
CONTROLLER_PAD = 3,
6363
};
6464

65+
enum e_ControllerActionType
66+
{
67+
ACTIONTYPE_1RSTPERSON = 0,
68+
ACTIONTYPE_3RDPERSON,
69+
ACTIONTYPE_VEHICLE,
70+
ACTIONTYPE_VEHICLE_3RDPERSON,
71+
ACTIONTYPE_COMMON,
72+
ACTIONTYPE_1RST3RDPERSON,
73+
ACTIONTYPE_NONE,
74+
};
75+
76+
enum eContSetOrder
77+
{
78+
SETORDER_NONE = 0,
79+
SETORDER_1,
80+
SETORDER_2,
81+
SETORDER_3,
82+
SETORDER_4
83+
};
84+
6585
class CControllerKey {
6686
public:
6787
unsigned int keyCode;
@@ -83,6 +103,57 @@ class CControllerConfigManager {
83103
CControllerAction m_actions[NUM_CONTROLLER_ACTIONS];
84104
bool m_aSimCheckers[4][4];
85105
bool m_bMouseAssociated;
106+
107+
void MakeControllerActionsBlank();
108+
int32_t GetJoyButtonJustDown();
109+
void SaveSettings(int32_t file);
110+
void LoadSettings(int32_t file);
111+
void InitDefaultControlConfiguration();
112+
void InitDefaultControlConfigMouse(CMouseControllerState const& availableButtons);
113+
void InitDefaultControlConfigJoyPad(uint32_t buttons);
114+
void InitialiseControllerActionNameArray();
115+
void UpdateJoyInConfigMenus_ButtonDown(int32_t button, int32_t padnumber);
116+
void AffectControllerStateOn_ButtonDown(int32_t button, eControllerType type);
117+
void AffectControllerStateOn_ButtonDown_Driving(int32_t button, eControllerType type, CControllerState& state);
118+
void AffectControllerStateOn_ButtonDown_FirstPersonOnly(int32_t button, eControllerType type, CControllerState& state);
119+
void AffectControllerStateOn_ButtonDown_ThirdPersonOnly(int32_t button, eControllerType type, CControllerState& state);
120+
void AffectControllerStateOn_ButtonDown_FirstAndThirdPersonOnly(int32_t button, eControllerType type, CControllerState& state);
121+
void AffectControllerStateOn_ButtonDown_AllStates(int32_t button, eControllerType type, CControllerState& state);
122+
void AffectControllerStateOn_ButtonDown_VehicleAndThirdPersonOnly(int32_t button, eControllerType type, CControllerState& state);
123+
void UpdateJoyInConfigMenus_ButtonUp(int32_t button, int32_t padnumber);
124+
void AffectControllerStateOn_ButtonUp(int32_t button, eControllerType type);
125+
void AffectControllerStateOn_ButtonUp_All_Player_States(int32_t button, eControllerType type, CControllerState& state);
126+
void AffectPadFromKeyBoard();
127+
void AffectPadFromMouse();
128+
void ClearSimButtonPressCheckers();
129+
bool GetIsKeyboardKeyDown(RsKeyCodes keycode);
130+
bool GetIsKeyboardKeyJustDown(RsKeyCodes keycode);
131+
bool GetIsMouseButtonDown(RsKeyCodes keycode);
132+
bool GetIsMouseButtonUp(RsKeyCodes keycode);
133+
void DeleteMatchingCommonControls(e_ControllerAction action, int32_t key, eControllerType type);
134+
void DeleteMatching3rdPersonControls(e_ControllerAction action, int32_t key, eControllerType type);
135+
void DeleteMatching1rst3rdPersonControls(e_ControllerAction action, int32_t key, eControllerType type);
136+
void DeleteMatchingVehicleControls(e_ControllerAction action, int32_t key, eControllerType type);
137+
void DeleteMatchingVehicle_3rdPersonControls(e_ControllerAction action, int32_t key, eControllerType type);
138+
void DeleteMatching1rstPersonControls(e_ControllerAction action, int32_t key, eControllerType type);
139+
void DeleteMatchingActionInitiators(e_ControllerAction action, int32_t key, eControllerType type);
140+
bool GetIsKeyBlank(int32_t key, eControllerType type);
141+
e_ControllerActionType GetActionType(e_ControllerAction action);
142+
void ClearSettingsAssociatedWithAction(e_ControllerAction action, eControllerType type);
143+
wchar_t* GetControllerSettingTextWithOrderNumber(e_ControllerAction action, eContSetOrder setorder);
144+
wchar_t* GetControllerSettingTextKeyBoard(e_ControllerAction action, eControllerType type);
145+
wchar_t* GetControllerSettingTextMouse(e_ControllerAction action);
146+
wchar_t* GetControllerSettingTextJoystick(e_ControllerAction action);
147+
int32_t GetNumOfSettingsForAction(e_ControllerAction action);
148+
void GetWideStringOfCommandKeys(uint16_t action, wchar_t* text, uint16_t leight);
149+
int32_t GetControllerKeyAssociatedWithAction(e_ControllerAction action, eControllerType type);
150+
void UpdateJoyButtonState(int32_t padnumber);
151+
bool GetIsActionAButtonCombo(e_ControllerAction action);
152+
wchar_t* GetButtonComboText(e_ControllerAction action);
153+
void SetControllerKeyAssociatedWithAction(e_ControllerAction action, int32_t key, eControllerType type);
154+
int32_t GetMouseButtonAssociatedWithAction(e_ControllerAction action);
155+
void SetMouseButtonAssociatedWithAction(e_ControllerAction action, int32_t button);
156+
void ResetSettingOrder(e_ControllerAction action);
86157
};
87158

88159
VALIDATE_SIZE(CControllerConfigManager, 0x143C);

0 commit comments

Comments
 (0)