* Handle equip/unequip methods
* Handle dialogues inside interfaces
* Fix style assignment
* Move wardrobe checks inside wardrobe python scope
This commit is contained in:
LoafyLemon 2024-10-15 17:22:38 +01:00
parent 15bc242d2b
commit 59788d5f16
5 changed files with 128 additions and 35 deletions

View File

@ -234,7 +234,7 @@ init python:
hbox = [] hbox = []
overlay = [] overlay = []
action = [Return(["equip", self]), self.build_button] action = [Function(wardrobe.equip, self), self.build_button]
unhovered = None unhovered = None
if is_inadequate: if is_inadequate:
@ -268,7 +268,7 @@ init python:
child = Fixed(child, *overlay, fit_first=True) child = Fixed(child, *overlay, fit_first=True)
if is_inadequate: if is_inadequate:
style = wardrobe_item_button_inadequate style = "wardrobe_item_button_inadequate"
return Button(child=child, focus_mask=None, xysize=(96, 96), action=action, tooltip=("\n".join(warnings)), unhovered=unhovered, style=style, selected=is_equipped) return Button(child=child, focus_mask=None, xysize=(96, 96), action=action, tooltip=("\n".join(warnings)), unhovered=unhovered, style=style, selected=is_equipped)

View File

@ -28,6 +28,10 @@ screen say(who, what, side_doll=None, side_image=None, icon=None):
layer "interface" layer "interface"
zorder 0 zorder 0
if not is_game_menu():
# Allows dialogues to function inside interface elements
use invisible_button(Return(), keysym="dismiss")
if states.settings.interface_hidden: if states.settings.interface_hidden:
use hider use hider
@ -106,16 +110,17 @@ screen quickbox():
xalign 1.0 xalign 1.0
if states.settings.quickbox_expanded: if states.settings.quickbox_expanded:
textbutton "󰈉" action ToggleVariable("states.settings.interface_hidden", True, False) tooltip _("Hide Interface") keysym "hide_windows" # Hide Interface (\F0209) textbutton "󰈉" action ToggleVariable("states.settings.interface_hidden", True, False) tooltip _("Hide Interface") keysym "hide_windows" # Hide Interface (\F0209)
textbutton "󰇚" action QuickSave() tooltip _("Quick Save") # File Save (\F01DA) textbutton "󰇚" action QuickSave() tooltip _("Quick Save") sensitive is_game_menu() # File Save (\F01DA)
textbutton "󰕒" action QuickLoad() tooltip _("Quick Load") # File Load (\F0552) textbutton "󰕒" action QuickLoad() tooltip _("Quick Load") sensitive is_game_menu() # File Load (\F0552)
textbutton "󰁪" action Preference("auto-forward", "toggle") tooltip _("Auto-Forward Dialogue") # Autoplay (\F18F2) textbutton "󰁪" action Preference("auto-forward", "toggle") tooltip _("Auto-Forward Dialogue") # Autoplay (\F18F2)
textbutton "󰒓" action ShowMenu("navigation") tooltip _("Game Options") # Settings (\F0493) textbutton "󰒓" action ShowMenu("navigation") tooltip _("Game Options") sensitive is_game_menu() # Settings (\F0493)
textbutton "󰮫" action ToggleVariable("states.settings.quickbox_expanded", True, False) tooltip _("Toggle Quick Action Box") # Menu (\F0BAB) textbutton "󰮫" action ToggleVariable("states.settings.quickbox_expanded", True, False) tooltip _("Toggle Quick Action Box") # Menu (\F0BAB)
style quickbox_button style quickbox_button
style quickbox_button_text: style quickbox_button_text:
font gui.glyph_font font gui.glyph_font
color "#bbbbbb" color "#bbbbbb"
insensitive_color "#505050"
hover_color "#ffffff" hover_color "#ffffff"
selected_color "#EA8E61" selected_color "#EA8E61"
selected_hover_color "#ffffff" selected_hover_color "#ffffff"

View File

@ -129,6 +129,10 @@ init python early:
global _game_menu_screen global _game_menu_screen
_game_menu_screen = "navigation" _game_menu_screen = "navigation"
def is_game_menu():
global _game_menu_screen
return _game_menu_screen is not None
def make_revertable(obj): def make_revertable(obj):
if isinstance(obj, _list): if isinstance(obj, _list):
return [make_revertable(x) for x in obj] return [make_revertable(x) for x in obj]

