Page 1 of 1

[Solved] Mystery of the Invisible Hotbar

Posted: Thu Mar 20, 2014 9:56 pm
by Gear
So my options screen has a hotbar for altering the volume of the sound effects, voice effects, text speed, and music. The hotbar works, so if you click and slide, the volume is affected. The problem is, the hotbar won't appear on the screen, so it's effectively invisible.
screenshot0017.png
Seriously, it's like an old TV. How did people live before we had on-screen volume displays?
Anyway, I can't for the life of me get the code to work. I didn't write it initially, but the person who did has vanished from the Internet, so I turn to you, more programmically-inclined individuals, to assist me. All I can say is that the images are exactly where the program is looking for them. Or at least it seems so. The code is as follows:

Code: Select all

imagemap:
        ground "ui/options/ground.png"
        idle "ui/options/idle.png"
        hover "ui/options/hover.png"
        selected_idle "ui/options/hover.png"
        selected_hover "ui/options/hover.png"
        
        hotspot (628,152,180,20) clicked Preference("display", "window")
        hotspot (621,181,195,21) clicked Preference ("display", "fullscreen")
        hotspot (1017,152,83,19) clicked Preference("transitions", "all")
        hotspot (1006,182,104,18) clicked Preference("transitions", "none")
        
        hotspot (613,313,225,20) action Preference('skip', 'seen')
        hotspot (624,343,202,19) action Preference('skip', 'all')
        hotspot (604,400,244,20) action Preference('skip', 'begin')
        hotspot (940,311,232,23) action Preference('skip', 'stop')
        hotspot (941,341,227,22) action Preference('skip', 'keep')
        #(725, 181, 790, 213, "Sound Test"),

        hotbar (278,161,266,21) value Preference("music volume")
        hotbar (278,222,266,21) value Preference("sound volume")
        hotbar (278,282,266,21) value Preference("voice volume")
        hotbar (278,342,266,21) value Preference("text speed")

        # Also define the game menu buttons.
        hotspot (42,615,164,23) action Return()
        hotspot (414,615,222,23) action ShowMenu('save')
        hotspot (645,615,223,23) action ShowMenu('load')
        hotspot (214,615,192,23) action ShowMenu('preferences')
        hotspot (877,615,223,23) action MainMenu()
        hotspot (1108,615,118,23) action Quit()
        
init -2 python:
    style.pref_slider.left_bar = "ui/options/full_bar.png"
    style.pref_slider.right_bar = "ui/options/empty_bar.png"   
    style.pref_slider.xmaximum = 221
    style.pref_slider.ymaximum = 15       
    style.pref_slider.thumb_offset = 0
    style.pref_slider.left_gutter = 0
    style.pref_slider.right_gutter = 0
    style.pref_slider.thumb_shadow = None
Any help would be appreciated.

Re: Professor Layton and the Mystery of the Invisible Hotbar

Posted: Thu Mar 20, 2014 10:15 pm
by Asceai
I'm pretty confused by this.
You have all these style.pref_slider lines, but you don't have any bars (hotbars use the imagemap images like hotspots) and you don't have anything that uses the pref_slider style or the pref style group.
There's nothing wrong with your hotbars as far as I can tell. Did you actually draw the hotbars onto your imagemap images? If you did, post the pics. If you didn't, that's the problem.

Re: Professor Layton and the Mystery of the Invisible Hotbar

Posted: Thu Mar 20, 2014 11:33 pm
by Gear
No...when the UI was sent to me, it had the hotbars as separate images, not built into the background image, if I understand your question correctly. Which bar goes in the image? The full, or empty?
full_bar.png
full_bar.png (3.01 KiB) Viewed 876 times
empty_bar.png
empty_bar.png (3.01 KiB) Viewed 876 times

Re: Professor Layton and the Mystery of the Invisible Hotbar

Posted: Thu Mar 20, 2014 11:40 pm
by Asceai
Both. I don't know which imagemap images they go into respectively though; I've never used hotbars. Try putting e.g. different colours in each of those imagemap images in the area defined covered by one of the hotbars so you can tell.

Re: Professor Layton and the Mystery of the Invisible Hotbar

Posted: Fri Mar 21, 2014 12:12 am
by Gear
It works on the ground and idle images, but the hover screws up. How do you set it up for hover?

Re: Professor Layton and the Mystery of the Invisible Hotbar

Posted: Fri Mar 21, 2014 12:14 am
by Asceai
The problem could be that you're using the same images for hover, selected_idle and selected_hover:

Code: Select all

        hover "ui/options/hover.png"
        selected_idle "ui/options/hover.png"
        selected_hover "ui/options/hover.png"
Perhaps try having 3 different images there and experimenting.

Re: Professor Layton and the Mystery of the Invisible Hotbar

Posted: Fri Mar 21, 2014 12:53 am
by Gear
Thank you. It's working now. I'm 98.7 percent sure that I could never duplicate whatever the hell I did to those images to make it work again, but it's working now, and that's good enough for me. Thanks!