Ejemplo n.º 1
0
 protected override void doOnEnable()
 {
     if (isLaunchedForFistTime)
     {
         contextualMenuManager = DesktopRootReferenceManager.getInstance().contextualMenuManager;
     }
 }
    protected override void doOnEnable()
    {
        if (isLaunchedForFistTime)
        {
            newScaleVideo = new Vector3(
                0,
                0,
                whoIsCallMe.DesktopItemCaller.transform.localScale.z
                );
            contextualMenuManager = DesktopRootReferenceManager.getInstance().contextualMenuManager;

            Transform dialogItem = transform.Find("InputWidth");
            if (dialogItem)
            {
                inputWidth = dialogItem.gameObject.GetComponent <InputField>();
            }

            dialogItem = transform.Find("InputHeight");
            if (dialogItem)
            {
                inputHeight = dialogItem.gameObject.GetComponent <InputField>();
            }

            dialogItem = transform.Find("isProporcionalList");
            if (dialogItem)
            {
                isProporcionalList = dialogItem.gameObject.GetComponent <Dropdown>();
            }
        }
    }
    protected override void doAceptDialog()
    {
        if (path.text.Contains("http://") || path.text.Contains("https://"))
        {
            return;
        }

        GameObject generated = GameObject.Instantiate <GameObject>(toInstantiate);

        // Position
        positionToPlaceNewItem.x     = contextualMenuManager.transform.position.x;
        positionToPlaceNewItem.y     = contextualMenuManager.transform.position.y;
        positionToPlaceNewItem.z     = generated.transform.position.z;
        generated.transform.position = positionToPlaceNewItem;
        // Item Propierties
        FileItem item = generated.GetComponent <FileItem>();

        item.desktopManager       = whoIsCallMe.DesktopManagerCaller;
        item.nameFile             = nameFile.text;
        item.filePath             = path.text;
        item.transform.localScale = new Vector3(
            DesktopRootReferenceManager.getInstance().CurrentDesktopShowed.IconRealScale,
            DesktopRootReferenceManager.getInstance().CurrentDesktopShowed.IconRealScale,
            item.transform.localScale.z
            );

        base.doAceptDialog();
    }
Ejemplo n.º 4
0
 public void closeDialog()
 {
     DesktopRootReferenceManager.getInstance().isADialogOpened = false;
     DesktopRootReferenceManager.getInstance().colliderBackgroundForDialogs.SetActive(false);
     uiFolderPanel.SetActive(false);
     gameObject.SetActive(false);
 }
Ejemplo n.º 5
0
 public void CloseDialog()
 {
     DesktopRootReferenceManager.getInstance().colliderBackgroundForDialogs.SetActive(false);
     DesktopRootReferenceManager.getInstance().isADialogOpened = false;
     DesktopRootReferenceManager.getInstance().autoSaver.MarkToSave = true;
     this.gameObject.SetActive(false);
 }
Ejemplo n.º 6
0
 protected override void doOnEnable()
 {
     if (isLaunchedForFistTime)
     {
         contextualMenuManager = DesktopRootReferenceManager.getInstance().contextualMenuManager;
         nameFile = transform.Find("InputNameFile").gameObject.GetComponent <InputField>();
     }
 }
Ejemplo n.º 7
0
 public void NoActionButton()
 {
     onNo();
     if (!wasColliderActiveBeforeShowAlert)
     {
         DesktopRootReferenceManager.getInstance().colliderBackgroundForDialogs.SetActive(false);
     }
     gameObject.SetActive(false);
 }
Ejemplo n.º 8
0
 public void showYesOrNoAlert(string textAlert, Action onYes, Action onNo)
 {
     settingAllReferences();
     InfoTextLabel.text = textAlert;
     this.onYes         = onYes;
     this.onNo          = onNo;
     wasColliderActiveBeforeShowAlert = DesktopRootReferenceManager.getInstance().colliderBackgroundForDialogs.activeSelf;
     DesktopRootReferenceManager.getInstance().colliderBackgroundForDialogs.SetActive(true);
     gameObject.SetActive(true);
 }
