/// <inheritdoc />
 /// <summary>
 /// </summary>
 public EditorSaveAndQuitDialog(EditorScreen screen) : base("You have unsaved changes. Would you like to save before quitting?", null)
 {
     Screen     = screen;
     OnConfirm += (sender, args) => Screen.Save(true);
     CreateNoButton();
     AlignButtons();
 }
 public TerraformTool(EditorScreen screen, WorldEditor editor)
     : base(screen, editor, EditorToolType.Terraform, Key.Number6)
 {
     window         = new TerraformWindow(UI.GUISystem, UI.Theme);
     window.Visible = false;
     UI.GUISystem.Add(window);
 }
Exemplo n.º 3
0
        public EditorPage()
        {
            InitializeComponent();
            _screen    = App.ChangeScreen <EditorScreen>();
            _prevPoint = null;

            Objectives = _screen.Objectives.Objectives;

            ObjectTypes = new List <string>();
            BuildObjTypeList();

            _gameGrid = new Graphics.Grid(Vector3.Zero, 32);
            _selected = null;
            _offset   = Vector3.Zero;

            DeleteModeCombo.Items.Add(ObjectType.Object);
            DeleteModeCombo.Items.Add(ObjectType.Road);
            DeleteModeCombo.Items.Add(ObjectType.Zone);
            DeleteModeCombo.SelectedIndex = 0;

            var roadMapEntity = _screen.CreateEntity("RoadMap", 0, 0, 1);

            _roadSprite = roadMapEntity.AddComponent <TileSprite>();
            _roadSprite.Load(_screen.Cache, "ms-appx:///Data/Road.map");
            _roadSprite.Origin = TileSprite.OriginLocation.TopLeft;

            AddObjectives();

            _pointerDown = false;

            DataContext = this;
        }
Exemplo n.º 4
0
        public LevelPreview(EditorScreen editorScreen, int index)
        {
            this.editorScreen = editorScreen;
            i = index;

            AutoSizeAxes = Axes.Both;
        }
Exemplo n.º 5
0
        internal static void SetAll(String tileType)
        {
            EditorScreen.updateHistory();

            for (int x = 0; x < game.world.currentArea.mapWidth; x++)
            {
                for (int y = 0; y < game.world.currentArea.mapHeight; y++)
                {
                    //apply properties
                    game.world.currentArea.tile[x, y].setAccessible(editor.northBox.Checked, editor.eastBox.Checked, editor.southBox.Checked, editor.westBox.Checked);
                    game.world.currentArea.tile[x, y].setRamp(editor.rampBox.Checked);
                    game.world.currentArea.tile[x, y].setJumpable(editor.jumpBox.Checked);
                    game.world.currentArea.tile[x, y].setRandomEncounter(editor.randomEncounterBox.Checked);
                    game.world.currentArea.tile[x, y].setWater(editor.waterBox.Checked);

                    //apply tile image
                    game.world.currentArea.tile[x, y].tileType = tileType;
                    //game.world.changeZone(game.world.currentArea);
                }
            }

            //if the history index is zero we want to save the current zone
            if (editor.historyIndex == 0)
            {
                editor.zoneHistory[0] = new Zone(game.world.currentArea);
            }

            //then update buffers all in one fell swoop
            GameDraw.MakeAdjBuffers(game.world);
        }
Exemplo n.º 6
0
 public ReversibleUpdateNoteEndTime(S2VXNote note, double oldEndTime, double newEndTime, EditorScreen editor)
 {
     Note       = note;
     OldEndTime = oldEndTime;
     NewEndTime = newEndTime;
     Editor     = editor;
 }
