예제 #1
0
        public void ClearItemDisplay()
        {
            ////SelectedScreen = null;

            ////for (int i = Controls.Count - 1; i >= 0; i--) {
            ////    ItemRowControl c = Controls[i] as ItemRowControl;
            ////    if (c != null) {
            ////        Controls.RemoveAt(i);
            ////        c.Dispose();
            ////        c.MapDisplay = null;
            ////    }
            ////}

            ////IsLoaded = false;
            SelectedScreen = null;

            for (int i = Controls.Count - 1; i >= 0; i--)
            {
                ItemScreenControl c = Controls[i] as ItemScreenControl;
                if (c != null)
                {
                    Controls.RemoveAt(i);
                    c.Dispose();
                    c.MapDisplay = null;
                }
            }

            IsLoaded = false;
        }
예제 #2
0
        /////// <summary>
        /////// Gets the control that owns the row entry with the specified index, or null if not found.
        /////// </summary>
        /////// <returns></returns>
        ////internal ItemRowControl_DEPRECATED GetEntryOwner_DEPRECATED(int index) {
        ////    foreach (WindowlessControl c in Controls) {
        ////        ItemRowControl_DEPRECATED row = c as ItemRowControl_DEPRECATED;
        ////        if (row != null && row.Entry.OrderIndex == index)
        ////            return row;
        ////    }

        ////    return null;
        ////}
        internal void NotifyActionOccurred(Editroid.UndoRedo.EditroidAction a)
        {
            if (a is EditItemProperty)
            {
                foreach (WindowlessControl c in Controls)
                {
                    ItemScreenControl screen = c as ItemScreenControl;
                    if (screen != null && screen.ItemData.Items.Contains(((EditItemProperty)a).Item))
                    {
                        screen.ReloadImage();
                    }
                }
            }

            ////if (a is ItemAction) {
            ////    ItemIndex_DEPRECATED ID = new ItemIndex_DEPRECATED();
            ////    ItemRowControl_DEPRECATED entryOwner = null;

            ////    ID = ((ItemAction)a).ItemIndex;
            ////    entryOwner = GetEntryOwner_DEPRECATED(ID.Row);
            ////    if (entryOwner == null) return;

            ////    if (a is SetItemTilePosition) {
            ////        entryOwner.NotifyScreenEntryMoved(ID);
            ////    } else if (a is SetItemRowPosition) {
            ////        entryOwner.NotifyRowMoved(ID);
            ////    }
            ////} else if (a is EditItemProperty) {
            ////    ID = ((EditItemProperty)a).ItemID;
            ////    entryOwner = GetEntryOwner_DEPRECATED(ID.Row);
            ////    if (entryOwner == null) return;

            ////    entryOwner.NotifyItemChanged(ID);
            ////}
        }
예제 #3
0
        private void CreateItemDisplay()
        {
            ////foreach (ItemRowEntry e in currentLevelItems) {
            ////    ItemRowControl entryEditor = new ItemRowControl(e);
            ////    entryEditor.MapDisplay = this;

            ////    Controls.Add(entryEditor);
            ////}
            foreach (ItemScreenData screen in LevelItems)
            {
                ItemScreenControl newScreen = new ItemScreenControl(screen);
                Controls.Add(newScreen);
            }

            IsLoaded = true;
        }