forked from skettios/LuaBackend
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,029 additions
and
922 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
--- | ||
Language: Cpp | ||
BasedOnStyle: Google | ||
ColumnLimit: 120 | ||
AccessModifierOffset: -4 | ||
DerivePointerAlignment: false | ||
IndentWidth: 4 | ||
BasedOnStyle: LLVM | ||
PointerAlignment: Left | ||
--- |
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,27 +1,27 @@ | ||
#include "ConsoleLib.h" | ||
|
||
void ConsoleLib::MessageOutput(const std::string& Text, int MessageType) { | ||
HANDLE _hConsole = GetStdHandle(STD_OUTPUT_HANDLE); | ||
HANDLE _hConsole = GetStdHandle(STD_OUTPUT_HANDLE); | ||
|
||
switch (MessageType) { | ||
case 0: | ||
SetConsoleTextAttribute(_hConsole, 11); | ||
std::cout << "MESSAGE: "; | ||
break; | ||
case 1: | ||
SetConsoleTextAttribute(_hConsole, 10); | ||
std::cout << "SUCCESS: "; | ||
break; | ||
case 2: | ||
SetConsoleTextAttribute(_hConsole, 14); | ||
std::cout << "WARNING: "; | ||
break; | ||
case 3: | ||
SetConsoleTextAttribute(_hConsole, 12); | ||
std::cout << "ERROR: "; | ||
break; | ||
} | ||
switch (MessageType) { | ||
case 0: | ||
SetConsoleTextAttribute(_hConsole, 11); | ||
std::cout << "MESSAGE: "; | ||
break; | ||
case 1: | ||
SetConsoleTextAttribute(_hConsole, 10); | ||
std::cout << "SUCCESS: "; | ||
break; | ||
case 2: | ||
SetConsoleTextAttribute(_hConsole, 14); | ||
std::cout << "WARNING: "; | ||
break; | ||
case 3: | ||
SetConsoleTextAttribute(_hConsole, 12); | ||
std::cout << "ERROR: "; | ||
break; | ||
} | ||
|
||
SetConsoleTextAttribute(_hConsole, 7); | ||
std::cout << Text; | ||
SetConsoleTextAttribute(_hConsole, 7); | ||
std::cout << 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
#include "DCInstance.h" | ||
|
||
void DCInstance::InitializeRPC(const char* applicationID) { | ||
Discord_Initialize(applicationID, NULL, 1, NULL); | ||
Discord_Initialize(applicationID, NULL, 1, NULL); | ||
|
||
std::memset(&DCInstance::Presence, 0, sizeof(DCInstance::Presence)); | ||
std::memset(&DCInstance::Presence, 0, sizeof(DCInstance::Presence)); | ||
|
||
auto _currTime = std::chrono::system_clock::now().time_since_epoch(); | ||
auto _secondCast = std::chrono::duration_cast<std::chrono::seconds>(_currTime); | ||
auto _currTime = std::chrono::system_clock::now().time_since_epoch(); | ||
auto _secondCast = | ||
std::chrono::duration_cast<std::chrono::seconds>(_currTime); | ||
|
||
DCInstance::Presence.startTimestamp = _secondCast.count(); | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
DCInstance::Presence.startTimestamp = _secondCast.count(); | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
} | ||
|
||
void DCInstance::UpdateDetails(const char* input) { | ||
DCInstance::Presence.details = input; | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
DCInstance::Presence.details = input; | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
} | ||
|
||
void DCInstance::UpdateState(const char* input) { | ||
DCInstance::Presence.state = input; | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
DCInstance::Presence.state = input; | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
} | ||
|
||
void DCInstance::UpdateLImage(const char* key, const char* text) { | ||
DCInstance::Presence.largeImageKey = key; | ||
DCInstance::Presence.largeImageText = text; | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
DCInstance::Presence.largeImageKey = key; | ||
DCInstance::Presence.largeImageText = text; | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
} | ||
|
||
void DCInstance::UpdateSImage(const char* key, const char* text) { | ||
DCInstance::Presence.smallImageKey = key; | ||
DCInstance::Presence.smallImageText = text; | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
DCInstance::Presence.smallImageKey = key; | ||
DCInstance::Presence.smallImageText = text; | ||
Discord_UpdatePresence(&DCInstance::Presence); | ||
} |
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
Oops, something went wrong.