Exemplo n.º 1
0
 public override void RemoveItem(List <UndoRedoAction> undoPipe)
 {
     lock (board.ParentControl)
     {
         if (boundTooltip == null)
         {
             return;                       //already removed via the parent tooltip
         }
         base.RemoveItem(undoPipe);
         if (undoPipe != null)
         {
             undoPipe.Add(UndoRedoManager.ToolTipUnlinked(boundTooltip, this));
         }
         boundTooltip.CharacterToolTip = null;
         boundTooltip = null;
     }
 }
Exemplo n.º 2
0
 public static UndoRedoAction ToolTipUnlinked(ToolTipInstance tt, ToolTipChar ttc)
 {
     return new UndoRedoAction(tt, UndoRedoType.ToolTipUnlinked, ttc, null);
 }
Exemplo n.º 3
0
        public void LoadToolTips(WzImage mapImage, Board mapBoard)
        {
            WzSubProperty tooltipsParent = (WzSubProperty)mapImage["ToolTip"];
            if (tooltipsParent == null)
            {
                return;
            }

            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)
            {
                return;
            }

            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);
                ToolTipInstance tt = new ToolTipInstance(mapBoard, tooltipPos, title, desc, i);
                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);
                }
            }
        }
Exemplo n.º 4
0
 private void CreateTooltip()
 {
     lock (Board.ParentControl)
     {
         ToolTipInstance tt = new ToolTipInstance(Board, new Xna.Rectangle(X, Y, 0, 0), "Title", "Description");
         Board.BoardItems.ToolTips.Add(tt);
         BindItem(tt.PointA, new Xna.Point());
         BindItem(tt.PointC, new Xna.Point());
     }
 }
Exemplo n.º 5
0
 public ToolTipChar(Board board, XNA.Rectangle rect, ToolTipInstance boundTooltip)
     : base(board, rect)
 {
     BoundTooltip = boundTooltip;
 }
Exemplo n.º 6
0
 public ToolTipChar(Board board, XNA.Rectangle rect, ToolTipInstance boundTooltip)
     : base(board, rect)
 {
     BoundTooltip = boundTooltip;
 }
Exemplo n.º 7
0
 public override void RemoveItem(List<UndoRedoAction> undoPipe)
 {
     lock (board.ParentControl)
     {
         if (boundTooltip == null) return; //already removed via the parent tooltip
         base.RemoveItem(undoPipe);
         if (undoPipe != null)
         {
             undoPipe.Add(UndoRedoManager.ToolTipUnlinked(boundTooltip, this));
         }
         boundTooltip.CharacterToolTip = null;
         boundTooltip = null;
     }
 }