Example #1
0
    void OnGUI()
    {
        GUI.skin = this.CustomGUISkin;

        //Replace "briefing" with the name of the map or something (should be in the intro text file)
        CommonMenuUtilities.drawCenterBoxHeader(this.CustomGUISkin, "", this._boxWidth, this._boxHeight);

        GUILayout.FlexibleSpace();

        this._drawPicture();

        GUILayout.FlexibleSpace();

        this._drawText();

        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Continue"))
        {
            this.GuiAudioSource.PlayOneShot(this.Click1);
            this._ContinueResponseFunction();
        }
        ;
        GUILayout.FlexibleSpace();

        CommonMenuUtilities.endCenterBox();
    }
    void OnGUI()
    {
        GUI.skin = this.CustomGUISkin;

        CommonMenuUtilities.drawCenterBoxHeader(this.CustomGUISkin, this._title, this._boxWidth, this._boxHeight);

        CommonMenuUtilities.drawSingleLabelLine("BATTLE REPORT");

        GUILayout.FlexibleSpace();

        CommonMenuUtilities.drawSingleLabelLine("Days Fought\t\t" + (this._LevelInformations.getBattleTime() / 1440) + 1);
        GUILayout.FlexibleSpace();

        CommonMenuUtilities.drawSingleLabelLine("Soldiers Remaining\t\t" + this._LevelInformations.getNumSoldiers());
        CommonMenuUtilities.drawSingleLabelLine("Soldiers Lost\t\t" + this._LevelInformations.getNumSoldiersKilled());
        GUILayout.FlexibleSpace();

        CommonMenuUtilities.drawSingleLabelLine("Enemies Remaining\t\t" + this._LevelInformations.getNumEnemies());
        CommonMenuUtilities.drawSingleLabelLine("Enemies Killed\t\t" + this._LevelInformations.getNumEnemiesKilled());
        GUILayout.FlexibleSpace();

        if (GUILayout.Button("Continue"))
        {
            this.GuiAudioSource.PlayOneShot(this.Click1);
            this._ContinueResponseFunction();
        }
        GUILayout.FlexibleSpace();

        CommonMenuUtilities.endCenterBox();
    }
Example #3
0
    // Use this for initialization
    void Start()
    {
        this._initCommonGui();

        this._boxWidth  = CommonMenuUtilities.forceDimensions(this._boxWidth, this._minWidth, this._maxWidth);
        this._boxHeight = CommonMenuUtilities.forceDimensions(this._boxHeight, this._minHeight, this._maxHeight);

        //Debug.Log("Briefing width: " + this._boxWidth);
        //Debug.Log("Briefing height: " + this._boxHeight);

        PersistentInfo Persistence = GameObject.Find("PersistentInfo").GetComponent <PersistentInfo>();

        this.InterludeText = Resources.Load("Texts/Interludes/" + Persistence.sceneName) as TextAsset;

        //Debug.Log ("Briefings/" + Persistence.sceneName);
        this.BriefingTexture = Resources.Load("Briefings/" + Persistence.sceneName) as Texture2D;

        this._ContinueResponseFunction = _loadNextScene;

        //Special exception scenes
        if (Persistence.sceneName == "Ending")
        {
            this._ContinueResponseFunction = _loadMainMenu;
        }
        else if (Persistence.sceneName == "Defeat")
        {
            this._ContinueResponseFunction = _loadMainMenu;
        }
    }
    public static void drawCommonMainMenuItems()
    {
        GUILayout.Space(20);
        CommonMenuUtilities.drawButton("Options", CommonMenuUtilities.displayOptions);

        GUILayout.Space(20);
        CommonMenuUtilities.drawButton("Exit Game", CommonMenuUtilities.exitGame);
    }
    public static void drawOptionsMenu(GUISkin CustomGuiSkin)
    {
        CommonMenuUtilities.drawCenterBoxHeader(CustomGuiSkin, "OPTIONS", CommonMenuUtilities._mainMenuWidth, CommonMenuUtilities._mainMenuHeight);

        CommonMenuUtilities.drawButton("Back", exitOptions);

        CommonMenuUtilities.endCenterBox();
    }
Example #6
0
    private void _drawPauseMenu()
    {
        if (CommonMenuUtilities.showOptions)
        {
            CommonMenuUtilities.drawOptionsMenu(GUI.skin);
            return;
        }

        CommonMenuUtilities.drawMainMenuHeader(GUI.skin);

        CommonMenuUtilities.drawButton("Resume Game", unpauseGame);

        CommonMenuUtilities.drawCommonMainMenuItems();

        CommonMenuUtilities.endCenterBox();
    }
Example #7
0
    // Use this for initialization
    void Start()
    {
        this._initCommonGui();

        CommonMenuUtilities.forceMainMenuDimensions();
        //Debug.Log (Screen.width + "," + Screen.height);
        //Debug.Log (this._mainMenuWidth + "," + this._mainMenuHeight);

        //Check if there's existing persistent info, just in case. So we don't have two
        //This would happen when restarting the game
        GameObject ExistingPersistentInfo = GameObject.Find("PersistentInfo");

        if (ExistingPersistentInfo != null)
        {
            Destroy(ExistingPersistentInfo);
        }
    }
