disables process mode when unused
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5w2xu"]
|
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5w2xu"]
|
||||||
|
|
||||||
[node name="dialog_bubble" type="CanvasLayer"]
|
[node name="dialog_bubble" type="CanvasLayer"]
|
||||||
|
process_mode = 4
|
||||||
script = ExtResource("1_xtj1q")
|
script = ExtResource("1_xtj1q")
|
||||||
metadata/_edit_use_anchors_ = true
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
@@ -113,4 +114,5 @@ metadata/_edit_lock_ = true
|
|||||||
stream = ExtResource("5_w6jq7")
|
stream = ExtResource("5_w6jq7")
|
||||||
bus = &"UI"
|
bus = &"UI"
|
||||||
|
|
||||||
|
[connection signal="visibility_changed" from="." to="." method="OnVisibilityChanged"]
|
||||||
[connection signal="timeout" from="typewriter_timer" to="." method="OnTypewriterTimerTimeout"]
|
[connection signal="timeout" from="typewriter_timer" to="." method="OnTypewriterTimerTimeout"]
|
||||||
|
@@ -53,6 +53,12 @@ public partial class dialog_bubble : CanvasLayer
|
|||||||
dlgLines = dlgLines.AsGodotArray()[GD.RandRange(0, dlgLines.AsGodotArray().Count - 1)];
|
dlgLines = dlgLines.AsGodotArray()[GD.RandRange(0, dlgLines.AsGodotArray().Count - 1)];
|
||||||
//TODO:copy a clean default array and remove already used indexes and copy from clean array when its empty
|
//TODO:copy a clean default array and remove already used indexes and copy from clean array when its empty
|
||||||
}
|
}
|
||||||
|
public void OnVisibilityChanged()
|
||||||
|
{
|
||||||
|
if (Visible)
|
||||||
|
ProcessMode = ProcessModeEnum.Inherit;
|
||||||
|
else ProcessMode = ProcessModeEnum.Disabled;
|
||||||
|
}
|
||||||
public override void _Process(double delta)
|
public override void _Process(double delta)
|
||||||
{
|
{
|
||||||
DialogControlls();
|
DialogControlls();
|
||||||
@@ -60,9 +66,9 @@ public partial class dialog_bubble : CanvasLayer
|
|||||||
}
|
}
|
||||||
public void DialogControlls()
|
public void DialogControlls()
|
||||||
{
|
{
|
||||||
if (Input.IsActionJustPressed("ui_cancel") && Visible) richText.VisibleCharacters = richText.Text.Length;
|
if (Input.IsActionJustPressed("ui_cancel")) richText.VisibleCharacters = richText.Text.Length;
|
||||||
|
|
||||||
if (Input.IsActionJustPressed("ui_accept") && Visible && GetNode<PanelContainer>("box/panel_container").Visible == false
|
if (Input.IsActionJustPressed("ui_accept") && GetNode<PanelContainer>("box/panel_container").Visible == false
|
||||||
&& richText.VisibleCharacters == -1 | Regex.Replace(richText.Text, @"\[[^]]+\]", "").Length <= richText.VisibleCharacters)
|
&& richText.VisibleCharacters == -1 | Regex.Replace(richText.Text, @"\[[^]]+\]", "").Length <= richText.VisibleCharacters)
|
||||||
{
|
{
|
||||||
if (dlgPointer < dlgLines.AsGodotArray().Count)
|
if (dlgPointer < dlgLines.AsGodotArray().Count)
|
||||||
|
Reference in New Issue
Block a user