Clean up code

This commit is contained in:
Grinch_ 2021-06-15 23:11:11 +06:00
parent bf6e751a2b
commit 14e2ba358e
6 changed files with 30 additions and 30 deletions

View File

@ -487,11 +487,11 @@ void Menu::Draw()
ImGui::Columns(2, NULL, false);
ImGui::Text("Author: Grinch_");
ImGui::Text((std::string("Version: ") + MENU_VERSION).c_str());
ImGui::Text("Version: %s",MENU_VERSION);
ImGui::NextColumn();
ImGui::Text(std::string("ImGui: " + std::string(ImGui::GetVersion())).c_str());
ImGui::Text((std::string("Build: ") + BUILD_NUMBER).c_str());
ImGui::Text("ImGui: %s", ImGui::GetVersion());
ImGui::Text("Build: %s", BUILD_NUMBER);
ImGui::Columns(1);

View File

@ -253,7 +253,7 @@ void Ped::Draw()
Ui::ListBox("Ped type", spawn_ped::ped_type, spawn_ped::selected_ped_type);
ImGui::Spacing();
ImGui::Text((std::string("Selected weapon: ") + Weapon::weapon_json.data[std::to_string(spawn_ped::weapon_id)].get<std::string>()).c_str());
ImGui::Text("Selected weapon: %s", Weapon::weapon_json.data[std::to_string(spawn_ped::weapon_id)].get<std::string>());
ImGui::Spacing();
Ui::DrawImages(Weapon::weapon_vec, ImVec2(65, 65), Weapon::search_categories, Weapon::selected_item, Weapon::filter,
[](std::string str) { spawn_ped::weapon_id = std::stoi(str); },

View File

@ -405,11 +405,11 @@ void Ui::EditStat(const char* label, const int stat_id, const int min, const int
int val = static_cast<int>(CStats::GetStatValue(stat_id));
ImGui::Columns(3, 0, false);
ImGui::Text(("Min: " + std::to_string(min)).c_str());
ImGui::Text("Min: %d", min);
ImGui::NextColumn();
ImGui::Text(("Def: " + std::to_string(def)).c_str());
ImGui::Text("Def: %d", def);
ImGui::NextColumn();
ImGui::Text(("Max: " + std::to_string(max)).c_str());
ImGui::Text("Max: %d", max);
ImGui::Columns(1);
ImGui::Spacing();
@ -723,16 +723,16 @@ void Ui::EditFloat(const char* label, const int address, const float min, const
ImGui::Columns(items, 0, false);
ImGui::Text(("Min: " + std::to_string(min)).c_str());
ImGui::Text("Min: %f", min);
if (items == 3)
{
ImGui::NextColumn();
ImGui::Text(("Def: " + std::to_string(def)).c_str());
ImGui::Text("Def: %f", def);
}
ImGui::NextColumn();
ImGui::Text(("Max: " + std::to_string(max)).c_str());
ImGui::Text("Max: %f", max);
ImGui::Columns(1);
ImGui::Spacing();

View File

@ -759,7 +759,7 @@ void Vehicle::Draw()
ImGui::Text(GetNameFromModel(veh->m_nModelIndex).c_str());
ImGui::NextColumn();
ImGui::Text((std::string("Total seats: ") + std::to_string(seats + 1)).c_str());
ImGui::Text("Total seats: %d", (seats + 1));
ImGui::Columns(1);
ImGui::Spacing();

View File

@ -287,39 +287,39 @@ void Visual::Draw()
ImGui::TextWrapped("These options won't work if you got any mods that drastically changes the game hud. i.e. Mobile Hud, GTA 5 Hud etc.");
ImGui::Spacing();
Ui::ColorPickerAddress("Armourbar color", *(int*)0x5890FC, ImVec4(180, 25, 29, 255));
Ui::EditAddress<float>("Armourbar fPosX ", 0x866B78, -999, 94, 999);
Ui::EditAddress<float>("Armourbar fPosY ", 0x862D38, -999, 48, 999);
Ui::EditAddress<float>("Armourbar posX", 0x866B78, -999, 94, 999);
Ui::EditAddress<float>("Armourbar posY", 0x862D38, -999, 48, 999);
Ui::ColorPickerAddress("Breathbar color", *(int*)0x5891EB, ImVec4(172, 203, 241, 255));
Ui::EditAddress<float>("Breathbar fPosX ", *(int*)0x58F11F, -999, 94, 999);
Ui::EditAddress<float>("Breathbar fPosY ", *(int*)0x58F100, -999, 62, 999);
Ui::EditAddress<float>("Breathbar posX", *(int*)0x58F11F, -999, 94, 999);
Ui::EditAddress<float>("Breathbar posY", *(int*)0x58F100, -999, 62, 999);
Ui::ColorPickerAddress("Clock color", *(int*)0x58EBD1, ImVec4(180, 25, 29, 255));
Ui::EditAddress<float>("Clock fPosX ", *(int*)0x58EC16, -999, 32, 999);
Ui::EditAddress<float>("Clock fPosY ", *(int*)0x58EC04, -999, 22, 999);
Ui::EditAddress<float>("Clock posX", *(int*)0x58EC16, -999, 32, 999);
Ui::EditAddress<float>("Clock posY", *(int*)0x58EC04, -999, 22, 999);
Ui::ColorPickerAddress("Healthbar color", *(int*)0x589331, ImVec4(180, 25, 29, 255));
Ui::EditAddress<float>("Healthbar fPosX ", 0x86535C, -999, 141, 999);
Ui::EditAddress<float>("Healthbar fPosY ", 0x866CA8, -999, 77, 999);
Ui::EditAddress<float>("Healthbar posX", 0x86535C, -999, 141, 999);
Ui::EditAddress<float>("Healthbar posY", 0x866CA8, -999, 77, 999);
Ui::ColorPickerAddress("Draw menu title border color", 0xBAB240, ImVec4(0, 0, 0, 255));
Ui::ColorPickerAddress("Money color", 0xBAB230, ImVec4(54, 104, 44, 255));
Ui::EditAddress<float>("Money fPosX ", *(int*)0x58F5FC, -999, 32, 999);
Ui::EditAddress<float>("Money fPosY ", 0x866C88, -999, 89, 999);
Ui::EditAddress<float>("Money posX", *(int*)0x58F5FC, -999, 32, 999);
Ui::EditAddress<float>("Money posY", 0x866C88, -999, 89, 999);
static std::vector<Ui::NamedValue> font_outline{ { "No outline", 0 }, { "Thin outline" ,1 }, { "Default outline" ,2 } };
Ui::EditRadioButtonAddressEx("Money font outline", 0x58F58D, font_outline);
static std::vector<Ui::NamedValue> style{ { "Style 1", 1 }, { "Style 2" ,2 }, { "Default style" ,3 } };
Ui::EditRadioButtonAddressEx("Money font style", 0x58F57F, style);
Ui::EditAddress<float>("Radar Height", *(int*)0x5834F6, 0, 76, 999);
Ui::EditAddress<float>("Radar Width", *(int*)0x5834C2, 0, 94, 999);
Ui::EditAddress<float>("Radar fPosX", *(int*)0x5834D4, -999, 40, 999);
Ui::EditAddress<float>("Radar fPosY", *(int*)0x583500, -999, 104, 999);
Ui::EditAddress<float>("Radar posX", *(int*)0x5834D4, -999, 40, 999);
Ui::EditAddress<float>("Radar posY", *(int*)0x583500, -999, 104, 999);
Ui::EditAddress<int>("Radar zoom", 0xA444A3, 0, 0, 170);
Ui::ColorPickerAddress("Radio station color", 0xBAB24C, ImVec4(150, 150, 150, 255));
static std::vector<Ui::NamedValue> star_border{ { "No border", 0 }, { "Default" ,1 }, { "Bold border" ,2 } };
Ui::EditRadioButtonAddressEx("Wanted star border", 0x58DD41, star_border);
Ui::EditAddress<float>("Wanted fPosX ", *(int*)0x58DD0F, -999, 29, 999);
Ui::EditAddress<float>("Wanted fPosY ", *(int*)0x58DDFC, -999, 114, 999);
Ui::EditAddress<float>("Weapon ammo fPosX ", *(int*)0x58FA02, -999, 32, 999);
Ui::EditAddress<float>("Weapon ammo fPosY ", *(int*)0x58F9E6, -999, 43, 999);
Ui::EditAddress<float>("Weapon icon fPosX ", *(int*)0x58F927, -999, 32, 999);
Ui::EditAddress<float>("Weapon icon fPosY ", *(int*)0x58F913, -999, 20, 999);
Ui::EditAddress<float>("Wanted posX", *(int*)0x58DD0F, -999, 29, 999);
Ui::EditAddress<float>("Wanted posY", *(int*)0x58DDFC, -999, 114, 999);
Ui::EditAddress<float>("Weapon ammo posX", *(int*)0x58FA02, -999, 32, 999);
Ui::EditAddress<float>("Weapon ammo posY", *(int*)0x58F9E6, -999, 43, 999);
Ui::EditAddress<float>("Weapon icon posX", *(int*)0x58F927, -999, 32, 999);
Ui::EditAddress<float>("Weapon icon posY", *(int*)0x58F913, -999, 20, 999);
ImGui::EndChild();
}

View File

@ -198,7 +198,7 @@ void Weapon::Draw()
ImGui::Columns(1);
ImGui::Spacing();
ImGui::Text((std::string("Current weapon: ") + weapon_json.data[std::to_string(gang_weapons[selected_gang][selected_weapon_count])].get<std::string>()).c_str());
ImGui::Text("Current weapon: %s", weapon_json.data[std::to_string(gang_weapons[selected_gang][selected_weapon_count])].get<std::string>());
ImGui::Spacing();
Ui::DrawImages(weapon_vec, ImVec2(65, 65), search_categories, selected_item, filter, SetGangWeapon, nullptr,
[](std::string str) {return weapon_json.data[str].get<std::string>(); },