using System.Collections.Generic; using NTERA.EmuEra.Game.EraEmu.Sub; namespace NTERA.EmuEra.Game.EraEmu.Display { //TODO:1810~ /* Emuera用Htmlもどきが実装すべき要素 * (できるだけhtmlとConsoleDisplayLineとの1:1対応を目指す。とか同じ結果になるタグを重複して実装しない) *

ALIGNMENT命令相当・行頭から行末のみ・行末省略可 * PRINTSINGLE相当・行頭から行末のみ・行末省略可 * フォント各種・オーバーラップ問題は保留 * ボタン化・htmlでは明示しない限りボタン化しない * フォント指定 色指定 ボタン選択中色指定 * 追加 コメント * * * * エスケープ * & > < " ' &<>"' ERBにおける利便性を考えると属性値の指定には"よりも'を使いたい。HTML4.1にはないがaposを入れておく * &#nn; &#xnn; Unicode参照 #xFFFF以上は却下 */ /* このクラスがサポートすべきもの * html から ConsoleDisplayLine[] //主に表示用 * ConsoleDisplayLine[] から html //現在の表示をstr化して保存? * html から ConsoleDisplayLine[] を経て html //表示を行わずに改行が入る位置のチェックができるかも * html から PlainText(非エスケープ)// * Text から エスケープ済Text */ /// /// EmueraConsoleのなんちゃってHtml解決用クラス /// public static class HtmlManager { public static string[] HtmlTagSplit(string str) { List strList = new List(); StringStream st = new StringStream(str); int found = -1; while (!st.EOS) { found = st.Find('<'); if (found < 0) { strList.Add(st.Substring()); break; } if (found > 0) { strList.Add(st.Substring(st.CurrentPosition, found)); st.CurrentPosition += found; } found = st.Find('>'); if(found < 0) return null; found++; strList.Add(st.Substring(st.CurrentPosition, found)); st.CurrentPosition += found; } string[] ret = new string[strList.Count]; strList.CopyTo(ret); return ret; } } }