Exemplo n.º 1
0
        // Creates a empty map that is only stored in temp memory.
        public static void MapDataCreateEmptyMap(string mapName = "New Map")
        {
            GlobalToolManager.DisabelTools();
            MapDataQuery.DeleteMapQuery();
            SessionManager.SessionManagerClearRefs();

            if (XCPManager.currentXCP.xpcMaps == null)
            {
                XCPManager.currentXCP.xpcMaps    = new MapData[1];
                XCPManager.currentXCP.xpcMaps[0] = new MapData().CreateEmptyMapData(mapName, EditorPrimer.editorVersionNumberInternal, "Derelictus");
                mapDataXCPIndex = 0;
            }
            else
            {
                Array.Resize(ref XCPManager.currentXCP.xpcMaps, XCPManager.currentXCP.xpcMaps.Length + 1);
                XCPManager.currentXCP.xpcMaps[XCPManager.currentXCP.xpcMaps.Length - 1] = new MapData().CreateEmptyMapData(mapName, EditorPrimer.editorVersionNumberInternal, "Derelictus");;
                mapDataXCPIndex = XCPManager.currentXCP.xpcMaps.Length - 1;
            }
            mapDataFileName = mapName;
            mapDataTileSize = 0.32f;
            SessionManager.CreateMapLayer("Layer 0", true, true);
            ScenePrimer.curPrimerComponent.PrimerMapUpdate();
            UiManager.DestroyAllFocus();
            MapDataCreateMapObj();
        }
Exemplo n.º 2
0
        // Tries to open and load a map file on users computer

        /*
         *      public static void MapDataOpenMap(string mapName = "", string mapPath = "")
         *      {
         *              switch (MapDataPrepForChange())
         *              {
         *                      case -1:
         *                      break;
         *                      case 0:
         *                              MapDataSaveMap();
         *                              MapDataQuery.DeleteMapQuery();
         *                      goto case 1;
         *                      case 1:
         *                              GlobalToolManager.disabelTools();
         *                              MapDataQuery.DeleteMapQuery();
         *                              SessionManager.SessionManagerClearRefs();
         *
         *                              mapData = MapDataImportFromFile(mapPath, mapName + ".berrymap");
         *
         *                              mapDataFileName = mapName;
         *                              mapDataTileSize = 0.32f;
         *                              UiManager.DestroyAllFocus();
         *
         *                              if(mapData == null){ Debug.LogError("WOOOPSI"); }
         *                              MapDataCreateMapObj();
         *
         *                      break;
         *              }
         *      }
         */

        public static void MapDataOpenXCPMap(int mapIndex)
        {
            if (XCPManager.currentXCP.xpcMaps[mapIndex] == null)
            {
                Debug.LogError("WWWWWNWOWPWEWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW");
            }
            //if(mapIndex == mapDataXCPIndex) {UiManager.DestroyAllFocus(); Debug.Log("Sorry Dave but i can't let you do that."); return;}

            GlobalToolManager.DisabelTools();
            MapDataQuery.DeleteMapQuery();
            SessionManager.SessionManagerClearRefs();

            mapDataXCPIndex = mapIndex;

            mapDataFileName = XCPManager.currentXCP.xpcMaps[mapIndex].map;
            mapDataTileSize = 0.32f;
            ScenePrimer.curPrimerComponent.PrimerMapUpdate();
            UiManager.DestroyAllFocus();

            if (XCPManager.currentXCP.xpcMaps[mapDataXCPIndex] == null)
            {
                Debug.LogError("WOOOPSI");
            }
            MapDataCreateMapObj();
        }
Exemplo n.º 3
0
 public override void PrimerInitialize()
 {
     primerModeName = "Game";
     GlobalToolManager.DisabelTools();
     gameUI = UiManager.CreateCanvas("gameUI", primerParrentObj);
     CreatePlayer();
     GL.Clear(true, true, new Color(0, 0, 0, 0));
 }
Exemplo n.º 4
0
        public override void PrimerInitialize()
        {
            primerModeName = "Console";
            GlobalToolManager.DisabelTools();
            UiManager.CreateEventSystem(this.gameObject);
            ConsoleManager.CreateConsole();

            GL.Clear(true, true, new Color(0, 0, 0, 0));
        }