Ejemplo n.º 9
0
    protected override void doOnLeftClick()
    {
        GameObject generated = GameObject.Instantiate <GameObject>(toInstantiate);

        positionToPlaceNewItem.x     = this.transform.position.x;
        positionToPlaceNewItem.y     = this.transform.position.y;
        positionToPlaceNewItem.z     = generated.transform.position.z;
        generated.transform.position = positionToPlaceNewItem;
        generated.GetComponent <GroupItemWidget>().desktopManager = whoIsCallMe.DesktopManagerCaller;

        DesktopRootReferenceManager.getInstance().autoSaver.MarkToSave = true;
    }
    public string mapDesktopListManagerToJSON()
    {
        List <DesktopManager> allDesktops = DesktopRootReferenceManager.getInstance().desktopListManager.AllDesktops;

        totalColumns = DesktopRootReferenceManager.getInstance().desktopListManager.NumberOfColumns;
        desktopList  = new JSONMapperDesktopManager[allDesktops.Count];

        for (int i = 0; i < desktopList.Length; i++)
        {
            desktopList[i] = new JSONMapperDesktopManager(allDesktops[i]);
        }
        return(JsonUtility.ToJson(this, true));
    }
Ejemplo n.º 11
0
    protected override void clearFieldsDialog()
    {
        defaultModeWallpaper    = currentDesktopManager.ModeWallpaper;
        listWallpaperMode.value = defaultModeWallpaper == AutoScaleMode.FULL ? 0 : 1;

        sliderIconSize.value    = defaultIconSize = currentDesktopManager.IconScalePercentage;
        inputWallpaperPath.text = defaultWallpaperPath = currentDesktopManager.WallpaperImagePath;

        defaultIndexMinutesToChangeWallpaper = fromSecondsToDropdownIndex(currentDesktopManager.SecondsToChangeWallpaper);
        listMinutesToChangeWallpaper.value   = defaultIndexMinutesToChangeWallpaper;

        textNColumnsDesktop.text = DesktopRootReferenceManager.getInstance().desktopListManager.NumberOfColumns.ToString();
        textNDesktop.text        = DesktopRootReferenceManager.getInstance().desktopListManager.NumberOfDesktop.ToString();
    }
Ejemplo n.º 12
0
 void OnEnable()
 {
     DesktopRootReferenceManager.getInstance().colliderBackgroundForDialogs.SetActive(true);
     isDoingAceptDialog   = false;
     isNavigationEnabled  = navigationList.Length > 0;
     indexInTabNavigation = 0;
     EventSystem.current.SetSelectedGameObject(navigationList[0]);
     doOnEnable();
     clearFieldsDialog();
     if (isLaunchedForFistTime)
     {
         isLaunchedForFistTime = false;
     }
 }
Ejemplo n.º 13
0
    public void changeBackgroundPreviewCurrentDesktop(string wallpaperPath)
    {
        int  index      = DesktopRootReferenceManager.getInstance().desktopListManager.CurrentDesktopShowedIndex;
        bool activeSelf = mapIndexPreview[index].gameObject.activeSelf;

        mapIndexPreview[index].gameObject.SetActive(true);

        changeBackgroundPreview(
            index,
            wallpaperPath
            );

        mapIndexPreview[index].gameObject.SetActive(activeSelf);
    }
Ejemplo n.º 14
0
    protected override void doOnEnable()
    {
        currentDesktopManager = DesktopRootReferenceManager.getInstance().CurrentDesktopShowed;

        if (isLaunchedForFistTime)
        {
            sliderIconSize               = transform.Find("SliderIconSize").GetComponent <Slider>();
            inputWallpaperPath           = transform.Find("InputPathWallpaper").GetComponent <InputField>();
            listWallpaperMode            = transform.Find("ListWallpaperMode").GetComponent <Dropdown>();
            listMinutesToChangeWallpaper = transform.Find("ListTimeAutoWallpaperChange").GetComponent <Dropdown>();
            textNColumnsDesktop          = transform.Find("InputNColumDesktop").GetComponent <InputField>();
            textNDesktop = transform.Find("InputNDesktop").GetComponent <InputField>();
        }
    }
Ejemplo n.º 15
0
 void Update()
 {
     if (!DesktopRootReferenceManager.getInstance().isADialogOpened&& Input.GetKeyUp(KeyCode.Escape))
     {
         DesktopRootReferenceManager.getInstance().alertYesOrNotController.showYesOrNoAlert(
             $"YOU WANT EXIT?",
             () => {
             DesktopRootReferenceManager.getInstance().autoSaver.forceToSave();
             Application.Quit();
         },
             () => {}
             );
     }
 }
Ejemplo n.º 16
0
 public static Sprite getSpriteByType(TypeFile typeFile)
 {
     if (DesktopRootReferenceManager.getInstance() != null)
     {
         return((from fileIcon in DesktopRootReferenceManager.getInstance().typeFileIconList
                 where fileIcon.typeFile == typeFile
                 select fileIcon).ToArray()[0].sprite);
     }
     else
     {
         // Show type other.
         return((from fileIcon in DesktopRootReferenceManager.getInstance().typeFileIconList
                 where fileIcon.typeFile == TypeFile.OTHER
                 select fileIcon).ToArray()[0].sprite);
     }
 }
Ejemplo n.º 17
0
    void OnEnable()
    {
        DesktopRootReferenceManager.getInstance().colliderBackgroundForDialogs.SetActive(true);
        uiFolderPanel.SetActive(true);
        if (folderTitle == null)
        {
            folderTitle        = uiFolderPanel.transform.Find("FolderTitle").GetComponent <Text>();
            positionInitColumn = transform.Find("InitColumns").position;
            positionEndColumn  = transform.Find("EndColumns").position;
            allContent         = transform.Find("Content").gameObject;
            autoscaleWideScreen(GetComponent <SpriteRenderer>());
        }

        folderTitle.text = folderItem.nameFile;
        folderTitle.text = folderTitle.text.Replace("\\n", "");
        createFileElement();
    }
Ejemplo n.º 18
0
    void OnEnable()
    {
        whoIsCallMe = DesktopRootReferenceManager.getInstance().contextualMenuManager.whoIsCallMe;
        if (colorSelectedItem == Color.clear)
        {
            menu = DesktopRootReferenceManager.getInstance().contextualMenuManager;
            colorSelectedItem   = menu.colorSelectedItem;
            colorUnselectedItem = menu.colorUnselectedItem;
        }

        if (sRenderer == null)
        {
            sRenderer = GetComponent <SpriteRenderer>();
        }
        sRenderer.color = colorUnselectedItem;
        this.doOnEnable();
    }
Ejemplo n.º 19
0
    protected override void doAceptDialog()
    {
        string numberOfColumns = DesktopRootReferenceManager.getInstance().desktopListManager.NumberOfColumns.ToString();
        string numberOfDesktop = DesktopRootReferenceManager.getInstance().desktopListManager.NumberOfDesktop.ToString();

        if (!textNColumnsDesktop.text.Equals(numberOfColumns))
        {
            DesktopRootReferenceManager.getInstance().desktopListManager.NumberOfColumns = int.Parse(textNColumnsDesktop.text);
        }

        if (!textNDesktop.text.Equals(numberOfDesktop))
        {
            DesktopRootReferenceManager.getInstance().desktopListManager.NumberOfDesktop = int.Parse(textNDesktop.text);
        }

        base.doAceptDialog();
    }
    void OnEnable()
    {
        if (indicatorsList == null)
        {
            indicatorsList = new List <GameObject>();
        }
        if (desktopListManager == null)
        {
            desktopListManager = DesktopRootReferenceManager.getInstance().desktopListManager;
        }
        if (desktopListManager.DesktopListIndicator == null)
        {
            desktopListManager.DesktopListIndicator = this;
        }

        positionForReflesh = new Vector3(0, 0, 0);
        ApplyMarkToRefleshWhenCreated(this);
    }
