Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

16 after closing a label it should not be mandatory to close with call screen room navigation #37

4 changes: 2 additions & 2 deletions .vscode/NQTR-TimeHandler.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"scope": "renpy",
"prefix": "DR_NewDay",
"body": [
"call wait${1:(wait_hour=${2:1}, after_exit=${3:True})}",
"call wait${1:(wait_hour=${2:1})}",
"",
],
"description": "Add an Action in DEFAULT_LABEL_TALK"
Expand All @@ -12,7 +12,7 @@
"scope": "renpy",
"prefix": "DR_Wait",
"body": [
"call new_day${1:(time_of_new_day=${2:9}, after_exit=${3:True})}",
"call new_day${1:(time_of_new_day=${2:9})}",
"",
],
"description": "Add an Action in DEFAULT_LABEL_TALK"
Expand Down
3 changes: 2 additions & 1 deletion game/script.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ label start:
$ quests["alice"].start()
$ quests["ann"].start()

## call screen room_navigation
## make check, for event...
call after_spending_time

call screen room_navigation
return
28 changes: 12 additions & 16 deletions game/tool/action_label.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ label nap:
jump sleep
"Return":
pass
call screen room_navigation
return

label sleep:
menu:
Expand All @@ -21,25 +21,21 @@ label sleep:
call new_day(time_of_new_day = 9, is_check_event=True)
"Return":
pass
jump after_spending_time

## Error and warming Label

label error_label:
"ERROR"
return

## Development Label

label development:
"In development"
call screen room_navigation
return

label development_characters_info:
"In development in another repo: {a=https://github.com/DRincs-Productions/DS-toolkit}DS toolkit{/a}"
call screen room_navigation
return

label development_inventory:
"In development in another repo: {a=https://github.com/DRincs-Productions/Inventory-System-toolkit}Inventory System{/a}"
call screen room_navigation
return

## Various actions

Expand All @@ -48,23 +44,23 @@ label order_product:
mc "Here's R****, for $1. Just the thing for me."
$ del actions['order_product']
$ quests["alice"].nextStage()
call screen room_navigation
return

label add_product:
$ actions["take_product"] = Act(name = _("Take product"), button_icon = "/interface/action-box.webp", label_name = "take_product", rooms=['terrace'])
call screen room_navigation
return

label take_product:
$ del actions['take_product']
$ quests["alice"].nextStage()
call screen room_navigation
return

label take_key:
mc "Are these the car keys?! Well... I should try to access the car!"
$ flags["goout"] = True
$ del actions['take_key']
$ quests["ann"].nextStage()
call screen room_navigation
return

label talk_sleep:
"zZz zZz ..."
Expand All @@ -74,7 +70,7 @@ label talk_sleep:
a "[mc]!!!! What are you doing?!!"
a "Get out of here! Now!"
$ closed_rooms[cur_room.id] = df_routine["alice_sleep"]
jump after_spending_time
call after_spending_time
"Leave her alone":
pass
call screen room_navigation
return
9 changes: 5 additions & 4 deletions game/tool/action_talk.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ init -11 python:
"""This is a is picture in background?"""
return not isNullOrEmpty(self.picture_in_background)

def talk(self) -> None:
"""Inside you can find the labels and images to start talk()"""
def getTalkLabelName(self) -> None:
# if label_name == None does the default procedure
if not isNullOrEmpty(self.label_name):
renpy.call(self.label_name)
return self.label_name
elif not isNullOrEmpty(DEFAULT_LABEL_TALK):
renpy.call(DEFAULT_LABEL_TALK)
return DEFAULT_LABEL_TALK
else:
renpy.log("Error: DEFAULT_LABEL_TALK is null or empty")
return

def getBackground(self) -> str:
Expand Down
14 changes: 5 additions & 9 deletions game/tool/action_talk_label.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@ label talk_menu:
# remove the item because otherwise every time I talk to a character more "Back" will be added (even if I have not understood why)
$ talk_choices.remove((_("Back"), "talk_back"))
$ del talk_choices
jump expression menu_result
call expression menu_result
return

# Best way to exit a dialogue
label talk_end:
jump after_spending_time

# label talk: is a label used to give the possibility to customize the dialog even more.
label talk:
if (talk_image != None):
scene expression (talk_image) as bg

if(talk_ch == None):
call error_label
call screen room_navigation
$ renpy.log("Error(talk): talk_ch is None")
return

# Costume Code
if(talk_ch == "alice"):
Expand All @@ -43,7 +39,7 @@ label talk:
"Now is busy test later."

call talk_menu
jump talk_end
return

# Display a random phrase and then end the conversation
label talk_back:
Expand All @@ -65,7 +61,7 @@ label talk_back:
mc "When it comes back to me I'll let you know, bye."

$ del num
jump talk_end
return

# Quest "alice"

Expand Down
10 changes: 10 additions & 0 deletions game/tool/flags.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@ init python:
del flags[x]
del flags_to_del
return flags

def getFlags(flag_id: str) -> bool:
"""returns the value of the flag_id in flags"""
if (not flag_id in flags):
updateFlags(flags = flags, flag_keys = flag_keys)
if (not flag_id in flags):
renpy.log("Error(getFlags): in flags is not there flag_id: "+flag_id)
else:
return False
return flags[flag_id]
25 changes: 13 additions & 12 deletions game/tool/nav_label.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
default sp_bg_change_room = None
# Image of a closed door
define bg_loc = "location/loc-[tm.image_time].webp"
## Check if mc can come out
define block_goout_dialogue = _("Now is not the time to go outside")


# Wiki: https://github.com/DRincs-Productions/NQTR-toolkit/wiki/Navigation-and-Map#change-room
label change_room(room_id = None, after_exit=False):
label change_room(room_id = None):
# start an event if it exists
if room_id:
$ changeRoom(room_id = room_id, rooms = rooms, locations = locations)
Expand All @@ -13,7 +16,7 @@ label change_room(room_id = None, after_exit=False):
# # this step is to change the background based on the presence of a ch
# $ commitments_in_cur_location = getChsInThisLocation(cur_location.id)
# $ cur_events_location = getEventsInThisLocation(cur_location.id, routine)
call after_spending_time(after_exit = after_exit, is_check_event=True)
call after_spending_time(is_check_event=True)
return

# Wiki: https://github.com/DRincs-Productions/NQTR-toolkit/wiki/Navigation-and-Map#go-previous-room
Expand All @@ -25,25 +28,22 @@ label go_previous_room:
del temp_room
return

## Check if mc can come out
define block_goout_dialogue = _("Now is not the time to go outside")
label check_goout:
if(not flags.get("goout")):
"[block_goout_dialogue]"
call screen room_navigation
return

## Open the map or close the map
label open_map:
call check_goout
if(not getFlags("goout")):
"[block_goout_dialogue]"
return

if not cur_location:
call change_room(room_id = cur_room.location_id)
scene expression map_images[cur_location.map_id] as bg


if (not map_open):
scene expression map_images[cur_location.map_id] as bg
$ map_open = True
call screen room_navigation
return
## Close the map
label close_map:
python:
Expand All @@ -52,7 +52,8 @@ label close_map:
cur_room = room
map_open = False
scene expression (cur_room.bg) as bg
jump change_room
call change_room
return

# Is opened in change_room when a room id is in closed rooms
label closed_room_event:
Expand Down
Loading