Silver wrote:I know you can hide the command bar with:request(Hide, "Command")
perhaps try swapping "Command" with "Compass"?
function hideCompass(){
compassAccordion.style.display = "none";
compassLabel.style.display = "none";
}
request (RunScript, "hideCompass")
JS.eval ("compassAccordion.style.display = 'none'")
JS.eval ("compassLabel.style.display = 'none'")
<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="display">
<gameid>952c1471-a281-4d82-8e1b-5fafd4959ee6</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<start type="script"><![CDATA[
msg ("Type Javascript commands by adding a hash (#) to the start of the command. For example:")
msg ("#compassAccordion.style.display = 'none'")
msg (" ")
msg ("The <i>compassAccordion</i> part is the ID for the XML element on screen. You can find these by clicking the \"HTML Tools\" button. In the dialogue box, hover over XML definitions and see what highlights in the game. You may need to expand a definition to dig deeper.")
msg ("The <i>style</i> part just tells javaScript we are changing the style.")
msg ("The <i>display</i> part is the CSS property. If this name is hyphenated (eg background-image), it must be converted to camel-case (eg backgroundImage).")
msg ("The <i>none</i> part, in single quotes, is the value to set. There are plenty of resources on the internet about CSS.")
msg (" ")
]]></start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<function name="HandleCommand" parameters="command, metadata"><![CDATA[
handled = false
if (game.menucallback <> null) {
if (HandleMenuTextResponse(command)) {
handled = true
}
else {
if (game.menuallowcancel) {
ClearMenu
}
else {
handled = true
}
}
}
if (not handled) {
StartTurnOutputSection
if (StartsWith (command, "*")) {
msg ("")
msg (SafeXML (command))
}
else if (StartsWith (command, "#")) {
msg ("")
msg ("JavaScript: " + SafeXML (Mid(command, 2)))
JS.eval (Mid(command, 2))
}
else {
shownlink = false
if (game.echocommand) {
if (metadata <> null and game.enablehyperlinks and game.echohyperlinks) {
foreach (key, metadata) {
if (EndsWith(command, key)) {
objectname = StringDictionaryItem(metadata, key)
object = GetObject(objectname)
if (object <> null) {
msg ("")
msg ("> " + Left(command, LengthOf(command) - LengthOf(key)) + "{object:" + object.name + "}")
shownlink = true
}
}
}
}
if (not shownlink) {
msg ("")
OutputTextRaw ("> " + SafeXML(command))
}
}
if (game.command_newline) {
msg ("")
}
commands = Split(command, ".")
game.pov.commandmetadata = metadata
if (ListCount(commands) = 1) {
game.pov.commandqueue = null
HandleSingleCommand (Trim(command))
}
else {
game.pov.commandqueue = commands
HandleNextCommandQueueItem
}
}
}
]]></function>
</asl>
JS.eval("status.style.backgroundColor = 'yellow'")
JS.eval("location.style.backgroundColor = 'black'")
JS.eval("gameBorder.style.backgroundColor = 'red'")
JS.eval("$('#status').css('backgroundColor', 'yellow')")
JS.eval("$('#location').css('backgroundColor', 'black')")
JS.eval("$('#gameBorder').css('backgroundColor', 'red')")
JS.eval("$('#txtCommand').css('backgroundColor', 'yellow')")
JS.eval("$('#txtCommandDiv').css('backgroundColor', 'yellow')")
<function name="OutputTextRaw" parameters="text">
<![CDATA[
format = GetCurrentTextFormat("")
JS.addText("<span style=\"" + format + "\">" + text + "</span><br/>")
if (GetString(game, "commandbarformat") <> format) {
format = format + ";background:" + game.defaultbackground
game.commandbarformat = format
JS.setCommandBarStyle(format)
}
request (Speak, text)
]]>
</function>