General fixes (#1251)

This commit is contained in:
maybegreat48
2023-04-16 18:28:49 +00:00
committed by GitHub
parent 958463d5ff
commit 3c2245f780
46 changed files with 797 additions and 680 deletions

View File

@ -26,6 +26,7 @@ namespace big
ImGui::Text(std::format("Players: {}/{}", network_player_mgr->m_player_count, network_player_mgr->m_player_limit)
.c_str());
// can't easily get used item count using pools, so keeping replay interface for now
if (auto replay_interface = *g_pointers->m_gta.m_replay_interface; g.window.ingame_overlay.show_replay_interface)
{
ImGui::Separator();
@ -52,8 +53,8 @@ namespace big
if (g.window.ingame_overlay.show_game_versions)
{
ImGui::Separator();
ImGui::Text(std::format("Game Version: {}", g_pointers->m_game_version).c_str());
ImGui::Text(std::format("Online Version: {}", g_pointers->m_online_version).c_str());
ImGui::Text(std::format("Game Version: {}", g_pointers->m_gta.m_game_version).c_str());
ImGui::Text(std::format("Online Version: {}", g_pointers->m_gta.m_online_version).c_str());
}
}
ImGui::End();

View File

@ -33,7 +33,7 @@ namespace big
static int base_address = 0;
static bool freeze = false;
static char name[32] = "";
static int(*offsets)[2] = nullptr;
static int offsets[10][2] = {};
static int offset_count = 0;
static int previous_offset_count = 0;
@ -46,21 +46,7 @@ namespace big
ImGui::Text("DEBUG_GLOBAL_OFFSET_COUNT"_T.data());
ImGui::InputInt("##modal_offset_count", &offset_count);
if (offset_count < 0)
offset_count = 0;
else if (offset_count > 10)
offset_count = 10;
if (offset_count != previous_offset_count)
{
int(*new_offsets)[2] = new int[offset_count][2]{0};
memcpy(new_offsets, offsets, sizeof(int) * std::min(offset_count, previous_offset_count) * 2);
delete[] offsets;
offsets = new_offsets;
previous_offset_count = offset_count;
}
offset_count = std::clamp(offset_count, 0, 10);
ImGui::PushItemWidth(320.f);
for (int i = 0; i < offset_count; i++)
@ -83,9 +69,7 @@ namespace big
if (components::button("CANCEL"_T))
{
strcpy(name, "");
freeze = false;
delete[] offsets;
offsets = nullptr;
freeze = false;
offset_count = 0;
previous_offset_count = 0;
@ -100,9 +84,7 @@ namespace big
g_globals_service->m_globals.push_back(new_global);
strcpy(name, "");
freeze = false;
delete[] offsets;
offsets = nullptr;
freeze = false;
offset_count = 0;
previous_offset_count = 0;

View File

@ -11,7 +11,7 @@ namespace big
static bool freeze = false;
static char name[200] = "";
static char script_thread_name[200] = "";
static int(*offsets)[2] = nullptr;
static int offsets[10][2] = {};
static int offset_count = 0;
static int previous_offset_count = 0;
components::input_text_with_hint("##local_name", "Name", name, sizeof(name));
@ -21,21 +21,7 @@ namespace big
ImGui::Text("Offsetcount");
ImGui::InputInt("##modal_offset_count", &offset_count);
if (offset_count < 0)
offset_count = 0;
else if (offset_count > 10)
offset_count = 10;
if (offset_count != previous_offset_count)
{
int(*new_offsets)[2] = new int[offset_count][2]{0};
memcpy(new_offsets, offsets, sizeof(int) * std::min(offset_count, previous_offset_count) * 2);
delete[] offsets;
offsets = new_offsets;
previous_offset_count = offset_count;
}
offset_count = std::clamp(offset_count, 0, 10);
ImGui::PushItemWidth(320.f);
for (int i = 0; i < offset_count; i++)
@ -57,9 +43,7 @@ namespace big
static auto reset_values = []() -> void {
strcpy(name, "");
freeze = false;
delete[] offsets;
offsets = nullptr;
freeze = false;
offset_count = 0;
previous_offset_count = 0;
};
@ -99,7 +83,7 @@ namespace big
if (components::button("SAVE"_T))
g_locals_service.save();
if (components::button("Add local"))
if (components::button("Add Local"))
{
ImGui::OpenPopup("##addlocal");
}

View File

@ -1,10 +1,10 @@
#include "core/data/hud_component_names.hpp"
#include "core/data/ptfx_effects.hpp"
#include "fiber_pool.hpp"
#include "services/orbital_drone/orbital_drone.hpp"
#include "util/entity.hpp"
#include "util/local_player.hpp"
#include "util/scripts.hpp"
#include "services/orbital_drone/orbital_drone.hpp"
#include "views/view.hpp"
namespace big
@ -55,7 +55,7 @@ namespace big
components::command_checkbox<"invis">();
if (g.self.invisibility)
components::command_checkbox<"localvis">();// TODO: does nothing in SP
components::command_checkbox<"localvis">(); // TODO: does nothing in SP
components::command_checkbox<"cleanloop">();
components::command_checkbox<"nocollision">();
components::command_checkbox<"mobileradio">();
@ -77,9 +77,9 @@ namespace big
{
if (ImGui::Selectable(ptfx_named[i].friendly_name, ptfx_named[i].asset_name == g.self.ptfx_effects.asset))
{
g.self.ptfx_effects.asset = ptfx_named[i].asset_name;// Update our asset name to be used
g.self.ptfx_effects.asset = ptfx_named[i].asset_name; // Update our asset name to be used
g.self.ptfx_effects.select = i;
g.self.ptfx_effects.effect = ptfx_named[i].effect_names.at(0);// set the effect to the first instance in the vector
g.self.ptfx_effects.effect = ptfx_named[i].effect_names.at(0); // set the effect to the first instance in the vector
}
if (ptfx_named[i].asset_name == g.self.ptfx_effects.asset)
@ -94,7 +94,7 @@ namespace big
for (const auto& ptfx_type : ptfx_named[g.self.ptfx_effects.select].effect_names)
{
if (ImGui::Selectable(ptfx_type, ptfx_type == g.self.ptfx_effects.effect))
g.self.ptfx_effects.effect = ptfx_type;// Update our ptfx effect
g.self.ptfx_effects.effect = ptfx_type; // Update our ptfx effect
if (ptfx_type == g.self.ptfx_effects.effect)
ImGui::SetItemDefaultFocus();
@ -210,9 +210,8 @@ namespace big
});
components::button("HIDE_ALL"_T, [] {
g.self.hud.hide_radar = true;
g.self.hud.hide_ammo = true;
g.self.hud.hide_ammo = true;
for (int i = 0; i < (int)HudComponents::HUD_WEAPONS; i++)
{
@ -221,9 +220,8 @@ namespace big
});
ImGui::SameLine();
components::button("SHOW_ALL"_T, [] {
g.self.hud.hide_radar = false;
g.self.hud.hide_ammo = false;
g.self.hud.hide_ammo = false;
for (int i = 0; i < (int)HudComponents::HUD_WEAPONS; i++)
{
@ -237,20 +235,55 @@ namespace big
ImGui::EndGroup();
ImGui::BeginGroup();
components::command_checkbox<"hudcolor">();
static int color_select_index = 0;
ImGui::Checkbox("Override Hud Color Specify", &g.self.hud.shcolor);
ImGui::InputInt("Hud Index", &g.self.hud.index);//need to display current val if not displayed
ImGui::InputInt("Hud Red", &g.self.hud.r);
ImGui::InputInt("Hud Green", &g.self.hud.g);
ImGui::InputInt("Hud Blue", &g.self.hud.b);
ImGui::InputInt("Hud Alpha", &g.self.hud.a);
if (g.self.hud.color_override)
{
ImGui::Combo("Color Index", &color_select_index, hud_colors.data(), hud_colors.size());
ImGui::Checkbox("Override Multiplayer Hud Color", &g.self.hud.mhcolor);
ImGui::InputInt("Hud Color", &g.self.hud.hcolor);
auto& ovr_color = g.self.hud.hud_color_overrides[color_select_index];
ImGui::Checkbox("Override Multiplayer Text Off Index", &g.self.hud.mtcolor);
ImGui::InputInt("Hud Text Color", &g.self.hud.tcolor);
float col[4]{};
col[0] = ovr_color.r / 255.0f;
col[1] = ovr_color.g / 255.0f;
col[2] = ovr_color.b / 255.0f;
col[3] = ovr_color.a / 255.0f;
if (ImGui::ColorPicker4("Override Color", col))
{
ovr_color.r = (int)(col[0] * 255);
ovr_color.g = (int)(col[1] * 255);
ovr_color.b = (int)(col[2] * 255);
ovr_color.a = (int)(col[3] * 255);
g_fiber_pool->queue_job([] {
auto& col = g.self.hud.hud_color_overrides[color_select_index];
HUD::REPLACE_HUD_COLOUR_WITH_RGBA(color_select_index, col.r, col.g, col.b, col.a);
});
}
components::button("Restore Default Color", [] {
g.self.hud.hud_color_overrides[color_select_index] = g.self.hud.hud_color_defaults[color_select_index];
auto& col = g.self.hud.hud_color_defaults[color_select_index];
HUD::REPLACE_HUD_COLOUR_WITH_RGBA(color_select_index, col.r, col.g, col.b, col.a);
});
ImGui::SameLine();
components::button("Restore All Defaults", [] {
for (int i = 0; i < hud_colors.size(); i++)
{
auto& col = g.self.hud.hud_color_defaults[i];
g.self.hud.hud_color_overrides[i] = col;
HUD::REPLACE_HUD_COLOUR_WITH_RGBA(i, col.r, col.g, col.b, col.a);
}
});
}
ImGui::EndGroup();
g.self.proof_mask = 0;
if (g.self.god_mode)

View File

@ -99,9 +99,7 @@ namespace big
draw_reaction(g.reactions.report_cash_spawn);
draw_reaction(g.reactions.request_control_event);
ImGui::Separator();
draw_reaction(g.reactions.lost_connection_kick);
draw_reaction(g.reactions.gamer_instruction_kick);
draw_interloper_reaction(g.reactions.lost_connection_kick_others);
draw_interloper_reaction(g.reactions.breakup_others);
components::title("SETTINGS_NOTIFICATIONS"_T);

View File

@ -35,25 +35,18 @@ namespace big
}
else
{
ImGui::TextWrapped("GAME_CACHE_SINGLE_PLAYER_DESCRIPTION"_T.data());
if (ImGui::Button("GAME_CACHE_DONT_CARE"_T.data()))
if (ImGui::Button("GAME_CACHE_UPDATE_CACHE"_T.data()))
{
g_gta_data_service->update_now();
}
if (ImGui::Button("GAME_CACHE_GO_ONLINE"_T.data()))
{
g_gta_data_service->update_in_online();
}
if (*g_pointers->m_gta.m_game_state == eGameState::Respawn)
{
if (ImGui::Button("GAME_CACHE_ON_INIT"_T.data()))
{
g_gta_data_service->update_on_init();
}
}
}
}
break;