Click to continue, Only pause when playing
This commit is contained in:
@@ -65,7 +65,7 @@ func _disable_plugin():
|
||||
|
||||
# Add ourselves to the list of dialog managers
|
||||
func _enable_plugin():
|
||||
print("Enabling plugin Escoria Dialog Simple")
|
||||
print("Enabling plugin RTMI Dialog Simple")
|
||||
|
||||
if EscoriaPlugin.register_dialog_manager(self, MANAGER_CLASS):
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
@@ -117,6 +117,14 @@ func _enable_plugin():
|
||||
}
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY,
|
||||
RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY_DEFAULT_VALUE,
|
||||
{
|
||||
"type": TYPE_INT
|
||||
}
|
||||
)
|
||||
|
||||
var left_click_actions_string: String = ",".join(left_click_actions)
|
||||
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
|
||||
@@ -10,7 +10,9 @@ const TEXT_TIME_PER_LETTER_MS_FAST = "%s/text_time_per_fast_letter_ms" % SETTING
|
||||
const TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE = 25
|
||||
const READING_SPEED_IN_WPM = "%s/reading_speed_in_wpm" % SETTINGS_ROOT
|
||||
const READING_SPEED_IN_WPM_DEFAULT_VALUE = 200
|
||||
const CLEAR_TEXT_BY_CLICK_ONLY_KEY = "clear_text_by_click_only"
|
||||
const CLEAR_TEXT_BY_CLICK_ONLY = "%s/clear_text_by_click_only" % SETTINGS_ROOT
|
||||
const CLEAR_TEXT_BY_CLICK_ONLY_DEFAULT_VALUE = false
|
||||
const LEFT_CLICK_ACTION = "%s/left_click_action" % SETTINGS_ROOT
|
||||
|
||||
const STOP_TALKING_ANIMATION_ON = "%s/stop_talking_animation_on" % SETTINGS_ROOT
|
||||
|
||||
@@ -232,7 +232,9 @@ func _on_dialog_finished():
|
||||
$Timer.stop()
|
||||
|
||||
# Only trigger to clear the text if we aren't limiting the clearing trigger to a click.
|
||||
if not ESCProjectSettingsManager.get_setting(RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY):
|
||||
var custom_setings = escoria.settings_manager.get_settings()["custom_settings"]
|
||||
var click_to_continue = custom_setings[RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY_KEY] if custom_setings.has(RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY_KEY) else false
|
||||
if not click_to_continue:
|
||||
say_finished.emit()
|
||||
|
||||
|
||||
|
||||
@@ -104,7 +104,6 @@ func _ready():
|
||||
get_video_player().connect("finished", Callable(self, "show_ui"))
|
||||
|
||||
|
||||
|
||||
func _enter_tree():
|
||||
var room_selector_parent = dev_tools_node
|
||||
|
||||
@@ -153,7 +152,10 @@ func toggle_room_selector_visibility():
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
super(event)
|
||||
if escoria.inputs_manager.input_mode == escoria.inputs_manager.INPUT_NONE:
|
||||
return
|
||||
if event.is_action_pressed("ui_cancel") && escoria.current_state == escoria.GAME_STATE.DEFAULT:
|
||||
request_pause_menu.emit()
|
||||
if escoria.get_escoria().is_ready_for_inputs():
|
||||
if event.is_action_pressed("ui_show_room_selector"):
|
||||
toggle_room_selector_visibility()
|
||||
@@ -433,20 +435,23 @@ func pause_game():
|
||||
escoria.set_game_paused(true)
|
||||
play_pause_music()
|
||||
|
||||
func apply_custom_settings(custom_settings: Dictionary):
|
||||
if custom_settings.has("speech_speed"):
|
||||
escoria.logger.info(
|
||||
self,
|
||||
"custom setting value loaded: %s."
|
||||
% str(custom_settings["speech_speed"])
|
||||
)
|
||||
|
||||
|
||||
func get_custom_data() -> Dictionary:
|
||||
return {
|
||||
"ui_type": "rtmi-ui"
|
||||
}
|
||||
|
||||
func apply_custom_settings(custom_settings: Dictionary):
|
||||
if custom_settings.has(RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY_KEY):
|
||||
escoria.logger.info(
|
||||
self,
|
||||
"custom setting value loaded: %s."
|
||||
% str(custom_settings[RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY_KEY])
|
||||
)
|
||||
escoria.settings_manager.set(RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY, custom_settings["clear_text_by_click_only"] )
|
||||
#ESCProjectSettingsManager.set_setting(RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY,custom_settings[RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY_KEY])
|
||||
|
||||
|
||||
|
||||
# Update the tooltip position
|
||||
func update_tooltip_following_mouse_position(tooltip: RTMIRichTooltip):
|
||||
|
||||
@@ -40,7 +40,9 @@ func initialize_options(p_settings):
|
||||
_options.get_node("speech_volume").value = p_settings["speech_volume"]
|
||||
|
||||
_options.get_node("fullscreen").set_pressed_no_signal(p_settings["fullscreen"])
|
||||
#_options.get_node("click_to_continue").set_pressed_no_signal(p_settings["click_to_continue"])
|
||||
|
||||
var click_to_continue = p_settings["custom_settings"].get(RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY_KEY) if p_settings["custom_settings"].has(RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY_KEY) else false
|
||||
_options.get_node("click_to_continue").set_pressed_no_signal(click_to_continue)
|
||||
|
||||
|
||||
# The language was changed
|
||||
@@ -140,8 +142,8 @@ func _on_fullscreen_toggled(toggle_pressed: bool) -> void:
|
||||
|
||||
# Save the settings
|
||||
func _on_apply_pressed():
|
||||
escoria.settings_manager.custom_settings[SPEECH_SPEED_SETTING] = ESCProjectSettingsManager.get_setting(
|
||||
RTMISimpleDialogSettings.READING_SPEED_IN_WPM
|
||||
escoria.settings_manager.custom_settings[RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY_KEY] = ESCProjectSettingsManager.get_setting(
|
||||
RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY
|
||||
)
|
||||
escoria.settings_manager.save_settings()
|
||||
changed = false
|
||||
|
||||
@@ -20,3 +20,4 @@ APPLY,Apply,Appliquer,Anwenden,Aplicar
|
||||
CONFIRM_OVERWRITE,Overwrite the savegame?,Écraser la sauvegarde ?,Soll das Spiel überschrieben werden?, ¿Sobreescribir la partida?
|
||||
YES,Yes,Oui,Ja,Sí
|
||||
NO,No,Non,Nein,No
|
||||
CLICK_TO_CONTINUE,Click to continue dialog,,,Click para avanzar dialogos
|
||||
|
Reference in New Issue
Block a user