Remove setdiscordimage
This commit is contained in:
parent
7f2d79349b
commit
e2d44d3d06
@ -17,7 +17,6 @@ namespace discord
|
|||||||
DiscordRichPresence discord_presence;
|
DiscordRichPresence discord_presence;
|
||||||
std::string state;
|
std::string state;
|
||||||
std::optional<std::string> details{};
|
std::optional<std::string> details{};
|
||||||
std::optional<std::string> image{};
|
|
||||||
|
|
||||||
void update_discord()
|
void update_discord()
|
||||||
{
|
{
|
||||||
@ -27,7 +26,6 @@ namespace discord
|
|||||||
{
|
{
|
||||||
state = {};
|
state = {};
|
||||||
details.reset();
|
details.reset();
|
||||||
image.reset();
|
|
||||||
|
|
||||||
discord_presence.details = game::UI_SafeTranslateString("MENU_MAIN_MENU");
|
discord_presence.details = game::UI_SafeTranslateString("MENU_MAIN_MENU");
|
||||||
discord_presence.state = "";
|
discord_presence.state = "";
|
||||||
@ -39,19 +37,14 @@ namespace discord
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static char map[0x1000] = {0};
|
const char* base_mapname = nullptr;
|
||||||
if (image.has_value())
|
auto* map = game::Dvar_FindVar("mapname")->current.string;
|
||||||
|
if (game::Com_IsAddonMap(map, &base_mapname))
|
||||||
{
|
{
|
||||||
strncpy_s(map, image.value().data(), sizeof(map));
|
map = base_mapname;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const auto mapname = game::Dvar_FindVar("mapname")->current.string;
|
|
||||||
strncpy_s(map, mapname, sizeof(map));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto mapname = game::UI_SafeTranslateString(utils::string::va("PRESENCE_SP_%s", map));
|
const auto mapname = game::UI_SafeTranslateString(utils::string::va("PRESENCE_SP_%s", map));
|
||||||
|
|
||||||
discord_presence.largeImageKey = map;
|
discord_presence.largeImageKey = map;
|
||||||
|
|
||||||
if (details.has_value())
|
if (details.has_value())
|
||||||
@ -124,16 +117,6 @@ namespace discord
|
|||||||
update_discord();
|
update_discord();
|
||||||
}, scheduler::pipeline::async);
|
}, scheduler::pipeline::async);
|
||||||
});
|
});
|
||||||
|
|
||||||
command::add("setdiscordimage", [](const command::params& params)
|
|
||||||
{
|
|
||||||
const std::string image_ = params.join(1);
|
|
||||||
scheduler::once([=]()
|
|
||||||
{
|
|
||||||
image = image_;
|
|
||||||
update_discord();
|
|
||||||
}, scheduler::pipeline::async);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -33,6 +33,7 @@ namespace game
|
|||||||
WEAK symbol<void(char const* finalMessage)> Com_Shutdown{0x1405A62C0};
|
WEAK symbol<void(char const* finalMessage)> Com_Shutdown{0x1405A62C0};
|
||||||
WEAK symbol<void()> Com_Quit_f{0x1405A50D0};
|
WEAK symbol<void()> Com_Quit_f{0x1405A50D0};
|
||||||
WEAK symbol<bool()> Com_InFrontend{0x140328BD0};
|
WEAK symbol<bool()> Com_InFrontend{0x140328BD0};
|
||||||
|
WEAK symbol<bool(const char* mapName, const char** pBaseMapName)> Com_IsAddonMap{0x140609570};
|
||||||
WEAK symbol<void()> Quit{0x1405A52A0};
|
WEAK symbol<void()> Quit{0x1405A52A0};
|
||||||
|
|
||||||
WEAK symbol<void(XAssetType type, void(__cdecl* func)(game::XAssetHeader, void*), const void* inData, bool includeOverride)>
|
WEAK symbol<void(XAssetType type, void(__cdecl* func)(game::XAssetHeader, void*), const void* inData, bool includeOverride)>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user