Exemplo n.º 7
0
 public EditorOptions(EditorScreen parent)
 {
     this.parent = parent;
     InitializeComponent();
     parent.CurrentSong.remakeLists(parent.Chart);
     popTiming();
     timingBox.SelectedIndex = 0;
     artistBox.Text          = parent.CurrentSong.Artist;
     titleBox.Text           = parent.CurrentSong.SongName;
     creatorBox.Text         = parent.CurrentSong.Creator;
     bgBox.Text   = parent.Chart.BgName;
     fileBox.Text = parent.CurrentSong.FileName;
     leadBox.Text = "" + (parent.Chart.LeadInTime * 1000);
     tagsBox.Text = "";
     foreach (string s in parent.Chart.Tags)
     {
         tagsBox.Text += s + " ";
     }
     foreach (var pair in parent.CurrentSong.Charts)
     {
         difficultiesCombo.Items.Add(pair.Value.Name);
     }
     difficultiesCombo.SelectedIndex = 0;
     foreach (double d in parent.CurrentSong.Bookmarks)
     {
         bookmarkBox.Items.Add(d);
     }
     if (bookmarkBox.Items.Count > 0)
     {
         bookmarkBox.SelectedIndex = 0;
     }
 }
Exemplo n.º 8
0
 public static void OnEditorScreenChanged(EditorScreen screen)
 {
     if (EditorScreenChanged != null)
     {
         EditorScreenChanged(screen);
     }
 }
Exemplo n.º 9
0
 public EditorOptions(EditorScreen parent)
 {
     this.parent = parent;
     InitializeComponent();
     parent.CurrentSong.remakeLists(parent.Chart);
     popTiming();
     timingBox.SelectedIndex = 0;
     artistBox.Text = parent.CurrentSong.Artist;
     titleBox.Text = parent.CurrentSong.SongName;
     creatorBox.Text = parent.CurrentSong.Creator;
     bgBox.Text = parent.Chart.BgName;
     fileBox.Text = parent.CurrentSong.FileName;
     leadBox.Text = "" + (parent.Chart.LeadInTime * 1000);
     tagsBox.Text = "";
     foreach (string s in parent.Chart.Tags)
     {
         tagsBox.Text += s + " ";
     }
     foreach (var pair in parent.CurrentSong.Charts)
     {
         difficultiesCombo.Items.Add(pair.Value.Name);
     }
     difficultiesCombo.SelectedIndex = 0;
     foreach (double d in parent.CurrentSong.Bookmarks)
     {
         bookmarkBox.Items.Add(d);
     }
     if (bookmarkBox.Items.Count > 0)
     {
         bookmarkBox.SelectedIndex = 0;
     }
 }
Exemplo n.º 10
0
        // ====================================================================
        //  Game Event Hooks
        // ====================================================================

        /// <summary>
        /// Enable the sort bar when we switch to the Crew AssignmentPanel; disable it when we switch out. (Callback)
        /// </summary>
        /// <param name="screen">The screen we've just switched to</param>
        protected void OnEditorScreenChange(EditorScreen screen)
        {
            try {
                if (screen == EditorScreen.Crew)
                {
                    sortBar.enabled = true;
                    playAnimation   = true;
                    animProgress    = 0f;
                    // To ensure a smooth transition:
                    sortBar.SetPos(baseX + anim.Evaluate(0f), baseY);

                    //sortBar.gameObject.GetComponent<Animation>().Play("flyin");

                    if (fixDefaultAssignment)
                    {
                        Utilities.FixDefaultVesselCrew(vesselCrew, availableCrew, sortBar);
                        fixDefaultAssignment = false;
                    }
                }
                else
                {
                    sortBar.enabled = false;
                }
            }
            catch (Exception e) {
                Debug.LogError("KerbalSorter: Unexpected error in EditorHook: " + e);
            }
        }
Exemplo n.º 11
0
 public PaintTool(EditorScreen screen, WorldEditor editor)
     : base(screen, editor, EditorToolType.Paint, Key.Number4)
 {
     window         = new PaintWindow(UI.GUISystem, UI.Theme);
     window.Visible = false;
     UI.GUISystem.Add(window);
 }
Exemplo n.º 12
0
        private void Load(AudioManager audio)
        {
            var audioPath = Path.Combine("TestTracks", "10-seconds-of-silence.mp3");
            var track     = S2VXTrack.Open(audioPath, audio);

            Add(new ScreenStack(Editor = new(new(), track)));
        }
 /// <summary>
 /// Here when the game scene switches.
 /// </summary>
 /// <param name="action"></param>
 private void OnGameSceneSwitch(GameEvents.FromToAction<GameScenes, GameScenes> action)
 {
     if (action.from != GameScenes.EDITOR) return;
     bool isStopping = (currentScreen == EditorScreen.Crew);
     currentScreen = EditorScreen.Parts;
     if (isStopping) OnStop();
 }
Exemplo n.º 14
0
 public void OnEditorScreenChange(EditorScreen e)
 {
     if (e == EditorScreen.Crew)
     {
         StartCoroutine(CallbackUtil.DelayedCallback(1, BuildCrewAssignmentDialogue));
     }
 }
Exemplo n.º 15
0
        public MainWindow()
        {
            InitializeComponent();

            EDITOR_SCREEN = new EditorScreen();

            Editor.Content = EDITOR_SCREEN;
        }
 /// <summary>
 /// Here when the editor screen changes.
 /// </summary>
 /// <param name="screen"></param>
 private void OnEditorScreenChange(EditorScreen screen)
 {
     bool isStarting = (screen == EditorScreen.Crew);
     bool isStopping = (currentScreen == EditorScreen.Crew);
     currentScreen = screen;
     if (isStopping) OnStop();
     if (isStarting) OnStart();
 }
Exemplo n.º 17
0
 protected void onEditorScreenChange(EditorScreen screen)
 {
     if (SystemHeatSettings.DebugOverlay)
     {
         Utils.Log("[SystemHeatOverlay]: Editor Screen Changed, clearing panels");
     }
     ClearPanels();
 }
 /// <summary>
 /// Start the monitor.
 /// </summary>
 public void Start()
 {
     currentScreen    = EditorScreen.Parts;
     lastUpdate       = DateTime.Now;
     lastAssignedCrew = GetCurrentlyAssignedCrew();
     GameEvents.onEditorScreenChange.Add(OnEditorScreenChange);
     // GameEvents.onGameSceneSwitchRequested.Add(OnGameSceneSwitch);
 }
Exemplo n.º 19
0
        /// <summary>
        /// </summary>
        /// <param name="screen"></param>
        public EditorRuleset(EditorScreen screen)
        {
            Screen = screen;

            // ReSharper disable once VirtualMemberCallInConstructor
            CompositionToolButtons = CreateCompositionToolButtons();
            AlignCompositionToolButtons();
        }
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public EditorLayerCompositor(EditorScreen screen)
        {
            Screen = screen;
            Size   = new ScalableVector2(230, 194);
            Image  = UserInterface.EditorLayerPanel;

            CreateHeader();
            CreateScrollContainer();
        }
Exemplo n.º 21
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public EditorMetadataConfirmationDialog(EditorScreen screen, EditorMetadataChanger changer) : base(0)
        {
            Screen  = screen;
            Changer = changer;
            Screen.InBackgroundConfirmationDialog = true;

            Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, 0, 0.75f, 100));
            CreateContent();
        }
Exemplo n.º 22
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public EditorHitsoundsPanel(EditorScreen screen)
        {
            Screen = screen;
            Size   = new ScalableVector2(230, 194);
            Image  = UserInterface.EditorHitsoundsPanel;

            CreateHeader();
            CreateHitsounds();
        }
Exemplo n.º 23
0
        public SelectTool(EditorScreen screen, WorldEditor editor)
            : base(screen, editor, EditorToolType.Select, Key.Number1)
        {
            debugRenderer = Renderer.GetRenderer3D <DebugRenderer>();
            transHandles  = new VoxelTranslationHandles(Renderer);

            window         = new ObjectEditWindow(UI.GUISystem, UI.Theme);
            window.Visible = false;
            UI.GUISystem.Add(window);
        }
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public EditorNavigationBarMain(EditorScreen screen) : base(new List <EditorControlButton>
        {
            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_arrow_pointing_to_left), "Back To Menu (ESC)", -48, Alignment.BotLeft,
                                    (o, e) => screen.HandleKeyPressEscape()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_plus_black_symbol), "New Map", -48, Alignment.BotLeft,
                                    (o, e) => screen.CreateNewDifficulty()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_undo_arrow), "Undo (CTRL+Z)", -48, Alignment.BotLeft,
                                    (o, e) => screen.Ruleset.ActionManager.Undo()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_refresh_arrow), "Redo (CTRL+Y)", -48, Alignment.BotLeft,
                                    (o, e) => screen.Ruleset.ActionManager.Redo()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_text_file), "Edit Metadata (F1)", -48, Alignment.BotLeft,
                                    (o, e) => screen.OpenMetadataDialog()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_time), "Timing Setup (F2)", -48, Alignment.BotLeft,
                                    (o, e) => NotificationManager.Show(NotificationLevel.Warning, "Not implemented yet")),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_dashboard), "Edit Scroll Velocities (F3)", -48, Alignment.BotLeft,
                                    (o, e) => screen.OpenScrollVelocityDialog()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_music_note_black_symbol), "Set Audio Preview Time (F4)", -48, Alignment.BotLeft,
                                    (o, e) => screen.ChangePreviewTime((int)AudioEngine.Track.Time)),
        }, new List <EditorControlButton>
        {
            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_settings), "Open Options Menu (CTRL+O)", -48, Alignment.BotRight,
                                    (o, e) =>
            {
                if (DialogManager.Dialogs.Count > 0)
                    return;

                DialogManager.Show(new SettingsDialog());
            }),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_earth_globe), "Visit Mapset Page (CTRL+T)", -48, Alignment.BotRight,
                                    (o, e) => MapManager.Selected.Value.VisitMapsetPage()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_cloud_storage_uploading_option), "Upload Mapset (CTRL+U)", -48, Alignment.BotRight,
                                    (o, e) => screen.UploadMapset()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_archive_black_box), "Export Mapset (CTRL+E)", -48, Alignment.BotRight,
                                    (o, e) => EditorScreen.ExportToZip()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_save_file_option), "Save File (CTRL+S)", -48, Alignment.BotRight,
                                    (o, e) => screen.Save()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_file), "Edit .qua File (CTRL+Q)", -48, Alignment.BotRight,
                                    (o, e) => MapManager.Selected.Value.OpenFile()),

            new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_open_folder), "Open Mapset Folder (CTRL+W)", -48, Alignment.BotRight,
                                    (o, e) => MapManager.Selected.Value.OpenFolder()),
        }) => Screen = screen;
Exemplo n.º 25
0
 /// <inheritdoc />
 /// <summary>
 /// </summary>
 /// <param name="screen"></param>
 public EditorRulesetKeys(EditorScreen screen) : base(screen)
 {
     CompositionTool = new Bindable <EditorCompositionTool>(EditorCompositionTool.Select)
     {
         Value = EditorCompositionTool.Select
     };
     CreateScrollContainer();
     CreateVisualizationGraphs();
     ActionManager = CreateActionManager();
     CreateRectangleSelector();
     SkinManager.SkinLoaded += OnSkinLoaded;
 }
Exemplo n.º 26
0
        void onEditorPanelChange(EditorScreen screen)
        {
            if (screen == EditorScreen.Actions || screen == EditorScreen.Crew)
            {
                minimized = true;
            }

            if (screen == EditorScreen.Parts)
            {
                minimized = minimizedManually;
            }
        }
Exemplo n.º 27
0
 protected void OnEditorScreenChanged(EditorScreen screen)
 {
     if (screen == EditorScreen.Crew)
     {
         RemapFillButton();
         CrewQueueRoster.HideVacationingCrew();
     }
     else
     {
         CrewQueueRoster.RestoreVacationingCrew();
     }
 }
Exemplo n.º 28
0
 public ReversibleCameraToolActions(
     EditorScreen editor,
     CameraMoveCommand moveCommand,
     CameraScaleCommand scaleCommand,
     CameraRotateCommand rotateCommand
     )
 {
     Editor        = editor;
     MoveCommand   = moveCommand;
     ScaleCommand  = scaleCommand;
     RotateCommand = rotateCommand;
 }
Exemplo n.º 29
0
        private void Load(AudioManager audio)
        {
            var storyPath = Path.Combine("VisualTests", "EditorScreenTests", "ValidStory.s2ry");

            Story = new S2VXStory();
            Story.Open(storyPath, true);
            var audioPath = Path.Combine("TestTracks", "10-seconds-of-silence.mp3");

            Track = S2VXTrack.Open(audioPath, audio);

            Add(new ScreenStack(Editor = new EditorScreen(Story, Track)));
        }
Exemplo n.º 30
0
 /// <summary>
 /// Here when a ship is loaded in the editor.
 /// </summary>
 /// <param name="construct"></param>
 /// <param name="loadType"></param>
 private void OnShipLoaded(ShipConstruct construct, CraftBrowserDialog.LoadType loadType)
 {
     try
     {
         CurrentEditorScreen = EditorScreen.Parts;
         HasBeenSorted       = false;
         sortAttempts        = 0;
     }
     catch (Exception e)
     {
         print("AlphabeticalKerbals: There was an error in OnShipLoaded");
     }
 }
Exemplo n.º 31
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public EditorUnsavedChangesDialog(EditorScreen screen) : base("You have unsaved changes. Would you like to save before creating a new difficulty?", null)
        {
            Screen = screen;

            OnConfirm += (sender, args) =>
            {
                Screen.Save();
                Screen.CreateNewDifficulty();
            };

            CreateNoButton();
            AlignButtons();
        }
Exemplo n.º 32
0
 private void OnEditorScreenChange(EditorScreen screen)
 {
     NetworkWorker.fetch.SendEditorScreenChange(screen);
 }
Exemplo n.º 33
0
        // ====================================================================
        //  Game Event Hooks
        // ====================================================================
        /// <summary>
        /// Enable the sort bar when we switch to the Crew AssignmentPanel; disable it when we switch out. (Callback)
        /// </summary>
        /// <param name="screen">The screen we've just switched to</param>
        protected void OnEditorScreenChange(EditorScreen screen)
        {
            try {
                if( screen == EditorScreen.Crew ) {
                    sortBar.enabled = true;
                    playAnimation = true;
                    animProgress = 0f;
                    // To ensure a smooth transition:
                    sortBar.SetPos(baseX + anim.Evaluate(0f), baseY);

                    //sortBar.gameObject.GetComponent<Animation>().Play("flyin");

                    if( fixDefaultAssignment ) {
                        Utilities.FixDefaultVesselCrew(vesselCrew, availableCrew, sortBar);
                        fixDefaultAssignment = false;
                    }
                }
                else {
                    sortBar.enabled = false;
                }
            }
            catch( Exception e ) {
                Debug.LogError("KerbalSorter: Unexpected error in EditorHook: " + e);
            }
        }
Exemplo n.º 34
0
 public void SendEditorScreenChange(EditorScreen screen)
 {
 }
Exemplo n.º 35
0
 public void OnEditorScreenChange(EditorScreen e)
 {
     if(e == EditorScreen.Crew) {
         StartCoroutine(CallbackUtil.DelayedCallback(1, BuildCrewAssignmentDialogue));
     }
 }
Exemplo n.º 36
0
 void onEditorScreenChange (EditorScreen screen)
 {
     OnEditorScreenChanged (screen);
 }
Exemplo n.º 37
0
 public void OnEditorScreenChanged (EditorScreen screen)
 {
     if (EditorScreenChanged != null) {
         EditorScreenChanged (screen);
     }
 }
        void onEditorPanelChange(EditorScreen screen)
        {
            if (screen == EditorScreen.Actions || screen == EditorScreen.Crew)
            {
                minimized = true;
            }

            if (screen == EditorScreen.Parts)
            {
                minimized = minimizedManually;
            }
        }