Newsticker stuff
This commit is contained in:
parent
961f2b0a0b
commit
a381debe87
2
deps/mongoose
vendored
2
deps/mongoose
vendored
@ -1 +1 @@
|
||||
Subproject commit 8b12263dbca0ef9be1cddf88fd9068ad7eb0ffe3
|
||||
Subproject commit 786f46c6551af34bb720913c13a5d7fb37c02822
|
@ -187,11 +187,15 @@ namespace Components
|
||||
{
|
||||
BitMessage::Save();
|
||||
|
||||
// We have to do that in another thread, as sometims the terminating thread already holds the mutex lock...
|
||||
// We have to do that in another thread, as sometimes the terminating thread already holds the mutex lock...
|
||||
#ifndef DEBUG
|
||||
std::thread([&] ()
|
||||
{
|
||||
#endif
|
||||
delete BitMessage::BMClient;
|
||||
#ifndef DEBUG
|
||||
}).join();
|
||||
#endif
|
||||
|
||||
BitMessage::BMClient = nullptr;
|
||||
}
|
||||
|
@ -66,6 +66,11 @@ namespace Components
|
||||
TerminateProcess(GetCurrentProcess(), exitCode);
|
||||
}
|
||||
|
||||
const char* News::GetNewsText()
|
||||
{
|
||||
return Localization::Get("MPUI_MOTD_TEXT");
|
||||
}
|
||||
|
||||
void News::CheckForUpdate()
|
||||
{
|
||||
std::string caches = Utils::WebIO("IW4x", "https://iw4xcachep26muba.onion.to/iw4/caches.xml").SetTimeout(5000)->Get();
|
||||
@ -103,6 +108,13 @@ namespace Components
|
||||
Localization::Set("MPUI_CHANGELOG_TEXT", "Loading...");
|
||||
Localization::Set("MPUI_MOTD_TEXT", NEWS_MOTD_DEFUALT);
|
||||
|
||||
// make newsfeed (ticker) menu items not cut off based on safe area
|
||||
Utils::Hook::Nop(0x63892D, 5);
|
||||
|
||||
// hook for getting the news ticker string
|
||||
Utils::Hook::Nop(0x6388BB, 2); // skip the "if (item->text[0] == '@')" localize check
|
||||
Utils::Hook(0x6388C1, News::GetNewsText, HOOK_CALL).Install()->Quick();
|
||||
|
||||
// TODO: Probably remove that, if the updater is part of the repo?
|
||||
if (Utils::IO::FileExists("updater.exe"))
|
||||
{
|
||||
|
@ -18,5 +18,7 @@ namespace Components
|
||||
|
||||
static void CheckForUpdate();
|
||||
static void ExitProcessStub(unsigned int exitCode);
|
||||
|
||||
static const char* GetNewsText();
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user