Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Marge fixes form question branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremi360 committed Jul 7, 2019
1 parent 2301208 commit b4468c8
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 21 deletions.
12 changes: 6 additions & 6 deletions addons/Rakugo/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,12 @@ func get_value(var_name:String):
return null

func get_node_value(var_name:String) -> Dictionary:
var s = NodeLink.new("").var_prefix
return get_value(s + var_name)
var p = NodeLink.new("").var_prefix
return get_value(p + var_name)

func get_avatar_value(var_name:String) -> Dictionary:
var s = Avatar.new("").var_prefix
return get_value(s + var_name)
var p = Avatar.new("").var_prefix
return get_value(p + var_name)

## returns type of variable defined using define
func get_type(var_name:String) -> int:
Expand Down Expand Up @@ -736,13 +736,13 @@ func _get_history_id() -> int:
## id_of_current_scene is id to scene defined in scenes_links or full path to scene
func jump(
id_of_scene:String, node_name:String,
dialog_name:String, state := 0
dialog_name:String, state := 0, force_reload := false
) -> void:

$Jump.invoke(
id_of_scene,
node_name, dialog_name,
state
state, force_reload
)

## use this to assign beginning scene and dialog
Expand Down
13 changes: 9 additions & 4 deletions addons/Rakugo/nodes/rakugo_anim_player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func _ready() -> void:

add_to_group("save", true)
return

Rakugo.connect("play_anim", self, "_on_play")
Rakugo.connect("stop_anim", self, "_on_stop")

Expand Down Expand Up @@ -47,13 +47,18 @@ func _on_stop(id : String, reset : bool) -> void:
seek(0, true)

func on_save():
node_link = Rakugo.get_node_link(node_id)
if not node_link:
prints("error with saveing:" , node_id)
return

node_link.value["anim_name"] = current_animation
node_link.value["is_playing"] = is_playing()

func on_load(game_version:String) -> void:
node_link = Rakugo.get_node_link(node_id)

if not node_link:
prints("error with loading:" , node_id)
return

if "is_playing" in node_link.value:
if node_link.value["is_playing"]:
if "anim_name" in node_link.value:
Expand Down
11 changes: 8 additions & 3 deletions addons/Rakugo/nodes/rakugo_audio_player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,18 @@ func _on_stop(id : String) -> void:
stop()

func on_save():
node_link = Rakugo.get_node_link(node_id)
if not node_link:
prints("error with saveing:" , node_id)

This comment has been minimized.

Copy link
@Sslaxx

Sslaxx Jul 7, 2019

For printing error messages I'd suggest using printerr instead?

This comment has been minimized.

Copy link
@Jeremi360

Jeremi360 Jul 7, 2019

Author Collaborator

O, thanks for suggestion I didn't know about printerr, I will use it next time.

This comment has been minimized.

Copy link
@Jeremi360

Jeremi360 Jul 7, 2019

Author Collaborator

I try it, but it for now it works like just print()
godotengine/godot#8645
And acording to ⬆️ I should try use push_error() and push_warning()

return

node_link.value["is_playing"] = is_playing()
node_link.value["from_pos"] = last_pos

func on_load(game_version:String) -> void:
node_link = Rakugo.get_node_link(node_id)

if not node_link:
prints("error with loading:" , node_id)
return

if "is_playing" in node_link:
if node_link.value["is_playing"]:
var last_pos = node_link.value["from_pos"]
Expand Down
2 changes: 0 additions & 2 deletions addons/Rakugo/nodes/rakugo_avatar.gd
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ func _exit_tree() -> void:
Rakugo.variables.erase(id)

func on_save() -> void:
avatar_link = Rakugo.get_avatar_link(avatar_id)
avatar_link.value["state"] = _state

func on_load(game_version:String) -> void:
avatar_link = Rakugo.get_avatar_link(avatar_id)
_state = avatar_link.value["state"]
_on_show(avatar_id, _state , {})

Expand Down
10 changes: 8 additions & 2 deletions addons/Rakugo/nodes/rakugo_control.gd
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ func on_save() -> void:
remove_from_group("save")
return

node_link = Rakugo.get_node_link(node_id)
if not node_link:
prints("error with saveing:" , node_id)
return

node_link.value["visible"] = visible
node_link.value["state"] = _state
node_link.value["show_args"] = last_show_args
Expand All @@ -119,7 +122,10 @@ func on_load(game_version:String) -> void:
if not _register:
return

node_link = Rakugo.get_node_link(node_id)
if not node_link:
prints("error with loading:" , node_id)
return

visible = node_link.value["visible"]

if visible:
Expand Down
11 changes: 8 additions & 3 deletions addons/Rakugo/nodes/rakugo_node2d.gd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func _ready() -> void:
node_link = Rakugo.node_link(node_id, get_path())

else:
node_link.node_path = get_path()
node_link.value.node_path = get_path()

add_to_group("save", true)

Expand Down Expand Up @@ -99,13 +99,18 @@ func _exit_tree() -> void:
Rakugo.variables.erase(id)

func on_save() -> void:
node_link = Rakugo.get_node_link(node_id)
if not node_link:
prints("error with saveing:" , node_id)
return

node_link.value["visible"] = visible
node_link.value["state"] = _state
node_link.value["show_args"] = last_show_args

func on_load(game_version:String) -> void:
node_link = Rakugo.get_node_link(node_id)
if not node_link:
prints("error with loading:" , node_id)
return

if "visible" in node_link.value:
visible = node_link.value["visible"]
Expand Down
9 changes: 8 additions & 1 deletion addons/Rakugo/nodes/rakugo_spatial.gd
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,19 @@ func _exit_tree() -> void:
Rakugo.variables.erase(id)

func on_save() -> void:
if not node_link:
prints("error with saveing:" , node_id)
return

node_link.value["visible"] = visible
node_link.value["state"] = _state
node_link.value["show_args"] = last_show_args

func on_load(game_version:String) -> void:
node_link = Rakugo.get_node_link(node_id)
if not node_link:
prints("error with loading:" , node_id)
return

visible = node_link.value["visible"]

if visible:
Expand Down

0 comments on commit b4468c8

Please sign in to comment.