mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 17:32:19 -05:00
fix string usage for cosmetic hud placement reset corrupting ship json (#2961)
This commit is contained in:
parent
6de0d8b69d
commit
90bd072f9b
@ -377,13 +377,11 @@ void SetMarginAll(const char* ButtonName, bool SetActivated) {
|
|||||||
}
|
}
|
||||||
void ResetPositionAll() {
|
void ResetPositionAll() {
|
||||||
if (ImGui::Button("Reset all positions")) {
|
if (ImGui::Button("Reset all positions")) {
|
||||||
u8 arrayLength = sizeof(MarginCvarList) / sizeof(*MarginCvarList);
|
for (auto cvarName : MarginCvarList) {
|
||||||
for (u8 s = 0; s < arrayLength; s++) {
|
std::string cvarPosType = std::string(cvarName).append("PosType");
|
||||||
const char* cvarName = MarginCvarList[s];
|
std::string cvarNameMargins = std::string(cvarName).append("UseMargins");
|
||||||
const char* cvarPosType = std::string(cvarName).append("PosType").c_str();
|
CVarSetInteger(cvarPosType.c_str(), 0);
|
||||||
const char* cvarNameMargins = std::string(cvarName).append("UseMargins").c_str();
|
CVarSetInteger(cvarNameMargins.c_str(), false); //Turn margin off to everythings as that original position.
|
||||||
CVarSetInteger(cvarPosType, 0);
|
|
||||||
CVarSetInteger(cvarNameMargins, false); //Turn margin off to everythings as that original position.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user