mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
Emills suggestion
This commit is contained in:
parent
a882d1cdc2
commit
ee7a55dee3
1 changed files with 7 additions and 7 deletions
|
@ -536,10 +536,10 @@ namespace SohImGui {
|
||||||
|
|
||||||
void EnhancementColor3(const char* text, const char* cvarName, float defaultColors[3])
|
void EnhancementColor3(const char* text, const char* cvarName, float defaultColors[3])
|
||||||
{
|
{
|
||||||
|
std::string cVarNameStr(cvarName);
|
||||||
int r = CVar_GetS32((std::string(cvarName) + "_Red").c_str(), (int32_t)(defaultColors[0] * 255.0f));
|
const int r = CVar_GetS32((cVarNameStr + "_Red").c_str(), (int32_t)(defaultColors[0] * 255.0f));
|
||||||
int g = CVar_GetS32((std::string(cvarName) + "_Green").c_str(), (int32_t)(defaultColors[1] * 255.0f));
|
const int g = CVar_GetS32((cVarNameStr + "_Green").c_str(), (int32_t)(defaultColors[1] * 255.0f));
|
||||||
int b = CVar_GetS32((std::string(cvarName) + "_Blue").c_str(), (int32_t)(defaultColors[2] * 255.0f));
|
const int b = CVar_GetS32((cVarNameStr + "_Blue").c_str(), (int32_t)(defaultColors[2] * 255.0f));
|
||||||
|
|
||||||
|
|
||||||
float colors[3];
|
float colors[3];
|
||||||
|
@ -550,9 +550,9 @@ namespace SohImGui {
|
||||||
{
|
{
|
||||||
if (ImGui::ColorEdit3(text, colors))
|
if (ImGui::ColorEdit3(text, colors))
|
||||||
{
|
{
|
||||||
CVar_SetS32((std::string(cvarName) + "_Red").c_str(), (int)(colors[0] * 255));
|
CVar_SetS32((cVarNameStr + "_Red").c_str(), (int)(colors[0] * 255));
|
||||||
CVar_SetS32((std::string(cvarName) + "_Green").c_str(), (int)(colors[1] * 255));
|
CVar_SetS32((cVarNameStr + "_Green").c_str(), (int)(colors[1] * 255));
|
||||||
CVar_SetS32((std::string(cvarName) + "_Blue").c_str(), (int)(colors[2] * 255));
|
CVar_SetS32((cVarNameStr + "_Blue").c_str(), (int)(colors[2] * 255));
|
||||||
needs_save = true;
|
needs_save = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue