FML Update

This commit is contained in:
Steffen Schröder
2013-11-28 07:30:00 +01:00
parent c39d35d1fe
commit fed96b36d0
12 changed files with 419 additions and 15 deletions

View File

@ -0,0 +1,4 @@
/*********************************
* FancyManiaLinks by steeffeen *
* http://fml.steeffeen.com *
*********************************/

View File

@ -1,3 +1,4 @@
Void Dummy() {}
main() {
+++OnInit+++

View File

@ -0,0 +1,12 @@
foreach (MenuIds in C_FML_MenuIds) {
if (!MenuIds.existskey(Event.ControlId)) continue;
declare MenuId = MenuIds[Event.ControlId][0];
declare SubMenuIds = MenuIds["__FML__Sub__Menus__"];
foreach (SubMenuId in SubMenuIds) {
declare SubMenu <=> Page.GetFirstChild(SubMenuId);
if (SubMenu == Null) continue;
SubMenu.Visible = (SubMenu.ControlId == MenuId);
}
}

View File

@ -0,0 +1,27 @@
foreach (PageIds in C_FML_PageIds) {
if (!PageIds.existskey(Event.ControlId)) continue;
declare Action = TextLib::ToInteger(PageIds[Event.ControlId][0]);
declare PagesId = PageIds["__FML__Pages__Id__"][0];
declare PagesIds = PageIds["__FML__Pages__Ids__"];
if (!G_FML_PageIndexes.existskey(PagesId)) {
G_FML_PageIndexes[PagesId] = 0;
}
G_FML_PageIndexes[PagesId] += Action;
if (G_FML_PageIndexes[PagesId] < 0) {
G_FML_PageIndexes[PagesId] = 0;
} else if (G_FML_PageIndexes[PagesId] >= PagesIds.count) {
G_FML_PageIndexes[PagesId] = PagesIds.count - 1;
}
foreach (PageIndex => PageId in PagesIds) {
declare Control <=> Page.GetFirstChild(PageId);
if (Control == Null) continue;
Control.Visible = (PageIndex == G_FML_PageIndexes[PagesId]);
}
declare Label_Counter <=> (Page.GetFirstChild(PagesId) as CMlLabel);
if (Label_Counter == Null) continue;
Label_Counter.Value = (G_FML_PageIndexes[PagesId]+1)^"/"^PagesIds.count;
}

View File

@ -0,0 +1,18 @@
foreach (PageIds in C_FML_PageIds) {
declare PagesId = PageIds["__FML__Pages__Id__"][0];
declare PagesIds = PageIds["__FML__Pages__Ids__"];
if (!G_FML_PageIndexes.existskey(PagesId)) {
G_FML_PageIndexes[PagesId] = 0;
}
foreach (PageIndex => PageId in PagesIds) {
declare Control <=> Page.GetFirstChild(PageId);
if (Control == Null) continue;
Control.Visible = (PageIndex == G_FML_PageIndexes[PagesId]);
}
declare Label_Counter <=> (Page.GetFirstChild(PagesId) as CMlLabel);
if (Label_Counter == Null) continue;
Label_Counter.Value = (G_FML_PageIndexes[PagesId]+1)^"/"^PagesIds.count;
}

View File

@ -3,4 +3,4 @@ if (C_FML_TooltipIds.existskey(Event.ControlId)) {
if (TooltipControl != Null) {
TooltipControl.Hide();
}
}
}

View File

@ -3,4 +3,4 @@ if (C_FML_TooltipIds.existskey(Event.ControlId)) {
if (TooltipControl != Null) {
TooltipControl.Show();
}
}
}