Description:
When a <label> gets both style and textprefix set through a <style>, then the textprefix gets ignored as soon as the opacity of the <label> is changed using ManiaScript.
This bug seems to only invole the textprefix attribute, other attributes still gets applied as intended. Additionally, it only occurs when changing the opacity of the <label>: When chaning any other attribute like the value or the position, the textprefix still gets applied.
Example ManiaLink:
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<manialink version="2" navigable3d="0">
<timeout>0</timeout>
<stylesheet>
<style class="styleLabel" style="TextButtonBig" textprefix="$t[I am the text prefix] " />
</stylesheet>
<label id="label" class="styleLabel" sizen="200 0" text="Press any key to trigger bug" />
<script><![CDATA[
while (True) {
yield;
foreach (Event in PendingEvents) {
if (Event.Type == CMlEvent::Type::KeyPress) {
declare Label = (Page.GetFirstChild("label") as CMlLabel);
Label.Opacity = 0.5;
}
}
}
]]></script>
</manialink>
When pressing any key, the <label> becomes 50% transparent by keeping all other attributes like its text prefix and formats.
Actual behavior:
The <label> actually looses its text prefix, having the text disappear and some of the formats change which have been implicitly manipulated with the textprefix.
Workaround:
This bug can be easily workaround by adding the textprefix to the <label> itself.