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

Method OnButtonClicked

engine/Poseidon/UI/DisplayUI.cpp:1122–1207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1120 }
1121 break;
1122 case IDC_CONFIG_YREVERSED:
1123 {
1124 input.ToggleReverseMouse();
1125 C3DActiveText* ctrl = static_cast<C3DActiveText*>(GetCtrl(IDC_CONFIG_YREVERSED));
1126 if (input.IsReverseMouse())
1127 {
1128 ctrl->SetText(LocalizeString(IDS_CONFIG_YREVERSED));
1129 }
1130 else
1131 {
1132 ctrl->SetText(LocalizeString(IDS_CONFIG_YNORMAL));
1133 }
1134 }
1135 break;
1136 case IDC_CONFIG_JOYSTICK:
1137 {
1138 input.ToggleJoystickEnabled();
1139 C3DActiveText* ctrl = static_cast<C3DActiveText*>(GetCtrl(IDC_CONFIG_JOYSTICK));
1140 if (input.IsJoystickEnabled())
1141 {
1142 ctrl->SetText(LocalizeString(IDS_CONFIG_JOYSTICK_ENABLED));
1143 }
1144 else
1145 {
1146 ctrl->SetText(LocalizeString(IDS_CONFIG_JOYSTICK_DISABLED));
1147 }
1148 }
1149 break;
1150 case IDC_CONFIG_BUTTONS:
1151 {
1152 input.ToggleMouseButtonsReversed();
1153 C3DActiveText* ctrl = static_cast<C3DActiveText*>(GetCtrl(IDC_CONFIG_BUTTONS));
1154 if (input.IsMouseButtonsReversed())
1155 {
1156 ctrl->SetText(LocalizeString(IDS_RIGHT_BUTTON));
1157 }
1158 else
1159 {
1160 ctrl->SetText(LocalizeString(IDS_LEFT_BUTTON));
1161 }
1162 }
1163 break;
1164 default:
1165 Display::OnButtonClicked(idc);
1166 break;
1167 }
1168}
1169
1170void DisplayConfigure::OnSliderPosChanged(int idc, float pos)
1171{
1172 auto& input = InputSubsystem::Instance();
1173 switch (idc)
1174 {
1175 case IDC_CONFIG_XAXIS:
1176 input.SetMouseSensitivityX(pos);
1177 break;
1178 case IDC_CONFIG_YAXIS:
1179 input.SetMouseSensitivityY(pos);

Callers

nothing calls this directly

Calls 15

GetCtrlFunction · 0.85
LocalizeStringFunction · 0.85
SetKeysMethod · 0.80
SetReverseMouseMethod · 0.80
SetJoystickEnabledMethod · 0.80
SetMouseSensitivityXMethod · 0.80
SetThumbPosMethod · 0.80
SetMouseSensitivityYMethod · 0.80
ToggleReverseMouseMethod · 0.80
IsReverseMouseMethod · 0.80
ToggleJoystickEnabledMethod · 0.80

Tested by

no test coverage detected