123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- using System.Drawing;
- using MinorShift.Emuera;
- using MinorShift.Emuera.GameProc;
- using MinorShift.Emuera.Sub;
- using NTERA.Game.Display;
- namespace NTERA.Interop
- {
- public interface IConsole
- {
- InputRequest CurrentRequest { get; }
- void GiveInput(string input);
- void PrintError(string message);
- void PrintSystemLine(string message);
- void DebugClearTraceLog();
- void DebugAddTraceLog(string message);
- void DebugRemoveTraceLog();
- bool RunERBFromMemory { get; }
- void PrintWarning(string message, ScriptPosition position, int level);
- void setStBar(string bar);
- void ReadAnyKey();
- void WaitInput(InputRequest request);
- void ResetStyle();
- void OutputLog(string log);
- bool noOutputLog { get; set; }
- void ThrowTitleError(bool something);
- void PrintBar();
- void PrintSingleLine(string line, bool something = false);
- void NewLine();
- void RefreshStrings(bool something);
- void SetWindowTitle(string title);
- bool IsRunning { get; }
- bool Enabled { get; }
- void ThrowError(bool playSound);
- void PrintErrorButton(string message, ScriptPosition position);
- void Write(string message);
- bool UseSetColorStyle { get; set; }
- void PrintC(string message, bool something);
- DisplayLineAlignment Alignment { get; set; }
- void deleteLine(int line);
- void PrintTemporaryLine(string line);
- bool updatedGeneration { get; set; }
- void PrintFlush(bool something);
- bool LastLineIsTemporary { get; }
- bool LastLineIsEmpty { get; }
- void ReloadErbFinished();
- bool MesSkip { get; }
- StringStyle StringStyle { get; set; }
- Color bgColor { get; set; }
- ConsoleRedraw Redraw { get; set; }
- bool EmptyLine { get; }
- string getStBar(string something);
- void PrintButton(string something, long something1);
- void PrintButton(string something, string something1);
- void PrintButtonC(string something, long something1, bool something2);
- void PrintButtonC(string something, string something1, bool something2);
- void PrintPlain(string message);
- void printCustomBar(string bar);
- bool UseUserStyle { get; set; }
- void Quit();
- void PrintHtml(string html, bool newline);
- void PrintImg(string img);
- void PrintShape(string shape, int[] param);
- void DebugPrint(string message);
- void DebugNewLine();
- void DebugClear();
- void ReadAnyKey(bool something, bool something2);
- void SetStringStyle(Color color);
- void SetStringStyle(FontStyle fontStyle);
- void SetBgColor(Color color);
- void SetToolTipColor(Color fc, Color bc);
- void SetToolTipDelay(int delay);
- void SetToolTipDuration(int duration);
- void SetFont(string font);
- void SetRedraw(long value);
- int NewButtonGeneration { get; }
- void UpdateGeneration();
- string GetWindowTitle();
- long LineCount { get; }
- string getDefStBar();
- bool IsTimeOut { get; }
- }
- public enum ConsoleRedraw
- {
- None = 0,
- Normal = 1
- }
- public enum DisplayLineAlignment
- {
- LEFT = 0,
- CENTER = 1,
- RIGHT = 2
- }
- /// <summary>
- /// 装飾付文字列(ConsoleStyledString)用のスタイル構造体
- /// </summary>
- public struct StringStyle
- {
- public StringStyle(Color color, FontStyle fontStyle, string fontname)
- {
- Color = color;
- ButtonColor = Config.FocusColor;
- ColorChanged = false;//こっちのパターンでは色変更を後で検知
- FontStyle = fontStyle;
- if (string.IsNullOrEmpty(fontname))
- Fontname = Config.FontName;
- else
- Fontname = fontname;
- }
- /// <summary>
- /// HTML用。ColorChangedを固定する。
- /// </summary>
- public StringStyle(Color color, bool colorChanged, Color buttonColor, FontStyle fontStyle, string fontname)
- {
- Color = color;
- ButtonColor = buttonColor;
- ColorChanged = colorChanged;
- FontStyle = fontStyle;
- if (string.IsNullOrEmpty(fontname))
- Fontname = Config.FontName;
- else
- Fontname = fontname;
- }
- public Color Color;
- public Color ButtonColor;
- public bool ColorChanged;
- public FontStyle FontStyle;
- public string Fontname;
- public override bool Equals(object obj)
- {
- if ((obj == null) || (!(obj is StringStyle)))
- return false;
- StringStyle ss = (StringStyle)obj;
- return ((Color == ss.Color) && (ButtonColor == ss.ButtonColor) && (ColorChanged == ss.ColorChanged) && (FontStyle == ss.FontStyle) && (Fontname.Equals(ss.Fontname, Config.SCIgnoreCase)));
- }
- public override int GetHashCode()
- {
- return Color.GetHashCode() ^ ButtonColor.GetHashCode() ^ ColorChanged.GetHashCode() ^ FontStyle.GetHashCode() ^ Fontname.GetHashCode();
- }
- public static bool operator ==(StringStyle x, StringStyle y)
- {
- return ((x.Color == y.Color) && (x.ButtonColor == y.ButtonColor) && (x.ColorChanged == y.ColorChanged) && (x.FontStyle == y.FontStyle) && (x.Fontname.Equals(y.Fontname, Config.SCIgnoreCase)));
- }
- public static bool operator !=(StringStyle x, StringStyle y)
- {
- return !(x == y);
- }
- }
- }
|