Exemple #1
0
 public void OnCliked()
 {
     Controller.getInstance().getSelectedChapterDataControl().getScenesList().getScenes()[
         GameRources.GetInstance().selectedSceneIndex].getActiveAreasList().getActiveAreas()[
         AddItemActionMenu.GetSelectedActiveArea()].getActionsList()
     .addElement(Controller.ACTION_EXAMINE, "");
 }
        public ItemsWindowActions(Rect aStartPos, GUIContent aContent, GUIStyle aStyle, params GUILayoutOption[] aOptions)
            : base(aStartPos, aContent, aStyle, aOptions)
        {
            clearTex     = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteContent", typeof(Texture2D));
            addTex       = (Texture2D)Resources.Load("EAdventureData/img/icons/addNode", typeof(Texture2D));
            duplicateTex = (Texture2D)Resources.Load("EAdventureData/img/icons/duplicateNode", typeof(Texture2D));

            conditionsTex   = (Texture2D)Resources.Load("EAdventureData/img/icons/conditions-24x24", typeof(Texture2D));
            noConditionsTex = (Texture2D)Resources.Load("EAdventureData/img/icons/no-conditions-24x24", typeof(Texture2D));

            moveUp   = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeUp", typeof(Texture2D));
            moveDown = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeDown", typeof(Texture2D));

            itemsNames      = Controller.getInstance().getSelectedChapterDataControl().getItemsList().getItemsIDs();
            charactersNames = Controller.getInstance().getSelectedChapterDataControl().getNPCsList().getNPCsIDs();
            // Both scenes and cutscenes are necessary for next scene popup
            joinedNamesList    = new string[itemsNames.Length + charactersNames.Length + 1];
            joinedNamesList[0] = "none";
            itemsNames.CopyTo(joinedNamesList, 1);
            charactersNames.CopyTo(joinedNamesList, itemsNames.Length + 1);

            selectedTarget = selectedTargetLast = 0;

            noBackgroundSkin = (GUISkin)Resources.Load("Editor/EditorNoBackgroundSkin", typeof(GUISkin));
            selectedAreaSkin = (GUISkin)Resources.Load("Editor/EditorLeftMenuItemSkinConcreteOptions", typeof(GUISkin));

            selectedAction = -1;

            addMenu = new AddItemActionMenu();
        }
        public ScenesWindowElementReference(Rect aStartPos, GUIContent aContent, GUIStyle aStyle,
                                            params GUILayoutOption[] aOptions)
            : base(aStartPos, aContent, aStyle, aOptions)
        {
            clearImg   = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteContent", typeof(Texture2D));
            addTexture = (Texture2D)Resources.Load("EAdventureData/img/icons/addNode", typeof(Texture2D));
            moveUp     = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeUp", typeof(Texture2D));
            moveDown   = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeDown", typeof(Texture2D));

            if (GameRources.GetInstance().selectedSceneIndex >= 0)
            {
                currentIndex   = GameRources.GetInstance().selectedSceneIndex;
                currentScene   = Controller.getInstance().getSelectedChapterDataControl().getScenesList().getScenes()[currentIndex];
                backgroundPath = currentScene.getPreviewBackground();
            }
            if (backgroundPath != null && !backgroundPath.Equals(""))
            {
                backgroundPreviewTex = AssetsController.getImage(backgroundPath).texture;
            }

            conditionTex = (Texture2D)Resources.Load("EAdventureData/img/icons/no-conditions-24x24", typeof(Texture2D));

            selectedElementSkin = (GUISkin)Resources.Load("Editor/EditorLeftMenuItemSkinConcreteOptions", typeof(GUISkin));
            noBackgroundSkin    = (GUISkin)Resources.Load("Editor/EditorNoBackgroundSkin", typeof(GUISkin));


            selectedElement = null;
            addMenu         = new AddItemActionMenu();
        }
Exemple #4
0
    public ScenesWindowElementReference(Rect aStartPos, GUIContent aContent, GUIStyle aStyle,
                                        params GUILayoutOption[] aOptions)
        : base(aStartPos, aContent, aStyle, aOptions)
    {
        clearImg   = (Texture2D)Resources.Load("EAdventureData/img/icons/deleteContent", typeof(Texture2D));
        addTexture = (Texture2D)Resources.Load("EAdventureData/img/icons/addNode", typeof(Texture2D));
        moveUp     = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeUp", typeof(Texture2D));
        moveDown   = (Texture2D)Resources.Load("EAdventureData/img/icons/moveNodeDown", typeof(Texture2D));

        windowWidth  = aStartPos.width;
        windowHeight = aStartPos.height;

        if (GameRources.GetInstance().selectedSceneIndex >= 0)
        {
            backgroundPath =
                Controller.getInstance().getSelectedChapterDataControl().getScenesList().getScenes()[
                    GameRources.GetInstance().selectedSceneIndex].getPreviewBackground();
        }
        if (backgroundPath != null && !backgroundPath.Equals(""))
        {
            backgroundPreviewTex =
                (Texture2D)
                Resources.Load(backgroundPath.Substring(0, backgroundPath.LastIndexOf(".")), typeof(Texture2D));
        }

        conditionTex = (Texture2D)Resources.Load("EAdventureData/img/icons/no-conditions-24x24", typeof(Texture2D));

        selectedElementSkin = (GUISkin)Resources.Load("Editor/EditorLeftMenuItemSkinConcreteOptions", typeof(GUISkin));
        noBackgroundSkin    = (GUISkin)Resources.Load("Editor/EditorNoBackgroundSkin", typeof(GUISkin));

        tableRect       = new Rect(0f, 0.1f * windowHeight, 0.9f * windowWidth, windowHeight * 0.33f);
        rightPanelRect  = new Rect(0.9f * windowWidth, 0.1f * windowHeight, 0.08f * windowWidth, 0.33f * windowHeight);
        infoPreviewRect = new Rect(0f, 0.45f * windowHeight, windowWidth, windowHeight * 0.05f);
        previewRect     = new Rect(0f, 0.5f * windowHeight, windowWidth, windowHeight * 0.45f);

        selectedElement = -1;
        addMenu         = new AddItemActionMenu();
    }
Exemple #5
0
 private void OnSelectionChanged(int i)
 {
     selectedArea   = i;
     selectedAction = -1;
     addMenu        = new AddItemActionMenu(i);
 }