Skip to content

Commit c38ffdd

Browse files
committed
Update to v3.4
1 parent 0185bfd commit c38ffdd

20 files changed

+426
-118
lines changed

appdata/il2cpp-functions.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,5 @@ DO_APP_FUNC(bool, LogicGameFlowNormal_IsGameOverDueToDeath, (LogicGameFlowNormal
321321
DO_APP_FUNC(bool, LogicGameFlowHnS_IsGameOverDueToDeath, (LogicGameFlowHnS* __this, MethodInfo* method), "Assembly-CSharp, System.Boolean LogicGameFlowHnS::IsGameOverDueToDeath()");
322322
DO_APP_FUNC(void, ChatController_OnResolutionChanged, (ChatController* __this, float aspectRatio, int32_t width, int32_t height, bool fullscreen, MethodInfo* method), "Assembly-CSharp, System.Void ChatController::OnResolutionChanged(System.Single, System.Int32, System.Int32, System.Boolean)");
323323
DO_APP_FUNC(void, ChatController_ForceClosed, (ChatController* __this, MethodInfo* method), "Assembly-CSharp, System.Void ChatController::ForceClosed()");
324-
DO_APP_FUNC(Byte__Array*, GameOptionsFactory_ToBytes, (GameOptionsFactory* __this, IGameOptions* data, bool forceAprilFoolsMode, MethodInfo* method), "Assembly-CSharp, System.Byte[] AmongUs.GameOptions.GameOptionsFactory::ToBytes(AmongUs.GameOptions.IGameOptions, System.Boolean)");
324+
//DO_APP_FUNC(Byte__Array*, GameOptionsFactory_ToBytes, (GameOptionsFactory* __this, IGameOptions* data, bool forceAprilFoolsMode, MethodInfo* method), "Assembly-CSharp, System.Byte[] AmongUs.GameOptions.GameOptionsFactory::ToBytes(AmongUs.GameOptions.IGameOptions, System.Boolean)");
325+
DO_APP_FUNC(void, NotificationPopper_AddItem, (NotificationPopper* __this, String* item, MethodInfo* method), "Assembly-CSharp, System.Void NotificationPopper::AddItem(System.String)");

appdata/il2cpp-types.h

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7758,7 +7758,7 @@ namespace app
77587758
void* shhhEmblem;
77597759
void* IntroPrefab;
77607760
void* GameMenu;
7761-
void* Notifier;
7761+
struct NotificationPopper* Notifier;
77627762
void* roomTracker;
77637763
void* TaskCompleteSound;
77647764
void* TaskUpdateSound;
@@ -8234,8 +8234,6 @@ namespace app
82348234
#endif
82358235
#pragma endregion
82368236

8237-
typedef Il2CppObject GameOptionsFactory;
8238-
82398237
#pragma region InnerNetClient
82408238

82418239
#if defined(_CPLUSPLUS_)
@@ -8355,7 +8353,7 @@ namespace app
83558353
void* LastMatchmakerError;
83568354
void* PreSpawnDispatcher;
83578355
void* Dispatcher;
8358-
GameOptionsFactory* gameOptionsFactory;
8356+
void* gameOptionsFactory;
83598357
bool _IsGamePublic_k__BackingField;
83608358
#if defined(_CPLUSPLUS_)
83618359
InnerNetClient_GameStates__Enum GameState;
@@ -11553,6 +11551,46 @@ namespace app
1155311551
};
1155411552
#pragma endregion
1155511553

11554+
#pragma region NotificationPopper
11555+
struct NotificationPopper__Fields {
11556+
struct MonoBehaviour__Fields _;
11557+
struct TextMeshPro* TextArea;
11558+
float zPos;
11559+
float alphaTimer;
11560+
float ShowDuration;
11561+
float FadeDuration;
11562+
struct Color textColor;
11563+
struct AudioClip* NotificationSound;
11564+
struct Camera* mainCamera;
11565+
struct StringBuilder* builder;
11566+
};
11567+
11568+
struct NotificationPopper {
11569+
struct NotificationPopper__Class* klass;
11570+
MonitorData* monitor;
11571+
struct NotificationPopper__Fields fields;
11572+
};
11573+
11574+
struct NotificationPopper__VTable {
11575+
VirtualInvokeData Equals;
11576+
VirtualInvokeData Finalize;
11577+
VirtualInvokeData GetHashCode;
11578+
VirtualInvokeData ToString;
11579+
};
11580+
11581+
struct NotificationPopper__StaticFields {
11582+
};
11583+
11584+
struct NotificationPopper__Class {
11585+
Il2CppClass_0 _0;
11586+
Il2CppRuntimeInterfaceOffsetPair* interfaceOffsets;
11587+
struct NotificationPopper__StaticFields* static_fields;
11588+
const Il2CppRGCTXData* rgctx_data;
11589+
Il2CppClass_1 _1;
11590+
struct NotificationPopper__VTable vtable;
11591+
};
11592+
#pragma endregion
11593+
1155611594
typedef Il2CppReflectionMethod MonoMethod;
1155711595

1155811596
typedef Il2CppObject ActivityManager;

gui/esp.cpp

Lines changed: 111 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static void RenderText(std::string_view text, const ImVec2& pos, const ImVec4& c
2323
{
2424
CurrentWindow->DrawList->AddText(nullptr, 0.f,
2525
ImScreen + 0.5f * State.dpiScale,
26-
ImGui::GetColorU32(ImVec4(0.f, 0.f, 0.f, 0.f)), text.data(), text.data() + text.length());
26+
ImGui::GetColorU32(IM_COL32_BLACK), text.data(), text.data() + text.length());
2727
}
2828

2929
CurrentWindow->DrawList->AddText(nullptr, 0.f, ImScreen, ImGui::GetColorU32(color), text.data(), text.data() + text.length());
@@ -59,7 +59,7 @@ static void RenderBox(const ImVec2& top, const ImVec2& bottom, const float heigh
5959
};
6060

6161
if (wantsShadow) {
62-
const ImVec4& shadowColor = ImVec4(0.f, 0.f, 0.f, 0.f);
62+
const ImVec4& shadowColor = ImGui::ColorConvertU32ToFloat4(ImGui::GetColorU32(color) & IM_COL32_A_MASK);
6363
for (size_t i = 0; i < std::size(points); i += 2) {
6464
RenderLine(points[i] + 0.5f * State.dpiScale, points[i + 1] + 0.5f * State.dpiScale, shadowColor, false);
6565
}
@@ -69,6 +69,8 @@ static void RenderBox(const ImVec2& top, const ImVec2& bottom, const float heigh
6969
}
7070
}
7171

72+
bool renderPlayerEsp = false;
73+
7274
void Esp::Render()
7375
{
7476
CurrentWindow = ImGui::GetCurrentWindow();
@@ -77,11 +79,54 @@ void Esp::Render()
7779

7880
// Lock our mutex when we render (this will unlock when it goes out of scope)
7981
synchronized(instance.m_DrawingMutex) {
82+
// testing some stuffs
83+
if (renderPlayerEsp) {
84+
for (auto& it : instance.m_Players)
85+
{
86+
if (const auto& player = it.playerData.validate();
87+
player.has_value() //Verify PlayerControl hasn't been destroyed (happens when disconnected)
88+
&& !player.is_Disconnected() //Sanity check, shouldn't ever be true
89+
&& player.is_LocalPlayer() //highlight yourself, you're ugly
90+
&& (!player.get_PlayerData()->fields.IsDead || State.ShowEsp_Ghosts)
91+
&& it.OnScreen)
92+
{
93+
if (State.ShowEsp_Box)
94+
{
95+
float width = GetScaleFromValue(35.0f);
96+
float height = GetScaleFromValue(120.0f);
97+
98+
ImVec2 top{ it.Position.x + width, it.Position.y };
99+
ImVec2 bottom{ it.Position.x - width, it.Position.y - height };
100+
101+
RenderBox(top, bottom, height, width, it.Color);
102+
}
103+
104+
// TODO: show x and y
105+
if (State.ShowEsp_Distance)
106+
{
107+
const ImVec2 position{ it.Position.x, it.Position.y + 15.0f * State.dpiScale };
108+
109+
Vector2 mouse = {
110+
ImGui::GetMousePos().x, ImGui::GetMousePos().y
111+
};
112+
113+
std::string lel = std::to_string(ScreenToWorld(mouse).x) + ", " + std::to_string(ScreenToWorld(mouse).y);
114+
115+
std::string lol = std::to_string(it.Position.x) + ", " + std::to_string(it.Position.y);
116+
char* player = lol.data();
117+
118+
RenderText(player, position, it.Color);
119+
}
120+
}
121+
}
122+
}
123+
// track player codes
80124
for (auto& it : instance.m_Players)
81125
{
82126
if (const auto& player = it.playerData.validate();
83127
player.has_value() //Verify PlayerControl hasn't been destroyed (happens when disconnected)
84128
&& !player.is_Disconnected() //Sanity check, shouldn't ever be true
129+
&& !player.is_LocalPlayer() //Don't highlight yourself, you're ugly
85130
&& (!player.get_PlayerData()->fields.IsDead || State.ShowEsp_Ghosts)
86131
&& it.OnScreen)
87132
{
@@ -98,28 +143,75 @@ void Esp::Render()
98143

99144
RenderBox(top, bottom, height, width, it.Color);
100145
}
101-
if (!player.is_LocalPlayer()) { //Don't highlight yourself, you're ugly
102-
/////////////////////////////////
103-
//// Distance ///////////////////
104-
/////////////////////////////////
105-
if (State.ShowEsp_Distance)
106-
{
107-
const ImVec2 position{ it.Position.x, it.Position.y + 15.0f * State.dpiScale };
146+
/////////////////////////////////
147+
//// Distance ///////////////////
148+
/////////////////////////////////
149+
150+
if (State.ShowEsp_Distance)
151+
{
152+
// logic and calculation
153+
ImVec2 position = { it.Position.x, it.Position.y + 15.0f * State.dpiScale };
154+
ImVec2 position2 = { it.Position.x, it.Position.y + 30.0f * State.dpiScale };
155+
156+
// infamous trash codes
157+
float minX = 40.0f, minY = 0.0f,
158+
maxX = DirectX::GetWindowSize().x - 46.0f, // 1320
159+
maxY = DirectX::GetWindowSize().y - 38.0f; // 730
108160

109-
char distance[32];
110-
sprintf_s(distance, "[%.2fm]", it.Distance);
161+
float x = it.Position.x, y = it.Position.y;
162+
float offset = 15.0f * State.dpiScale;
111163

112-
RenderText(distance, position, it.Color);
164+
if (x < minX) {
165+
x = minX;
113166
}
114-
/////////////////////////////////
115-
//// Tracers ////////////////////
116-
/////////////////////////////////
117-
if (State.ShowEsp_Tracers && !player.is_LocalPlayer())
118-
{
119-
RenderLine(instance.LocalPosition, it.Position, it.Color, true);
167+
else if (x > maxX) {
168+
x = maxX;
169+
}
170+
171+
if (y < minY) {
172+
y = minY;
120173
}
174+
else if (y > maxY) {
175+
y = maxY;
176+
}
177+
178+
position = { x, y + offset };
179+
position2 = { x, y + 2 * offset };
180+
181+
// strings
182+
char distance[32];
183+
sprintf_s(distance, "[%.0fm]", it.Distance);
184+
185+
std::string lol = it.Name;
186+
char* player = lol.data();
187+
188+
//std::string lol2 = std::to_string(it.Position.x) + ", " + std::to_string(it.Position.y);
189+
//char* pl = lol2.data();
190+
191+
// kill cd update
192+
GameOptions options;
193+
if (const auto& player = it.playerData.validate();
194+
State.ShowKillCD
195+
&& !player.get_PlayerData()->fields.IsDead
196+
&& player.get_PlayerData()->fields.Role
197+
&& player.get_PlayerData()->fields.Role->fields.CanUseKillButton
198+
) {
199+
float killTimer = player.get_PlayerControl()->fields.killTimer;
200+
sprintf_s(distance, "[%.1fs]", killTimer);
201+
}
202+
203+
// render info
204+
RenderText(player, position, it.Color);
205+
RenderText(distance, position2, it.Color);
206+
}
207+
/////////////////////////////////
208+
//// Tracers ////////////////////
209+
/////////////////////////////////
210+
if (State.ShowEsp_Tracers)
211+
{
212+
RenderLine(instance.LocalPosition, it.Position, it.Color, true);
121213
}
122214
}
123215
}
124216
}
125-
}
217+
}

gui/tabs/game_tab.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,34 @@ namespace GameTab {
187187
State.rpcQueue.push(new RpcVent(*Game::pLocalPlayer, 1, true));
188188
}*/
189189

190+
if (IsInLobby() && ImGui::Button("Allow Everyone to NoClip")) {
191+
for (auto p : GetAllPlayerControl())
192+
State.lobbyRpcQueue.push(new RpcMurderLoop(*Game::pLocalPlayer, p, 1, true));
193+
State.NoClip = true;
194+
ShowHudNotification("Allowed everyone to NoClip!");
195+
}
196+
ImGui::SameLine();
197+
if ((IsInGame() || IsInLobby()) && ImGui::Button("Kill Everyone")) {
198+
for (auto player : GetAllPlayerControl()) {
199+
if (IsInGame())
200+
State.rpcQueue.push(new RpcMurderPlayer(*Game::pLocalPlayer, player));
201+
else if (IsInLobby())
202+
State.lobbyRpcQueue.push(new RpcMurderPlayer(*Game::pLocalPlayer, player));
203+
}
204+
}
205+
if ((IsInGame() || IsInLobby()) && (IsHost() || !State.SafeMode)) {
206+
ImGui::SameLine();
207+
if (ImGui::Button("Protect Everyone")) {
208+
for (auto player : GetAllPlayerControl()) {
209+
uint8_t colorId = GetPlayerOutfit(GetPlayerData(player))->fields.ColorId;
210+
if (IsInGame())
211+
State.rpcQueue.push(new RpcProtectPlayer(*Game::pLocalPlayer, PlayerSelection(player), colorId));
212+
else if (IsInLobby())
213+
State.lobbyRpcQueue.push(new RpcProtectPlayer(*Game::pLocalPlayer, PlayerSelection(player), colorId));
214+
}
215+
}
216+
}
217+
190218
if (IsInGame() && ToggleButton("Disable Venting", &State.DisableVents)) {
191219
State.Save();
192220
}

0 commit comments

Comments
 (0)