当前位置: 首页>>代码示例>>C#>>正文


C# Model.LiveSplitState类代码示例

本文整理汇总了C#中LiveSplit.Model.LiveSplitState的典型用法代码示例。如果您正苦于以下问题:C# LiveSplitState类的具体用法?C# LiveSplitState怎么用?C# LiveSplitState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LiveSplitState类属于LiveSplit.Model命名空间,在下文中一共展示了LiveSplitState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawVertical

 public void DrawVertical(Graphics g, LiveSplitState state, float width, Region clipRegion)
 {
     using (var solidBrush = new SolidBrush(LineColor))
     {
         g.FillRectangle(solidBrush, 0.0f, 0.0f, width, VerticalHeight);
     }
 }
开发者ID:xarrez,项目名称:LiveSplit,代码行数:7,代码来源:LineComponent.cs

示例2: GetSegmentTimeOrSegmentDelta

        private static TimeSpan? GetSegmentTimeOrSegmentDelta(LiveSplitState state, int splitNumber, bool useCurrentTime, bool segmentTime, string comparison, TimingMethod method)
        {
            TimeSpan? currentTime;
            if (useCurrentTime)
                currentTime = state.CurrentTime[method];
            else
                currentTime = state.Run[splitNumber].SplitTime[method];
            if (currentTime == null)
                return null;

            for (int x = splitNumber - 1; x >= 0; x--)
            {
                var splitTime = state.Run[x].SplitTime[method];
                if (splitTime != null)
                {
                    if (segmentTime)
                        return currentTime - splitTime;
                    else if (state.Run[x].Comparisons[comparison][method] != null)
                        return (currentTime - state.Run[splitNumber].Comparisons[comparison][method]) - (splitTime - state.Run[x].Comparisons[comparison][method]);
                }
            }

            if (segmentTime)
                return currentTime;
            else
                return currentTime - state.Run[splitNumber].Comparisons[comparison][method];
        }
开发者ID:Rezura,项目名称:LiveSplit,代码行数:27,代码来源:LiveSplitStateHelper.cs

示例3: DrawHorizontal

 public void DrawHorizontal(Graphics g, LiveSplitState state, float height, Region clipRegion)
 {
     using (var solidBrush = new SolidBrush(LineColor))
     {
         g.FillRectangle(solidBrush, 0.0f, 0.0f, HorizontalWidth, height);
     }
 }
开发者ID:PrototypeAlpha,项目名称:LiveSplit,代码行数:7,代码来源:LineComponent.cs

示例4: Activate

 public void Activate(LiveSplitState state)
 {
     if (!IsActivated)
     {
         try
         {
             if (!IsDownloaded || Type == AutoSplitterType.Script)
                 DownloadFiles();
             if (Type == AutoSplitterType.Component)
             {
                 Factory = ComponentManager.ComponentFactories[FileName];
                 Component = Factory.Create(state);
             }
             else
             {
                 Factory = ComponentManager.ComponentFactories["LiveSplit.ScriptableAutoSplit.dll"];
                 Component = ((dynamic)Factory).Create(state, LocalPath);
             }
         }
         catch (Exception ex)
         {
             Log.Error(ex);
             MessageBox.Show(state.Form, "The Auto Splitter could not be activated. (" + ex.Message + ")", "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
开发者ID:Hydro8182,项目名称:LiveSplit,代码行数:26,代码来源:AutoSplitter.cs

示例5: Update

        public override void Update(IInvalidator invalidator, LiveSplitState state, float width, float height, LayoutMode mode)
        {
            if (state.CurrentPhase == TimerPhase.NotRunning)
            {
                if (AutoSplitter.ShouldStart(state))
                {
                    Model.Start();
                }
            }
            else if (state.CurrentPhase == TimerPhase.Running || state.CurrentPhase == TimerPhase.Paused)
            {
                if (AutoSplitter.ShouldReset(state))
                {
                    Model.Reset();
                    return;
                }
                else if (AutoSplitter.ShouldSplit(state))
                {
                    Model.Split();
                }

                state.IsGameTimePaused = AutoSplitter.IsGameTimePaused(state);

                var gameTime = AutoSplitter.GetGameTime(state);
                if (gameTime != null)
                    state.SetGameTime(gameTime);
            }
        }
开发者ID:Rezura,项目名称:LiveSplit,代码行数:28,代码来源:AutoSplitComponent.cs

示例6: Create

        public IComponent Create(LiveSplitState state)
        {
            // workaround for livesplit 1.4 oversight where components can be loaded from two places at once
            // remove all this junk when they fix it
            string caller = new StackFrame(1).GetMethod().Name;
            string callercaller = new StackFrame(2).GetMethod().Name;
            bool createAsLayoutComponent = (caller == "LoadLayoutComponent" || caller == "AddComponent");

            // if component is already loaded somewhere else
            if (_instance != null && !_instance.Disposed)
            {
                // "autosplit components" can't throw exceptions for some reason, so return a dummy component
                if (callercaller == "CreateAutoSplitter")
                {
                    return new DummyComponent();
                }

                MessageBox.Show(
                    "LiveSplit.RedFaction is already loaded in the " +
                        (_instance.IsLayoutComponent ? "Layout Editor" : "Splits Editor") + "!",
                    "Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);

                throw new Exception("Component already loaded.");
            }

            return (_instance = new RedFactionComponent(state, createAsLayoutComponent));
        }
开发者ID:SuiMachine,项目名称:LiveSplit.RedFaction,代码行数:29,代码来源:RedFactionFactory.cs

示例7: RunHighlighterComponent

        public RunHighlighterComponent(LiveSplitState state)
        {
            this._state = state;
            this.Settings = new RunHighlighterSettings();
            this.ContextMenuControls = new Dictionary<string, Action>();

            this.ContextMenuControls.Add("Run Highlighter...", new Action(() =>
            {
				MessageBox.Show(_state.Form, "This component is now obsolete and has been replaced by this website:\nhttps://dalet.github.io/run-highlighter/"
					+ "\n\nThe website has new features such as individual segment highlighting and multi-part detection."
					+ "\n\nThe URL will be opened after you close this message.", "Run Highlighter",
					MessageBoxButtons.OK, MessageBoxIcon.Information);
				System.Diagnostics.Process.Start("https://dalet.github.io/run-highlighter/");

				/*if (_state.CurrentPhase == TimerPhase.Ended)
                {
                    MessageBox.Show(_state.Form, "The timer needs to be resetted in order to update the Attempt History.", "Run Highlighter");
                    return;
                }

                var originalTopMost = _state.Form.TopMost;
                _state.Form.TopMost = false; //to ensure our Internet Explorer window isn't covered

                using (var form = new RunHighlighterForm(state.Run, Settings))
                    form.ShowDialog(state.Form);

                _state.Form.TopMost = originalTopMost;*/
			}));
        }
开发者ID:Dalet,项目名称:LiveSplit.RunHighlighter,代码行数:29,代码来源:RunHighlighterComponent.cs

示例8: PrepareDraw

        private void PrepareDraw(LiveSplitState state, LayoutMode mode)
        {
            InternalComponent.DisplayTwoRows = Settings.Display2Rows;

            InternalComponent.NameLabel.HasShadow 
                = InternalComponent.ValueLabel.HasShadow
                = state.LayoutSettings.DropShadows;

            if (String.IsNullOrEmpty(Settings.Text1) || String.IsNullOrEmpty(Settings.Text2))
            {
                InternalComponent.NameLabel.HorizontalAlignment = StringAlignment.Center;
                InternalComponent.ValueLabel.HorizontalAlignment = StringAlignment.Center;
                InternalComponent.NameLabel.VerticalAlignment = StringAlignment.Center;
                InternalComponent.ValueLabel.VerticalAlignment = StringAlignment.Center;
            }
            else
            {
                InternalComponent.NameLabel.HorizontalAlignment = StringAlignment.Near;
                InternalComponent.ValueLabel.HorizontalAlignment = StringAlignment.Far;
                InternalComponent.NameLabel.VerticalAlignment = 
                    mode == LayoutMode.Horizontal || Settings.Display2Rows ? StringAlignment.Near : StringAlignment.Center;
                InternalComponent.ValueLabel.VerticalAlignment =
                    mode == LayoutMode.Horizontal || Settings.Display2Rows ? StringAlignment.Far : StringAlignment.Center;
            }

            InternalComponent.NameLabel.ForeColor = Settings.OverrideTextColor ? Settings.TextColor : state.LayoutSettings.TextColor;
            InternalComponent.ValueLabel.ForeColor = Settings.OverrideTimeColor ? Settings.TimeColor : state.LayoutSettings.TextColor;
        }
开发者ID:0xwas,项目名称:LiveSplit.Text,代码行数:28,代码来源:TextComponent.cs

示例9: DrawHorizontal

 public void DrawHorizontal(Graphics g, LiveSplitState state, float height, Region clipRegion)
 {
     var component = queuedComponents.FirstOrDefault();
     if (component != null)
     {
         component.DrawHorizontal(g, state, height, clipRegion);
     }
 }
开发者ID:LiveSplit,项目名称:LiveSplit.ContextualSlideshow,代码行数:8,代码来源:ContextualSlideshowComponent.cs

示例10: ManualGameTimeComponent

 public ManualGameTimeComponent(LiveSplitState state)
 {
     Settings = new ManualGameTimeSettings();
     GameTimeForm = new ShitSplitter(state, Settings);
     state.OnStart += state_OnStart;
     state.OnReset += state_OnReset;
     CurrentState = state;
 }
开发者ID:0xwas,项目名称:LiveSplit.ManualGameTime,代码行数:8,代码来源:ManualGameTimeComponent.cs

示例11: Component

        public Component(LiveSplitState state)
        {
            model = new TimerModel() { CurrentState = state };
            model.CurrentState.OnStart += State_OnStart;

            eventList = settings.GetEventList();
            settings.EventsChanged += settings_EventsChanged;
        }
开发者ID:kugelrund,项目名称:LiveSplit.Quake2,代码行数:8,代码来源:Component.cs

示例12: DrawVertical

 public void DrawVertical(Graphics g, LiveSplitState state, float width, Region clipRegion)
 {
     var component = queuedComponents.FirstOrDefault();
     if (component != null)
     {
         component.DrawVertical(g, state, width, clipRegion);
     }
 }
开发者ID:LiveSplit,项目名称:LiveSplit.ContextualSlideshow,代码行数:8,代码来源:ContextualSlideshowComponent.cs

示例13: Component

 public Component(LiveSplitState state, string scriptPath)
     : this(state)
 {
     Settings = new ComponentSettings()
     {
         ScriptPath = scriptPath
     };
 }
开发者ID:glasnonck,项目名称:LiveSplit.ScriptableAutoSplit,代码行数:8,代码来源:Component.cs

示例14: TextComponent

 public TextComponent(LiveSplitState state)
 {
     Settings = new TextComponentSettings()
     {
         CurrentState = state
     };
     InternalComponent = new TextTextComponent(Settings);
 }
开发者ID:0xwas,项目名称:LiveSplit.Text,代码行数:8,代码来源:TextComponent.cs

示例15: PrepareDraw

 private void PrepareDraw(LiveSplitState state)
 {
     InternalComponent.DisplayTwoRows = Settings.Display2Rows;
     InternalComponent.NameLabel.HasShadow
         = InternalComponent.ValueLabel.HasShadow
         = state.LayoutSettings.DropShadows;
     InternalComponent.NameLabel.ForeColor = Settings.OverrideTextColor ? Settings.TextColor : state.LayoutSettings.TextColor;
 }
开发者ID:0xwas,项目名称:LiveSplit.PreviousSegment,代码行数:8,代码来源:PreviousSegment.cs


注:本文中的LiveSplit.Model.LiveSplitState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。