Пример #1
0
        /// <summary>
        ///   Clean up any resources being used.
        /// </summary>
        /// <param name="disposing"> true if managed resources should be disposed; otherwise, false. </param>
        protected override void Dispose(bool disposing)
        {
            EidssMapSerializer.Instance.LayerDeserializationExceptionEvent -= Instance_LayerDeserializationExceptionEvent;

            if (m_ZlyrSelector != null)
            {
                m_ZlyrSelector.Dispose();
                m_ZlyrSelector = null;
            }

            if (m_MapSelector != null)
            {
                m_MapSelector.Dispose();
                m_MapSelector = null;
            }
            if (m_mapImage != null && !m_mapImage.IsDisposed)
            {
                m_mapImage.Dispose(); //Crash where!
                m_mapImage = null;
            }
            if (m_MapContent != null)
            {
                m_MapContent.Map = null;
            }

            base.Dispose(disposing);
        }
Пример #2
0
    //keep the instance alive
    void FixedUpdate()
    {
        instance = this;

        time        = MultiplayerManager.instance.matchTime;
        startHealth = MultiplayerManager.instance.matchHP;
        ammo        = MultiplayerManager.instance.matchAmmo;

        int  prevTeam    = MultiplayerManager.instance.PlayerList[0].team;
        bool TeamVariety = false;

        foreach (MyPlayer pl in MultiplayerManager.instance.PlayerList)
        {
            if (pl.team != prevTeam || !MultiplayerManager.instance.allowTeams)
            {
                TeamVariety = true;
            }
        }

        Check();

        if (/*TeamVariety && */ AllLockedIn)
        {
            AllReady = true;
        }
    }
Пример #3
0
    void Start()
    {
        loadConfigs();

        Debug.Log("Loading GRF at " + configs["grf"] + "...");
        FileManager.loadGrf(configs["grf"] as string);
        Debug.Log("GRF loaded, filetable contains " + FileManager.Grf.files.Count + " files.");

        Debug.Log("Building map list...");
        MapSelector selector = new MapSelector(FileManager.Grf);

        selector.buildDropdown(mapDropdown);
        Debug.Log("Map list has " + selector.GetMapList().Count + " entries.");

        MapRenderer.SoundsMixerGroup = soundsMixerGroup;
        MapRenderer.WorldLight       = worldLight;

        SPR        spr = FileManager.Load("data/sprite/npc/4_bb_poring.spr") as SPR;
        GameObject obj = new GameObject(spr.filename);

        obj.AddComponent <SPRRenderer>().setSPR(spr, 0, 3);

        SPR        spr2 = FileManager.Load("data/sprite/homun/lif_h.spr") as SPR;
        GameObject obj2 = new GameObject(spr2.filename);

        obj2.AddComponent <SPRRenderer>().setSPR(spr2, 0, 3);

        if (!string.IsNullOrEmpty(mapname))
        {
            selector.ChangeMap(mapname);
        }
    }
Пример #4
0
        public static Stream GetResourceMap(MapSelector mapsSelector)
        {
            Stream resourceMap = new MemoryStream();

            switch (mapsSelector)
            {
            case MapSelector.Map1:
                resourceMap = GetResourceTestMap1();
                break;

            case MapSelector.Map2:
                resourceMap = GetResourceTestMap2();
                break;

            case MapSelector.Map3:
                resourceMap = GetResourceTestMap3();
                break;

            case MapSelector.Map4:
                resourceMap = GetResourceTestMap4();
                break;

            default:
                break;
            }

            return(resourceMap);
        }
