public static UndoRedoAction ToolTipUnlinked(ToolTip tt, ToolTipChar ttc) { return new UndoRedoAction(tt, UndoRedoType.ToolTipUnlinked, ttc, null); }
public static UndoRedoAction ToolTipUnlinked(ToolTip tt, ToolTipChar ttc) { return(new UndoRedoAction(tt, UndoRedoType.ToolTipUnlinked, ttc, null)); }
private static void LoadToolTips(WzImage mapImage, Board mapBoard) { WzSubProperty tooltipsParent = (WzSubProperty)mapImage["ToolTip"]; WzImage tooltipsStringImage = (WzImage)Program.WzManager.String["ToolTipHelp.img"]; if (!tooltipsStringImage.Parsed) tooltipsStringImage.ParseImage(); WzSubProperty tooltipStrings = (WzSubProperty)tooltipsStringImage["Mapobject"][mapBoard.MapInfo.id.ToString()]; if (tooltipStrings == null || tooltipsParent == null) return; //if (tooltipStrings == null ^ tooltipsParent == null) throw new Exception("at LoadToolTips, only one tooltip parent is null"); for (int i = 0; true; i++) { string num = i.ToString(); WzSubProperty tooltipString = (WzSubProperty)tooltipStrings[num]; WzSubProperty tooltipProp = (WzSubProperty)tooltipsParent[num]; WzSubProperty tooltipChar = (WzSubProperty)tooltipsParent[num + "char"]; if (tooltipString == null && tooltipProp == null) break; if (tooltipString == null ^ tooltipProp == null) continue; string title = InfoTool.GetOptionalString(tooltipString["Title"]); string desc = InfoTool.GetOptionalString(tooltipString["Desc"]); int x1 = InfoTool.GetInt(tooltipProp["x1"]); int x2 = InfoTool.GetInt(tooltipProp["x2"]); int y1 = InfoTool.GetInt(tooltipProp["y1"]); int y2 = InfoTool.GetInt(tooltipProp["y2"]); Microsoft.Xna.Framework.Rectangle tooltipPos = new Microsoft.Xna.Framework.Rectangle(x1, y1, x2 - x1, y2 - y1); HaCreator.MapEditor.ToolTip tt = new HaCreator.MapEditor.ToolTip(mapBoard, tooltipPos, title, desc); mapBoard.BoardItems.ToolTips.Add(tt); if (tooltipChar != null) { x1 = InfoTool.GetInt(tooltipChar["x1"]); x2 = InfoTool.GetInt(tooltipChar["x2"]); y1 = InfoTool.GetInt(tooltipChar["y1"]); y2 = InfoTool.GetInt(tooltipChar["y2"]); tooltipPos = new Microsoft.Xna.Framework.Rectangle(x1, y1, x2 - x1, y2 - y1); ToolTipChar ttc = new ToolTipChar(mapBoard, tooltipPos, tt); mapBoard.BoardItems.CharacterToolTips.Add(ttc); } } }