Navigation screen, hiding overlays and moving namebox
Posted: Sat Jul 13, 2013 2:57 pm
Hi guys! I realise I seek help far too often, but programming always manages to come up with a way to completely stun me. So, if anyone who actually knows what they're doing gives me a hand, I'll be very grateful.
Here are the issues I'm currently grappling with:
1. I have created an imagemap Navigation screen, but when I try to use it with "use navigation" in the Save/Load screen, nothing happens.
Here's my code:
It works just fine in the Preferences screen, where my code doesn't look different than in the Save/Load:
Could it be because the Prefs are an imagemap, while the Save/Load (still) isn't? How do I get the Navigation to appear there as well?
2. I created a bar with buttons that appears next to the textbox in-game using this code:
It works just fine, but the problem is that it won't disappear on the Yes/No prompt screen. When I press the "Quit" button from said bar, it takes me to the corresponding Yes/No prompt, but the whole bar stays. It only happens with this button, the other Yes/No prompts are fine.
I have the same problem with the overlay I'm using to display the date in-game.
I tried hiding it using "$ date = None", but it won't budge. Again, that's only when I press the "Quit" button from the textbox bar.
3. How would you recommend that I move the namebox to the right only for a certain character? The MC has a side image and it comes on top of said namebox.
All right, I think that was everything I meant to ask. Apologies for the gigantic post, I really hope that will be the last time I'll have to bother you guys with GUI problems. Thanks in advance for your help!
Here are the issues I'm currently grappling with:
1. I have created an imagemap Navigation screen, but when I try to use it with "use navigation" in the Save/Load screen, nothing happens.
Here's my code:
Code: Select all
screen navigation:
# The background of the game menu.
window:
style "gm_root"
# The various buttons.
imagemap:
ground "menus/nav_ground1.png"
idle "menus/navigation_idle1.png"
hover "menus/navigation_hover1.png"
hotspot (591, 355, 84, 28) action Return()
hotspot (584, 406, 96, 26) action ShowMenu("save")
hotspot (586, 433, 93, 22) action ShowMenu("load")
hotspot (588, 385, 88, 22) action ShowMenu("preferences")
hotspot (585, 456, 95, 26) action MainMenu()
hotspot (599, 506, 64, 25) action Quit()
init -2 python:
style.gm_nav_button.size_group = "gm_nav"
Code: Select all
screen preferences:
tag menu
use navigation
2. I created a bar with buttons that appears next to the textbox in-game using this code:
Code: Select all
def button_game_menu():
global show_button_game_menu
if show_button_game_menu:
ui.vbox(xpos=0.86, ypos=0.78, focus_mask=True)
ui.imagebutton("menus/skip button idle1.png", "menus/skip button hover1.png", clicked=toggle_skipping, focus_mask=True)
ui.imagebutton("menus/save button idle1.png", "menus/save button hover1.png", clicked=ccinc("_game_menu_save"), focus_mask=True)
ui.imagebutton("menus/load button idle1.png", "menus/load button hover1.png", clicked=ccinc("_game_menu_load"), focus_mask=True)
ui.imagebutton("menus/quit button idle1.png", "menus/quit button hover1.png", clicked=Quit(), focus_mask=True)
ui.close()
config.window_overlay_functions.append(button_game_menu)
I have the same problem with the overlay I'm using to display the date in-game.
Code: Select all
init:
$ date = False
python hide:
def date_overlay():
if date:
ui.text(date,
xpos=0.785, xanchor="left",
ypos=0.015, yanchor="top")
config.overlay_functions.append(date_overlay)
3. How would you recommend that I move the namebox to the right only for a certain character? The MC has a side image and it comes on top of said namebox.
All right, I think that was everything I meant to ask. Apologies for the gigantic post, I really hope that will be the last time I'll have to bother you guys with GUI problems. Thanks in advance for your help!