MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / key_settings_dialog

Function key_settings_dialog

Descent3/ctlconfig.cpp:1258–1288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1256#define CFG_KEY_RAMP_MAX 1.0f
1257#define CFG_KEY_RAMP_RANGE 20
1258void key_settings_dialog() {
1259 newuiTiledWindow wnd;
1260 newuiSheet *sheet;
1261 int res;
1262 int16_t curpos;
1263 tSliderSettings slider_set;
1264 int16_t *key_ramp_speed;
1265 wnd.Create(TXT_KEYSETTINGS, 0, 0, 384, 256);
1266 sheet = wnd.GetSheet();
1267 sheet->NewGroup(NULL, 0, 30);
1268 slider_set.min_val.f = 0.0f;
1269 slider_set.max_val.f = CFG_KEY_RAMP_MAX;
1270 slider_set.type = SLIDER_UNITS_FLOAT;
1271 curpos = CALC_SLIDER_POS_FLOAT(Key_ramp_speed, &slider_set, CFG_KEY_RAMP_RANGE);
1272 key_ramp_speed = sheet->AddSlider(TXT_KEYRAMPINGTIME, CFG_KEY_RAMP_RANGE, curpos, &slider_set);
1273 sheet->NewGroup(NULL, 180, 160, NEWUI_ALIGN_HORIZ);
1274 sheet->AddButton(TXT_OK, UID_OK);
1275 sheet->AddButton(TXT_CANCEL, UID_CANCEL);
1276 wnd.Open();
1277 do {
1278 res = wnd.DoUI();
1279 if (res == NEWUIRES_FORCEQUIT) {
1280 break;
1281 }
1282 } while (res != UID_OK && res != UID_CANCEL);
1283 if (res == UID_OK) {
1284 Key_ramp_speed = CALC_SLIDER_FLOAT_VALUE(*key_ramp_speed, 0.0f, CFG_KEY_RAMP_MAX, CFG_KEY_RAMP_RANGE);
1285 }
1286 wnd.Close();
1287 wnd.Destroy();
1288}
1289//////////////////////////////////////////////////////////////////////////////
1290// configure controller new way
1291struct t_ctlcfgswitchcb_data {

Callers 2

processMethod · 0.85
processMethod · 0.85

Calls 11

CALC_SLIDER_POS_FLOATFunction · 0.85
CALC_SLIDER_FLOAT_VALUEFunction · 0.85
GetSheetMethod · 0.80
NewGroupMethod · 0.80
AddSliderMethod · 0.80
AddButtonMethod · 0.80
CreateMethod · 0.45
OpenMethod · 0.45
DoUIMethod · 0.45
CloseMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected