• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Model.LiveSplitState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetLastDelta

 /// <summary>
 /// Gets the last non-live delta in the run starting from splitNumber.
 /// </summary>
 /// <param name="state">The current state.</param>
 /// <param name="splitNumber">The split number to start checking deltas from.</param>
 /// <param name="comparison">The comparison that you are comparing with.</param>
 /// <param name="method">The timing method that you are using.</param>
 /// <returns>Returns the last non-live delta or null if there have been no deltas yet.</returns>
 public static TimeSpan? GetLastDelta(LiveSplitState state, int splitNumber, string comparison, TimingMethod method)
 {
     for (var x = splitNumber; x >= 0; x--)
     {
         if (state.Run[x].Comparisons[comparison][method] != null && state.Run[x].SplitTime[method] != null)
             return state.Run[x].SplitTime[method] - state.Run[x].Comparisons[comparison][method];
     }
     return null;
 }
开发者ID:Rezura,项目名称:LiveSplit,代码行数:17,代码来源:LiveSplitStateHelper.cs


示例17: TotalPlaytimeComponent

 public TotalPlaytimeComponent(LiveSplitState state)
 {
     TimeFormatter = new RegularTimeFormatter(TimeAccuracy.Seconds);
     InternalComponent = new InfoTimeComponent("Total Playtime", TimeSpan.Zero, TimeFormatter);
     Settings = new TotalPlaytimeSettings()
     {
         CurrentState = state
     };
 }
开发者ID:0xwas,项目名称:LiveSplit.TotalPlaytime,代码行数:9,代码来源:TotalPlaytimeComponent.cs


示例18: DragonAgeInquisitionComponent

        public DragonAgeInquisitionComponent(LiveSplitState state)
        {
            _timer = new TimerModel { CurrentState = state };

            _gameMemory = new GameMemory();
            _gameMemory.OnLoadStarted += gameMemory_OnLoadStarted;
            _gameMemory.OnLoadFinished += gameMemory_OnLoadFinished;
            _gameMemory.StartMonitoring();
        }
开发者ID:glasnonck,项目名称:LiveSplit.DragonAgeInquisition,代码行数:9,代码来源:DragonAgeInquisitionComponent.cs


示例19: ColumnSettings

        public ColumnSettings(LiveSplitState state, string columnName, IList<ColumnSettings> columnsList)
        {
            InitializeComponent();

            Data = new ColumnData(columnName, ColumnType.Delta, "Current Comparison", "Current Timing Method");

            CurrentState = state;
            ColumnsList = columnsList; 
        }
开发者ID:BR-,项目名称:LiveSplit.Splits,代码行数:9,代码来源:ColumnSettings.cs


示例20: ShitSplitter

 public ShitSplitter(LiveSplitState state, ManualGameTimeSettings settings)
 {
     InitializeComponent();
     Model = new TimerModel()
     {
         CurrentState = state
     };
     Settings = settings;
 }
开发者ID:0xwas,项目名称:LiveSplit.ManualGameTime,代码行数:9,代码来源:ShitSplitter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Domain.finalContext类代码示例发布时间:2022-05-26
下一篇:
C# Sdk.contact类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap