Skip to content

Commit

Permalink
Merge pull request #8 from Jeremi360/master
Browse files Browse the repository at this point in the history
Add can_save variable to Rakugo and use it in gui and combat
  • Loading branch information
Jeremi360 authored Aug 13, 2020
2 parents e09b436 + 12f9a72 commit 9477665
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions rakugo-rpg/addons/Rakugo/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ var can_alphanumeric := true
var emoji_size := 16
var skipping := false
var current_dialogs := {}
var can_save := true

const skip_types := [
StatementType.SAY,
Expand Down
4 changes: 4 additions & 0 deletions rakugo-rpg/game/rpg/CombatArea/CombatArea.gd
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ func spawn_party(array: Array) -> Array:

func spawn_enemies(array: Array) -> Array:
return spawn("Enemy", array)

# turn off saveing during combat
func _on_CombatArea_visibility_changed():
Rakugo.can_save = !visible
1 change: 1 addition & 0 deletions rakugo-rpg/game/rpg/CombatArea/CombatArea.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ margin_bottom = 286.0
size_flags_horizontal = 4
text = "Close"
icon = ExtResource( 6 )
[connection signal="visibility_changed" from="." to="." method="_on_CombatArea_visibility_changed"]
[connection signal="toggled" from="CombatPanel/HBox/SkillTypesGrid/Attack" to="CombatPanel" method="_on_Attack_toggled"]
[connection signal="toggled" from="CombatPanel/HBox/SkillTypesGrid/Magic" to="CombatPanel" method="_on_Magic_toggled"]
[connection signal="toggled" from="CombatPanel/HBox/SkillTypesGrid/Special" to="CombatPanel" method="_on_Special_toggled"]
Expand Down
2 changes: 1 addition & 1 deletion rakugo-rpg/game/rpg/CombatArea/SpawnPoint.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ tracks/7/keys = {
position = Vector2( 180.203, 433.823 )
script = ExtResource( 5 )
__meta__ = {
"_gizmo_extents_": 104.7
"_gizmo_extents_": 50.0
}

[node name="VBoxContainer" type="VBoxContainer" parent="."]
Expand Down
7 changes: 5 additions & 2 deletions rakugo-rpg/gui/Screens/Screens.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export onready var qyes_button = $QuitBox/HBoxContainer/Yes
var current_node: Node = self
var in_game_gui: Node
var viewport_con : Control

onready var new_game_button: Button = get_page("NewGame")
onready var continue_button: Button = get_page("Continue")
onready var return_button: Button = get_page("Return")
Expand Down Expand Up @@ -126,9 +127,11 @@ func history_menu():
func _on_visibility_changed():
blur_shader.set_shader_param("radius", 0)
if visible:

if Rakugo.started:
blur_shader.set_shader_param("radius", 5)

save_button.disabled = !Rakugo.can_save

get_tree().paused = true
in_game_gui.hide()
Expand Down Expand Up @@ -205,7 +208,7 @@ func _on_Quests_pressed():

# if press "yes" on quit page
func _on_Yes_pressed():
if Rakugo.started:
if Rakugo.started and Rakugo.can_save:
Rakugo.savefile("auto")
Rakugo.save_global_history()

Expand Down
13 changes: 5 additions & 8 deletions rakugo-rpg/gui/Screens/Screens.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=23 format=2]

[ext_resource path="res://themes/question/question.tres" type="Theme" id=1]
[ext_resource path="res://themes/rpgm_like/rpgm_like.tres" type="Theme" id=1]
[ext_resource path="res://gui/Screens/Screens.gd" type="Script" id=2]
[ext_resource path="res://ubuntu-font-family/UB32outline.tres" type="DynamicFont" id=3]
[ext_resource path="res://addons/Rakugo/nodes/controls/rakugo_var_label.gd" type="Script" id=4]
Expand All @@ -16,10 +16,6 @@
[ext_resource path="res://gui/Labels/dialogue_text.tscn" type="PackedScene" id=14]
[ext_resource path="res://gui/Screens/QuitBox.tscn" type="PackedScene" id=15]





[sub_resource type="ButtonGroup" id=1]

[sub_resource type="Animation" id=2]
Expand Down Expand Up @@ -4292,8 +4288,8 @@ rect_min_size = Vector2( 100, 40 )
size_flags_horizontal = 3
size_flags_vertical = 3
bbcode_enabled = true
bbcode_text = "[right]Rakugo 2.0.0"
text = "Rakugo 2.0.0"
bbcode_text = "[right]Rakugo [rakugo_version]"
text = "Rakugo [rakugo_version]"
script = ExtResource( 5 )
rakugo_text = "{right}Rakugo [rakugo_version]"
vars_names = [ "rakugo_version" ]
Expand Down Expand Up @@ -4525,10 +4521,11 @@ margin_bottom = 457.0
focus_mode = 0
size_flags_horizontal = 3
size_flags_vertical = 3
bbcode_text = ""
text = ""
scroll_active = true
selection_enabled = false
script = ExtResource( 5 )
rakugo_text_file = "res://addons/Rakugo/credits.txt"

[node name="QuitBox" parent="." instance=ExtResource( 15 )]
visible = false
Expand Down

0 comments on commit 9477665

Please sign in to comment.