Пример #5
0
 void DrawMap()
 {
     foreach (Room room in rooms)
     {
         if (room == null)
         {
             continue; //skip where there is no room
         }
         Vector2 drawPos = room.gridPos;
         drawPos.x *= 22;//aspect ratio of map sprite
         drawPos.y *= 12;
         drawPos.y -= 0.5f;
         //create map obj and assign its variables
         MapSelector mapper = mapSelector.GetComponent <MapSelector>();
         mapper.type  = room.type;
         mapper.up    = room.doorTop;
         mapper.down  = room.doorBot;
         mapper.right = room.doorRight;
         mapper.left  = room.doorLeft;
         mapper.gameObject.transform.parent = mapRoot;
         mapper.PickRoom();
         GameObject       roomObj       = (GameObject)Object.Instantiate(mapper.getRoom(), drawPos, Quaternion.identity);
         CameraTriggerEnd centerTrigger = roomObj.transform.Find("Center").GetComponent <CameraTriggerEnd>();
         centerTrigger.isStartingRoom = room.isStartingRoom;
         if (room.isEndingRoom)
         {
             GameObject exit = (GameObject)Object.Instantiate(levelExit, drawPos, Quaternion.identity);
             exit.transform.SetParent(roomObj.transform);
             centerTrigger.isSafeRoom = true;
             room.cameraPosition      = roomObj.transform.position;
             room.setRoom(roomObj);
             continue;
         }
         if (Random.value < 0.1 && !safeRoomExists && !room.isStartingRoom)
         {
             // roomObj.transform.Find("Enemy Spawner").gameObject.GetComponent<EnemySpawner>().isSafeRoom = true;
             centerTrigger.isSafeRoom = true;
             GameObject s  = (GameObject)Object.Instantiate(storage, drawPos, Quaternion.identity);
             GameObject s1 = (GameObject)Object.Instantiate(shop, drawPos + new Vector2(-7f, 3f), Quaternion.identity);
             s.transform.SetParent(roomObj.transform);
             s.transform.SetParent(roomObj.transform);
             safeRoomExists = true;
         }
         else if (Random.value < chestRoomChance && !room.isStartingRoom)
         {
             // roomObj.transform.Find("Enemy Spawner").gameObject.GetComponent<EnemySpawner>().isSafeRoom = true;
             centerTrigger.isSafeRoom = true;
             GameObject s = (GameObject)Object.Instantiate(chest, drawPos, Quaternion.identity);
             s.transform.SetParent(roomObj.transform);
         }
         else
         {
             centerTrigger.isSafeRoom = false;
         }
         room.cameraPosition = roomObj.transform.position;
         room.setRoom(roomObj);
     }
 }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        mm = GameObject.Find("Multiplayer Manager").GetComponent <MultiplayerManager>();

        instance    = this;
        skins       = Resources.LoadAll("Skins");
        currentMenu = "Lobby";
        InitiateLocked();
    }
Пример #7
0
    void Awake()
    {
        Anim = Character.GetComponent <Animator>();

        ingame_cs                = Canvas.GetComponent <Ingame>();
        death_show_img           = death_show.GetComponent <Image>();
        mapselector_sc           = Canvas.GetComponent <MapSelector>();
        CharacaterDeathPoup_anim = CharacterDeathPopup.GetComponent <Animator>();
    }
Пример #8
0
 public void DeleteMap()
 {
     if (selectedMap != null)
     {
         MapData.Delete(selectedMap.mapName);
         ClearGrid();
         FetchGrid();
         selectedMap = null;
     }
 }
Пример #9
0
        public void GoToGame(MapSelector selection)
        {
            string selectedMap = selection.arenaSelector ? ((Enums.BattleStages)selection.currentSelectedMap).ToString() : ((Enums.TargetPracticeStages)selection.currentSelectedMap).ToString();

            GameManager.lastLoadedLevel = selectedMap;
            if (ProfileManager.instance.NumSignedIn() > 1)
            {
                SceneManager.LoadScene(selectedMap, LoadSceneMode.Single);
            }
        }
Пример #10
0
        /// <summary>
        /// Init default map project
        /// </summary>
        public void InitMap()
        {
            MapSpatRef = CoordinateSystems.SphericalMercatorCS;
            var defPath = string.IsNullOrEmpty(BaseSettings.DefaultMapProject)
                ? MapProjectsStorage.DefaultMapPath
                : BaseSettings.DefaultMapProject;

            LoadMap(defPath);
            MapSelector.UpdateValue(GisInterface.GetMapName(defPath));
        }
        public static IAsciiMap LoadAsciiMap(MapSelector mapsSelector)
        {
            IAsciiMap map = new AsciiMap();

            using (var mapResource = LoadMapFromEmbeddedResource(mapsSelector))
            {
                map.MapMatrix = GetMapMatrixFromResource(mapResource);
            }

            return(map);
        }
        public static Stream LoadMapFromEmbeddedResource(MapSelector mapsSelector)
        {
            var assembly = Assembly.GetExecutingAssembly();
            var mapName  = GetMapName(assembly, mapsSelector);

            if (mapName == null)
            {
                return(null);
            }

            return(assembly.GetManifestResourceStream(mapName));
        }
        public void LoadMapFromEmbeddedResource_ReadMapFile_ReturnsMapCharacters(MapSelector mapsSelector, int mapCharacterLengthExpected)
        {
            int mapCharactersLength = 0;

            using (var mapResource = MapLoader.LoadMapFromEmbeddedResource(mapsSelector))
            {
                StreamReader mapReader = new StreamReader(mapResource);
                mapCharactersLength = mapReader.ReadToEnd().Length;
            }

            Assert.Equal(mapCharacterLengthExpected, mapCharactersLength);
        }
        public void GetMapMatrixFromResource_AciiMapFromResource_ReturnsMap(
            MapSelector mapsSelector,
            int expectedMapMatrixFieldCount)
        {
            IDictionary <IAsciiMapCoordinate, IAsciiField> map;

            using (var mapResource = TestResource.GetResourceMap(mapsSelector))
            {
                map = MapLoader.GetMapMatrixFromResource(mapResource);
            }

            Assert.Equal(map.Count, expectedMapMatrixFieldCount);
        }
Пример #15
0
    private void FetchGrid()
    {
        maps = MapData.GetMapsInDirectory();

        Debug.Log("maps count in directory -> " + maps.Length);

        for (int i = 0; i < maps.Length; i++)
        {
            Button      button      = Instantiate(buttonPrefab, grid);
            MapSelector mapSelector = button.gameObject.AddComponent <MapSelector>();
            mapSelector.mapName     = maps[i];
            mapSelector.loadMapMenu = this;
        }
    }
Пример #16
0
        private static IAsciiMap LoadAsciiMap(MapSelector mapSelector)
        {
            IAsciiMap map = null;

            try
            {
                map = MapLoader.LoadAsciiMap(mapSelector);
            }
            catch (Exception e)
            {
                log.Error("Error loading ascii map!", e);
                Environment.Exit(1);
            }

            return(map);
        }
Пример #17
0
    private void OnEnable()
    {
        if (PlayerPrefs.HasKey(Enum.GetName(typeof(MapEnum), unlockedMapName)) || (int)unlockedMapName == 0)
        {
            _unlocked       = true;
            mapImage.sprite = unlockedMapSprite;
            mapName.text    = Enum.GetName(typeof(MapEnum), unlockedMapName);
        }
        else
        {
            _unlocked       = false;
            mapImage.sprite = lockedMapSprite;
            mapName.text    = Enum.GetName(typeof(MapEnum), lockedMapName);
        }

        _mapSelector = GetComponentInParent <MapSelector>();
    }
    private void Awake()
    {
        panel       = gameObject.transform.GetChild(0);
        displayDict = new Dictionary <string, GameObject>();
        for (int i = 0; i < panel.childCount; i++)
        {
            var child = panel.GetChild(i).gameObject;
            var name  = child.name;

            if (name == "Question Background")
            {
                questionText = child.GetComponentInChildren <Text>();
                displayDict.Add("question", child);
            }
            else if (name == "Category Question")
            {
                displayDict.Add("category", child);
            }
            else if (name == "Dropdown Question")
            {
                displayDict.Add("dropdown", child);
                answerDropdown = child.GetComponentInChildren <Dropdown>();
                var submitButton = child.GetComponentInChildren <Button>();
                submitButton.onClick.AddListener(OnSubmitDropdown);
                //answerDropdown.onValueChanged.AddListener(OnSelectDropdown);
            }
            else if (name == "Map Question")
            {
                displayDict.Add("map", child);
                mapSelector = child.GetComponent <MapSelector>();
                mapSelector.selectCallback        = OnSelectMapPoint;
                mapSelector.onClickButtonCallback = OnSelectMapButton;
            }
            else if (name == "String Question")
            {
                displayDict.Add("input", child);
                answerField = child.GetComponentInChildren <InputField>();
                answerField.onEndEdit.AddListener(OnAnswerInputField);
            }
            else if (name == "Skip Button")
            {
                skipButton = child.GetComponent <Button>();
                skipButton.onClick.AddListener(OnSkipButton);
            }
        }
    }
