From 37faa88cdbea9d988aef6268aaf10a7ebeee6d57 Mon Sep 17 00:00:00 2001 From: Vamist Date: Sun, 27 Dec 2020 13:12:26 +0000 Subject: [PATCH] Can no longer use button to reset text progress --- CoreScripts/Character/BlobCharacter.as | 4 ++-- CoreScripts/Character/CharacterCore.as | 16 ++++++++++------ CoreScripts/Character/InteractableCharacter.as | 4 ---- CoreScripts/Rules/CharacterHandler.as | 10 ---------- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/CoreScripts/Character/BlobCharacter.as b/CoreScripts/Character/BlobCharacter.as index 862f03c..dc72c6b 100644 --- a/CoreScripts/Character/BlobCharacter.as +++ b/CoreScripts/Character/BlobCharacter.as @@ -206,7 +206,7 @@ class BlobCharacterHandler for (int a = 0; a < BlobList.length; a++) { BlobCharacter@ char = BlobList[a]; - if (char !is null && char.CurrentText != "") + if (char !is null && char.CurrentlyInteracting) { @CharacterToRender = char; return true; @@ -225,7 +225,7 @@ class BlobCharacterHandler CharacterToRender.Update(); - if (CharacterToRender.FinishedTalking) + if (!CharacterToRender.CurrentlyInteracting) @CharacterToRender = @null; } diff --git a/CoreScripts/Character/CharacterCore.as b/CoreScripts/Character/CharacterCore.as index 1fcc233..965c362 100644 --- a/CoreScripts/Character/CharacterCore.as +++ b/CoreScripts/Character/CharacterCore.as @@ -29,9 +29,9 @@ mixin class Character // - Used to know if text is done updating bool FinishedWriting = false; - // Is the client done talking to us? + // We are interacting with a player // - Used to end talking to the character (gui goes bye) - bool FinishedTalking = false; + bool CurrentlyInteracting = false; // CurrentRenderOutput Total length including special tokens that are not outputted // - Used when updating text so we can grab the correct substr @@ -113,8 +113,8 @@ mixin class Character void ResetTalkVars() { + CurrentlyInteracting = false; FinishedWriting = false; - FinishedTalking = false; TextRenderLength = 0; WriteSpeed = 1; CurrentRenderOutput = ""; @@ -168,13 +168,17 @@ mixin class Character // Temp bind with buttons void ButtonPress() { - ResetTalkVars(); + if (!CurrentlyInteracting) + { + ResetTalkVars(); + CurrentlyInteracting = true; + } } void Update() { CBlob@ blob = getLocalPlayerBlob(); - if (blob is null || FinishedTalking) + if (blob is null || !CurrentlyInteracting) return; @@ -196,7 +200,7 @@ mixin class Character else { // User stops talking, gui closes - FinishedTalking = true; + CurrentlyInteracting = false; } } else diff --git a/CoreScripts/Character/InteractableCharacter.as b/CoreScripts/Character/InteractableCharacter.as index b1806b8..121c88d 100644 --- a/CoreScripts/Character/InteractableCharacter.as +++ b/CoreScripts/Character/InteractableCharacter.as @@ -27,10 +27,6 @@ void TryingToTalk(CBlob@ this, CBlob@ caller) { BlobCharacter@ char = getCharacter(this); char.ButtonPress(); - - CBitStream cbs = CBitStream(); - cbs.write_u16(this.getNetworkID()); - getRules().SendCommand(getRules().getCommandID("character_force_talk"), cbs); } diff --git a/CoreScripts/Rules/CharacterHandler.as b/CoreScripts/Rules/CharacterHandler.as index 8f02ffc..e3758a0 100644 --- a/CoreScripts/Rules/CharacterHandler.as +++ b/CoreScripts/Rules/CharacterHandler.as @@ -18,9 +18,6 @@ void onInit(CRules@ this) // This will be called when a blob dies // This is required unless you want the game to crash this.addCommandID("character_unbound"); - // This will force the current character to become - // Current render target - this.addCommandID("character_force_talk"); onRestart(this); @@ -101,13 +98,6 @@ void onCommand(CRules@ this, u8 cmd, CBitStream@ params) Handler.RemoveCharacter(blob); } - else if (cmd == this.getCommandID("character_force_talk")) - { - u16 networkId = params.read_u16(); - CBlob@ blob = getBlobByNetworkID(networkId); - - Handler.SetBlobToRender(blob); - } } void onRender(CRules@ this) -- knotmirror 0.0.1