You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<function name="OutputTextRaw" parameters="text">
<![CDATA[
format = GetCurrentTextFormat("")
JS.addText("<span style=\"" + format + "\">" + text + "</span><br/>")
ResetCommandBarFormat
RequestSpeak (text)
]]>
</function>
<function name="ResetCommandBarFormat">
format = GetCommandBarFormat()
if (GetString(game, "commandbarformat") <> format) {
game.commandbarformat = format
JS.setCommandBarStyle(format)
}
</function>
<function name="GetCommandBarFormat" type="string">
format = GetCurrentTextFormat("") + ";background:" + game.defaultbackground
if(HasString(game, "overridecommandbarformat")) {
format = format + ";" + game.overridecommandbarformat
}
return (format)
</function>
and to make sure it doesn't mess with hiding:
function setCommandBarStyle(style) {
var width = $("#txtCommand").width();
var hidden = $("#txtCommand").is(":hidden") && $("#txtCommand").parent().is(":visible");
$("#txtCommand").attr("style", style);
$("#txtCommand").width(width);
if(hidden) {
$("#txtCommand").hide();
} else {
$("#txtCommand").show();
}
}
I think it's a bit overkill; but the combination least likely to cause gotchas for anyone who's already overridden one or more of those functions.
Note: While I was writing those functions, I created an attribute game.overridecommandbarformat - if that code gets used it would probably be advisable to add this to the editor too, so users can just type some CSS in a box if they want the command bar to use a different font from the main text or something. And also to add the attribute to the docs
The text was updated successfully, but these errors were encountered:
Discussion in Quest channel on Discord: https://discord.com/channels/1278365322054996018/1314620834467545200/1324154058612674664
Angel's suggestions:
The text was updated successfully, but these errors were encountered: