/// <summary>
        /// Called by sub nodes when the step selection was updated
        /// </summary>
        public void NotifyStepSelected(StepType selectedType)
        {
            SfcPatchControl controller = GetNode <SfcPatchNode>("..").SfcPatchControl;

            controller.UpdateSfcStepTo(selectedType);
            _stepNode.OnCreationFocus();
        }
Exemple #2
0
 /// <summary>
 /// Called only once when the node is created by the patch control.
 /// </summary>
 public void InitializeWith(SfcPatchControl sfcPatchControl, PatchEntity data, bool isEditable)
 {
     SfcPatchControl = sfcPatchControl;
     SetCellPosition(data.X, data.Y);
     GetNode <SfcTransitionNode>("SfcTransition").Initialise();
     GetNode <ActionEditorBox>("ActionEditorBox").InitializeWith(SfcPatchControl, isEditable);
     Connect("mouse_entered", this, nameof(OnMouseEntered));
     Connect("mouse_exited", this, nameof(OnMouseExited));
     GetNode <Control>("MouseFilterEdit").Visible = !isEditable;
 }
Exemple #3
0
 public void Initialise()
 {
     _textEdit        = GetNode <TextEdit>("TransitionTextEditor");
     _patchController = GetNode <SfcPatchNode>("..").SfcPatchControl;
     _textEdit.Connect("focus_exited", this, nameof(OnTextEditorFocusExited));
     _textEdit.Connect("mouse_entered", this, nameof(OnMouseEntered));
     _textEdit.Connect("mouse_exited", this, nameof(OnMouseExited));
     _textEdit.Connect("focus_entered", this, nameof(OnFocusEntered));
     _textEdit.Connect("focus_exited", this, nameof(OnFocusExited));
     _textEdit.Connect("text_changed", this, nameof(OnTextChanged));
 }
Exemple #4
0
        /// <summary>
        /// Ensures that a patch field is aviable at the given position.
        /// </summary>
        private void EnsurePatchAt(int x, int y)
        {
            PatchEntity patch = Data.SfcEntity.Lookup(x, y);

            if (patch == null)
            {
                Data.SfcEntity.CreatePatchAt((short)x, (short)y);
                patch = Data.SfcEntity.Lookup(x, y);
                SfcPatchControl control = new SfcPatchControl(patch, this, _isEditable);
                _controlMap.Add(patch.Key, control);
            }
        }
Exemple #5
0
        /// <summary>
        /// Loads the data from the stream. Written in "WriteTo".
        /// </summary>
        private void InitialiseFromData()
        {
            foreach (SfcPatchControl patch in _controlMap.Values)
            {
                patch.RemovePatch();
            }
            _controlMap.Clear();
            IReadOnlyCollection <PatchEntity> patches = Data.SfcEntity.Patches;

            foreach (PatchEntity entity in patches)
            {
                SfcPatchControl control = new SfcPatchControl(entity, this, _isEditable);
                _controlMap.Add(entity.Key, control);
            }
            UpdateGrid();
        }
Exemple #6
0
 /// <summary>
 /// Called only once when the node is created by the patch node.
 /// </summary>
 public void InitializeWith(SfcPatchControl sfcPatchControl, bool isEditable)
 {
     _patchController = sfcPatchControl;
     _isEditable      = isEditable;
 }
 /// <summary>
 /// Called when the model has changed or is initialized.
 /// </summary>
 public void UpdateLine(PatchEntity entity, SfcPatchControl control)
 {
     GetNode <ColorRect>("TransitionLineTop").Visible = entity.SfcStepType != StepType.Unused && entity.SfcStepType != StepType.Jump;
     GetNode <ColorRect>("TransitionLineMid").Visible = entity.ContainsTransition() || control.SfcPatchMeta.HasPossibleTransitionSkip;
     GetNode <ColorRect>("TransitionLineBot").Visible = control.SfcPatchMeta.RequestsLowerStepConnection;
 }