This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added new event for players leaving the lobby
- Loading branch information
Showing
7 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "pch-il2cpp.h" | ||
#include "_events.h" | ||
#include "utility.h" | ||
|
||
DisconnectEvent::DisconnectEvent(EVENT_PLAYER source) : EventInterface(source, EVENT_DISCONNECT) { } | ||
|
||
void DisconnectEvent::Output() { | ||
ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); | ||
ImGui::SameLine(); | ||
ImGui::Text("has left the game"); | ||
ImGui::SameLine(); | ||
auto sec = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count() - std::chrono::duration_cast<std::chrono::seconds>(this->timestamp.time_since_epoch()).count(); | ||
auto min = std::chrono::duration_cast<std::chrono::minutes>(std::chrono::system_clock::now().time_since_epoch()).count() - std::chrono::duration_cast<std::chrono::minutes>(this->timestamp.time_since_epoch()).count(); | ||
if (sec < 60) ImGui::Text(" [%ds ago]", sec); | ||
else ImGui::Text(" [%dm ago]", min); | ||
} | ||
|
||
void DisconnectEvent::ColoredEventOutput() { | ||
ImGui::Text("["); | ||
ImGui::SameLine(); | ||
ImGui::TextColored(ImVec4(1.f, 1.f, 1.f, 1.f), "DISCONNECT"); | ||
ImGui::SameLine(); | ||
ImGui::Text("]"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#define GIT_CUR_COMMIT 9c1b3553fa9d5ce5471b61c88699736db773ed77 | ||
#define GIT_CUR_COMMIT 68a2089d212e5058138387a4202ead7f92350570 | ||
#define GIT_BRANCH main |