コード例 #1
0
 public TriggeredCallback(Control control, Action callback)
 {
     if (control == null) throw new ArgumentNullException("control");
     if (callback == null) throw new ArgumentNullException("callback");
     Control = control;
     _callback = callback;
 }
コード例 #2
0
ファイル: PlayerChat.cs プロジェクト: vvnurmi/assaultwing
        public PlayerChat(AssaultWing game, int updateOrder)
            : base(game, updateOrder)
        {
            g_cursorBlinkCurve = new Curve();
            g_cursorBlinkCurve.Keys.Add(new CurveKey(0, 1));
            g_cursorBlinkCurve.Keys.Add(new CurveKey(0.5f, 0));
            g_cursorBlinkCurve.Keys.Add(new CurveKey(1, 1));
            g_cursorBlinkCurve.PreLoop = CurveLoopType.Cycle;
            g_cursorBlinkCurve.PostLoop = CurveLoopType.Cycle;

            g_scrollArrowBlinkCurve = new Curve();
            g_scrollArrowBlinkCurve.Keys.Add(new CurveKey(0, 1));
            g_scrollArrowBlinkCurve.Keys.Add(new CurveKey(0.75f, 0));
            g_scrollArrowBlinkCurve.Keys.Add(new CurveKey(1.5f, 1));
            g_scrollArrowBlinkCurve.PreLoop = CurveLoopType.Cycle;
            g_scrollArrowBlinkCurve.PostLoop = CurveLoopType.Cycle;

            _game = game;
            _chatSendControl = new KeyboardKey(Keys.Enter);
            _escapeControl = new KeyboardKey(Keys.Escape);
            _scrollUpControl = new KeyboardKey(Keys.Up);
            _scrollDownControl = new KeyboardKey(Keys.Down);
            _cursorBlinkStartTime = _game.GameTime.TotalRealTime;
            _scrollArrowGlowStartTime = _game.GameTime.TotalRealTime;
            _messageBeeper = new MessageBeeper(game, "PlayerMessage", () => Messages.FirstOrDefault());
        }
コード例 #3
0
ファイル: ChatTab.cs プロジェクト: vvnurmi/assaultwing
 public ChatTab(EquipMenuComponent menuComponent)
     : base(menuComponent)
 {
     _sendControl = new KeyboardKey(Keys.Enter);
     _message = new EditableText("", 1000, new CharacterSet(Content.FontChat.Characters), MenuEngine.Game, () => { });
     _messageBeeper = new MessageBeeper(MenuEngine.Game, "PlayerMessage", () => Messages.FirstOrDefault());
     _cursorBlinkStartTime = MenuEngine.Game.GameTime.TotalRealTime;
 }
コード例 #4
0
ファイル: AssaultWing.cs プロジェクト: vvnurmi/assaultwing
        public AssaultWing(GraphicsDeviceService graphicsDeviceService, CommandLineOptions args)
            : base(graphicsDeviceService, args)
        {
            CustomControls = new List<Tuple<Control, Action>>();
            MessageHandlers = new Net.MessageHandling.MessageHandlers(this);
            if (CommandLineOptions.DedicatedServer)
                Logic = new DedicatedServerLogic(this);
            else if (CommandLineOptions.QuickStart != null)
                Logic = new QuickStartLogic(this, CommandLineOptions.QuickStart);
            else
                Logic = new UserControlledLogic(this);
            ArenaLoadTask = new BackgroundTask();
            NetworkingErrors = new Queue<string>();
            _gameSettingsSendTimer = new AWTimer(() => GameTime.TotalRealTime, TimeSpan.FromSeconds(2)) { SkipPastIntervals = true };
            _arenaStateSendTimer = new AWTimer(() => GameTime.TotalRealTime, TimeSpan.FromSeconds(2)) { SkipPastIntervals = true };
            _frameNumberSynchronizationTimer = new AWTimer(() => GameTime.TotalRealTime, TimeSpan.FromSeconds(1)) { SkipPastIntervals = true };

            NetworkEngine = new NetworkEngine(this, 30);
            WebData = new WebData(this, 21);
            Components.Add(NetworkEngine);
            Components.Add(WebData);
            ChatStartControl = Settings.Controls.Chat.GetControl();
            _frameStepControl = new KeyboardKey(Keys.F8);
            _frameRunControl = new KeyboardKey(Keys.F7);
            _frameStep = false;
            _debugPrintLagTimer = new AWTimer(() => GameTime.TotalRealTime, TimeSpan.FromSeconds(1)) { SkipPastIntervals = true };
            DataEngine.SpectatorAdded += SpectatorAddedHandler;
            DataEngine.SpectatorRemoved += SpectatorRemovedHandler;
            NetworkEngine.Enabled = true;
            AW2.Graphics.PlayerViewport.CustomOverlayCreators.Add(viewport => new SystemStatusOverlay(viewport));

            // Replace the dummy StatsBase by a proper StatsSender.
            Components.Remove(comp => comp is StatsBase);
            Stats = new StatsSender(this, 7);
            Components.Add(Stats);
            Stats.Enabled = true;
        }
コード例 #5
0
ファイル: LogicEngine.cs プロジェクト: vvnurmi/assaultwing
 public LogicEngine(AssaultWingCore game, int updateOrder)
     : base(game, updateOrder)
 {
     _gobsToKillOnClient = new List<GobKillData>();
     _helpControl = new KeyboardKey(Keys.F1);
 }
コード例 #6
0
ファイル: Ship.cs プロジェクト: vvnurmi/assaultwing
 public void TryFire(ShipDevice.OwnerHandleType ownerHandleType, Control control)
 {
     DeviceUsagesToClients[ownerHandleType] = GetDevice(ownerHandleType).TryFire(control.State);
 }
コード例 #7
0
ファイル: IntroEngine.cs プロジェクト: vvnurmi/assaultwing
 public override void Initialize()
 {
     base.Initialize();
     _skipControl = new KeyboardKey(Microsoft.Xna.Framework.Input.Keys.Escape);
 }
コード例 #8
0
ファイル: MenuControls.cs プロジェクト: vvnurmi/assaultwing
 public Directions(Control up, Control down, Control left, Control right)
 {
     Up = up; Down = down; Left = left; Right = right;
 }