コード例 #1
0
        private static bool ShowTimeTuningDialog(float startTime, float endTime, out float start, out float end)
        {
            bool changes = false;

            string[] values = ThreeStringInputDialog.Show("The owner of the bottle", new string[] { "Arrives at (hour, 0-24, 0='don't come')", "Leaves at (hour, 0-24, 0='don't come')", "Spare field for future needs" }, new string[] { startTime.ToString(), endTime.ToString(), "" }, true);

            if (!string.IsNullOrEmpty(values[0]))
            {
                start   = float.Parse(values[0]);
                changes = true;
            }
            else
            {
                start = 0;
            }

            if (!string.IsNullOrEmpty(values[1]))
            {
                end     = float.Parse(values[1]);
                changes = true;
            }
            else
            {
                end = 0;
            }
            return(changes);
        }
コード例 #2
0
        public override bool Run()
        {
            string[] values = ThreeStringInputDialog.Show("Give Forward Vector",
                                                          new String[] { "X: (-0.99 - 0.99)", "Y: (-0.99 - 0.99)", "Z: (-0.99 - 0.99)" },
                                                          new String[] { Target.ForwardVector.x.ToString(), Target.ForwardVector.y.ToString(), Target.ForwardVector.z.ToString() }, false);

            float x = 0.5F;
            float y = 0.5F;
            float z = 0.5F;

            if (!string.IsNullOrEmpty(values[0]))
            {
                if (!float.TryParse(values[0], out x))
                {
                    return(false);
                }
            }
            if (!string.IsNullOrEmpty(values[1]))
            {
                if (!float.TryParse(values[1], out y))
                {
                    return(false);
                }
            }
            if (!string.IsNullOrEmpty(values[2]))
            {
                if (!float.TryParse(values[2], out z))
                {
                    return(false);
                }
            }
            MoveThings.Tilt(this.Target, x, y, z);
            return(true);
        }
コード例 #3
0
        private static bool ShowTimeTuningDialog(float showDuration, float[] showTimes, out float newShowDuration, out float[] newShowTimes)
        {
            bool   changes         = false;
            string showTimesString = ShowTimesToString(showTimes, "H");

            string[] values = ThreeStringInputDialog.Show("The Dancer",
                                                          new string[] { "Show Times Are (hour, 0-24, separate with 'H')", "Show Lasts (minutes, 0-300)", "Spare field for future needs" },
                                                          new string[] { showTimesString, showDuration.ToString(), "" }, false);

            if (!string.IsNullOrEmpty(values[0]))
            {
                newShowTimes = StringToShowTimes(values[0]);
                changes      = true;
            }
            else
            {
                newShowTimes = showTimes;
            }

            if (!string.IsNullOrEmpty(values[1]))
            {
                newShowDuration = float.Parse(values[1]);
                changes         = true;
            }
            else
            {
                newShowDuration = showDuration;
            }
            return(changes);
        }
コード例 #4
0
        private static bool ShowTuningDialog(float startTime, float endTime, string roleTitle, out float newStartTime, out float newEndTime, out string newRoleTitle)
        {
            bool   changes     = false;
            string dialogTitle = Localization.LocalizeString(Texts.TUNING_DIALOG_TITLE, new string[0]);

            string[] fieldNames = new string[]
            {
                Localization.LocalizeString(Texts.TUNING_DIALOG_ROLE_START_TIME, new string[0]),
                Localization.LocalizeString(Texts.TUNING_DIALOG_ROLE_END_TIME, new string[0]),
                Localization.LocalizeString(Texts.TUNING_DIALOG_ROLE_TOOLTIP, new string[0])
            };

            string[] values = ThreeStringInputDialog.Show(dialogTitle, fieldNames,
                                                          new string[] { startTime.ToString(), endTime.ToString(), roleTitle }, false);

            if (!string.IsNullOrEmpty(values[0]))
            {
                newStartTime = float.Parse(values[0]);
                changes      = true;
            }
            else
            {
                newStartTime = startTime;
            }

            if (!string.IsNullOrEmpty(values[1]))
            {
                newEndTime = float.Parse(values[1]);
                changes    = true;
            }
            else
            {
                newEndTime = endTime;
            }

            if (!string.IsNullOrEmpty(values[2]))
            {
                newRoleTitle = values[2].ToString();
                changes      = true;
            }
            else
            {
                newRoleTitle = roleTitle;
            }
            return(changes);
        }