public DuplicateResourcesBlockTool(DataControl dataControl, List <ResourcesUni> resourcesList, List <ResourcesDataControl> resourcesDataControlList, DataControlWithResources parent)
 {
     this.dataControl              = dataControl;
     this.resourcesList            = resourcesList;
     this.resourcesDataControlList = resourcesDataControlList;
     this.parent = parent;
 }
 public static bool ShowAtPosition(DataControlWithResources data, bool showResourcesList, Rect buttonRect)
 {
     buttonRect.height = 0;
     buttonRect.x     += buttonRect.width;
     PopupWindow.Show(buttonRect, new ResourcesPopup(data, showResourcesList));
     return(true);
 }
Esempio n. 3
0
 public AddResourcesBlockTool(List <ResourcesUni> resourcesList, List <ResourcesDataControl> resourcesDataControlList, int resourcesType, DataControlWithResources parent)
 {
     this.resourcesList            = resourcesList;
     this.resourcesDataControlList = resourcesDataControlList;
     this.resourcesType            = resourcesType;
     this.parent = parent;
 }
 public DeleteResourcesBlockTool(List <ResourcesUni> resourcesList, List <ResourcesDataControl> resourcesDataControlList, DataControl dataControl, DataControlWithResources parentDataControl)
 {
     this.resourcesDataControlList = resourcesDataControlList;
     this.resourcesList            = resourcesList;
     this.dataControl       = dataControl;
     this.parentDataControl = parentDataControl;
 }
 public ResourcesPopup(DataControlWithResources data, bool showResourcesList)
 {
     this.data = data;
     this.showResourcesList = showResourcesList;
     resourcesEditor        = new ResourcesEditor {
         Data = data, ShowResourcesList = showResourcesList
     };
 }
Esempio n. 6
0
        private void RefreshPathInformation(DataControlWithResources data)
        {
            var book = (BookDataControl)data;

            var backgroundPath = book.getPreviewImage();

            backgroundPreview = !string.IsNullOrEmpty(backgroundPath) ? Controller.ResourceManager.getImage(backgroundPath) : null;

            leftNormalArrow  = LoadArrowTexture(book, BookDataControl.ARROW_LEFT, BookDataControl.ARROW_NORMAL);
            rightNormalArrow = LoadArrowTexture(book, BookDataControl.ARROW_RIGHT, BookDataControl.ARROW_NORMAL);
            leftOverArrow    = LoadArrowTexture(book, BookDataControl.ARROW_LEFT, BookDataControl.ARROW_OVER);
            rightOverArrow   = LoadArrowTexture(book, BookDataControl.ARROW_RIGHT, BookDataControl.ARROW_OVER);
        }
        public static void DoResourcesButton(Rect rect, DataControlWithResources data, bool showResourcesList, bool active, GUIStyle style)
        {
            if (!resourceActive || !resourceInactive)
            {
                resourceActive   = Resources.Load <Texture2D>("EAdventureData/img/icons/resources");
                resourceInactive = Resources.Load <Texture2D>("EAdventureData/img/icons/resources-inactive");
            }

            if (GUI.Button(rect, active ? resourceActive : resourceInactive, style))
            {
                ShowAtPosition(data, showResourcesList, rect);
            }
        }
        private void RefreshPathInformation(DataControlWithResources data)
        {
            var npc = data as NPCDataControl;

            foreach (var group in groups) // For each group
            {
                foreach (var animationType in resourceTypeGroups[group])
                {
                    // Reload the texture
                    textures[animationType.Key] = LoadCharacterTexturePreview(npc, resourceTypeGroups[group][animationType.Key]);
                }
            }
        }
Esempio n. 9
0
        private void RefreshResources(DataControlWithResources dataControl)
        {
            var item = dataControl as ItemDataControl;

            if (item == null)
            {
                return;
            }

            var imagePath         = item.getPreviewImage();
            var imageWhenOverPath = item.getMouseOverImage();

            imageTex     = string.IsNullOrEmpty(imagePath)         ? null : Controller.ResourceManager.getImage(imagePath);
            imageOverTex = string.IsNullOrEmpty(imageWhenOverPath) ? null : Controller.ResourceManager.getImage(imageWhenOverPath);
        }
Esempio n. 10
0
        public float getElementAppropiateScale(DataControlWithResources dataControl)
        {
            var background = Controller.ResourceManager.getImage(getPreviewBackground());

            var npc     = dataControl as NPCDataControl;
            var item    = dataControl as ItemDataControl;
            var atrezzo = dataControl as AtrezzoDataControl;

            Texture2D image = null;

            if (npc != null)
            {
                image = Controller.ResourceManager.getImage(npc.getPreviewImage());
            }
            else if (item != null)
            {
                image = Controller.ResourceManager.getImage(item.getPreviewImage());
            }
            else if (atrezzo != null)
            {
                image = Controller.ResourceManager.getImage(atrezzo.getPreviewImage());
            }

            if (image && background)
            {
                var imageToBackgroundRatio = background.height / (float)image.height;
                if (imageToBackgroundRatio < 1.2)
                {
                    return(imageToBackgroundRatio / 1.2f);
                }
                else if (imageToBackgroundRatio > 10)
                {
                    return(imageToBackgroundRatio / 10f);
                }
            }

            return(1);
        }
Esempio n. 11
0
        public void RefreshSceneResources(DataControlWithResources resources)
        {
            var scene = resources as SceneDataControl;

            if (scene == null)
            {
                foregroundPreview     = null;
                lastSelectedResources = -1;
                return;
            }

            var back = scene.getPreviewBackground();
            var fore = scene.getPreviewForeground();

            backgroundPreview = Controller.ResourceManager.getImage(back);
            foregroundPreview = Controller.ResourceManager.getImage(fore);

            if (backgroundPreview && foregroundPreview)
            {
                foregroundPreview = CreateMask(backgroundPreview, foregroundPreview);
            }

            lastSelectedResources = scene.getSelectedResources();
        }
 private void RefreshPathInformation(DataControlWithResources data)
 {
     texturePaths.Clear();
     textures.Clear();
 }