MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / OnCreateCtrl

Method OnCreateCtrl

engine/Poseidon/UI/DisplayUI.cpp:1084–1120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1082
1083void DisplayConfigure::OnButtonClicked(int idc)
1084{
1085 auto& input = InputSubsystem::Instance();
1086 switch (idc)
1087 {
1088 case IDC_CONFIG_DEFAULT:
1089 {
1090 UserActionDesc* userActionDesc = InputSubsystem::GetUserActionDesc();
1091 for (int i = 0; i < UAN; i++)
1092 {
1093 _keys->SetKeys(i, userActionDesc[i].keys);
1094 }
1095 }
1096 {
1097 input.SetReverseMouse(false);
1098 C3DActiveText* ctrl = static_cast<C3DActiveText*>(GetCtrl(IDC_CONFIG_YREVERSED));
1099 ctrl->SetText(LocalizeString(IDS_CONFIG_YNORMAL));
1100 }
1101 {
1102 input.SetJoystickEnabled(true);
1103 C3DActiveText* ctrl = static_cast<C3DActiveText*>(GetCtrl(IDC_CONFIG_JOYSTICK));
1104 ctrl->SetText(LocalizeString(IDS_CONFIG_JOYSTICK_ENABLED));
1105 }
1106 {
1107 input.SetMouseButtonsReversed(false);
1108 C3DActiveText* ctrl = static_cast<C3DActiveText*>(GetCtrl(IDC_CONFIG_BUTTONS));
1109 ctrl->SetText(LocalizeString(IDS_LEFT_BUTTON));
1110 }
1111 {
1112 input.SetMouseSensitivityX(1.0);
1113 C3DSlider* ctrl = static_cast<C3DSlider*>(GetCtrl(IDC_CONFIG_XAXIS));
1114 ctrl->SetThumbPos(1.0);
1115 }
1116 {
1117 input.SetMouseSensitivityY(1.0);
1118 C3DSlider* ctrl = static_cast<C3DSlider*>(GetCtrl(IDC_CONFIG_YAXIS));
1119 ctrl->SetThumbPos(1.0);
1120 }
1121 break;
1122 case IDC_CONFIG_YREVERSED:
1123 {

Callers

nothing calls this directly

Calls 15

LocalizeStringFunction · 0.85
GetWorldNameFunction · 0.85
FindPictureFunction · 0.85
GlobLoadTextureFunction · 0.85
AddStringMethod · 0.80
SetKeysMethod · 0.80
SetThumbPosMethod · 0.80
GetMouseSensitivityXMethod · 0.80
GetMouseSensitivityYMethod · 0.80
LowerMethod · 0.80
stricmpFunction · 0.50
SetCurSelMethod · 0.45

Tested by

no test coverage detected