Ejemplo n.º 21
0
    // Vector3 positionToPlaceNewItem = new Vector3();
    protected override void doAceptDialog()
    {
        string     nameSelected = folderListDropdown.options[folderListDropdown.value].text;
        FolderItem item         = DesktopRootReferenceManager.getInstance().CurrentDesktopShowed.getFolderByName(nameSelected);

        if (folderListDropdown.value == 0)
        {
            DesktopRootReferenceManager.getInstance().CurrentDesktopShowed.RemoveFromFolderAndPutInDesktop(whoIsCallMe.DesktopItemCaller);
            DesktopRootReferenceManager.getInstance().folderController.RemoveFromFolderAndPutInDesktop(whoIsCallMe.DesktopItemCaller);
        }
        else
        {
            item.AddToFolder(whoIsCallMe.DesktopItemCaller.gameObject);
            FolderItem.HideItemFromDesktop(whoIsCallMe.DesktopItemCaller.gameObject);
        }

        base.doAceptDialog();
    }
Ejemplo n.º 22
0
    protected override void doOnEnable()
    {
        if (isLaunchedForFistTime)
        {
            contextualMenuManager = DesktopRootReferenceManager.getInstance().contextualMenuManager;
            folderListDropdown    = transform.Find("DropdownFolder").gameObject.GetComponent <Dropdown>();
        }
        List <Dropdown.OptionData> newOptions = filterNewOptions(
            folderListDropdown.options,
            DesktopRootReferenceManager.getInstance().CurrentDesktopShowed.allFoldersNames
            );

        if (newOptions.Count > 0)
        {
            folderListDropdown.AddOptions(newOptions);
            folderListDropdown.RefreshShownValue();
        }
    }
Ejemplo n.º 23
0
    protected override void doAceptDialog()
    {
        DesktopManager desktop = DesktopRootReferenceManager.getInstance().CurrentDesktopShowed;

        if (
            !(whoIsCallMe.DesktopItemCaller is FolderItem) &&
            whoIsCallMe.DesktopItemCaller.NameFolderParent != null &&
            !"".Equals(whoIsCallMe.DesktopItemCaller.NameFolderParent)
            )
        {
            FolderItem folder = desktop.getFolderByName(whoIsCallMe.DesktopItemCaller.NameFolderParent);
            folder.removeFromFolder(whoIsCallMe.DesktopItemCaller.gameObject);
        }

        desktop.removeItem(whoIsCallMe.DesktopItemCaller.gameObject);
        GameObject.Destroy(whoIsCallMe.DesktopItemCaller.gameObject);

        base.doAceptDialog();
    }
    public static void parseJSONToDesktopListManager(string jsonData)
    {
        JSONMapperDesktopListManager superDesktop = JsonUtility.FromJson <JSONMapperDesktopListManager>(jsonData);

        DesktopRootReferenceManager.getInstance().desktopListManager.NumberOfColumns = superDesktop.totalColumns;
        DesktopRootReferenceManager.getInstance().desktopListManager.NumberOfDesktop = superDesktop.desktopList.Length;

        DesktopManager desktop;

        for (int i = 0; i < superDesktop.desktopList.Length; i++)
        {
            desktop = DesktopRootReferenceManager.getInstance().desktopListManager.AllDesktops[i];

            superDesktop.desktopList[i].parseJSONToDesktop(desktop);
            DesktopRootReferenceManager.getInstance().desktopBigPreviews.changeBackgroundPreviewToDesktop(
                i,
                desktop.autoScaleBackground.backgroundPathList
                );
        }
    }
Ejemplo n.º 25
0
 public void showDialog(MenuCaller whoIsCallMe)
 {
     this.whoIsCallMe = whoIsCallMe;
     DesktopRootReferenceManager.getInstance().isADialogOpened = true;
     this.gameObject.SetActive(true);
 }
Ejemplo n.º 26
0
 protected virtual void doAceptDialog() => DesktopRootReferenceManager.getInstance().autoSaver.MarkToSave = true;
Ejemplo n.º 27
0
 public void RemoveFromFolderAndPutInDesktop(DesktopItem desktopItemCaller) =>
 desktopItemCaller.transform.parent = DesktopRootReferenceManager.getInstance().CurrentDesktopShowed.transform;
Ejemplo n.º 28
0
 public void showDialog(FolderItem folderItem)
 {
     DesktopRootReferenceManager.getInstance().isADialogOpened = true;
     this.folderItem = folderItem;
     gameObject.SetActive(true);
 }