Compare commits
No commits in common. "88221039bb0d2aabbb1c23c216422f2f7046d9e3" and "805453d90c8b281866210b4876b705758387adfc" have entirely different histories.
88221039bb
...
805453d90c
@ -3,7 +3,6 @@ uint S_NbOfLinksInCache = 5;
|
|||||||
|
|
||||||
const string C_LinksCache = "LinksCache.txt";
|
const string C_LinksCache = "LinksCache.txt";
|
||||||
|
|
||||||
bool G_PermissionIssueNotified = false;
|
|
||||||
string G_QuickURL = "";
|
string G_QuickURL = "";
|
||||||
bool G_PressEnter = false;
|
bool G_PressEnter = false;
|
||||||
bool G_WasEditing = false;
|
bool G_WasEditing = false;
|
||||||
@ -11,8 +10,6 @@ bool G_WasEditing = false;
|
|||||||
array<string> G_LinksCache;
|
array<string> G_LinksCache;
|
||||||
|
|
||||||
void Main() {
|
void Main() {
|
||||||
if (!hasPermissions()) return;
|
|
||||||
|
|
||||||
trace("Loading links cache");
|
trace("Loading links cache");
|
||||||
string filepath = IO::FromStorageFolder(C_LinksCache);
|
string filepath = IO::FromStorageFolder(C_LinksCache);
|
||||||
IO::File file(filepath);
|
IO::File file(filepath);
|
||||||
@ -24,8 +21,6 @@ void Main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderMenuMain() {
|
void RenderMenuMain() {
|
||||||
if (!hasPermissions()) return;
|
|
||||||
|
|
||||||
if (!G_PressEnter && UI::BeginMenu("\\$cf9" + Icons::ExternalLink + "\\$z Quick Link Opener##QuickLinkOpenerMenu")) {
|
if (!G_PressEnter && UI::BeginMenu("\\$cf9" + Icons::ExternalLink + "\\$z Quick Link Opener##QuickLinkOpenerMenu")) {
|
||||||
G_QuickURL = UI::InputText("###quickURL", G_QuickURL, G_PressEnter, UI::InputTextFlags::EnterReturnsTrue + UI::InputTextFlags::CallbackAlways, UI::InputTextCallback(ITCB));
|
G_QuickURL = UI::InputText("###quickURL", G_QuickURL, G_PressEnter, UI::InputTextFlags::EnterReturnsTrue + UI::InputTextFlags::CallbackAlways, UI::InputTextCallback(ITCB));
|
||||||
|
|
||||||
@ -53,7 +48,6 @@ void ITCB(UI::InputTextCallbackData@ d) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LoadLink(string _Url, bool _NewUrl) {
|
void LoadLink(string _Url, bool _NewUrl) {
|
||||||
if (!hasPermissions()) return;
|
|
||||||
if (_Url == "") return;
|
if (_Url == "") return;
|
||||||
|
|
||||||
string parsedURL = "";
|
string parsedURL = "";
|
||||||
@ -84,15 +78,3 @@ void LoadLink(string _Url, bool _NewUrl) {
|
|||||||
CTrackMania@ app = cast<CTrackMania>(GetApp());
|
CTrackMania@ app = cast<CTrackMania>(GetApp());
|
||||||
app.ManiaPlanetScriptAPI.OpenLink(parsedURL, CGameManiaPlanetScriptAPI::ELinkType::ManialinkBrowser);
|
app.ManiaPlanetScriptAPI.OpenLink(parsedURL, CGameManiaPlanetScriptAPI::ELinkType::ManialinkBrowser);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasPermissions() {
|
|
||||||
if (Permissions::PlayPublicClubRoom()) return true;
|
|
||||||
|
|
||||||
if (!G_PermissionIssueNotified) {
|
|
||||||
G_PermissionIssueNotified = true;
|
|
||||||
string msg = "Missing permissions: you need to be able to play on public room to use this plugin.";
|
|
||||||
warn(msg);
|
|
||||||
UI::ShowNotification(Meta::ExecutingPlugin().Name, msg, vec4(.9, .5, .3, .2), 15000);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[meta]
|
[meta]
|
||||||
name = "TMWT Interfaces Remover"
|
name = "TMWT Interfaces Remover"
|
||||||
category = "TMWT"
|
category = "TMWT"
|
||||||
version = "1.4"
|
version = "1.3"
|
||||||
siteid = 318
|
siteid = 318
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const string C_Class_UIModules = 'component-cmgame-uimodules-module';
|
const string C_Class_UIModules = 'component-modelibs-uimodules-module';
|
||||||
const string C_Id_TMWT_LiveRanking = 'TMWTCommon_LiveRanking';
|
const string C_Id_TMWT_LiveRanking = 'TMWTCommon_LiveRanking';
|
||||||
const string C_Id_TMWT_Header = 'TMWTCommon_Header';
|
const string C_Id_TMWT_Header = 'TMWTCommon_Header';
|
||||||
const string C_Id_TMWC2023_LiveRanking = 'TMWC2023_LiveRanking';
|
const string C_Id_TMWC2023_LiveRanking = 'TMWC2023_LiveRanking';
|
||||||
|
Loading…
Reference in New Issue
Block a user