feat(Teleport): Added more teleport to objective (#185)

Co-authored-by: Yimura <andreas.maerten@scarlet.be>
This commit is contained in:
Aure7138 2022-05-10 05:00:50 +08:00 committed by GitHub
parent 929705cd8a
commit cce5c553e6
2 changed files with 21 additions and 7 deletions

View File

@ -1,6 +1,7 @@
#pragma once
#include "blip.hpp"
#include "entity.hpp"
#include "gta/enums.hpp"
namespace big::teleport
{
@ -139,4 +140,23 @@ namespace big::teleport
}
return true;
}
inline bool to_objective()
{
if (to_blip((int)BlipIcons::Circle, (int)BlipColors::YellowMission)) return true;
if (to_blip((int)BlipIcons::Circle, (int)BlipColors::YellowMission2)) return true;
if (to_blip((int)BlipIcons::Circle, (int)BlipColors::Mission)) return true;
if (to_blip((int)BlipIcons::RaceFinish, (int)BlipColors::None)) return true;
if (to_blip((int)BlipIcons::Circle, (int)BlipColors::Green)) return true;
if (to_blip((int)BlipIcons::Circle, (int)BlipColors::Blue)) return true;
if (to_blip((int)BlipIcons::CrateDrop)) return true;
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 (to_blip(blips[i], 5)) {
return true;
}
}
g_notification_service->push_warning("Teleport", "Failed to find objective position");
return false;
}
}

View File

@ -15,13 +15,7 @@ namespace big
});
components::button("Objective", [] {
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;
}
}
teleport::to_objective();
});
ImGui::Text("Vehicles:");