diff --git a/game/script.rpy b/game/script.rpy index 10450c9..49c10d5 100644 --- a/game/script.rpy +++ b/game/script.rpy @@ -22,5 +22,6 @@ label start: ## make check, for event... call after_spending_time + call enable_notifyEx call screen room_navigation return diff --git a/game/tool/action.rpy b/game/tool/action.rpy index a246811..9d6faae 100644 --- a/game/tool/action.rpy +++ b/game/tool/action.rpy @@ -46,10 +46,9 @@ init -5 python: self.day_start = day_start self.rooms = rooms if rooms else [] if self.day_start < 0: - renpy.log("Warn: You have set day_start < 0, so it will be ignored") + log_info("You have set day_start < 0, so it will be ignored", renpy.get_filename_line()) if self.day_deadline < 0: - renpy.log( - "Warn: You have set day_deadline < 0, so it will be ignored") + log_info("You have set day_deadline < 0, so it will be ignored", renpy.get_filename_line()) def getActions(actions: dict[str, Act], room: Room, now_hour: int, cur_day: int) -> list[Act]: diff --git a/game/tool/action_talk.rpy b/game/tool/action_talk.rpy index 05180c5..5a6c950 100644 --- a/game/tool/action_talk.rpy +++ b/game/tool/action_talk.rpy @@ -50,7 +50,7 @@ init -11 python: elif not isNullOrEmpty(DEFAULT_LABEL_TALK): return DEFAULT_LABEL_TALK else: - renpy.log("Error: DEFAULT_LABEL_TALK is null or empty") + log_error("DEFAULT_LABEL_TALK is null or empty", renpy.get_filename_line()) return def getBackground(self) -> str: diff --git a/game/tool/action_talk_label.rpy b/game/tool/action_talk_label.rpy index c704a37..ee55a27 100644 --- a/game/tool/action_talk_label.rpy +++ b/game/tool/action_talk_label.rpy @@ -28,7 +28,7 @@ label talk: scene expression (talk_image) as bg if(talk_ch == None): - $ renpy.log("Error(talk): talk_ch is None") + $ log_error("talk_ch is None", renpy.get_filename_line()) return # Costume Code diff --git a/game/tool/button.rpy b/game/tool/button.rpy index b1eefea..be9170e 100644 --- a/game/tool/button.rpy +++ b/game/tool/button.rpy @@ -27,16 +27,13 @@ init -99 python: self.disabled = disabled self.hidden = hidden if (self.xalign != None and self.yalign == None): - renpy.log( - "Warn: xalign is set but yalign is not, so yalign set to 0") + log_warn("xalign is set but yalign is not, so yalign set to 0", renpy.get_filename_line()) self.yalign = 0 if (self.xalign == None and self.yalign != None): - renpy.log( - "Warn: yalign is set but xalign is not, so xalign set to 0") + log_warn("yalign is set but xalign is not, so xalign set to 0", renpy.get_filename_line()) self.xalign = 0 if (isNullOrEmpty(self.button_icon) and isNullOrEmpty(self.picture_in_background)): - renpy.log( - "Error: You have set button_icon and picture_in_background to None, this action will be ignored") + log_info("You have set button_icon and picture_in_background to None, this action will be ignored", renpy.get_filename_line()) def isButton(self) -> bool: """This is a button?""" @@ -66,7 +63,7 @@ init -99 python: elif(not isNullOrEmpty(self.picture_in_background)): return self.picture_in_background else: - renpy.log("Error: You have set button_icon and picture_in_background to None, this button will be ignored") + log_error("You have set button_icon and picture_in_background to None, this button will be ignored", renpy.get_filename_line()) return "" def getPictureInBackgroundOrDefault(self) -> str: @@ -75,7 +72,7 @@ init -99 python: elif(not isNullOrEmpty(self.button_icon)): return self.button_icon else: - renpy.log("Error: You have set button_icon and picture_in_background to None, this button will be ignored") + log_error("You have set button_icon and picture_in_background to None, this button will be ignored", renpy.get_filename_line()) return "" def getSelectedButtonOrDefault(self) -> str: @@ -88,7 +85,7 @@ init -99 python: elif(not isNullOrEmpty(self.picture_in_background)): return self.picture_in_background else: - renpy.log("Error: You have set button_icon_selected and picture_in_background_selected and button_icon and picture_in_background to None, this button will be ignored") + log_info("You have set button_icon_selected and picture_in_background_selected and button_icon and picture_in_background to None, this button will be ignored", renpy.get_filename_line()) return "" def getSelectedPictureInBackgroundOrDefault(self) -> str: @@ -101,5 +98,5 @@ init -99 python: elif(not isNullOrEmpty(self.button_icon)): return self.button_icon else: - renpy.log("Error: You have set picture_in_background_selected and button_icon_selected and button_icon and picture_in_background to None, this button will be ignored") + log_error("You have set picture_in_background_selected and button_icon_selected and button_icon and picture_in_background to None, this button will be ignored", renpy.get_filename_line()) return "" diff --git a/game/tool/flags.rpy b/game/tool/flags.rpy index e35808a..2b8269d 100644 --- a/game/tool/flags.rpy +++ b/game/tool/flags.rpy @@ -33,7 +33,7 @@ init python: 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) + log_error("in flags is not there flag_id: " + flag_id, renpy.get_filename_line()) else: return False return flags[flag_id] diff --git a/game/tool/nav_class.rpy b/game/tool/nav_class.rpy index 90414d2..1905af0 100644 --- a/game/tool/nav_class.rpy +++ b/game/tool/nav_class.rpy @@ -138,7 +138,7 @@ init -9 python: def getRoomById(room_id: str, rooms: list[Room]) -> None: """Wiki: https://github.com/DRincs-Productions/NQTR-toolkit/wiki/Navigation-and-Map#change-room """ if not room_id: - renpy.log("Warning: room_id is None") + log_warn("room_id is None", renpy.get_filename_line()) return for room in rooms: if room.id == room_id: @@ -149,7 +149,7 @@ init -9 python: def getLocationById(location_id: str, locations: list[Room]) -> None: """Wiki: https://github.com/DRincs-Productions/NQTR-toolkit/wiki/Navigation-and-Map#change-location """ if not location_id: - renpy.log("Error: location_id is None") + log_error("location_id is None", renpy.get_filename_line()) return for location in locations: if location.id == location_id: diff --git a/game/tool/nqtr_screens.rpy b/game/tool/nqtr_screens.rpy index e48a50c..7442066 100644 --- a/game/tool/nqtr_screens.rpy +++ b/game/tool/nqtr_screens.rpy @@ -688,12 +688,12 @@ label set_room_background(sp_bg_change_room = ""): # and in the "label" I use "return" an almost all cases the game will end. label after_return_from_room_navigation(label_name_to_call = ""): if isNullOrEmpty(label_name_to_call): - $ renpy.log("Error(after_return_from_room_navigation): label_name_to_call is empty") + $ log_error("label_name_to_call is empty", renpy.get_filename_line()) else: $ renpy.call(label_name_to_call) call set_background_nqtr # Custom Code: # ... call screen room_navigation - $ renpy.log("Error(after_return_from_room_navigation): thera is a anomaly in room_navigation. value: " + label_name_to_call) + $ log_error("thera is a anomaly in room_navigation. value: " + label_name_to_call, renpy.get_filename_line()) jump after_return_from_room_navigation diff --git a/game/tool/quest.rpy b/game/tool/quest.rpy index 201c5a2..11957b7 100644 --- a/game/tool/quest.rpy +++ b/game/tool/quest.rpy @@ -1,6 +1,8 @@ init python: from typing import Optional + new_quest_notify = _("A new quest began") + quest_updated_notify = _("The quest has been updated") class Goal(object): """Wiki: https://github.com/DRincs-Productions/NQTR-toolkit/wiki/Quest#goal""" @@ -19,10 +21,10 @@ init python: self.have = 0 if (self.have < 0): self.have = 0 - renpy.log("Warn: You have set have < 0, so it will be set to 0.") + log_warn("You have set have < 0, so it will be set to 0.", renpy.get_filename_line()) if (self.need < 0): self.need = 0 - renpy.log("Warn: You have set need < 0, so it will be set to 0.") + log_warn("You have set need < 0, so it will be set to 0.", renpy.get_filename_line()) def find(self, value: int = 1) -> bool: """Adds in element to the target, then checks the completion status. In case a need is null completes the mission. Returns True if the mission has been completed. @@ -32,7 +34,6 @@ init python: self.have += value if (self.isComplete()): self.complete = True - # Todo: notify description return True return False @@ -128,7 +129,6 @@ init python: self.active = True if (self.start_label_name != None): renpy.call(self.start_label_name) - # TODO: notify return True def respectAllRequests(self) -> bool: @@ -226,8 +226,8 @@ init python: def setDayNumberRequiredToStart(self, dayNumberRequired: int) -> None: """Wiki: https://github.com/DRincs-Productions/NQTR-toolkit/wiki/Quest#add-days-waiting-before-start """ if (not (self.id in number_stages_completed_in_quest)): - renpy.log("Warn: the Quest: "+self.id + - " not is in number_stages_completed_in_quest, so i update it") + log_warn("the Quest: "+self.id + + " not is in number_stages_completed_in_quest, so i update it", renpy.get_filename_line()) self.update() return current_task_stages[self.id].setDayNumberRequiredToStart(dayNumberRequired) @@ -257,6 +257,8 @@ init python: quest_stages[self.stages_id[n_stage]].addInCurrentQuestStages() current_quest_stages[self.id].start() number_stages_completed_in_quest[self.id] = n_stage + if (n_stage == 0): + notifyEx(new_quest_notify) return def nextStageOnlyIsCompleted(self) -> bool: @@ -276,12 +278,13 @@ init python: del current_task_stages[self.quest_id] return self.afterNextStage() + notifyEx(quest_updated_notify) return def afterNextStage(self) -> None: if (not (self.id in number_stages_completed_in_quest)): - renpy.log("Warn: the Quest: "+self.id + - " not is in number_stages_completed_in_quest, so i update it") + log_warn("the Quest: "+self.id + + " not is in number_stages_completed_in_quest, so i update it", renpy.get_filename_line()) self.update() if len(self.stages_id)-1 == number_stages_completed_in_quest[self.id]: current_quest_stages[self.id].completed = True diff --git a/game/tool/time_handler.rpy b/game/tool/time_handler.rpy index d5e4f5c..6cb6920 100644 --- a/game/tool/time_handler.rpy +++ b/game/tool/time_handler.rpy @@ -36,18 +36,16 @@ init -11 python: self.image_time = 0 self.update_image_time() if self.hour_of_new_day < 0: - renpy.log( - "Warn: You have set hour_of_new_day < 0, so it will be set to 0.") + log_warn("You have set hour_of_new_day < 0, so it will be set to 0.", renpy.get_filename_line()) self.hour_of_new_day = 0 if self.hour < 0: - renpy.log("Warn: You have set hour < 0, so it will be set to 0.") + log_warn("You have set hour < 0, so it will be set to 0.", renpy.get_filename_line()) self.hour = 0 if self.day < 0: - renpy.log("Warn: You have set day < 0, so it will be set to 0.") + log_warn("You have set day < 0, so it will be set to 0.", renpy.get_filename_line()) self.day = 0 if self.weekend_day < 0: - renpy.log( - "Warn: You have set weekend_day < 0, so it will be set to 6.") + log_warn("You have set weekend_day < 0, so it will be set to 6.", renpy.get_filename_line()) self.weekend_day = 6 def get_hour_name(self) -> str: