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