mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
@@ -2183,9 +2183,16 @@ namespace overlay::windows {
|
||||
// check lights
|
||||
if (lights) {
|
||||
for (auto &light_in : *lights) {
|
||||
build_light(&light_in);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
}
|
||||
|
||||
void Config::build_light(Light *light) {
|
||||
// get light based on page
|
||||
auto light = &light_in;
|
||||
auto &light_alternatives = light->getAlternatives();
|
||||
if (this->lights_page > 0) {
|
||||
while ((int) light_alternatives.size() < this->lights_page) {
|
||||
@@ -2228,11 +2235,7 @@ namespace overlay::windows {
|
||||
if (light_display.size() > 0) {
|
||||
ImGui::SameLine();
|
||||
if (ImGui::DeleteButton("Remove")) {
|
||||
light->setDeviceIdentifier("");
|
||||
light->setIndex(0xFF);
|
||||
::Config::getInstance().updateBinding(
|
||||
games_list[games_selected], *light,
|
||||
lights_page - 1);
|
||||
clear_light(light);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2276,10 +2279,13 @@ namespace overlay::windows {
|
||||
// clean up
|
||||
ImGui::PopID();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
void Config::clear_light(Light *light) {
|
||||
light->setDeviceIdentifier("");
|
||||
light->setIndex(0xFF);
|
||||
::Config::getInstance().updateBinding(
|
||||
games_list[games_selected], *light,
|
||||
lights_page - 1);
|
||||
}
|
||||
|
||||
void Config::edit_light_popup(Light *light) {
|
||||
|
||||
@@ -94,6 +94,8 @@ namespace overlay::windows {
|
||||
void edit_analog_popup(Analog &analog);
|
||||
|
||||
void build_lights(const std::string &name, std::vector<Light> *lights);
|
||||
void build_light(Light *light);
|
||||
void clear_light(Light *light);
|
||||
void edit_light_popup(Light *light);
|
||||
|
||||
void build_cards();
|
||||
|
||||
Reference in New Issue
Block a user