Пример #19
0
    private void BuildMapSelector()
    {
        Debug.Log("Building map list...");
        MapSelector selector = new MapSelector(FileManager.Grf);

        selector.buildDropdown(mapDropdown);
        Debug.Log($"Map list has {selector.GetMapList().Count} entries.");

        // do we have a map to load on startup
        var preLoadMap = !string.IsNullOrEmpty(mapname);

        // there is a map to load on startup: load it
        if (preLoadMap)
        {
            selector.ChangeMap(mapname);
        }

        // if a map is pre loaded, do not display map selector on startup
        mapDropdown.gameObject.SetActive(!preLoadMap);
    }
Пример #20
0
 void Start()
 {
     border = gameObject.GetComponentInParent<CountryBorder>();
     country = border.country;
     mapSelector = MapSelector.Instance;
 }
Пример #21
0
    private void HandleCallBack()
    {
        string RetVal;
        string RequestParam;
        string RequestParam2;
        string RequestParam3;
        string RequestParam4;
        string RequestParam5;
        string RequestParam6;
        string dbNid = string.Empty;
        string lngCode = string.Empty;

        CallbackType OCallbackType;
        MapSelector OCallback;

        RetVal = string.Empty;
        RequestParam = string.Empty;
        RequestParam2 = string.Empty;
        RequestParam3 = string.Empty;
        RequestParam4 = string.Empty;
        RequestParam5 = string.Empty;
        RequestParam6 = string.Empty;

        OCallback = null;
        OCallbackType = CallbackType.None;

        try
        {
            if (Request.QueryString.Count > 0)
            {
                dbNid = Request.QueryString["dbnid"];
                lngCode = Request.QueryString["lngcode"];
            }

            if (Request.Params.Count > 0)
            {
                OCallbackType = (CallbackType)int.Parse(Request[Constants.RequestHeaderParamNames.CallBack].ToString());
                RequestParam = Request[Constants.RequestHeaderParamNames.Param1];
                RequestParam2 = Request[Constants.RequestHeaderParamNames.Param2];
                RequestParam3 = Request[Constants.RequestHeaderParamNames.Param3];
                RequestParam4 = Request[Constants.RequestHeaderParamNames.Param4];
                RequestParam5 = Request[Constants.RequestHeaderParamNames.Param5];
                RequestParam6 = Request[Constants.RequestHeaderParamNames.Param6];

                OCallback = new MapSelector(this.Page);

                switch (OCallbackType)
                {
                    case CallbackType.InitializeByMap:
                        RetVal = OCallback.InitializeByMap(RequestParam, RequestParam2, RequestParam3, dbNid, lngCode);
                        break;
                    case CallbackType.ZoomInByMap:
                        RetVal = OCallback.ZoomInByMap();
                        break;
                    case CallbackType.ZoomOutByMap:
                        RetVal = OCallback.ZoomOutByMap();
                        break;
                    case CallbackType.ZoomToRectangleByMap:
                        RetVal = OCallback.ZoomToRectangleByMap(RequestParam, RequestParam2, RequestParam3, RequestParam4);
                        break;
                    case CallbackType.PanByMap:
                        RetVal = OCallback.PanByMap(RequestParam, RequestParam2, RequestParam3, RequestParam4);
                        break;
                    case CallbackType.FullExtentByMap:
                        RetVal = OCallback.FullExtentByMap();
                        break;
                    case CallbackType.GetAreaSelection:
                        RetVal = OCallback.GetAreaSelection(RequestParam);
                        break;
                    case CallbackType.SetMapSelection:
                        RetVal = OCallback.SetMapSelection(RequestParam, RequestParam2, dbNid, lngCode);
                        break;
                    case CallbackType.LabelByMap:
                        RetVal = OCallback.LabelByMap(RequestParam);
                        break;
                    default:
                        break;
                }
            }
        }
        catch (Exception ex)
        {
            Global.CreateExceptionString(ex, null);
        }
        finally
        {
            Response.Write(RetVal);
        }
    }
