Exemplo n.º 1
0
 private Object3D getSelectedObject()
 {
     if (Globals.list_selected == -1 || Globals.item_selected == -1)
         return null;
     switch (Globals.list_selected)
     {
         case 0:
             return level.getCurrentArea().Objects[Globals.item_selected];
         case 1:
             return level.getCurrentArea().MacroObjects[Globals.item_selected];
         case 2:
             return level.getCurrentArea().SpecialObjects[Globals.item_selected];
         default:
             return null;
     }
 }
Exemplo n.º 2
0
        public static Object3D GetGlobalSelection(this Level level)
        {
            Area area;

            if (list_selected < 0 || list_selected > 2 || item_selected < 0 || null == (object)level ||
                null == (area = level.getCurrentArea()))
            {
                return(null);
            }

            var List = list_selected == 0 ? area.Objects : list_selected == 1 ? area.MacroObjects : area.SpecialObjects;

            if (null == (object)List || item_selected >= List.Count)
            {
                return(null);
            }

            return(List[item_selected]);
        }
Exemplo n.º 3
0
        private void refreshObjectsInList()
        {
            Globals.list_selected        = -1;
            Globals.item_selected        = -1;
            propertyGrid1.SelectedObject = null;
            TreeNode objects = treeView1.Nodes[0];

            objects.Nodes.Clear();
            foreach (Object3D obj in level.getCurrentArea().Objects)
            {
                obj.Title = obj.getObjectComboName();
                objects.Nodes.Add(obj.Title);
                // objects.Nodes.Add("0x" + obj.Behavior.ToString("X8"));
            }

            TreeNode macro_objects = treeView1.Nodes[1];

            macro_objects.Nodes.Clear();
            foreach (Object3D obj in level.getCurrentArea().MacroObjects)
            {
                obj.Title = obj.getObjectComboName();
                macro_objects.Nodes.Add(obj.Title);
                //macro_objects.Nodes.Add("0x" + obj.Behavior.ToString("X8"));
            }

            TreeNode special_objects = treeView1.Nodes[2];

            special_objects.Nodes.Clear();
            foreach (Object3D obj in level.getCurrentArea().SpecialObjects)
            {
                obj.Title = obj.getObjectComboName();
                special_objects.Nodes.Add(obj.Title);
                //special_objects.Nodes.Add("0x" + obj.Behavior.ToString("X8"));
            }

            TreeNode warps = treeView1.Nodes[3];

            warps.Nodes.Clear();
            foreach (Warp warp in level.getCurrentArea().Warps)
            {
                warps.Nodes.Add(warp.ToString());
            }
            foreach (Warp warp in level.getCurrentArea().PaintingWarps)
            {
                warps.Nodes.Add(warp.ToString());
            }
            foreach (WarpInstant warp in level.getCurrentArea().InstantWarps)
            {
                warps.Nodes.Add(warp.ToString());
            }
        }