I'm actually working on a little title pack
and I have a little problem : I need to get a variable from a manialink to another ...
In fact, in a custom solo mode,
according to the guy you choose in the mappers page,
the maps page will be build with his maps.
I'm not sure you understood, if not : just remember I need a persistent data between two manialink
from what I saw here
https://forum.maniaplanet.com/viewtopic ... 89#p271789
and here
https://forum.maniaplanet.com/viewtopic ... 45#p268945
it seems to be possible ...
here is what I've written in first file :
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<manialink version="2">
<label id="Busard" text="Busard" scriptevents="1" manialink="file://Media/Manialinks/TrackMania/VioK_Tests/VioK_Maps.xml"/>
<label id="KriTtPen" text="KriTtPen" scriptevents="1" manialink="file://Media/Manialinks/TrackMania/VioK_Tests/VioK_Maps.xml"/>
<script><!--
#RequireContext CMlScript
***StartManialink***
***
declare persistent Text Persistent_VioKTM_ChosenMapper for LocalUser;
***
***Yield***
***
foreach (Event in PendingEvents) {
if (Event.Type == CMlEvent::Type::MouseClick) {
if (Event.ControlId == "Busard") {
Persistent_VioKTM_ChosenMapper = "Busard";
}
if (Event.ControlId == "KriTtPen") {
Persistent_VioKTM_ChosenMapper = "KriTtPen";
}
}
}
***
main() {
---StartManialink---
while (True) {
yield;
---Yield---
}
}
--></script>
</manialink>
And in the second file :
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<manialink version="2">
<script><!--
#RequireContext CMlScript
#Const C_MapperNames ["Busard", "KriTtPen"] // short list for tests =)
***StartManialink***
***
declare persistent Text Persistent_VioKTM_ChosenMapper for LocalUser;
if (Persistent_VioKTM_ChosenMapper != "") {
G_ChosenMapper = Persistent_VioKTM_ChosenMapper;
foreach (Mapper in C_MapperNames) {
if (G_ChosenMapper == Mapper) {
DisplayMainPage();
}
}
}
***
***Yield***
***
// thing to be done when choosing a map ...
****
DisplayMainPage() {
// things to display according to mapper's name
}
main() {
---StartManialink---
while (True) {
yield;
---Yield---
}
}
--></script>
</manialink>
but I think I will need later to get another persistent variable between two manialniks, so ...
Thanks for help =)