public void AddPopup(string sender, string message) { message += "^W9^W9"; SHGUI.current.PlaySound(SHGUIsound.confirm); chat = new SHGUIguruchatwindow(); chat.SetLeftRight(false); chat.SetWidth(35); chat.SetContent(message); chat.SetLabel(sender); AddSubViewBottom(chat); chat.y = 0; }
private scrollmessage AddChatMessage(string sender, string message, bool leftright, bool interactive, bool poor, bool overrideLast = false) { if (dontDisplaySender) { sender = ""; } SHGUIguruchatwindow chat; chat = new SHGUIguruchatwindow(); chat.SetLeftRight(leftright); if (interactive) { chat.SetInteractive(); } if (poor) { chat.poorMode = true; } chat.SetWidth(desiredFrameWidth); chat.SetContent(message); chat.SetLabel(sender); chat.x = chatMargin; if (!leftright) { chat.x = SHGUI.current.resolutionX - chatMargin - chat.width; } int h = chat.GetHeightOfCompleteTextWithFrameVERYSLOWandMOODY(); var msg = new scrollmessage(chat, h, 0, false, 0); msg.overrideLast = overrideLast; queue.Add(msg); if (defaultConsoleCallback != null) { chat.SetCallback(defaultConsoleCallback); } //chat.ForceFadeRecursive (1f); return(msg); }
public void AddChatMessage(string sender, string message, bool leftright, bool interactive, bool poor) { sender = ""; if (lastChat != null) { if (lastChat.height < 3) { lines += 3; } else { lines += lastChat.height; } } lastChat = new SHGUIguruchatwindow(); lastChat.SetLeftRight(leftright); if (interactive) { lastChat.SetInteractive(); } if (poor) { lastChat.poorMode = true; } lastChat.SetWidth(35); lastChat.SetContent(message); lastChat.SetLabel(sender); chats.Add(AddSubViewBottom(lastChat) as SHGUIguruchatwindow); lastChat.y = lines - totalOff; int margin = 14; lastChat.x = margin; if (!leftright) { lastChat.x = 80 - margin - lastChat.width - 1; } if (skippable) { if (leftright) { SetInstructions("press-ESC-to-leave-chat"); //SetInstructions ("TYPE-TO-SPEAK-|-ESC-TO-GO-AWAY"); } else { SetInstructions("press-ESC-to-leave-chat"); //SetInstructions ("WAIT-FOR-YOUR-PARTNER-|-ESC-TO-GO-AWAY"); } } else { SetInstructions(""); } if (leftright && interactive && !poor) { lastChat.PunchIn(.7f); } if (!poor) { SHGUI.current.PlaySound(SHGUIsound.confirm); } else { SHGUI.current.PlaySound(SHGUIsound.wrong); } /* * a.Add(AddSubView (new SHGUIframe (0, 0, SHGUI.current.resolutionX - 1, 3, 'z'))); * a.Add(AddSubView (new SHGUItext (message, 2, 1, 'w').BreakCut((int)(SHGUI.current.resolutionX / 2), 2))); * if (!leftright) { * (a [a.Count - 1] as SHGUItext).x = SHGUI.current.resolutionX - 3; * (a [a.Count - 1] as SHGUItext).GoFromRight (); * } * * a.Add(AddSubView (new SHGUItext (sender, 2, 0, 'z'))); * if (!leftright) { * (a [a.Count - 1] as SHGUItext).x = SHGUI.current.resolutionX - 3; * (a [a.Count - 1] as SHGUItext).GoFromRight (); * } */ }