Exemplo n.º 5
0
 public static GameObject CreateUiFocusObj(bool createSeparateFocusInstance = false, bool disabelBackBackground = false, bool fadeInAnimation = false, BerryWindow targetWindow = null, bool killInput = false, bool skipSystemRefrencerce = false)
 {
     if (createSeparateFocusInstance)
     {
         GameObject separateFocus = CreateCanvas("separateFocusCanvas", null, false, true, 10000, true, false);
         if (!disabelBackBackground)
         {
             /*
              *                  ScenePrimer.curPrimerComponent.disableInput = true;
              *                  GlobalToolManager.globalToolManager.disableInput = true;
              */
             GlobalToolManager.DisabelTools();
             UiInteractiveBackgroundObject focusBG = new UiInteractiveBackgroundObject();
             focusBG.uiSize       = new Vector2(0, 0);
             focusBG.normalColor  = new Color(0, 0, 0, 0.35f);
             focusBG.hoverColor   = new Color(0, 0, 0, 0.35f);
             focusBG.pressedColor = new Color(0, 0, 0, 0.35f);
             UiButtonObject focusBackgroundButton = new UiButtonObject();
             focusBackgroundButton.uiSize = new Vector2(0, 0);
             focusBackgroundButton.uiButtonBackgroundObject           = focusBG;
             focusBackgroundButton.uiButtonBackgroundObject.uiRayCast = true;
             focusBackgroundButton.uiButtonBackgroundObject.uiColor   = new Color(0, 0, 0, 0);
             focusBackgroundButton.uiButtonIcon = null;
             focusBackgroundButton.uiButtonBackgroundObject.uiAnchorMode = UiAnchorsMode.FillStretch;
             focusBackgroundButton.uiAnchorMode = UiAnchorsMode.FillStretch;
             GameObject defocusBg = CreateButton(separateFocus, focusBackgroundButton).gameObject;
             defocusBg.AddComponent <DefocusBtn>().focusInstanceObjRef = focusInstanceObj;
             defocusBg.GetComponent <DefocusBtn>().windowReference     = targetWindow;
             defocusBg.GetComponent <DefocusBtn>().killInput           = killInput;
         }
         if (!skipSystemRefrencerce)
         {
             addFocusSeparate(separateFocus);
         }
         return(separateFocus);
     }
     else
     {
         if (curFocusObj != null)
         {
             /*
              *                  if(fadeInAnimation)
              *                  {
              *                          curFocusObj.transform.parent.gameObject.AddComponent<QuickUiAnimator>().PlayFadeAnim(0, 1, false, true, 0.01f);
              *                  }else{
              *                          curFocusObj.SetActive(true);
              *                  }
              */
         }
         else
         {
             GameObject curFocus = CreateCanvas("FocusCanvas", null, false, true, 10000, true, false);
             focusInstanceObj = curFocus;
             if (!disabelBackBackground)
             {
                 /*
                  *                      ScenePrimer.curPrimerComponent.disableInput = true;
                  *                      GlobalToolManager.globalToolManager.disableInput = true;
                  */
                 GlobalToolManager.DisabelTools();
                 UiInteractiveBackgroundObject focusBG = new UiInteractiveBackgroundObject();
                 focusBG.uiSize       = new Vector2(0, 0);
                 focusBG.normalColor  = new Color(0, 0, 0, 0.35f);
                 focusBG.hoverColor   = new Color(0, 0, 0, 0.35f);
                 focusBG.pressedColor = new Color(0, 0, 0, 0.35f);
                 UiButtonObject focusBackgroundButton = new UiButtonObject();
                 focusBackgroundButton.uiSize = new Vector2(0, 0);
                 focusBackgroundButton.uiButtonBackgroundObject           = focusBG;
                 focusBackgroundButton.uiButtonBackgroundObject.uiColor   = new Color(0, 0, 0, 0);
                 focusBackgroundButton.uiButtonBackgroundObject.uiRayCast = true;
                 focusBackgroundButton.uiButtonIcon = null;
                 focusBackgroundButton.uiButtonBackgroundObject.uiAnchorMode = UiAnchorsMode.FillStretch;
                 focusBackgroundButton.uiAnchorMode = UiAnchorsMode.FillStretch;
                 GameObject defocusBg = CreateButton(curFocus, focusBackgroundButton).gameObject;
                 defocusBg.AddComponent <DefocusBtn>().focusInstanceObjRef = focusInstanceObj;
                 defocusBg.GetComponent <DefocusBtn>().windowReference     = targetWindow;
                 defocusBg.GetComponent <DefocusBtn>().killInput           = killInput;
             }
             curFocusObj = curFocus;
             if (fadeInAnimation)
             {
             }
             else
             {
                 curFocusObj.SetActive(true);
             }
             return(curFocus);
         }
         return(focusInstanceObj);
     }
 }