feat(GUI): Splitting elements into different files
This commit is contained in:
parent
d393fb3768
commit
571bd3020f
@ -13,13 +13,18 @@
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
#include "gui/base_tab.h"
|
||||
#include "gui/gui_main.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void gui::dx_init()
|
||||
{
|
||||
auto &style = ImGui::GetStyle();
|
||||
static ImVec4 bgColor = ImVec4(0.105f, 0.1f, 0.1f, .75f);
|
||||
static ImVec4 primary = ImVec4(0.117f, 0.529f, 0.941f, 1.f);
|
||||
static ImVec4 secondary = ImVec4(0.156f, 0.647f, 0.97f, 1.f);
|
||||
static ImVec4 whiteBroken = ImVec4(.972f, .972f, .972f, 1.f);
|
||||
|
||||
auto& style = ImGui::GetStyle();
|
||||
style.WindowPadding = { 10.f, 10.f };
|
||||
style.PopupRounding = 0.f;
|
||||
style.FramePadding = { 8.f, 4.f };
|
||||
@ -29,25 +34,25 @@ namespace big
|
||||
style.IndentSpacing = 21.f;
|
||||
style.ScrollbarSize = 15.f;
|
||||
style.GrabMinSize = 8.f;
|
||||
style.WindowBorderSize = 1.f;
|
||||
style.WindowBorderSize = 0.f;
|
||||
style.ChildBorderSize = 0.f;
|
||||
style.PopupBorderSize = 1.f;
|
||||
style.PopupBorderSize = 0.f;
|
||||
style.FrameBorderSize = 0.f;
|
||||
style.TabBorderSize = 0.f;
|
||||
style.WindowRounding = 0.f;
|
||||
style.ChildRounding = 0.f;
|
||||
style.FrameRounding = 0.f;
|
||||
style.ScrollbarRounding = 0.f;
|
||||
style.WindowRounding = 5.f;
|
||||
style.ChildRounding = 2.f;
|
||||
style.FrameRounding = 3.f;
|
||||
style.ScrollbarRounding = 3.f;
|
||||
style.GrabRounding = 0.f;
|
||||
style.TabRounding = 0.f;
|
||||
style.TabRounding = 3.f;
|
||||
style.WindowTitleAlign = { 0.5f, 0.5f };
|
||||
style.ButtonTextAlign = { 0.5f, 0.5f };
|
||||
style.DisplaySafeAreaPadding = { 3.f, 3.f };
|
||||
|
||||
auto &colors = style.Colors;
|
||||
auto& colors = style.Colors;
|
||||
colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
|
||||
colors[ImGuiCol_TextDisabled] = ImVec4(1.00f, 0.90f, 0.19f, 1.00f);
|
||||
colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 1.00f);
|
||||
colors[ImGuiCol_WindowBg] = bgColor;
|
||||
colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
colors[ImGuiCol_PopupBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f);
|
||||
colors[ImGuiCol_Border] = ImVec4(0.30f, 0.30f, 0.30f, 0.50f);
|
||||
@ -59,25 +64,25 @@ namespace big
|
||||
colors[ImGuiCol_TitleBgActive] = ImVec4(0.19f, 0.19f, 0.19f, 1.00f);
|
||||
colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.51f);
|
||||
colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
|
||||
colors[ImGuiCol_ScrollbarBg] = ImVec4(0.02f, 0.02f, 0.02f, 0.53f);
|
||||
colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.31f, 0.31f, 0.31f, 1.00f);
|
||||
colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
|
||||
colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f);
|
||||
colors[ImGuiCol_ScrollbarBg] = colors[ImGuiCol_WindowBg];
|
||||
colors[ImGuiCol_ScrollbarGrab] = primary;
|
||||
colors[ImGuiCol_ScrollbarGrabHovered] = secondary;
|
||||
colors[ImGuiCol_ScrollbarGrabActive] = primary;
|
||||
colors[ImGuiCol_CheckMark] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
|
||||
colors[ImGuiCol_SliderGrab] = ImVec4(0.34f, 0.34f, 0.34f, 1.00f);
|
||||
colors[ImGuiCol_SliderGrabActive] = ImVec4(0.39f, 0.38f, 0.38f, 1.00f);
|
||||
colors[ImGuiCol_Button] = ImVec4(0.41f, 0.41f, 0.41f, 0.74f);
|
||||
colors[ImGuiCol_ButtonHovered] = ImVec4(0.41f, 0.41f, 0.41f, 0.78f);
|
||||
colors[ImGuiCol_ButtonActive] = ImVec4(0.41f, 0.41f, 0.41f, 0.87f);
|
||||
colors[ImGuiCol_Button] = primary;
|
||||
colors[ImGuiCol_ButtonHovered] = secondary;
|
||||
colors[ImGuiCol_ButtonActive] = colors[ImGuiCol_ButtonHovered];
|
||||
colors[ImGuiCol_Header] = ImVec4(0.37f, 0.37f, 0.37f, 0.31f);
|
||||
colors[ImGuiCol_HeaderHovered] = ImVec4(0.38f, 0.38f, 0.38f, 0.37f);
|
||||
colors[ImGuiCol_HeaderActive] = ImVec4(0.37f, 0.37f, 0.37f, 0.51f);
|
||||
colors[ImGuiCol_Separator] = ImVec4(0.38f, 0.38f, 0.38f, 0.50f);
|
||||
colors[ImGuiCol_SeparatorHovered] = ImVec4(0.46f, 0.46f, 0.46f, 0.50f);
|
||||
colors[ImGuiCol_SeparatorActive] = ImVec4(0.46f, 0.46f, 0.46f, 0.64f);
|
||||
colors[ImGuiCol_ResizeGrip] = ImVec4(0.26f, 0.26f, 0.26f, 1.00f);
|
||||
colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.31f, 0.31f, 0.31f, 1.00f);
|
||||
colors[ImGuiCol_ResizeGripActive] = ImVec4(0.35f, 0.35f, 0.35f, 1.00f);
|
||||
colors[ImGuiCol_ResizeGrip] = whiteBroken;
|
||||
colors[ImGuiCol_ResizeGripHovered] = ImVec4(1.f, 1.f, 1.f, 1.00f);
|
||||
colors[ImGuiCol_ResizeGripActive] = whiteBroken;
|
||||
colors[ImGuiCol_Tab] = ImVec4(0.21f, 0.21f, 0.21f, 0.86f);
|
||||
colors[ImGuiCol_TabHovered] = ImVec4(0.27f, 0.27f, 0.27f, 0.86f);
|
||||
colors[ImGuiCol_TabActive] = ImVec4(0.34f, 0.34f, 0.34f, 0.86f);
|
||||
@ -99,13 +104,7 @@ namespace big
|
||||
{
|
||||
TRY_CLAUSE
|
||||
{
|
||||
if (ImGui::Begin("BigBaseV2"))
|
||||
{
|
||||
ImGui::BeginTabBar("tabbar");
|
||||
base_tab::render_base_tab();
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
ImGui::End();
|
||||
main_gui::draw();
|
||||
}
|
||||
EXCEPT_CLAUSE
|
||||
}
|
||||
|
@ -5,7 +5,8 @@
|
||||
#include "fiber_pool.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "gta_util.hpp"
|
||||
#include "ImGuiBitfield.h"
|
||||
#include "imguibitfield.h"
|
||||
#include "util/vehicle.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -37,29 +38,10 @@ namespace big
|
||||
{
|
||||
QUEUE_JOB_BEGIN_CLAUSE()
|
||||
{
|
||||
constexpr auto hash = RAGE_JOAAT("adder");
|
||||
while (!STREAMING::HAS_MODEL_LOADED(hash))
|
||||
{
|
||||
STREAMING::REQUEST_MODEL(hash);
|
||||
script::get_current()->yield();
|
||||
}
|
||||
Ped player = PLAYER::GET_PLAYER_PED(PLAYER::GET_PLAYER_INDEX());
|
||||
Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.f, 8.f, 0.5f);
|
||||
|
||||
auto pos = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true);
|
||||
*(unsigned short*)g_pointers->m_model_spawn_bypass = 0x9090;
|
||||
Vehicle vehicle = VEHICLE::CREATE_VEHICLE(hash, pos.x, pos.y, pos.z, 0.f, TRUE, FALSE, FALSE);
|
||||
*(unsigned short*)g_pointers->m_model_spawn_bypass = 0x0574; //By writing the "old" bypass to the function, running CREATE_VEHICLE, then restoring it, the anti-cheat does not have enough time to catch the function in a dirty state.
|
||||
|
||||
script::get_current()->yield();
|
||||
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash);
|
||||
if (*g_pointers->m_is_session_started)
|
||||
{
|
||||
DECORATOR::DECOR_SET_INT(vehicle, "MPBitset", 0);
|
||||
ENTITY::_SET_ENTITY_SOMETHING(vehicle, TRUE); //True means it can be deleted by the engine when switching lobbies/missions/etc, false means the script is expected to clean it up.
|
||||
auto networkId = NETWORK::VEH_TO_NET(vehicle);
|
||||
if (NETWORK::NETWORK_GET_ENTITY_IS_NETWORKED(vehicle))
|
||||
NETWORK::SET_NETWORK_ID_EXISTS_ON_ALL_MACHINES(networkId, true);
|
||||
VEHICLE::SET_VEHICLE_IS_STOLEN(vehicle, FALSE);
|
||||
}
|
||||
vehicle::spawn("adder", location, ENTITY::GET_ENTITY_HEADING(player) + 90.f);
|
||||
}
|
||||
QUEUE_JOB_END_CLAUSE
|
||||
}
|
||||
|
10
BigBaseV2/src/gui/gui_main.cpp
Normal file
10
BigBaseV2/src/gui/gui_main.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include "gui_main.hpp"
|
||||
#include "window.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void main_gui::draw()
|
||||
{
|
||||
window::main();
|
||||
}
|
||||
}
|
12
BigBaseV2/src/gui/gui_main.hpp
Normal file
12
BigBaseV2/src/gui/gui_main.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "common.hpp"
|
||||
#include "natives.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
class main_gui {
|
||||
public:
|
||||
static void draw();
|
||||
};
|
||||
}
|
9
BigBaseV2/src/gui/window.hpp
Normal file
9
BigBaseV2/src/gui/window.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
namespace big
|
||||
{
|
||||
class window {
|
||||
public:
|
||||
static void main();
|
||||
};
|
||||
}
|
16
BigBaseV2/src/gui/window/main/tab_self.cpp
Normal file
16
BigBaseV2/src/gui/window/main/tab_self.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include "tabs.hpp"
|
||||
#include "imgui.h"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void tab_main::tab_self()
|
||||
{
|
||||
if (ImGui::BeginTabItem("Self"))
|
||||
{
|
||||
ImGui::Text("Yeet");
|
||||
//ImGui::Checkbox("No Clip", nullptr);
|
||||
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
}
|
||||
}
|
9
BigBaseV2/src/gui/window/main/tabs.hpp
Normal file
9
BigBaseV2/src/gui/window/main/tabs.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
namespace big
|
||||
{
|
||||
class tab_main {
|
||||
public:
|
||||
static void tab_self();
|
||||
};
|
||||
}
|
19
BigBaseV2/src/gui/window/window_main.cpp
Normal file
19
BigBaseV2/src/gui/window/window_main.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "gui/window.hpp"
|
||||
#include "imgui.h"
|
||||
#include "gui/base_tab.h"
|
||||
#include "gui/window/main/tabs.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void window::main()
|
||||
{
|
||||
ImGui::SetNextWindowSize({ 800, 840 }, ImGuiCond_FirstUseEver);
|
||||
if (ImGui::Begin("Yimura's Mod Menu"))
|
||||
{
|
||||
ImGui::BeginTabBar("tabbar");
|
||||
tab_main::tab_self();
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user