From 531bf7a6a78c9542fb19cf4cfcd5d3976e0744c5 Mon Sep 17 00:00:00 2001 From: Yimura Date: Tue, 29 Dec 2020 23:28:30 +0100 Subject: [PATCH] feat(Top Bar): Added function to join specific session types --- BigBaseV2/src/gui/top_bar.cpp | 16 ++++++++++++++++ BigBaseV2/src/structs/lists.hpp | 14 ++++++++++++++ BigBaseV2/src/structs/session_type.hpp | 8 ++++++++ 3 files changed, 38 insertions(+) create mode 100644 BigBaseV2/src/structs/session_type.hpp diff --git a/BigBaseV2/src/gui/top_bar.cpp b/BigBaseV2/src/gui/top_bar.cpp index 689bddfa..783d8428 100644 --- a/BigBaseV2/src/gui/top_bar.cpp +++ b/BigBaseV2/src/gui/top_bar.cpp @@ -56,6 +56,22 @@ namespace big ImGui::EndMenu(); } + if (ImGui::BeginMenu("Session")) + { + for (uint8_t i = 0; i < IM_ARRAYSIZE(sessions); i++) + { + if (ImGui::MenuItem(sessions[i].descr)) + { + QUEUE_JOB_BEGIN_CLAUSE(=) + { + features::functions::join_session_type(sessions[i]); + }QUEUE_JOB_END_CLAUSE + } + } + + ImGui::EndMenu(); + } + if (ImGui::BeginMenu("Quit")) { if (ImGui::MenuItem("Unload Menu (may crash)")) diff --git a/BigBaseV2/src/structs/lists.hpp b/BigBaseV2/src/structs/lists.hpp index 889ed01d..a5809dc7 100644 --- a/BigBaseV2/src/structs/lists.hpp +++ b/BigBaseV2/src/structs/lists.hpp @@ -1,4 +1,5 @@ #pragma once +#include "session_type.hpp" namespace big { @@ -42,4 +43,17 @@ namespace big "SNOWLIGHT", "BLIZZARD" }; + + inline session_type sessions[] = { + { 0, "Join Public Session" }, + { 1, "New Public Session" }, + { 2, "Closed Crew Session" }, + { 3, "Crew Session" }, + { 6, "Closed Friend Session" }, + { 9, "Find Friend Session" }, + { 10, "Solo Session" }, + { 11, "Invite Only Session" }, + { 12, "Join Crew Session" }, + { -1, "Leave GTA Online" } + }; } \ No newline at end of file diff --git a/BigBaseV2/src/structs/session_type.hpp b/BigBaseV2/src/structs/session_type.hpp new file mode 100644 index 00000000..044717d3 --- /dev/null +++ b/BigBaseV2/src/structs/session_type.hpp @@ -0,0 +1,8 @@ +namespace big +{ + struct session_type + { + int id = 0; + char descr[32]; + }; +} \ No newline at end of file