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

Method AddSlider

Descent3/newui_core.cpp:2014–2027  ·  view source on GitHub ↗

adds a slider, set the range for it too.

Source from the content-addressed store, hash-verified

2012
2013// adds a slider, set the range for it too.
2014int16_t *newuiSheet::AddSlider(const char *title, int16_t range, int16_t init_pos, tSliderSettings *settings, int16_t id) {
2015 newuiSheet::t_gadget_desc *gadget = AddGadget(id, GADGET_SLIDER, title);
2016 gadget->parm.s[0] = init_pos;
2017 gadget->parm.s[1] = range;
2018
2019 if (settings) {
2020 gadget->internal = mem_malloc(sizeof(tSliderSettings));
2021 memcpy(gadget->internal, settings, sizeof(tSliderSettings));
2022 } else {
2023 gadget->internal = NULL;
2024 }
2025
2026 return &gadget->parm.s[0];
2027}
2028
2029// adds a static text item
2030void newuiSheet::AddText(const char *text, ...) {

Callers 5

joystick_settings_dialogFunction · 0.80
key_settings_dialogFunction · 0.80
config_gammaFunction · 0.80
setupMethod · 0.80
setupMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected