[ManiaScript] ValueLineCount not working for maptype scripts
Posted: 05 Dec 2014, 19:39
I discovered that MlLabel.ValueLineCount always returns -1 if the manialink is displayed in maptype context.
\Documents\ManiaPlanet\Scripts\MapTypes\ShootMania\Test.Script.txt
If the same manialink code is opended with the manialink explorer the correct result is returned.
EDIT:
If changing the text on the label with SetText() the ValueLineCount is not changed.
This is also the case if not in maptype context.
\Documents\ManiaPlanet\Scripts\MapTypes\ShootMania\Test.Script.txt
Code: Select all
#RequireContext CSmMapType
main() {
ManialinkText = """
<manialink version="1">
<script><!--
main() {
declare CMlLabel MlLabel;
MlLabel = (Page.GetFirstChild("MlLabel") as CMlLabel);
log("MlLabel line count: " ^ MlLabel.ValueLineCount);
}
--></script>
<timeout>0</timeout>
<label id="MlLabel" posn="0 0 3" sizen="150 10" halign="center" valign="center" text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." autonewline="1" />
</manialink>
""";
while(True) {
yield;
}
}
EDIT:
If changing the text on the label with SetText() the ValueLineCount is not changed.
This is also the case if not in maptype context.