From b648cba70d2669002cee528db6108eb3748415c6 Mon Sep 17 00:00:00 2001 From: Kaki Date: Wed, 29 Dec 2021 11:48:53 +0100 Subject: [PATCH 1/4] feat(Teleport): Teleport to objective --- .../src/gui/window/main/tab_teleport.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/BigBaseV2/src/gui/window/main/tab_teleport.cpp b/BigBaseV2/src/gui/window/main/tab_teleport.cpp index 603a5b1b..0148b69c 100644 --- a/BigBaseV2/src/gui/window/main/tab_teleport.cpp +++ b/BigBaseV2/src/gui/window/main/tab_teleport.cpp @@ -16,6 +16,26 @@ namespace big }QUEUE_JOB_END_CLAUSE } + if (ImGui::Button("Waypoint")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + teleport::to_blip(1, 5); + teleport::to_blip(57, 5); + teleport::to_blip(128, 5); + teleport::to_blip(129, 5); + teleport::to_blip(130, 5); + teleport::to_blip(143, 5); + teleport::to_blip(144, 5); + teleport::to_blip(145, 5); + teleport::to_blip(146, 5); + teleport::to_blip(271, 5); + teleport::to_blip(286, 5); + teleport::to_blip(287, 5); + teleport::to_blip(288, 5); + }QUEUE_JOB_END_CLAUSE + } + ImGui::EndTabItem(); } } From 6cd2d56a62f82b6e24c7cab031a9855f0b53bf5e Mon Sep 17 00:00:00 2001 From: Kaki Date: Wed, 29 Dec 2021 14:24:12 +0100 Subject: [PATCH 2/4] fixing everything --- .../src/gui/window/main/tab_teleport.cpp | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/BigBaseV2/src/gui/window/main/tab_teleport.cpp b/BigBaseV2/src/gui/window/main/tab_teleport.cpp index 0148b69c..3e208f62 100644 --- a/BigBaseV2/src/gui/window/main/tab_teleport.cpp +++ b/BigBaseV2/src/gui/window/main/tab_teleport.cpp @@ -1,6 +1,7 @@ #include "main_tabs.hpp" #include "fiber_pool.hpp" #include "util/teleport.hpp" +#include namespace big { @@ -16,23 +17,16 @@ namespace big }QUEUE_JOB_END_CLAUSE } - if (ImGui::Button("Waypoint")) + if (ImGui::Button("Objective")) { QUEUE_JOB_BEGIN_CLAUSE() { - teleport::to_blip(1, 5); - teleport::to_blip(57, 5); - teleport::to_blip(128, 5); - teleport::to_blip(129, 5); - teleport::to_blip(130, 5); - teleport::to_blip(143, 5); - teleport::to_blip(144, 5); - teleport::to_blip(145, 5); - teleport::to_blip(146, 5); - teleport::to_blip(271, 5); - teleport::to_blip(286, 5); - teleport::to_blip(287, 5); - teleport::to_blip(288, 5); + std::vector blips = {1, 57, 128, 129, 130, 143, 144, 145, 146, 271, 286, 287, 288}; + for (int i = 0; i < blips.size(); i++) { + if (teleport::to_blip(blips[i], 5)) { + break; + } + } }QUEUE_JOB_END_CLAUSE } From 8dfa7cd14e9a2dd5f666029903d6df5dd5eb2f4b Mon Sep 17 00:00:00 2001 From: Kaki Date: Wed, 29 Dec 2021 14:57:58 +0100 Subject: [PATCH 3/4] use array instead of vector --- BigBaseV2/src/gui/window/main/tab_teleport.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BigBaseV2/src/gui/window/main/tab_teleport.cpp b/BigBaseV2/src/gui/window/main/tab_teleport.cpp index 3e208f62..29b836bc 100644 --- a/BigBaseV2/src/gui/window/main/tab_teleport.cpp +++ b/BigBaseV2/src/gui/window/main/tab_teleport.cpp @@ -21,11 +21,12 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE() { - std::vector blips = {1, 57, 128, 129, 130, 143, 144, 145, 146, 271, 286, 287, 288}; - for (int i = 0; i < blips.size(); i++) { + static const int blips[] = {1, 57, 128, 129, 130, 143, 144, 145, 146, 271, 286, 287, 288}; + for (int i = 0; i < (sizeof(blips)/sizeof(*blips)); i++) { if (teleport::to_blip(blips[i], 5)) { break; } + } }QUEUE_JOB_END_CLAUSE } From 3554334ed71b285ef96384053c6136f7980a1eb9 Mon Sep 17 00:00:00 2001 From: Kaki Date: Wed, 29 Dec 2021 15:09:43 +0100 Subject: [PATCH 4/4] remove include --- BigBaseV2/src/gui/window/main/tab_teleport.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/BigBaseV2/src/gui/window/main/tab_teleport.cpp b/BigBaseV2/src/gui/window/main/tab_teleport.cpp index 29b836bc..e4afece8 100644 --- a/BigBaseV2/src/gui/window/main/tab_teleport.cpp +++ b/BigBaseV2/src/gui/window/main/tab_teleport.cpp @@ -1,7 +1,6 @@ #include "main_tabs.hpp" #include "fiber_pool.hpp" #include "util/teleport.hpp" -#include namespace big {