mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-21 05:01:53 -05:00
Adds option to lock a cosmetic from being randomized (#1812)
Resolves #1809
This commit is contained in:
parent
4fb78f9caa
commit
af02623456
@ -72,6 +72,10 @@ void GetRandomColorRGB(CosmeticsColorSection* ColorSection, int SectionSize){
|
|||||||
ImVec4 colors = Element->ModifiedColor;
|
ImVec4 colors = Element->ModifiedColor;
|
||||||
Color_RGBA8 NewColors = { 0, 0, 0, 255 };
|
Color_RGBA8 NewColors = { 0, 0, 0, 255 };
|
||||||
std::string cvarName = Element->CvarName;
|
std::string cvarName = Element->CvarName;
|
||||||
|
std::string cvarLock = cvarName + "Lock";
|
||||||
|
if(CVar_GetS32(cvarLock.c_str(), 0)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
std::string Cvar_RBM = cvarName + "RBM";
|
std::string Cvar_RBM = cvarName + "RBM";
|
||||||
colors = RANDOMIZE_32(255);
|
colors = RANDOMIZE_32(255);
|
||||||
NewColors.r = fmin(fmax(colors.x * 255, 0), 255);
|
NewColors.r = fmin(fmax(colors.x * 255, 0), 255);
|
||||||
@ -893,7 +897,7 @@ void Draw_Placements(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Draw_HUDButtons(){
|
void Draw_HUDButtons(){
|
||||||
if (CVar_GetS32("gHudColors",0) ==2 ){
|
if (CVar_GetS32("gHudColors",0) == 2){
|
||||||
DrawRandomizeResetButton("every buttons", Buttons_section, SECTION_SIZE(Buttons_section));
|
DrawRandomizeResetButton("every buttons", Buttons_section, SECTION_SIZE(Buttons_section));
|
||||||
if (ImGui::CollapsingHeader("A Button colors & A Cursors")) {
|
if (ImGui::CollapsingHeader("A Button colors & A Cursors")) {
|
||||||
if (ImGui::BeginTable("tableBTN_A", 1, FlagsTable)) {
|
if (ImGui::BeginTable("tableBTN_A", 1, FlagsTable)) {
|
||||||
|
@ -474,6 +474,15 @@ namespace UIWidgets {
|
|||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrawLockColorCheckbox(const char* cvarName) {
|
||||||
|
std::string Cvar_Lock = cvarName;
|
||||||
|
Cvar_Lock += "Lock";
|
||||||
|
s32 lock = CVar_GetS32(Cvar_Lock.c_str(), 0);
|
||||||
|
std::string FullName = "Lock##" + Cvar_Lock;
|
||||||
|
EnhancementCheckbox(FullName.c_str(), Cvar_Lock.c_str());
|
||||||
|
Tooltip("Prevents this color from being changed upon selecting \"Randomize all\"");
|
||||||
|
}
|
||||||
|
|
||||||
void RainbowColor(const char* cvarName, ImVec4* colors) {
|
void RainbowColor(const char* cvarName, ImVec4* colors) {
|
||||||
std::string Cvar_RBM = cvarName;
|
std::string Cvar_RBM = cvarName;
|
||||||
Cvar_RBM += "RBM";
|
Cvar_RBM += "RBM";
|
||||||
@ -546,6 +555,7 @@ namespace UIWidgets {
|
|||||||
}
|
}
|
||||||
RainbowColor(cvarName, &ColorRGBA);
|
RainbowColor(cvarName, &ColorRGBA);
|
||||||
}
|
}
|
||||||
|
DrawLockColorCheckbox(cvarName);
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user