* 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 = []
overlay = []
action = [Return(["equip", self]), self.build_button]
action = [Function(wardrobe.equip, self), self.build_button]
unhovered = None
if is_inadequate:
@ -268,7 +268,7 @@ init python:
child = Fixed(child, *overlay, fit_first=True)
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)

View File

@ -28,6 +28,10 @@ screen say(who, what, side_doll=None, side_image=None, icon=None):
layer "interface"
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:
use hider
@ -106,16 +110,17 @@ screen quickbox():
xalign 1.0
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 QuickSave() tooltip _("Quick Save") # File Save (\F01DA)
textbutton "󰕒" action QuickLoad() tooltip _("Quick Load") # File Load (\F0552)
textbutton "󰇚" action QuickSave() tooltip _("Quick Save") sensitive is_game_menu() # File Save (\F01DA)
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 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)
style quickbox_button
style quickbox_button_text:
font gui.glyph_font
color "#bbbbbb"
insensitive_color "#505050"
hover_color "#ffffff"
selected_color "#EA8E61"
selected_hover_color "#ffffff"

View File

@ -129,6 +129,10 @@ init python early:
global _game_menu_screen
_game_menu_screen = "navigation"
def is_game_menu():
global _game_menu_screen
return _game_menu_screen is not None
def make_revertable(obj):
if isinstance(obj, _list):
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):
req = get_character_requirement(states.active_girl, f"category {category}")
flag = get_character_progression(states.active_girl)
req = renpy.store.get_character_requirement(renpy.store.states.active_girl, f"category {category}")
flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req)
def wardrobe_check_touch(what):
req = get_character_requirement(states.active_girl, f"touch {what}")
flag = get_character_progression(states.active_girl)
req = renpy.store.get_character_requirement(renpy.store.states.active_girl, f"touch {what}")
flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req)
def wardrobe_check_equip(item):
req = item.level
flag = get_character_progression(states.active_girl)
flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req)
def wardrobe_check_unequip(item):
req = get_character_requirement(states.active_girl, f"unequip {item.type}")
flag = get_character_progression(states.active_girl)
req = renpy.store.get_character_requirement(renpy.store.states.active_girl, f"unequip {item.type}")
flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req)
def wardrobe_check_equip_outfit(item):
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_panties = any(i.type == "panties" for i in item.group)
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:
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):
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)
@ -45,29 +45,29 @@ init python:
if not item.blacklist:
return True
req = max((get_character_requirement(states.active_girl, f"unequip {i}") for i in item.blacklist))
flag = get_character_progression(states.active_girl)
req = max((renpy.store.get_character_requirement(renpy.store.states.active_girl, f"unequip {i}") for i in item.blacklist))
flag = renpy.store.get_character_progression(renpy.store.states.active_girl)
return (flag >= req)
def wardrobe_fallback_required(item):
fallbacks = {"top", "bottom", "bra", "panties"}
char = get_character_object(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]
char = renpy.store.get_character_object(renpy.store.states.active_girl)
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:
return False
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)
def wardrobe_react(what, arg):
global _skipping
if wardrobe_chitchats:
if chitchats:
_skipping = True
renpy.suspend_rollback(False)
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

File diff suppressed because it is too large Load Diff