MCPcopy Create free account
hub / github.com/Lovrom8/RSMods / AddStringColorTestingUI

Function AddStringColorTestingUI

DLL/Menu.cpp:98–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 void AddStringColorTestingUI() {
99 static bool CB = false;
100
101 static std::string previewValue = "Select a string";
102 if (ImGui::BeginCombo("String Colors", previewValue.c_str()))
103 {
104 for (int n = 0; n < 6; n++)
105 {
106 const bool is_selected = (selectedString == n);
107 if (ImGui::Selectable(comboStringsItems[n], is_selected, ImGuiSelectableFlags_::ImGuiSelectableFlags_DontClosePopups))
108 selectedString = n;
109
110 if (is_selected) {
111 previewValue = std::to_string(selectedString);
112
113 RSColor currColors = D3D::GetCustomColors(selectedString, CB)["Enabled"];
114 strR = (int)currColors.r * 255;
115 strG = (int)currColors.g * 255;
116 strB = (int)currColors.b * 255;
117 }
118 }
119
120 ImGui::EndCombo();
121 }
122
123 ImGui::SliderInt("R", &strR, 0, 255);
124 ImGui::SliderInt("G", &strG, 0, 255);
125 ImGui::SliderInt("B", &strB, 0, 255);
126 ImGui::Checkbox("CB", &CB);
127
128 if (ImGui::Button("Generate Texture")) {
129 Settings::SetStringColors(selectedString, RSColor(strR, strG, strB), CB);
130 generateTexture = true;
131 }
132
133 if (ImGui::Button("Restore default colors"))
134 ERMode::ResetString(selectedString);
135 }
136
137 void CreateTextures(IDirect3DDevice9* pDevice) {
138 D3DXCreateTextureFromFile(pDevice, L"nonexistenttexture.dds", &nonexistentTexture); // Black Notes

Callers

nothing calls this directly

Calls 2

c_strMethod · 0.80
RSColorClass · 0.70

Tested by

no test coverage detected