Example #1
0
    public void RefreshEventControls(GameWorldModel gameWorldModel)
    {
        if (gameWorldModel.EventPlaybackMode == GameWorldModel.eGameEventMode.paused)
        {
            m_firstEventButton.Visible    = !gameWorldModel.IsEventCursorAtFirstEvent;
            m_previousEventButton.Visible = !gameWorldModel.IsEventCursorAtFirstEvent;
            m_nextEventButton.Visible     = !gameWorldModel.IsEventCursorAtLastEvent;
            m_lastEventButton.Visible     = !gameWorldModel.IsEventCursorAtLastEvent;

            // When paused, only show the play/pause button with the "play" label
            m_playPauseEventButton.Visible = !gameWorldModel.IsEventCursorAtLastEvent || gameWorldModel.IsWaitingForEventCompletion;
            m_playPauseEventButton.Label   = "|>";
        }
        else
        {
            m_firstEventButton.Visible    = false;
            m_previousEventButton.Visible = false;
            m_nextEventButton.Visible     = false;
            m_lastEventButton.Visible     = false;

            // When playing, only show the play/pause button with the "pause" label
            m_playPauseEventButton.Visible = !gameWorldModel.IsEventCursorAtLastEvent;
            m_playPauseEventButton.Label   = "||";
        }
    }
    public override void Start()
    {
        base.Start();

        m_gameWorldModel                  = new GameWorldModel(this);
        m_gameWorldDebug                  = new GameWorldDebug(this);
        m_contextOverlayController        = new ContextOverlayController(this);
        gameWorldView.GameWorldController = this;
        m_chatWindowController            = null;

        gameWorldView.Start();
        m_contextOverlayController.Start(gameWorldView.RootWidgetGroup);
        m_gameWorldModel.Start();
        m_gameWorldDebug.Start();

        // Ask the server for the complete state of the game
        m_gameWorldModel.RequestFullGameState();

        // $TODO Play title music

        // Fade in the background
        m_readyForInput = false;
        Fader.AttachFaderTo(this.gameObject, Color.black, Fader.eFadeType.fadeIn, 1.0f, () =>
        {
            m_readyForInput = true;
        });
    }
Example #3
0
        public override List <GameWorldModel> GetGameWorlds()
        {
            SqlCommand command = new SqlCommand("GetGameWorlds", _connection);

            command.CommandType = CommandType.StoredProcedure;

            SqlDataReader reader = command.ExecuteReader();

            List <GameWorldModel> result = new List <GameWorldModel>();

            while (reader.Read())
            {
                GameWorldModel world = new GameWorldModel();
                world.GameWorldId   = (byte)reader.GetInt32(0);
                world.GameWorldName = reader.GetString(1);
                world.GameWorldIP   = reader.GetString(2);
                world.GameWorldPort = (ushort)reader.GetInt32(3);
            }
            return(result);
        }
Example #4
0
    public void RefreshEventControls(GameWorldModel gameWorldModel)
    {
        if (gameWorldModel.EventPlaybackMode == GameWorldModel.eGameEventMode.paused)
        {
            m_firstEventButton.Visible = !gameWorldModel.IsEventCursorAtFirstEvent;
            m_previousEventButton.Visible = !gameWorldModel.IsEventCursorAtFirstEvent;
            m_nextEventButton.Visible = !gameWorldModel.IsEventCursorAtLastEvent;
            m_lastEventButton.Visible = !gameWorldModel.IsEventCursorAtLastEvent;

            // When paused, only show the play/pause button with the "play" label
            m_playPauseEventButton.Visible = !gameWorldModel.IsEventCursorAtLastEvent || gameWorldModel.IsWaitingForEventCompletion;
            m_playPauseEventButton.Label = "|>";
        }
        else
        {
            m_firstEventButton.Visible = false;
            m_previousEventButton.Visible = false;
            m_nextEventButton.Visible = false;
            m_lastEventButton.Visible = false;

            // When playing, only show the play/pause button with the "pause" label
            m_playPauseEventButton.Visible = !gameWorldModel.IsEventCursorAtLastEvent;
            m_playPauseEventButton.Label = "||";
        }
    }
    public override void Start()
    {
        base.Start();

        m_gameWorldModel = new GameWorldModel(this);
        m_gameWorldDebug = new GameWorldDebug(this);
        m_contextOverlayController = new ContextOverlayController(this);
        gameWorldView.GameWorldController = this;
        m_chatWindowController = null;

        gameWorldView.Start();
        m_contextOverlayController.Start(gameWorldView.RootWidgetGroup);
        m_gameWorldModel.Start();
        m_gameWorldDebug.Start();

        // Ask the server for the complete state of the game
        m_gameWorldModel.RequestFullGameState();

        // $TODO Play title music

        // Fade in the background
        m_readyForInput = false;
        Fader.AttachFaderTo(this.gameObject, Color.black, Fader.eFadeType.fadeIn, 1.0f, () =>
        {
            m_readyForInput = true;
        });
    }