Пример #22
0
        public void InitLightMapProjectToolBar()
        {
            barManager.Form = this;
            barManager.BeginUpdate();


            #region Create GeoSearch bar

            var geoSearchBar = new Bar(barManager, "GeoSearch");
            geoSearchBar.OptionsBar.AllowDelete             = false;
            geoSearchBar.OptionsBar.AllowQuickCustomization = false;
            geoSearchBar.OptionsBar.DisableClose            = true;
            geoSearchBar.OptionsBar.DisableCustomization    = true;
            geoSearchBar.DockStyle           = BarDockStyle.Top;
            geoSearchBar.CanDockStyle        = BarCanDockStyle.Top;
            geoSearchBar.OptionsBar.BarState = BarState.Expanded;
            geoSearchBar.Visible             = true;
            geoSearchBar.DockRow             = 0;
            geoSearchBar.DockCol             = 3;
            geoSearchBar.ApplyDockRowCol();

            //create MapSelectorTool
            var beGeoSearch = new RepositoryItemButtonEdit();
            //beGeoSearch.Buttons[0].ToolTip = "Search for administrative unit";
            beGeoSearch.Buttons[0].Kind    = ButtonPredefines.Glyph;
            beGeoSearch.Buttons[0].Caption = "Search";

            var toolTipTitle = new ToolTipTitleItem();
            toolTipTitle.Text = EidssMessages.GetForCurrentLang("gis_Geosearch_Tooltip", "Search for administrative unit");
            //"Search for administrative unit";
            var superToolTip = new SuperToolTip();
            superToolTip.Items.Add(toolTipTitle);

            var beiGeoSearch = new BarEditItem(barManager, beGeoSearch)
            {
                SmallWithoutTextWidth = 130,
                SmallWithTextWidth    = 130,
                Width    = 130,
                SuperTip = superToolTip
            };


            m_GeoSearch = new GeoSearch {
                MapControl = m_mapImage, ControlForVisualize = beiGeoSearch
            };

            geoSearchBar.AddItem(beiGeoSearch);
            beiGeoSearch.Visibility = BarItemVisibility.Always;

            beGeoSearch.ButtonClick += beGeoSearch_ButtonClick;


            #endregion

            //create map projects bar
            var mapsBar = new Bar(barManager, "MapProjects");
            mapsBar.OptionsBar.AllowDelete             = false;
            mapsBar.OptionsBar.AllowQuickCustomization = false;
            mapsBar.OptionsBar.DisableClose            = true;
            mapsBar.OptionsBar.DisableCustomization    = true;

            mapsBar.DockStyle           = BarDockStyle.Top;
            mapsBar.CanDockStyle        = BarCanDockStyle.Top;
            mapsBar.OptionsBar.BarState = BarState.Expanded;
            mapsBar.Visible             = true;
            mapsBar.DockRow             = 0;
            mapsBar.DockCol             = 0;
            mapsBar.ApplyDockRowCol();

            //create ExportImage Tool
            var mbb   = new MapBarButton();
            var mTool = new MtExportAsImage {
                MapImage = m_mapImage
            };
            mbb.MapTool = mTool;
            mapsBar.AddItem(mbb);

            //create Admin filter Tool
            mbb = new MapBarButton();
            var mTool1 = new MtAdminMask()
            {
                MapImage = m_mapImage
            };
            mbb.MapTool = mTool1;
            mapsBar.AddItem(mbb);

            //create MapSelectorTool
            var cmb = new RepositoryItemComboBox();
            var bei = new BarEditItem(barManager, cmb);
            bei.SmallWithoutTextWidth = 118;
            bei.SmallWithTextWidth    = 118;
            bei.Width = 118;

            if (m_MapSelector != null)
            {
                m_MapSelector.Dispose();
            }
            m_MapSelector = new MapSelector {
                MapControl = m_mapImage, ControlForVisualize = bei, Content = m_MapContent
            };
            m_MapSelector.MapChanging += m_MapSelector_MapChanging;

            mapsBar.AddItem(bei);

            barManager.EndUpdate();
        }
Пример #23
0
 public void SetMapSelector(MapSelector mapSelector)
 {
     this.mapSelector = mapSelector;
 }
