void UpdateTutorial() { if (!alive) { tutorialView.Kill(); } }
void ShowAnimationStep(int step) { if (step <= lastShownStep) { return; } if (step == 0) { //AddSubView(loading); } else if (step == 1) { loading.Kill(); prompters.hidden = false; AddSubView(prompters); } else if (step == 2) { AddSubView(dude); } else if (step == 3) { dude.Kill(); prompters.Kill(); AddSubView(finalAnimation); } else if (step == 4) { AddSubView(instruction); } lastShownStep = step; }
void AddSuperView() { return; if (superView != null) { superView.Kill(); } if (hotView != null) { hotView.Kill(); } superView = new SHGUItext(SHGUI.current.GetASCIIartByName("supersmall"), 8, 8, '0'); superView.overrideFadeInSpeed = 2f; AddSubView(superView); }
public void HideChatFrames() { if (frame != null) { frame.Kill(); } HideChatLabels(); frameOffset = 0; }
public override void ReactToInputKeyboard(SHGUIinput key) { if (key == SHGUIinput.enter) { if (IsTherePopup()) { popup.Kill(); } else { skipToPhase = phase + 1; } } if (key == SHGUIinput.esc) { SHGUI.current.PopView(); } }
public void Popup(string msg, int originx, int originy, bool overrideLast = true) { if (lastPopup != null && overrideLast) { lastPopup.Kill(); } int X = camerax + originx + 2; int Y = cameray + originy; SHGUItempview pop = new SHGUItempview(.75f); SHGUIview text = new SHGUItext(msg, X, Y, 'w'); pop.AddSubView(new SHGUIrect(X, Y, X + msg.Length - 1, Y, 'z', ' ', 2)); pop.AddSubView(text); this.AddSubViewBottom(pop); lastPopup = pop; }
void ShowNextItemWhenReady() { currentTimer -= Time.unscaledDeltaTime; bool ready = (currentTimer < 0); if (currentView != null && currentView is SHGUIguruchatwindow) { if (!(currentView as SHGUIguruchatwindow).finished) { ready = false; currentTimer += Time.unscaledDeltaTime; } } if (currentView != null && currentView is SHGUImultichat) { if (!(currentView as SHGUImultichat).finished) { ready = false; currentTimer += Time.unscaledDeltaTime; } } if (ready) { if (timers.Count > 0) { if (currentView != null) { currentView.Kill(); } currentView = queue[0]; currentTimer = timers[0]; queue.RemoveAt(0); timers.RemoveAt(0); AddSubView(currentView); } else { Kill(); } } }
public void HideChatLabels() { //if (frame != null) frame.Kill (); if (appname != null) { appname.Kill(); } if (instructions != null) { instructions.Kill(); } if (chatQuitInstructions != null) { chatQuitInstructions.Kill(); } if (clock != null) { clock.Kill(); } }
public void PopView() { if (views.Count > 0 && views.Last() != null) { views.Last().OnExit(); } bool seethrough = false; SHGUIview interactable = GetInteractableView(); if (interactable != null) { seethrough = !interactable.dontDrawViewsBelow; interactable.Kill(); } //SHGUI.current.PlayConfirm(); if (views.Count == 0) { PopViewFromQueue(); } interactable = GetInteractableView(); if (interactable != null) { if (!seethrough) { GetInteractableView().PunchIn(); } else { GetInteractableView().PunchIn(.9f); } } }
void UpdateCurrentPhase() { if (phase == 0) //brain gets scanned in Redraw(...) { if (Progress(10f)) { AddSubView(brainView); } } else if (phase == 1) //memory is prepared { if (Progress(1f)) { AddSubView(memoryFrame); memoryFrame.x = cypherBrainView.x; memoryFrame.y = cypherBrainView.y; } } else if (phase == 2) //brain and memory converge { if (!Wait(1.5f)) { return; } ShowPopup(" Are you sure? "); brainView.x = (int)Mathf.Lerp(brainViewSideX, brainViewCenterX, progress); cypherBrainView.x = (int)Mathf.Lerp(cypherBrainViewSideX, cypherBrainViewCenterX, progress); memoryFrame.x = cypherBrainView.x; if (Progress(2f)) { brainView.x = brainViewCenterX; cypherBrainView.x = cypherBrainViewCenterX; memoryFrame.x = cypherBrainView.x; SetSubtitle(" you may experience\n slight discomfort ", 'z'); } } else if (phase == 3) //brain dump in Redraw(...) { if (!Wait(0.5f)) { return; } Progress(4f); } else if (phase == 4) //brain dump in Redraw(...) { if (!Wait(0.5f)) { return; } Progress(4f); } else if (phase == 5) //brain dump in Redraw(...) { if (!Wait(0.5f)) { return; } Progress(4f); } else if (phase == 6) //brain dump in Redraw(...) { if (!Wait(0.5f)) { return; } if (Progress(4f)) { SetSubtitle("", 'w'); cypherBrainView.text = SHGUI.current.GetASCIIartByName("CypherBrain01"); AddSubView(brainCover); brainCover.x = brainView.x; brainCover.y = brainView.y; AddSubView(cypherBrainView); } } else if (phase == 7) // brain and memory diverge { if (!Wait(2f)) { return; } brainView.x = (int)Mathf.Lerp(brainViewCenterX, brainViewSideX, progress); cypherBrainView.x = (int)Mathf.Lerp(cypherBrainViewCenterX, cypherBrainViewSideX, progress); memoryFrame.x = cypherBrainView.x; brainCoverItself.SetChar(GetPulsatingChar()); brainCover.x = brainView.x; brainCover.y = brainView.y; if (Progress(2.5f)) { brainView.x = brainViewSideX; cypherBrainView.x = cypherBrainViewSideX; memoryFrame.x = cypherBrainView.x; } } else if (phase == 8) //connection persists { brainCover.x = brainView.x; brainCover.y = brainView.y; memoryFrameGlow.SetChar(GetPulsatingChar()); brainCoverItself.SetChar(GetPulsatingChar()); Progress(2f); } else if (phase == 9) //connection blinks fast for a moment { memoryFrameGlow.SetChar(GetPulsatingChar(10f)); brainCoverItself.SetChar(GetPulsatingChar(10f)); Progress(.5f); } else if (phase == 10) //connection disappears brain half-empty; brain dies { memoryFrameGlow.SetChar(' '); brainCoverItself.SetChar(' '); if (Progress(2f)) { brainView.Kill(); brainView.overrideFadeOutSpeed = .15f; } } else if (phase == 11) { if (!Wait(2.5f)) { return; } cypherBrainView.x = (int)Mathf.Lerp(cypherBrainViewSideX, cypherBrainViewCenterX, progress); memoryFrame.x = cypherBrainView.x; if (Progress(2.5f)) { if (brainCover != null) { brainCover.Kill(); } cypherBrainView.x = cypherBrainViewCenterX; memoryFrame.x = cypherBrainView.x; } } else if (phase == 12) { if (Progress(2f)) { memoryFrame.SetColorRecursive('r'); outflowView = AddSubView(new SHGUIoutflow()) as SHGUIoutflow; } } else if (phase == 13) { if (!Wait(.3f)) { return; } outflowView.AddSeeds(); if (Progress(2f)) { memoryFrame.AddSubView(new SHGUIrect(-1, 2, -1, 2)); outflowView.DestroyBarrier(); } } else if (phase == 14) { outflowView.DestroyBarrier(); if (cypherBrainView != null && !cypherBrainView.fadingOut) { cypherBrainView.Kill(); } if (Progress(1.2f)) { outflowView.AddLimit(); } } else if (phase == 15) { outflowView.AddLimit(); //dla pewności if (!Wait(1.5f)) { return; } if (memoryFrame != null) { memoryFrame.Kill(); } if (Progress(4.2f)) { outflowView.Kill(); Kill(); SHGUI.current.AddViewOnTop(new APPrecruit()); } } else if (phase == 16) { if (Progress(10f)) { } } else if (phase == 60) //only copy exists { if (Progress(5)) { //Kill (); } } else // skip empty phases { Progress(-1f); } }
public override void Update() { base.Update(); if (fadingOut) { return; } if ((lastChat == null || lastChat.finished)) { if (messageQueue.Count > 0) { gurumessage m = messageQueue[0]; messageQueue.RemoveAt(0); AddChatMessage(m.sender, m.message, m.leftright, m.interactive, m.isPoor); if (m.isQuit) { quiting = true; } } else { Kill(); return; } } if (quiting) { instructions.Kill(); appname.Kill(); clock.Kill(); //frame.Kill(); /* * for (int i = 1; i < children.Count; ++i){ * children[i].Kill(); * } */ } if (lastChat == null) { return; } if (FixedUpdater(.01f)) { //lastChat.SetContent(lastChat.message + StringScrambler.GetGlitchChar()); //chat.ForcedFadeIn(1); int margin = 14; lastChat.x = margin; if (!lastChat.leftright) { lastChat.x = SHGUI.current.resolutionX - margin - lastChat.width - 1; } } if (lines + lastChat.height - totalOff > SHGUI.current.resolutionY - 1) { for (int i = 0; i < chats.Count; ++i) { chats[i].y -= 1; if (chats[i].y < -chats[i].height) { chats[i].remove = true; } } totalOff++; } }
public void Kill() { parent.Kill(); }