Minor bug fixes
This commit is contained in:
parent
fa3d257c81
commit
81e39ddfda
@ -591,21 +591,21 @@ AmbientBl = "Ambient bl"
|
||||
AmbientObj = "Ambient object"
|
||||
AmbientObjBl = "Ambient object bl"
|
||||
ArmourbarColor = "Armour bar color"
|
||||
ArmourbarPosX = "Armour bar X"
|
||||
ArmourbarPosY = "Armour bar Y"
|
||||
ArmourbarPosX = "Armour bar posX"
|
||||
ArmourbarPosY = "Armour bar posY"
|
||||
ArmourBorder = "Armour border"
|
||||
ArmourPercentage = "Armour percentage"
|
||||
Blur = "Blur"
|
||||
BoldBorder = "Bold border"
|
||||
BreathbarColor = "Breath bar color"
|
||||
BreathbarPosX = "Breath bar X"
|
||||
BreathbarPosY = "Breath bar Y"
|
||||
BreathbarPosX = "Breath bar posX"
|
||||
BreathbarPosY = "Breath bar posY"
|
||||
BreathBorder = "Breath border"
|
||||
BreathPercentage = "Breath percentage"
|
||||
CCTVEffect = "CCTV effect"
|
||||
ClockColor = "Clock color"
|
||||
ClockPosX = "Clock X"
|
||||
ClockPosY = "Clock Y"
|
||||
ClockPosX = "Clock posX"
|
||||
ClockPosY = "Clock posY"
|
||||
CloudAlpha = "Cloud alpha"
|
||||
CloudsBottom = "Clouds bottom"
|
||||
CloudsLow = "Clouds low"
|
||||
@ -634,8 +634,8 @@ GrainEffect = "Grain Effect"
|
||||
GrayRadar = "Gray radar"
|
||||
GreenScanlines = "Green scanlines"
|
||||
HealthbarColor = "Health bar color"
|
||||
HealthbarPosX = "Health bar X"
|
||||
HealthbarPosY = "Health bar Y"
|
||||
HealthbarPosX = "Health bar posX"
|
||||
HealthbarPosY = "Health bar posY"
|
||||
HealthBorder = "Health border"
|
||||
HealthPercentage = "Health percentage"
|
||||
HeatHazeEffect = "Heathaze effect"
|
||||
@ -662,8 +662,8 @@ Minute = "Minute"
|
||||
MoneyColor = "Money color"
|
||||
MoneyFontOutline = "Money font outline"
|
||||
MoneyFontStyle = "Money font style"
|
||||
MoneyPosX = "Money X"
|
||||
MoneyPosY = "Money Y"
|
||||
MoneyPosX = "Money posX"
|
||||
MoneyPosY = "Money posY"
|
||||
NextWeather = "Next weather"
|
||||
NightVision = "Night vision"
|
||||
NoBorder = "No border"
|
||||
|
@ -608,7 +608,7 @@ void Widget::EditAddr(const char* label, uint address, float min, float def, flo
|
||||
{
|
||||
if (ImGui::CollapsingHeader(label))
|
||||
{
|
||||
float val = patch::Get<float>(address, false) * mul;
|
||||
float val = patch::Get<float>(address) * mul;
|
||||
|
||||
int items = 3;
|
||||
|
||||
@ -637,20 +637,30 @@ void Widget::EditAddr(const char* label, uint address, float min, float def, flo
|
||||
|
||||
if (ImGui::InputFloat(("##" + std::string(label)).c_str(), &val))
|
||||
{
|
||||
patch::SetFloat(address, val / mul, false);
|
||||
if (val < min)
|
||||
{
|
||||
val = min;
|
||||
}
|
||||
|
||||
if (val > max)
|
||||
{
|
||||
val = max;
|
||||
}
|
||||
patch::SetFloat(address, val / mul);
|
||||
}
|
||||
|
||||
ImGui::SameLine(0.0, 4.0);
|
||||
if (ImGui::Button("-", ImVec2(size, size)) && (val - change) > min)
|
||||
{
|
||||
val -= change;
|
||||
patch::SetFloat(address, val / mul, false);
|
||||
if (val < min)
|
||||
patch::SetFloat(address, val / mul);
|
||||
}
|
||||
ImGui::SameLine(0.0, 4.0);
|
||||
if (ImGui::Button("+", ImVec2(size, size)) && (val + change) < max)
|
||||
{
|
||||
val += change;
|
||||
patch::SetFloat(address, val / mul, false);
|
||||
patch::SetFloat(address, val / mul);
|
||||
}
|
||||
ImGui::SameLine(0.0, 4.0);
|
||||
ImGui::Text("Set");
|
||||
@ -660,7 +670,7 @@ void Widget::EditAddr(const char* label, uint address, float min, float def, flo
|
||||
|
||||
if (ImGui::Button(("Minimum##" + std::string(label)).c_str(), CalcSize(items)))
|
||||
{
|
||||
patch::Set<float>(address, min / mul, false);
|
||||
patch::Set<float>(address, min / mul);
|
||||
}
|
||||
|
||||
if (items == 3)
|
||||
@ -669,7 +679,7 @@ void Widget::EditAddr(const char* label, uint address, float min, float def, flo
|
||||
|
||||
if (ImGui::Button(("Default##" + std::string(label)).c_str(), CalcSize(items)))
|
||||
{
|
||||
patch::Set<float>(address, def / mul, false);
|
||||
patch::Set<float>(address, def / mul);
|
||||
}
|
||||
}
|
||||
|
||||
@ -677,7 +687,7 @@ void Widget::EditAddr(const char* label, uint address, float min, float def, flo
|
||||
|
||||
if (ImGui::Button(("Maximum##" + std::string(label)).c_str(), CalcSize(items)))
|
||||
{
|
||||
patch::Set<float>(address, max / mul, false);
|
||||
patch::Set<float>(address, max / mul);
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
|
19
src/widget.h
19
src/widget.h
@ -110,21 +110,20 @@ void Widget::EditAddr(const char* label, uint address, int min, int def, int max
|
||||
|
||||
if (ImGui::InputInt(("Set value##" + std::string(label)).c_str(), &val))
|
||||
{
|
||||
if (val < min)
|
||||
{
|
||||
val = min;
|
||||
}
|
||||
|
||||
if (val > max)
|
||||
{
|
||||
val = max;
|
||||
}
|
||||
patch::Set<T>(address, val, false);
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
if (val < min)
|
||||
{
|
||||
val = min;
|
||||
}
|
||||
|
||||
if (val > max)
|
||||
{
|
||||
val = max;
|
||||
}
|
||||
|
||||
if (ImGui::Button(("Minimum##" + std::string(label)).c_str(), CalcSize(items)))
|
||||
{
|
||||
patch::Set<T>(address, min, false);
|
||||
|
Loading…
Reference in New Issue
Block a user