Пример #24
0
 void Start()
 {
     inst = this;
     StartCoroutine(GetText("http://madebyjimchen.com/WarOfCastles/api/getMapList.php?page=1"));
 }
Пример #25
0
		public void GoToGame(MapSelector selection) {
			string selectedMap = selection.arenaSelector ? ((Enums.BattleStages)selection.currentSelectedMap).ToString() : ((Enums.TargetPracticeStages)selection.currentSelectedMap).ToString();
			GameManager.lastLoadedLevel = selectedMap;
			if(ProfileManager.instance.NumSignedIn() > 1) SceneManager.LoadScene(selectedMap, LoadSceneMode.Single);
		}
Пример #26
0
    void Awake()
    {
        worldmap.SetActive(true);

        npcsc_sc   = npc.GetComponent <NpcScript>();
        money_text = Money_tex.GetComponent <Text>();
        Singleton.getInstance.stage      = 999;
        Singleton.getInstance.MyPosition = Inanis_map.WorldTree;
        mapname_img = MapnameSeal.GetComponent <Image>();
        Screen.SetResolution(540, 960, false);

        if (PlayerPrefs.GetInt("Money") == 0)
        {
            if (PlayerPrefs.GetInt("First") == 0)
            {
                Debug.Log("f");
                PlayerPrefs.SetInt("First", 1);
                PlayerPrefs.SetInt("Money", 100);
                PlayerPrefs.Save();
            }
        }
        int i = PlayerPrefs.GetInt("Quest");

        if (i == 0)
        {
            Singleton.getInstance.quest = Quest.none;
        }
        else if (i == 1)
        {
            Singleton.getInstance.quest = Quest.going;
        }
        else if (i == 2)
        {
            Singleton.getInstance.quest = Quest.finish;
        }
        else if (i == 3)
        {
            Singleton.getInstance.quest = Quest.fd;
        }

        if (PlayerPrefs.GetInt("BerserkerLevel") == 0)
        {
            PlayerPrefs.SetInt("BerserkerLevel", 1);
        }
        Singleton.getInstance.Level          = PlayerPrefs.GetInt("BerserkerLevel");
        Singleton.getInstance.EnableWorld[0] = 1;
        Singleton.getInstance.EnableWorld[1] = 1;
        Singleton.getInstance.EnableWorld[2] = 0;
        Singleton.getInstance.EnableWorld[3] = 0;
        Singleton.getInstance.EnableWorld[4] = 0;
        Singleton.getInstance.EnableWorld[5] = 0;
        Singleton.getInstance.money          = PlayerPrefs.GetInt("Money");
        Singleton.getInstance.Level          = PlayerPrefs.GetInt("BerserkerLevel");

        int c = 50;
        int j = Singleton.getInstance.Level;

        for (int d = 1; d < j; d++)
        {
            c += ((d) * 2 + 1);
        }
        Singleton.getInstance.Power    = c;
        Singleton.getInstance.skill1lv = PlayerPrefs.GetInt("SKill1");
        Singleton.getInstance.skill2lv = PlayerPrefs.GetInt("SKill2");
        mapname.Add("메마른 오아시스 입구");
        mapname.Add("붉은 사막길3");
        mapname.Add("붉은 사막길2");
        mapname.Add("붉은 사막길1");
        mapname.Add("황폐화된 벌판2");
        mapname.Add("황페화된 벌판1");
        mapname.Add("메마른 오아시스");
        mapname.Add("메마른 오아시스");
        money_text.text = Singleton.getInstance.money.ToString() + " G";

        bossmanager_sc     = GetComponent <BossManager>();
        mapname_text       = Mapname_gb.GetComponent <Text>();
        createpattern_sc   = GetComponent <CreatePattern>();
        monstermananger_sc = GetComponent <MonsterMananger>();
        mapselector_sc     = GetComponent <MapSelector>();
        map_sc             = Map_gb.GetComponent <Map>();
    }
        private static string GetMapName(Assembly assembly, MapSelector mapsSelector)
        {
            var resourceNames = assembly.GetManifestResourceNames();

            return(Array.Find(resourceNames, x => x.Contains(mapsSelector.ToString())));
        }
Пример #28
0
 public void SelectMap(MapSelector mapSelector)
 {
     selectedMap = mapSelector;
 }