Hide/Show Command Bar Question :)

Anonynn
07 Sept 2018, 05:05

Hey all :)

I've already checked the UI Walk-through in the Quest Documentation page, but it doesn't explain HOW to hide/show the command bar. I tried...

request (Hide, "Command")
request (Show, "Command")

But I think these are outdated because they threw errors.

I also tried...

game.commandpane = True/False

But that didn't work either.

Could it be...

 commandpane.show = True/False

I know it's probably something simply but I didn't see it in the game.attributes. I found it in the interface options though :O

I would appreciate any and all help :D

Anonynn.


The Pixie
07 Sept 2018, 06:56

Try:

JS.uiShow("#txtCommandDiv")
JS.uiHide("#txtCommandDiv")

Anonynn
07 Sept 2018, 18:20

That worked perfectly, except that removed the "press to continue" button as well. Is there anyway to bring back the "continue" without showing the command bar?

Anonynn.


Anonynn
08 Sept 2018, 23:24

Or is there no way to do one without the other?


The Pixie
09 Sept 2018, 06:58

Okay, try:

JS.eval("$('#txtCommand').hide()")
JS.eval("$('#txtCommand').show()")

Anonynn
09 Sept 2018, 09:25

Nope. That didn't do anything.

I'll keep looking through the hidden filter area and see if I can't stumble across anything in the meantime!

We shall figure this out! :D

Anonynn.


Anonynn
09 Sept 2018, 09:30

I found...

Name: EditorGameShowCommandPane
Text: Show a command pane (use JS.setCommands to set)

AND

Name: EditorGameShowcommand
Text: Show command bar

Not much help there though.


The Pixie
09 Sept 2018, 10:45

I just created a couple of functions using that, and they work fine (though the command bar reappears after continue is pressed).

  <function name="HideCommandBar">
    JS.eval ("$('#txtCommand').hide()")
  </function>
  <function name="ShowCommandBar">
    JS.eval ("$('#txtCommand').show()")
  </function>

Anonynn
09 Sept 2018, 19:06

Yeah, strange. I put this...

HideCommandBar

(the standard function way) in the start script right before loading the game-title function but it doesn't hide the command bar at all.

I'll try it in a few more places.

Anonynn.


Anonynn
09 Sept 2018, 20:49

UPDATE:

Yeah, I tried the function in a couple of other places as well but nothing happens :O

Anonynn.


Forgewright
10 Sept 2018, 04:21

In my game, when the player looks at a NPC or monster, I created a function called 'ViewObjectSceen'. Instead of writing the same script over and over. The function is called from the objects description script when a player 'looks' at an NPC or monster.

The function contains:

request (Hide, "Command")
request (Hide, "Panes")
SetFontSize (15)
ClearScreen
JS.setGamePadding (100, 100, 50, 0)

This hides the Command box and panes correctly. I have been using this function since 5.5 and am now using 5.8

I then print whatever info with that set up.

Then I place a command hyper-link at the bottom of the NPC's description script.
The command calls this function to return to normal game play.

SetFontSize (16)
request (Show, "Command")
request (Show, "Panes")
JS.setGamePadding (250, 25, 25, 25)
ClearScreen
ShowRoomDescription

This effectively stops the player from any input other than the hyper-link during the viewing of the NPC description, so I do not know if the 'hide' will maintain if other input is allowed.

I've been doing this to avoid a bunch of screen scrolling...Gives a clean 'snap to' shot.

Preview DevMode


Anonynn
11 Sept 2018, 18:07

Weirdly enough...

request (Hide, "Command")
request (Hide, "Panes")

These work now but didn't before. I think because I tried them on the start script. Instead, I moved it to a function I use first and that seemed to do the trick. I appreciate all the weigh-ins and fixes everyone. Thank you!

Anonynn.


Forgewright
11 Sept 2018, 20:54

Sometimes...you just have to hold your mouth right to get things to work.