aboutsummaryrefslogtreecommitdiff
path: root/RelicManager.cpp
blob: db5306c74d64aa471aba107f8e0945142e82356b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "RelicManager.h"
#include "Sdk.h"
#include "Renderer.h"
#include "Engine.h"

void RelicManager::OnNeutralUnit(Unit* unit)
{
	
}

void RelicManager::OnMenuMainWindow()
{
	if (true)
	{
		relics.clear();
		Player* gaia = Engine::Get()->GetPlayerByName("Gaia");
		for (int i = 0; i < gaia->pObjectManager->Count; i++)
		{
			Unit* unit = gaia->pObjectManager->units[i];
			if (!unit)
			{
				continue;
			}
			if (strcmp(unit->GetUnitData()->GetName(), "RELIC") == 0)
			{
				relics.push_back(unit);
			}
		}
	}

	ImGui::Separator();
	ImGui::Text("Relics %d", relics.size());

	if (relics.size() != 0)
	{
		if (ImGui::Button("<"))
		{
			currentRelic = (currentRelic - 1) % relics.size();
			Engine::Get()->GetLocalPlayer()->SetCameraPosition(relics[currentRelic]->GetPosition());
		}
		ImGui::SameLine();
		ImGui::Text("%d/%d", currentRelic + 1, relics.size());
		ImGui::SameLine();
		if (ImGui::Button(">"))
		{
			currentRelic = (currentRelic + 1) % relics.size();
			Engine::Get()->GetLocalPlayer()->SetCameraPosition(relics[currentRelic]->GetPosition());
		}
	}
	ImGui::Separator();
}