Adding checkboxes to pin psyline
This commit is contained in:
parent
47eba63990
commit
f801f3a61e
2 changed files with 97 additions and 32 deletions
36
main.gd
36
main.gd
|
@ -10,14 +10,18 @@ extends Control
|
||||||
@onready var sound: Node2D = $Sounds
|
@onready var sound: Node2D = $Sounds
|
||||||
@onready var roll_dice: TextureButton = $Roll/Roll_dice
|
@onready var roll_dice: TextureButton = $Roll/Roll_dice
|
||||||
@onready var psyline_other: Control = $Psy_line_other
|
@onready var psyline_other: Control = $Psy_line_other
|
||||||
|
@onready var pin_other: CheckBox = $Others_panel/Pin
|
||||||
@onready var psyline_self: Control = $Psy_line_self
|
@onready var psyline_self: Control = $Psy_line_self
|
||||||
|
@onready var pin_self: CheckBox = $Self_panel/Pin
|
||||||
@onready var psyline_true: Control = $Psy_line_true
|
@onready var psyline_true: Control = $Psy_line_true
|
||||||
|
@onready var pin_true: CheckBox = $True_panel/Pin
|
||||||
@onready var traits: Control = $Traits
|
@onready var traits: Control = $Traits
|
||||||
@onready var keep_psy: CheckBox = $Roll/Keep_psy
|
@onready var keep_psy: CheckBox = $Roll/Keep_psy
|
||||||
@onready var keep_traits: CheckBox = $Roll/Keep_traits
|
@onready var keep_traits: CheckBox = $Roll/Keep_traits
|
||||||
@onready var language_choice: MenuButton = $Language
|
@onready var language_choice: MenuButton = $Language
|
||||||
@onready var soundplayer: EAEventBankMounter = $SoundPlayer
|
@onready var soundplayer: EAEventBankMounter = $SoundPlayer
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
lets_roll(seed, 0)
|
lets_roll(seed, 0)
|
||||||
|
@ -50,31 +54,33 @@ func lets_roll(chosen_seed: int, noise: bool = 1) -> void:
|
||||||
|
|
||||||
# Randomize psychology
|
# Randomize psychology
|
||||||
if not keep_psy.button_pressed:
|
if not keep_psy.button_pressed:
|
||||||
random.randomize()
|
if not pin_other.button_pressed:
|
||||||
var result_other: int = random.randi_range(0, possible_psy - 1)
|
random.randomize()
|
||||||
psyline_other.choice.select(result_other)
|
var result_other: int = random.randi_range(0, possible_psy - 1)
|
||||||
psyline_other.on_item_selected(result_other)
|
psyline_other.choice.select(result_other)
|
||||||
|
psyline_other.on_item_selected(result_other)
|
||||||
random.randomize()
|
if not pin_self.button_pressed:
|
||||||
var result_self: int = random.randi_range(0, possible_psy - 1)
|
random.randomize()
|
||||||
psyline_self.choice.select(result_self)
|
var result_self: int = random.randi_range(0, possible_psy - 1)
|
||||||
psyline_self.on_item_selected(result_self)
|
psyline_self.choice.select(result_self)
|
||||||
|
psyline_self.on_item_selected(result_self)
|
||||||
random.randomize()
|
if not pin_true.button_pressed:
|
||||||
var result_true: int = random.randi_range(0, possible_psy - 1)
|
random.randomize()
|
||||||
psyline_true.choice.select(result_true)
|
var result_true: int = random.randi_range(0, possible_psy - 1)
|
||||||
psyline_true.on_item_selected(result_true)
|
psyline_true.choice.select(result_true)
|
||||||
|
psyline_true.on_item_selected(result_true)
|
||||||
|
|
||||||
# Randomize trait
|
# Randomize trait
|
||||||
if not keep_traits.button_pressed:
|
if not keep_traits.button_pressed:
|
||||||
traits.populate()
|
traits.populate()
|
||||||
|
|
||||||
func update_language(new_language: String) -> void:
|
func update_language(new_language: String) -> void:
|
||||||
|
# Change the localisation on Translation Server
|
||||||
TranslationServer.set_locale(new_language)
|
TranslationServer.set_locale(new_language)
|
||||||
emit_signal("language_changed", new_language)
|
emit_signal("language_changed", new_language)
|
||||||
|
|
||||||
# Fonction appelée lorsque l'utilisateur sélectionne une option
|
|
||||||
func _on_menu_language_selected(id: int) -> void:
|
func _on_menu_language_selected(id: int) -> void:
|
||||||
|
# To call proper locale when button signal is emitted
|
||||||
match id:
|
match id:
|
||||||
0:
|
0:
|
||||||
TranslationServer.set_locale("fr")
|
TranslationServer.set_locale("fr")
|
||||||
|
|
93
main.tscn
93
main.tscn
|
@ -17,57 +17,90 @@ grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
script = ExtResource("1_gqole")
|
script = ExtResource("1_gqole")
|
||||||
|
|
||||||
|
[node name="SoundPlayer" type="Node" parent="."]
|
||||||
|
script = ExtResource("6_im5e0")
|
||||||
|
_audio_bank_resource = ExtResource("7_6knbw")
|
||||||
|
|
||||||
|
[node name="Sounds" type="Node2D" parent="."]
|
||||||
|
|
||||||
[node name="Others_panel" type="ColorRect" parent="."]
|
[node name="Others_panel" type="ColorRect" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 40.0
|
offset_left = 16.0
|
||||||
offset_top = 64.0
|
offset_top = 64.0
|
||||||
offset_right = 1136.0
|
offset_right = 1136.0
|
||||||
offset_bottom = 168.0
|
offset_bottom = 168.0
|
||||||
color = Color(0, 1, 0.203922, 0.478431)
|
color = Color(0, 1, 0.203922, 0.478431)
|
||||||
|
|
||||||
|
[node name="Pin" type="CheckBox" parent="Others_panel"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 8.0
|
||||||
|
offset_top = 64.0
|
||||||
|
offset_right = 32.0
|
||||||
|
offset_bottom = 88.0
|
||||||
|
tooltip_text = "PIN"
|
||||||
|
|
||||||
[node name="Self_panel" type="ColorRect" parent="."]
|
[node name="Self_panel" type="ColorRect" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 40.0
|
offset_left = 16.0
|
||||||
offset_top = 184.0
|
offset_top = 184.0
|
||||||
offset_right = 1136.0
|
offset_right = 1136.0
|
||||||
offset_bottom = 288.0
|
offset_bottom = 288.0
|
||||||
color = Color(1, 0.815852, 0, 0.478431)
|
color = Color(1, 0.815852, 0, 0.478431)
|
||||||
|
|
||||||
|
[node name="Pin" type="CheckBox" parent="Self_panel"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 8.0
|
||||||
|
offset_top = 64.0
|
||||||
|
offset_right = 32.0
|
||||||
|
offset_bottom = 88.0
|
||||||
|
tooltip_text = "PIN"
|
||||||
|
|
||||||
[node name="True_panel" type="ColorRect" parent="."]
|
[node name="True_panel" type="ColorRect" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 40.0
|
offset_left = 16.0
|
||||||
offset_top = 304.0
|
offset_top = 304.0
|
||||||
offset_right = 1136.0
|
offset_right = 1136.0
|
||||||
offset_bottom = 408.0
|
offset_bottom = 408.0
|
||||||
color = Color(0.159107, 0.480726, 1, 0.478431)
|
color = Color(0.159107, 0.480726, 1, 0.478431)
|
||||||
|
|
||||||
|
[node name="Pin" type="CheckBox" parent="True_panel"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 8.0
|
||||||
|
offset_top = 64.0
|
||||||
|
offset_right = 32.0
|
||||||
|
offset_bottom = 88.0
|
||||||
|
tooltip_text = "PIN"
|
||||||
|
|
||||||
[node name="People think" type="Label" parent="."]
|
[node name="People think" type="Label" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 64.0
|
offset_left = 64.0
|
||||||
offset_top = 88.0
|
offset_top = 80.0
|
||||||
offset_right = 209.0
|
offset_right = 232.0
|
||||||
offset_bottom = 104.0
|
offset_bottom = 112.0
|
||||||
theme = ExtResource("2_vc4v2")
|
theme = ExtResource("2_vc4v2")
|
||||||
text = "Who people think character is"
|
text = "Who people think character is"
|
||||||
|
autowrap_mode = 3
|
||||||
|
|
||||||
[node name="Character think" type="Label" parent="."]
|
[node name="Character think" type="Label" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 64.0
|
offset_left = 64.0
|
||||||
offset_top = 208.0
|
offset_top = 200.0
|
||||||
offset_right = 209.0
|
offset_right = 232.0
|
||||||
offset_bottom = 224.0
|
offset_bottom = 232.0
|
||||||
theme = ExtResource("2_vc4v2")
|
theme = ExtResource("2_vc4v2")
|
||||||
text = "Who character think he is"
|
text = "Who character think he is"
|
||||||
|
autowrap_mode = 3
|
||||||
|
|
||||||
[node name="Character is actually" type="Label" parent="."]
|
[node name="Character is actually" type="Label" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 64.0
|
offset_left = 64.0
|
||||||
offset_top = 336.0
|
offset_top = 320.0
|
||||||
offset_right = 209.0
|
offset_right = 232.0
|
||||||
offset_bottom = 352.0
|
offset_bottom = 352.0
|
||||||
theme = ExtResource("2_vc4v2")
|
theme = ExtResource("2_vc4v2")
|
||||||
text = "Character is actually
|
text = "Character is actually
|
||||||
"
|
"
|
||||||
|
autowrap_mode = 3
|
||||||
|
|
||||||
[node name="Slogan_label" type="Label" parent="."]
|
[node name="Slogan_label" type="Label" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
|
@ -79,6 +112,14 @@ theme = ExtResource("2_vc4v2")
|
||||||
text = "Slogan"
|
text = "Slogan"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="Slogan_label"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = -26.0
|
||||||
|
offset_top = -8.0
|
||||||
|
offset_right = 98.0
|
||||||
|
offset_bottom = 372.0
|
||||||
|
color = Color(1, 1, 1, 0.266667)
|
||||||
|
|
||||||
[node name="Motivation_label" type="Label" parent="."]
|
[node name="Motivation_label" type="Label" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 384.0
|
offset_left = 384.0
|
||||||
|
@ -99,6 +140,14 @@ theme = ExtResource("2_vc4v2")
|
||||||
text = "Goal"
|
text = "Goal"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="ColorRect2" type="ColorRect" parent="Goal_label"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = -18.0
|
||||||
|
offset_top = -8.0
|
||||||
|
offset_right = 106.0
|
||||||
|
offset_bottom = 372.0
|
||||||
|
color = Color(1, 1, 1, 0.266667)
|
||||||
|
|
||||||
[node name="Fear_label" type="Label" parent="."]
|
[node name="Fear_label" type="Label" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 640.0
|
offset_left = 640.0
|
||||||
|
@ -119,6 +168,14 @@ theme = ExtResource("2_vc4v2")
|
||||||
text = "Strategy"
|
text = "Strategy"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="ColorRect3" type="ColorRect" parent="Strategy_label"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = -18.0
|
||||||
|
offset_top = -8.0
|
||||||
|
offset_right = 106.0
|
||||||
|
offset_bottom = 372.0
|
||||||
|
color = Color(1, 1, 1, 0.266667)
|
||||||
|
|
||||||
[node name="Weakness_label" type="Label" parent="."]
|
[node name="Weakness_label" type="Label" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 896.0
|
offset_left = 896.0
|
||||||
|
@ -139,6 +196,14 @@ theme = ExtResource("2_vc4v2")
|
||||||
text = "Problem handling"
|
text = "Problem handling"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="ColorRect4" type="ColorRect" parent="Problem_handling_label"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = -10.0
|
||||||
|
offset_top = -8.0
|
||||||
|
offset_right = 114.0
|
||||||
|
offset_bottom = 372.0
|
||||||
|
color = Color(1, 1, 1, 0.266667)
|
||||||
|
|
||||||
[node name="Psy_line_other" parent="." instance=ExtResource("1_03r8p")]
|
[node name="Psy_line_other" parent="." instance=ExtResource("1_03r8p")]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchor_top = 0.086
|
anchor_top = 0.086
|
||||||
|
@ -241,9 +306,3 @@ item_count = 2
|
||||||
popup/item_0/text = "FRENCH"
|
popup/item_0/text = "FRENCH"
|
||||||
popup/item_1/text = "ENGLISH"
|
popup/item_1/text = "ENGLISH"
|
||||||
popup/item_1/id = 1
|
popup/item_1/id = 1
|
||||||
|
|
||||||
[node name="SoundPlayer" type="Node" parent="."]
|
|
||||||
script = ExtResource("6_im5e0")
|
|
||||||
_audio_bank_resource = ExtResource("7_6knbw")
|
|
||||||
|
|
||||||
[node name="Sounds" type="Node2D" parent="."]
|
|
||||||
|
|
Loading…
Reference in a new issue