private void UpdateInstructions() { if (subElement == null) { return; } string lastInstructions = subElement.text; if (showInstructions && !textElement.IsFinished()) { if (textElement.manualUpdate) { if (textElement.IsAlmostFinished()) { subElement.text = LocalizationManager.Instance.GetLocalized("ENTER_TO_SEND_INPUT"); } else { subElement.text = LocalizationManager.Instance.GetLocalized("TYPE_TO_HACK_INPUT"); } } else { //if (!leftright) subElement.text = "WAIT"; } subElement.x = width - 2; subElement.y = height - 1; subElement.GoFromRight(); if (lastInstructions != subElement.text) { subElement.PunchIn(.6f); } } else { //this could backfire and null maybe? subElement.Kill(); } if (textElement.IsFinished()) { subElement.Kill(); } }
public override void Update() { base.Update(); if (startQueueCount < 0) { startQueueCount = queue.Count; } delay -= Time.unscaledDeltaTime; if (lines > maxlines) { ShiftAllMessages(-1); } if (customSkipTimeout < 0) { if (skippable) { SetChatQuitInstructions(LocalizationManager.Instance.GetLocalized(leaveChatLocalizedString)); } else { SetChatQuitInstructions(""); } } else { customSkipTimeout -= Time.unscaledDeltaTime; } bool waitForMessageToEnd = false; if (messages.Count > 0) { if (messages[messages.Count - 1] as SHGUIprompter != null && (messages[messages.Count - 1] as SHGUIprompter).manualUpdate) { waitForMessageToEnd = true; SHGUIprompter prom = messages[messages.Count - 1] as SHGUIprompter; if (prom.noInteractionTimer > 1.5f) { if (prom.IsAlmostFinished()) { UpdateInstructions(enterInstruction); } else { UpdateInstructions(typeInstruction); } } else { UpdateInstructions(""); } } if (messages[messages.Count - 1] as SHGUIguruchatwindow != null) { waitForMessageToEnd = true; } } if (waitForMessageToEnd) { if ((messages[messages.Count - 1] as SHGUIprompter != null) && (messages[messages.Count - 1] as SHGUIprompter).IsFinished()) { DisplayNextMessage(); } else if (messages[messages.Count - 1] as SHGUIguruchatwindow != null) { SHGUIguruchatwindow g = messages[messages.Count - 1] as SHGUIguruchatwindow; if (g.finished == true) { DisplayNextMessage(); } } } else { UpdateInstructions(""); if (delay < 0) { DisplayNextMessage(); } } for (int i = 0; i < messages.Count; ++i) { SHGUIguruchatwindow g = messages[i] as SHGUIguruchatwindow; if (g != null) { g.x = chatMargin; if (!g.leftright) { g.x = SHGUI.current.resolutionX - chatMargin - g.width; } } } }