- May 24, 2020
- 160
- 79
Hey everyone,
I have created my own custom main menu, which consists of three "layers" so to say:
1 background image slideshow, which gets chosen randomly from a list of pictures
1 bar on the bottom half of the screen, which persists
all the buttons atop of that bar.
Now I have a small problem, which is almost unnoticable, but just like most small flaws in the world, I can't unsee it...
When the background picture dissolves into the next and I click at the exact timing on a button, nothing happens.
I'm guessing it has to do with the Dissolve function which according to another thread is loading a complete new screen each time, but maybe I'm wrong...
So does anyone have any ideas, how to fix this?
TLDR: Slideshow dissolve eats up all clicks on the main menu during dissolve. What can I do about it?
Code taken from other forums :
I have created my own custom main menu, which consists of three "layers" so to say:
1 background image slideshow, which gets chosen randomly from a list of pictures
1 bar on the bottom half of the screen, which persists
all the buttons atop of that bar.
Now I have a small problem, which is almost unnoticable, but just like most small flaws in the world, I can't unsee it...
When the background picture dissolves into the next and I click at the exact timing on a button, nothing happens.
I'm guessing it has to do with the Dissolve function which according to another thread is loading a complete new screen each time, but maybe I'm wrong...
So does anyone have any ideas, how to fix this?
TLDR: Slideshow dissolve eats up all clicks on the main menu during dissolve. What can I do about it?
Code taken from other forums :
Python:
init python:
#Fill up the images that get rotated in the main menu
#random pic for mainmenu
import random
mm_imgs = [INSERT PICS HERE]
mm_img = mm_imgs[0]
def next_mm_img(kind="random"):
global mm_img
global mm_imgs
if kind == "random":
mm_img = random.choice(mm_imgs)
elif kind == "progressive":
index = mm_imgs.index(mm_img)
index = (index+1) % len(mm_imgs)
mm_img = mm_imgs[index]
screen main_menu():
tag menu
style_prefix "main_menu"
add mm_img
timer 8.0 action Function(next_mm_img, "random"), With(dissolve) repeat True
add "gui/bottomhalf.png" #Set Main menu bar (Just a black bar)
#Imagebutton code (Fill in all buttons here)
imagebutton auto "gui/buttons/newgamebutton_%s.png":
xalign 0.2
yalign 0.95
focus_mask True
action Start()