Example #8
0
    void OnGUI()
    {
        GUI.skin = this.CustomGUISkin;

        if (CommonMenuUtilities.showOptions)
        {
            CommonMenuUtilities.drawOptionsMenu(GUI.skin);
            return;
        }

        CommonMenuUtilities.drawMainMenuHeader(GUI.skin);

        CommonMenuUtilities.drawButton("Start Game", startGame);

        CommonMenuUtilities.drawCommonMainMenuItems();

        CommonMenuUtilities.endCenterBox();
    }
Example #9
0
    private void _drawPotentialSelectableUnitsBox()
    {
        CommonMenuUtilities.drawMainMenuHeader(GUI.skin, "Select Unit");

        foreach (GameObject SelectableUnit in this._Player.PotentialSelectedUnits)
        {
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();

            //Just display the first squaddie info for now
            //In reality we should display the leader stuff
            Unit        UnitInfo      = SelectableUnit.GetComponent <Unit>();
            SquadMember FirstSquaddie = UnitInfo.SquadMembers[0] as SquadMember;

            GUILayout.Label(FirstSquaddie.SquadViewTexture);
            GUILayout.Space(10.0f);
            if (GUILayout.Button(FirstSquaddie.name))               //Player selected one of these guys

            {
                this.GuiAudioSource.PlayOneShot(this.Click1);
                Time.timeScale = 1;
                this._Player.PotentialSelectedUnits.RemoveRange(0, this._Player.PotentialSelectedUnits.Count);
                this._Player.SelectedUnit = SelectableUnit;

                //Unit.displaySelectSprite() should already handle deselecting previously-selected unit
                this._Player.displaySelectSprite();
                break;
            }

            GUILayout.FlexibleSpace();

            GUILayout.EndHorizontal();

            //For vertical space
            GUILayout.FlexibleSpace();
        }

        CommonMenuUtilities.endCenterBox();
    }
    // Use this for initialization
    void Start()
    {
        this._initCommonGui();

        this._boxWidth  = CommonMenuUtilities.forceDimensions(this._boxWidth, this._maxWidth, this._maxWidth);
        this._boxHeight = CommonMenuUtilities.forceDimensions(this._boxHeight, this._maxHeight, this._maxHeight);

        GameObject LevelInfoObj = GameObject.Find("LevelInfo");

        if (LevelInfoObj != null)
        {
            this._LevelInformations = LevelInfoObj.GetComponent <LevelInfo>();
        }
        else
        {
            //For debugging really
            this._LevelInformations = new LevelInfo();
        }

        //Technically this is all paused
        Time.timeScale = 0;

        //Debug.Log("PostGame width: " + this._boxWidth);
        //Debug.Log("PostGame height: " + this._boxHeight);

        if (this._LevelInformations.gameEvent == LevelInfo.GAME_EVENT_PLAYER_WON)
        {
            this._title = "YOU ARE VICTORIOUS";
            this._ContinueResponseFunction = _loadNextScene;
        }
        else
        {
            this._title = "YOU HAVE BEEN DEFEATED";
            this._ContinueResponseFunction = _loadDefeatScene;
        }
    }
Example #11
0
    // Use this for initialization
    void Start()
    {
        this._initCommonGui();

        this.TimeOfDay = this.Sun;

        GameObject LevelInfoObj = GameObject.Find("LevelInfo");

        this.LevelInformation = LevelInfoObj.GetComponent <LevelInfo>();

        GameObject CameraObj = GameObject.Find("MainCamera");

        this.Camera = CameraObj.GetComponent <CameraMovement> ();

        this._Player = GameObject.Find("Player").GetComponent <Player>();

        this._generalStatsWidth  = CommonMenuUtilities.forceDimensions(this._generalStatsWidth, this._generalStatsMinWidth, this._generalStatsMaxWidth);
        this._generalStatsHeight = CommonMenuUtilities.forceDimensions(this._generalStatsHeight, this._generalStatsMinHeight, this._generalStatsMaxHeight);

        this._squadBoxWidth  = CommonMenuUtilities.forceDimensions(this._squadBoxWidth, this._squadBoxMinWidth, this._squadBoxMaxWidth);
        this._squadBoxHeight = CommonMenuUtilities.forceDimensions(this._squadBoxWidth, this._squadBoxMinHeight, this._squadBoxMaxHeight);

        this._gameEventWidth  = CommonMenuUtilities.forceDimensions(this._gameEventWidth, this._gameEventMinWidth, this._gameEventMaxWidth);
        this._gameEventHeight = CommonMenuUtilities.forceDimensions(this._gameEventHeight, this._gameEventMinHeight, this._gameEventMaxHeight);

        Debug.Log("General stats width: " + this._generalStatsWidth);
        Debug.Log("General stats height: " + this._generalStatsHeight);

        Debug.Log("Squad box width: " + this._squadBoxWidth);
        Debug.Log("Squad box height: " + this._squadBoxHeight);

        Debug.Log("Game events width: " + this._gameEventWidth);
        Debug.Log("Game events height: " + this._gameEventHeight);

        CommonMenuUtilities.forceMainMenuDimensions();
    }
 public static void drawMainMenuHeader(GUISkin CustomGuiSkin, string menuHeading = "MAIN MENU")
 {
     CommonMenuUtilities.drawCenterBoxHeader(CustomGuiSkin, menuHeading, CommonMenuUtilities._mainMenuWidth, CommonMenuUtilities._mainMenuHeight);
 }
Example #13
0
 private void _drawText()
 {
     CommonMenuUtilities.drawSingleWrappingLabelLine(this.InterludeText.text);
 }