Added spawn ped feature. (#377)

This commit is contained in:
aa15032261
2022-08-10 08:42:34 +08:00
committed by GitHub
parent 954b7673ee
commit 77adac6e1a
32 changed files with 1178 additions and 608 deletions

View File

@ -3,13 +3,12 @@
#include "services/players/player_service.hpp"
#include "views/view.hpp"
#include "fonts/fonts.hpp"
#include <renderer.hpp>
#include <natives.hpp>
#include "natives.hpp"
#include "fiber_pool.hpp"
#define IMGUI_DEFINE_PLACEMENT_NEW
#define IMGUI_DEFINE_MATH_OPERATORS
#include <imgui_internal.h>
#include "fiber_pool.hpp"
namespace big
{
@ -38,7 +37,7 @@ namespace big
// calculate icons width
ImGuiWindow* window = ImGui::GetCurrentWindow();
ImGui::PushFont(g_renderer->m_font_icons);
ImGui::PushFont(g->window.font_icon);
ImVec2 iconsSize = ImGui::CalcTextSize(playerIconsCStr, playerIconsCStr + playerIcons.size());
ImVec2 iconsPos(window->DC.CursorPos.x + 300.0f - 32.0f - iconsSize.x, window->DC.CursorPos.y + 2.0f);
ImRect iconsBox(iconsPos, iconsPos + iconsSize);
@ -46,7 +45,9 @@ namespace big
if (playerSelected)
{
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.29f, 0.45f, 0.69f, 1.f));
}
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, { 0.0, 0.5 });
ImGui::PushID(plyr->id());
@ -63,7 +64,7 @@ namespace big
ImGui::PopStyleColor();
// render icons on top of the player button
ImGui::PushFont(g_renderer->m_font_icons);
ImGui::PushFont(g->window.font_icon);
ImGui::RenderTextWrapped(iconsBox.Min, playerIconsCStr, playerIconsCStr + playerIcons.size(), iconsSize.x);
ImGui::PopFont();
}