Some some side-panel panes but not others

psymann
Hello all,

On the right, I see a side-panel with various panes:

- Inventory
- Places and Objects
- Compass

I quite like the Inventory one.
But I don't like the Places and Objects one.

So I want to turn off the Places and Objects one, but keep the Inventory one. Is that possible?

All I can see is the "Game -> Display -> Show panes" option which is just a boolean tick-box, ie show all, or show none. If need be, I'll turn it to show none, and just force my user to keep typing "inv" every few minutes to remember what he's carrying. But is there a clever codey way to show just the Inventory one?

Thank you for your continued support! :)

psymann

jaynabonne
Add these two lines to your game start script (add one if you don't have one!)

JS.eval("$('#placesObjectsLabel').hide();")
JS.eval("$('#placesObjectsAccordian').hide();")

psymann
Ooh, nice, that works... though I don't understand what it's doing since the code is a bit beyond me.

If I wanted to hide the Compass one as well, how would that look?
Or if I wanted to hide just the Inventory one?

psymann
Actually, no, that doesn't quite work...

It removes the Title "Places and Objects", but leaves behind the actual list of all the places and objects.

jaynabonne
<deleted, since it's nonsense...>

jaynabonne
psymann wrote:Actually, no, that doesn't quite work...

It removes the Title "Places and Objects", but leaves behind the actual list of all the places and objects.


Darn. Ok, let me check.

jaynabonne
All I can figure is that Quest must be turning it back on again. Since it comes and goes, that makes sense. I don't have the latest cs/vb code, so I can't say if there is a way to work around that.

Maybe there is no way with the current version. :(

sonic102
HTML editing maybe? Or try putting Jay's code in a turn script?

jaynabonne
I tried the turn script, and it didn't work. Quest must be updating the panes after the turn scripts fire.

HegemonKhan
I thought I saw (and read) some thread with posts on how to maybe at least create a pane and~or maybe also hide a pane, so try looking or searching through or at the various threads for such posts. I don't know though where I remember seeing it, :(

maybe it was a library too, so try looking or searching for libraries that MIGHT have been made on doing what you want with the panes.

sonic102
Then HTML Editing is all we can do.

psymann
I think then until Quest 5.x turns up with an easier way to do it, I'll just stick to turning the whole lot off, and getting people to type "inv" when they want to see what they're carrying. Worked well enough for people in the 1980s ;-)

sonic102
That is what non-Questers do too.

jaynabonne
I hate it when I have the solution right under my nose, but I refuse to see for some reason. It turns out this works, but I don't know why (or, rather, why mine didn't).

The code I had offered before was based on a .js file Alex had given Scott before for hiding panes. I tried to convert it into ASLX "JS" calls, and it didn't work. But it didn't register that it should have (or that it worked otherwise).

At any rate (rambling aside), if you include the attached .js file in your project, it will turn off the "places objects" pane as well as the compass. If you want one or the other, delete the appropriate section from the .js file.

[Tutorial: to include a .js file, copy into your project folder - the folder where your .aslx file is. Then from the menu choose Add / Advanced / Javascript. When you get to the Javascript page, click on the FIlename dropdown. The .js file should be in the list. Select it, and it will be included.)

(Note the .js file is zipped up, since the forum won't allow .js attachments.)

If you look at the file and the HTML structure, you'll see why I thought it should have worked. Perhaps it's a question of *when* things run more than what. (The "next" element from the label is the accordian.)

The code is:

$(function() {
var $placesObjectsLabel = $("#placesObjectsLabel");
var $placesObjects = $placesObjectsLabel.next();
$placesObjectsLabel.hide();
$placesObjects.hide();
});

$(function() {
var $compassLabel = $("#compassLabel");
var $compass = $compassLabel.next();
$compassLabel.hide();
$compass.hide();
});

psymann
Whoo, that works, thanks :-)

Now it's in my program, when I eventually finish and publish it, it'll do the same for other people, presumably? I won't have to supply them with the javascript file as well?

jaynabonne
The JS file will be included when you publish the game, as it does for images, etc. (all lumped into the .quest file). It won't need to be a separate file, but you do need to keep the external JS file in your project since it's referenced. You can also modify the .JS file at will and the changes will be reflected immediately in the game.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums