public void CreateDialogueOption()
    {
        DialogueOption newOption = new DialogueOption();

        newOption.OptionID = EditorInfo.Options;
        CurrentOptions.Add(newOption);

        EditorInfo.Windows.Add(new Rect(10 + scrollPosition.x, 10 + scrollPosition.y, 200, 5));
        EditorInfo.WindowTypes.Add(NodeType.Option);
        EditorInfo.NodeTypesIDs.Add(EditorInfo.Options++);
        EditorInfo.OptionsIndexes.Add(EditorInfo.Windows.Count - 1);

        WriteDebug("Adding option");

        SaveChanges("Create Dialogue Option");
    }
        private bool SetParameterCount(int numberOfParameters)
        {
            Overload = AllOverloads
                       .OrderBy(o => Math.Abs(numberOfParameters - o.Parameters.Length))
                       .FirstOrDefault();

            CurrentOptions = CurrentOptions
                             .Where(o => numberOfParameters <= o.Parameters.Length)
                             .ToList();

            if (CurrentOptions.Count == 0)
            {
                parseInfo.Script.Diagnostics.Error(
                    string.Format(ErrorMessages.BadParameterCount, numberOfParameters),
                    genericErrorRange
                    );
                return(false);
            }
            return(true);
        }
    void DeleteOptionWindow(int id, int idOfType)
    {
        EntityDeleted(id);
        EditorInfo.OptionsIndexes.RemoveAt(idOfType);
        EditorInfo.Options--;

        CurrentOptions.RemoveAt(idOfType);

        ClearAllConnectionsPending();

        int[] keys = new int[EditorInfo.NodesOptionsFoldouts.Count];
        EditorInfo.NodesOptionsFoldouts.Keys.CopyTo(keys, 0);
        for (int i = 0; i < keys.Length; i++)
        {
            EditorInfo.NodesOptionsFoldouts[keys[i]].Remove(idOfType);

            int[] optionsKeys = new int[EditorInfo.NodesOptionsFoldouts[keys[i]].Count];
            EditorInfo.NodesOptionsFoldouts[keys[i]].Keys.CopyTo(optionsKeys, 0);

            for (int j = 0; j < optionsKeys.Length; j++)
            {
                int key = optionsKeys[j];

                if (key > idOfType)
                {
                    bool value = EditorInfo.NodesOptionsFoldouts[keys[i]][key];
                    EditorInfo.NodesOptionsFoldouts[keys[i]].Remove(key);
                    key--;
                    EditorInfo.NodesOptionsFoldouts[keys[i]].Add(key, value);
                }
            }
        }

        DecrementIndexes(id);
        UpdateTargetAfterDeletion(id, idOfType, NodeType.Option);

        WriteDebug("Deleting option " + idOfType + " and it's associations.");
    }
예제 #4
0
        public override void Awake()
        {
            base.Awake();

            _slider = GetComponentInChildren <Slider>();
            _slider.onValueChanged.AddListener(OnValueChanged);

            try
            {
                if (_slider.wholeNumbers) // ints
                {
                    _slider.value = (int)CurrentOptions.GetType().GetField(targetOption).GetValue(CurrentOptions);
                }
                else // floats
                {
                    _slider.value = (float)CurrentOptions.GetType().GetField(targetOption).GetValue(CurrentOptions);
                }
            }
            catch (Exception e)
            {
                Debug.LogError($"Unable to set slider value for option: {targetOption}");
            }
        }
예제 #5
0
        private void HandleLoad()
        {
            string str = Support.GetProjectDirectory("Bootstrap HTML Project");

            if (string.IsNullOrEmpty(str) == true)
            {
                // user hit cancel do nothing
            }
            else if (Support.IsHtmlAllowed(CurrentOptions, str, CurrentOptions.BootstrapHtml) == false)
            {
                if (CurrentOptions.IsTraceOn(Trace_Options.TraceWarning) == true)
                {
                    Trace.TraceWarning("Html is not allowed when loading new  Html Source");
                }
            }
            else
            {
                IsBootstrapHtml = Support.IsBootstrapHtml;
                CurrentOptions.BootstrapProjectPath = str;
                CurrentOptions.PageName             = "Test";
                UpdateScreen();
            }
        }
예제 #6
0
        private void MergingMainViewModel_Activated(object sender, ActivationEventArgs e)
        {
            Shell = IoC.Get <IShell>();
            NotifyOfPropertyChange(() => BranchSequence);
            CandidateList.Clear();
            NotifyOfPropertyChange(() => NumCandidates);
            SetTfsBranches();
            FilterText = string.Empty;

            _filterTextChangeTimer           = new System.Timers.Timer(500);
            _filterTextChangeTimer.AutoReset = true;
            _filterTextChangeTimer.Elapsed  += _filterTextChangeTimer_Elapsed;

            if (CurrentOptions == null)
            {
                CurrentOptions = new MyOptions();
            }
            else
            {
                CurrentOptions.SetDefaultOptions();
            }
            Refresh();
        }
예제 #7
0
 private void SaveAll()
 {
     CurrentOptions.Save("config.xml");
     GlobalBusinessDaysCalculator.Save("business.xml");
     GlobalAddressBook.SaveXML("addresses.xml");
 }
 public void OnValueChanged(Color newValue)
 {
     CurrentOptions.GetType().GetField(targetOption).SetValue(CurrentOptions, newValue);
 }
예제 #9
0
        private void AddDisplayOptions()
        {
            var colX = XPos(0.50f);

            Add(UiLabels.Option("Display", new Vector2(colX, Height(0))));
            Add(UiButtons.Menu("Toggle FullScreen", new Vector2(colX, Height(1)), () => CurrentOptions.UpdateDisplay(x => x.IsFullscreen = !x.IsFullscreen)));

            Add(UiButtons.Menu("960x540", new Vector2(colX, Height(3)), () => CurrentOptions.UpdateDisplay(x => x.Scale = 0.5f),
                               () => !CurrentOptions.IsFullscreen));
            Add(UiButtons.Menu("1440x810", new Vector2(colX, Height(4)), () => CurrentOptions.UpdateDisplay(x => x.Scale = 0.75f),
                               () => !CurrentOptions.IsFullscreen));
            Add(UiButtons.Menu("1920x1080", new Vector2(colX, Height(5)), () => CurrentOptions.UpdateDisplay(x => x.Scale = 1),
                               () => !CurrentOptions.IsFullscreen));
        }
예제 #10
0
 private void ToggleTutorials()
 {
     CurrentOptions.Update(x => x.TutorialsEnabled = !x.TutorialsEnabled);
     _tutorialsToggle.Text = GetTutorialText();
 }