Customizing the Panes

Lthr_Be
Hello All, I'm trying to do the following:

* Eliminate the compass. I think there was code for that here. Will this still work with 5.6?

* Change the titles for the "Inventory" and "Places and Objects" panes. So instead of "Inventory", I wish it to say something else. Same with the "Places and Objects" pane.

Any help is appreciated....Thanks!

HegemonKhan
here are some links:

http://docs.textadventures.co.uk/quest/ ... quest.html
http://docs.textadventures.co.uk/quest/ ... nced_.html
viewtopic.php?f=18&t=3405
viewtopic.php?f=18&t=3789

I think...

request (Hide, "Compass")
~OR~
request (Hide, Compass)

...not sure if one of the links covers how to change the titles of the panes...

actually, I think the 1st link (request link) shows how, see here (or in the 'request' link):

from the wiki 'request' link above wrote:SetInterfaceString
Takes a parameter of the form "ElementName=Value", to set the text in the user interface. Valid element names are:

InventoryLabel (default "Inventory")
PlacesObjectsLabel (default "Places and Objects")
CompassLabel (default "Compass")
InButtonLabel (default "in")
OutButtonLabel (default "out")
EmptyListLabel (default "(empty)")
NothingSelectedLabel (default "(nothing selected)")

The Pixie
I do not think you can do it with the request script command unfortunately. Type this JavaScript:
JS.eval ("compassAccordion.style.display = 'none'")
JS.eval ("compassLabel.style.display = 'none'")

Lthr_Be
Thank you HegemonKhan and Pixie. Sorry I should have dug a bit deeper as I have found jaynabonne's old post regarding hiding panes. The above JS works as well as a start script.

viewtopic.php?f=10&t=3597&p=23880&hilit=hide+compass#p23880

I have to admit through I am completely lost with changing the titles for the panes. I've been looking in the core library files themselves for anything to change, but nothing seems to affect these pane titles.

Lthr_Be
@HegemonKhan
@The Pixie

With that InventoryLabel (and I admit I'll need help with the coding) is that something I can use in a Start script?

Thank you again,

Silver
You'll need to copy a function into your game called inituserinterface and put it in there (I think).

The Pixie
You can put it in start script too. The problem sometimes is that changes to the interface are forgotten if the screen is cleared, but I would guess that is only changes to the area when text areas, as that gets wiped out. Changes to the panes on the right should be fine.

Arguably it is better practice to put it in InitUserInterface. But if you are using the on-line editor that is not an option anyway.

Also, it is vital that you get the capitalisation right, InitUserInterface not inituserinterface.

Silver
Fair dos. It's something you search for to copy over, and search isn't case sensitive hence me not really thinking about that.

Lthr_Be
Okay...so...if I have this right...I create a script in InitUserInterface? I found InitUserInterface, but I'm iffy on the coding. For example, if I wanted to change the inventory label, what would that look like?

Thank you for all your help.

The Pixie
I have been writing a "how to" on modifying the UI. You have prompted me to post it, though a couple of sections are outstanding. It covers doing just that:
viewtopic.php?f=18&t=5111&p=35347

Silver
That's an interesting post. I Held off posting on it in case you needed another post.

Lthr_Be
@The Pixie

Thank you for putting that together, although it doesn't seem to be working for me. I'm wondering, would using v5.6 make any difference here, as it seems to be resistant to the instructions I followed. (I'm using the v5.6 "offline" version.)

When I try to create a new function, InitUserInterface, I receive the message "An element called 'InitUserInterface' already exists in this game." So I went to FILTER -> SHOW LIBRARY ELEMENTS, found InitUserInterface, selected COPY (in the upper right corner), and then proceeded with copying and pasting

request (SetInterfaceString, "InventoryLabel=You are holding")

into SCRIPT -> CODE VIEW

And it still didn't work. The Inventory pane stubbornly refuses to change it's title. And

request (SetInterfaceString, "PlacesObjectsLabel=Things you can see")

doesn't work either.

However,

request (SetInterfaceString, "TypeHereLabel=Now what?")

works! So I'm wondering if this is an issue for 5.6...?

Lthr_Be
Also, in FILTER -> SHOW LIBRARY ELEMENTS there is InitInterface with some Raise UI requests that point to strings for InventoryLabel, PlacesObjectsLabel, etc, and changing these strings for these have no effect. Changing the string for TypeHereLabel only seems to work.

Lthr_Be
Update: I think this is a bug with 5.6.

I can successfully change the pane labels in 5.5.1 by changing the Raise UI request strings in FILTER -> SHOW LIBRARY ELEMENTS -> InitInterface.

If I load and play my 5.5.1 gamefile in 5.6, the pane label reverts to default.

Does anyone else encounter this?

The Pixie
Yes, this does seem to be a bug in 5.6. You should be able to change it using a template, and that also fails, which means language support is broken.
I have filed it as an issue:
https://github.com/textadventures/quest/issues/783

Lthr_Be
Thank you, Pixie! I had a feeling this would need to be forwarded to the bug list.

So I guess I'll be using 5.5.1...

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

Support

Forums