Пример #1
0
        public void SetTransition(Vector2 _position)
        {
            if (inScreen)
            {
                using (DropDownDialog mapSelected = new DropDownDialog(".gmap", "Map", "Selected Map:"))
                {
                    MapObject mObject = mapInfo.MapObjects.AsQueryable().Where(x => x.DestinationBox.Contains(_position - Position)).FirstOrDefault();


                    mapSelected.ShowDialog();
                    DialogResult result  = mapSelected.DialogResult;
                    String       results = mapSelected.GetCleanText();

                    if (result == DialogResult.OK && results != "")
                    {
                        Tile t = cursor.Selected;
                        if (mObject == null)
                        {
                            MapObject obj = new MapObject();
                            obj.AddTile(t);
                            obj.SetType(MapTypeObject.Transition);
                            obj.Data = results;
                            mapInfo.MapObjects.Add(obj);
                        }
                        else if (mObject.Type == MapTypeObject.Transition)
                        {
                            mObject.AddTile(t);
                            mObject.SetType(MapTypeObject.Transition);
                            mObject.Data = results;
                        }
                    }
                }
            }
        }
Пример #2
0
 internal void SetMusic()
 {
     using (DropDownDialog musicDialog = new DropDownDialog(".mp3", "Music", "Choose Music:"))
     {
         DialogResult result = musicDialog.ShowDialog();
         if (result == DialogResult.OK)
         {
             mapInfo.Music = musicDialog.GetCleanText().Replace(".mp3", "");
         }
     }
 }