View File

@ -1,43 +1,43 @@
init python: init python in wardrobe:
def wardrobe_check_category(category): def wardrobe_check_category(category):
req = get_character_requirement(states.active_girl, f"category {category}") req = renpy.store.get_character_requirement(renpy.store.states.active_girl, f"category {category}")
flag = get_character_progression(states.active_girl) flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req) return (flag >= req)
def wardrobe_check_touch(what): def wardrobe_check_touch(what):
req = get_character_requirement(states.active_girl, f"touch {what}") req = renpy.store.get_character_requirement(renpy.store.states.active_girl, f"touch {what}")
flag = get_character_progression(states.active_girl) flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req) return (flag >= req)
def wardrobe_check_equip(item): def wardrobe_check_equip(item):
req = item.level req = item.level
flag = get_character_progression(states.active_girl) flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req) return (flag >= req)
def wardrobe_check_unequip(item): def wardrobe_check_unequip(item):
req = get_character_requirement(states.active_girl, f"unequip {item.type}") req = renpy.store.get_character_requirement(renpy.store.states.active_girl, f"unequip {item.type}")
flag = get_character_progression(states.active_girl) flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req) return (flag >= req)
def wardrobe_check_equip_outfit(item): def wardrobe_check_equip_outfit(item):
req = max((i.level for i in item.group)) req = max((i.level for i in item.group))
flag = get_character_progression(states.active_girl) flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
has_bra = any(i.type == "bra" for i in item.group) has_bra = any(i.type == "bra" for i in item.group)
has_panties = any(i.type == "panties" for i in item.group) has_panties = any(i.type == "panties" for i in item.group)
if not has_bra: if not has_bra:
req = max(req, get_character_requirement(states.active_girl, "unequip bra")) req = max(req, renpy.store.get_character_requirement(renpy.store.states.active_girl, "unequip bra"))
if not has_panties: if not has_panties:
req = max(req, get_character_requirement(states.active_girl, "unequip panties")) req = max(req, renpy.store.get_character_requirement(renpy.store.states.active_girl, "unequip panties"))
if any(i.type.startswith(("piercing", "tattoo")) for i in item.group): if any(i.type.startswith(("piercing", "tattoo")) for i in item.group):
req = max(req, get_character_requirement(states.active_girl, "category piercings & tattoos")) req = max(req, renpy.store.get_character_requirement(renpy.store.states.active_girl, "category piercings & tattoos"))
return (flag >= req) return (flag >= req)
@ -45,29 +45,29 @@ init python:
if not item.blacklist: if not item.blacklist:
return True return True
req = max((get_character_requirement(states.active_girl, f"unequip {i}") for i in item.blacklist)) req = max((renpy.store.get_character_requirement(renpy.store.states.active_girl, f"unequip {i}") for i in item.blacklist))
flag = get_character_progression(states.active_girl) flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req) return (flag >= req)
def wardrobe_fallback_required(item): def wardrobe_fallback_required(item):
fallbacks = {"top", "bottom", "bra", "panties"} fallbacks = {"top", "bottom", "bra", "panties"}
char = get_character_object(states.active_girl) char = renpy.store.get_character_object(renpy.store.states.active_girl)
req = [get_character_requirement(states.active_girl, f"unequip {i}") for i in fallbacks if not char.is_equipped(i) and not i in char.blacklist] req = [renpy.store.get_character_requirement(renpy.store.states.active_girl, f"unequip {i}") for i in fallbacks if not char.is_equipped(i) and not i in char.blacklist]
if not req: if not req:
return False return False
req = max(req) req = max(req)
flag = get_character_progression(states.active_girl) flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return not (flag >= req) return not (flag >= req)
def wardrobe_react(what, arg): def wardrobe_react(what, arg):
global _skipping global _skipping
if wardrobe_chitchats: if chitchats:
_skipping = True _skipping = True
renpy.suspend_rollback(False) renpy.suspend_rollback(False)
renpy.block_rollback() renpy.block_rollback()
renpy.call_in_new_context(get_character_response(states.active_girl, what), arg) renpy.call_in_new_context(renpy.store.get_character_response(renpy.store.states.active_girl, what), arg)
return return

File diff suppressed because it is too large Load Diff