private void OnJoinConfirm(MessageBox.ReturnType Return)
 {
     if (Return == MessageBox.ReturnType.MB_YES)
     {
         Logger.trace("mFactionSelected:" + mFactionSelected);
         GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Buy_Press);
         GameData.MyFactionId = mFactionSelected + 1;
         GameData.MySuitID    = mSuitSelected;
         GameData.AddOwnedSuit(mSuitSelected);
         Logger.trace("suit " + GameData.MySuitID);
         Logger.trace("faction " + GameData.MyFactionId);
         string factionDisplayName = GameData.getFactionDisplayName(GameData.MyFactionId);
         MessageBox.AddMessageCustom("Congratulations!", "You have been accepted to join " + factionDisplayName + "!", null, true, OnJoinComplete, "Sweet!");
     }
 }
Esempio n. 2
0
    public void showTab(Rect tabGroup)
    {
        string b = (Event.current.type != EventType.Repaint) ? lastHover : string.Empty;

        mIconSize = (tabGroup.height - mSelectTop - mSelectBottom - (float)(mNumPerColumn + 1) * mGapSize) / (float)mNumPerColumn;
        if (mSuitInspector.ModelTransforms[0] == null)
        {
            SuitInspector.TempSuitInfo tempSuitInfo = mSuits[mSelectedIndex];
            if (GameData.getExosuit(tempSuitInfo.mIndex).getHighPolyModel() != null)
            {
                mSuitInspector.ModelTransforms[0] = GameData.getExosuit(tempSuitInfo.mIndex).getHighPolyModel().transform;
            }
            else
            {
                AssetLoader.AddSuitToLoad(tempSuitInfo.mIndex, AssetLoader.SuitAsset.SuitType.high, 1000);
                GUI.Label(new Rect(Screen.width / 2 - 200, Screen.height / 2 - 70, 400f, 40f), "Loading Suit: " + (int)(AssetLoader.GetSuitLoadProgress(tempSuitInfo.mIndex, AssetLoader.SuitAsset.SuitType.high) * 100f) + "%", mShowcaseSkin.GetStyle("SuitLoadStyle"));
                GUIUtil.DrawLoadingAnim(new Rect((Screen.width - 128) / 2, (Screen.height - 128) / 2 + 40, 128f, 128f), 1);
            }
        }
        GUI.color = Color.white;
        if (Input.GetKeyUp(KeyCode.Keypad0))
        {
            tempheight = 0f;
        }
        if (Input.GetKeyUp(KeyCode.Keypad1))
        {
            LastKey    = KeyCode.Keypad1;
            tempheight = 0f;
        }
        if (Input.GetKeyUp(KeyCode.Keypad2))
        {
            LastKey    = KeyCode.Keypad2;
            tempheight = 0f;
        }
        if (Input.GetKeyUp(KeyCode.Keypad3))
        {
            LastKey    = KeyCode.Keypad3;
            tempheight = 0f;
        }
        tempheight += Time.deltaTime * tabGroup.height / 1f;
        tempheight  = Mathf.Min(tempheight, mInspectGroup.height);
        switch (LastKey)
        {
        case KeyCode.Keypad1:
            GUI.BeginGroup(new Rect(mInspectGroup.x, mInspectGroup.y, mInspectGroup.width, tempheight));
            ShowPreview();
            GUI.EndGroup();
            break;

        case KeyCode.Keypad2:
            GUI.BeginGroup(new Rect(mInspectGroup.x, mInspectGroup.y + mInspectGroup.height / 2f - tempheight / 2f, mInspectGroup.width, tempheight));
            ShowPreview();
            GUI.EndGroup();
            break;

        case KeyCode.Keypad3:
            GUI.BeginGroup(new Rect(mInspectGroup.x, (int)(mInspectGroup.y + mInspectGroup.height / 2f - tempheight / 2f), mInspectGroup.width, tempheight));
            GUI.BeginGroup(new Rect(0f, (int)(0f - mInspectGroup.height / 2f + tempheight / 2f), mInspectGroup.width, mInspectGroup.height));
            ShowPreview();
            GUI.EndGroup();
            GUI.EndGroup();
            break;
        }
        GUI.BeginGroup(mViewToolsGroup);
        GUI.Box(new Rect(0f, 0f, 0f, 0f), GUIContent.none, mShowcaseSkin.GetStyle("ViewToolsBracket"));
        bool flag = Event.current.type != EventType.Repaint && clickRepeat;

        switch (GUIUtil.RepeatButton(new Rect(49f, mViewToolsGroup.height - 34f, 34f, 34f), GUIContent.none, mShowcaseSkin.GetStyle("RotateLeft" + GameData.MyFactionId)))
        {
        case GUIUtil.GUIState.Hover:
        case GUIUtil.GUIState.Active:
            if (Event.current.type == EventType.Repaint)
            {
                b = "RotateLeft";
                if (lastHover != b)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
            }
            break;

        case GUIUtil.GUIState.Click:
            b = "RotateLeft";
            mSuitInspector.ModelRotations[0].y += 75f * Time.deltaTime;
            if (mSuitInspector.ModelRotations[0].y > 360f)
            {
                mSuitInspector.ModelRotations[0].y -= 360f;
            }
            flag = true;
            if (!clickRepeat)
            {
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            }
            break;
        }
        switch (GUIUtil.RepeatButton(new Rect(85f, mViewToolsGroup.height - 34f, 34f, 34f), GUIContent.none, mShowcaseSkin.GetStyle("RotateRight" + GameData.MyFactionId)))
        {
        case GUIUtil.GUIState.Hover:
        case GUIUtil.GUIState.Active:
            if (Event.current.type == EventType.Repaint)
            {
                b = "RotateRight";
                if (lastHover != b)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
            }
            break;

        case GUIUtil.GUIState.Click:
            b = "RotateRight";
            mSuitInspector.ModelRotations[0].y -= 75f * Time.deltaTime;
            if (mSuitInspector.ModelRotations[0].y < 0f)
            {
                mSuitInspector.ModelRotations[0].y += 360f;
            }
            flag = true;
            if (!clickRepeat)
            {
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            }
            break;
        }
        switch (GUIUtil.RepeatButton(new Rect(121f, mViewToolsGroup.height - 34f, 34f, 34f), GUIContent.none, mShowcaseSkin.GetStyle("ZoomIn" + GameData.MyFactionId)))
        {
        case GUIUtil.GUIState.Hover:
        case GUIUtil.GUIState.Active:
            if (Event.current.type == EventType.Repaint)
            {
                b = "ZoomIn";
                if (lastHover != b)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
            }
            break;

        case GUIUtil.GUIState.Click:
            b = "ZoomIn";
            mSuitInspector.mCameraOffset.z -= Time.deltaTime * 10f;
            mSuitInspector.mCameraOffset.y -= Time.deltaTime * 3.5f;
            mSuitInspector.LimitCameraOffset();
            flag = true;
            if (!clickRepeat)
            {
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            }
            break;
        }
        switch (GUIUtil.RepeatButton(new Rect(157f, mViewToolsGroup.height - 34f, 34f, 34f), GUIContent.none, mShowcaseSkin.GetStyle("ZoomOut" + GameData.MyFactionId)))
        {
        case GUIUtil.GUIState.Hover:
        case GUIUtil.GUIState.Active:
            if (Event.current.type == EventType.Repaint)
            {
                b = "ZoomOut";
                if (lastHover != b)
                {
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                }
            }
            break;

        case GUIUtil.GUIState.Click:
            b = "ZoomOut";
            mSuitInspector.mCameraOffset.z += Time.deltaTime * 10f;
            mSuitInspector.mCameraOffset.y += Time.deltaTime * 3.5f;
            mSuitInspector.LimitCameraOffset();
            flag = true;
            if (!clickRepeat)
            {
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
            }
            break;
        }
        clickRepeat = flag;
        SuitInspector.TempSuitInfo tempSuitInfo2 = mSuits[mSelectedIndex];
        GUI.color = Color.white;
        if (GameData.MATCH_MODE == GameData.Build.DEBUG || GameData.MyOwnedSuitIDs.Contains(tempSuitInfo2.mIndex) || Application.isEditor)
        {
            if (GameData.MySuitID != tempSuitInfo2.mIndex)
            {
                switch (GUIUtil.Button(new Rect(39f, 5f, 163f, 50f), new GUIContent("Equip Exosuit", GUIUtil.GUISoundClips.TT_Global_Button_Over + "05"), mShowcaseSkin.GetStyle("EquipButton" + GameData.MyFactionId)))
                {
                case GUIUtil.GUIState.Hover:
                case GUIUtil.GUIState.Active:
                    if (Event.current.type == EventType.Repaint)
                    {
                        b = "Equip Exosuit";
                        if (lastHover != b)
                        {
                            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                        }
                    }
                    break;

                case GUIUtil.GUIState.Click:
                    b = "Equip Exosuit";
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Equip_Press);
                    GameData.MySuitID     = tempSuitInfo2.mIndex;
                    mParent.avatarTexture = (Resources.Load("HUD/avatar/" + GameHUD.avatar_images[GameData.MySuitID - 1]) as Texture2D);
                    break;
                }
            }
            else if (GameData.MySuitID == tempSuitInfo2.mIndex)
            {
                switch (GUIUtil.Button(new Rect(39f, 5f, 163f, 50f), new GUIContent("Current Exosuit", GUIUtil.GUISoundClips.TT_Global_Button_Over + "05"), mShowcaseSkin.GetStyle("EquipButton" + GameData.MyFactionId)))
                {
                case GUIUtil.GUIState.Hover:
                case GUIUtil.GUIState.Active:
                    if (Event.current.type == EventType.Repaint)
                    {
                        b = "Current Exosuit";
                        if (lastHover != b)
                        {
                            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                        }
                    }
                    break;

                case GUIUtil.GUIState.Click:
                    b = "Current Exosuit";
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Button_Inactive);
                    break;
                }
            }
        }
        else
        {
            bool bEnable = false;
            if (GameData.MyPlayStatus > 1 && tempSuitInfo2.mLevelRequirement <= GameData.MyLevel && GameData.MyTotalCredits >= tempSuitInfo2.mCost)
            {
                bEnable = true;
            }
            GUIUtil.GUIEnable(bEnable);
            switch (GUIUtil.Button(new Rect(39f, 5f, 163f, 50f), new GUIContent("Buy Exosuit", GUIUtil.GUISoundClips.TT_Global_Button_Over + "05"), mShowcaseSkin.GetStyle("EquipButton" + GameData.MyFactionId)))
            {
            case GUIUtil.GUIState.Hover:
            case GUIUtil.GUIState.Active:
                if (Event.current.type == EventType.Repaint)
                {
                    b = "Buy Exosuit";
                    if (lastHover != b)
                    {
                        GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                    }
                }
                break;

            case GUIUtil.GUIState.Click:
                b = "Buy Exosuit";
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Buy_Press);
                MessageBox.AddMessageCustom("Confirm Purchase", "Are you sure that you want to buy " + tempSuitInfo2.mSuitName + " for " + tempSuitInfo2.mCost + "c?", null, true, OnClickBuy, "Yes, Buy", "No, Cancel");
                break;
            }
            GUIUtil.GUIEnable(bEnable: true);
        }
        GUI.EndGroup();
        float f = 0.8f;

        GUI.matrix = Matrix4x4.identity;
        int   num  = Mathf.CeilToInt((float)mSuits.Count / (float)mNumPerColumn);
        float num2 = (float)(mSelectedIndex / mNumPerColumn) - anim;

        if (num2 < 0f)
        {
            num2 += (float)num;
        }
        anim += Time.deltaTime * Mathf.Max(num2, 0.25f) * 1.3f;
        if (anim > (float)num)
        {
            anim -= num;
        }
        int num3 = (int)anim;
        int num4 = num3;

        if (mSelectedIndex / mNumPerColumn == num3)
        {
            anim = num3;
        }
        num4 = num3 - 1;
        int  num5  = -1;
        bool flag2 = GUIUtil.TestFlag(GUIUtil.GUIFlags.WindowUp);

        do
        {
            if (num4 < 0)
            {
                num4 = num - 1;
            }
            if (num4 >= num || num4 < 0)
            {
                break;
            }
            float num6 = (float)num4 - anim;
            if (num6 <= -1f)
            {
                num6 = (float)num + num6;
            }
            float num7 = Mathf.Pow(f, num6);
            if (num7 > 1f)
            {
                num7 *= num7;
            }
            GUI.matrix = Matrix4x4.identity * Matrix4x4.Scale(new Vector3(num7, num7, 1f));
            float num8  = (mSelectTop + mGapSize * num6) / num7;
            float num9  = (tabGroup.width - mIconSize - mGapSize) / num7;
            float num10 = Mathf.Clamp(GameHome.ScreenSpace.width / (4.25f * (float)num * GameHome.ScreenSpace.height / GameHome.ScreenSpace.width), mIconSize * 0.4f, mIconSize * 0.75f);
            float num11 = num6;
            while ((num11 -= 1f) >= 0f)
            {
                num9 -= num10 / Mathf.Pow(f, num11);
                num8 += -10f / Mathf.Pow(f, num11);
            }
            float num12 = num6 - (float)Mathf.FloorToInt(num6);
            if (num12 > 0f)
            {
                num9 -= num12 * num10;
                num8 += num12 * -10f;
            }
            for (int i = 0; i < Mathf.Min(mNumPerColumn, mSuits.Count - num4 * mNumPerColumn); i++)
            {
                int num13 = num4 * mNumPerColumn + i;
                SuitInspector.TempSuitInfo tempSuitInfo3 = mSuits[num13];
                bool   flag3 = GameData.MyOwnedSuitIDs.Contains(tempSuitInfo3.mIndex);
                string text  = "ChooserLockedIcon";
                if (flag3)
                {
                    text = "ChooserOwnedIcon";
                }
                else if (tempSuitInfo3.mLevelRequirement <= GameData.MyLevel)
                {
                    text = "ChooserBuyableIcon";
                }
                if (num7 > 1f)
                {
                    GUI.color = new Color(1f, 1f, 1f, 4.05f - Mathf.Sqrt(num7 * 13f));
                    if (GameData.MySuitID == tempSuitInfo3.mIndex)
                    {
                        text += "Hover";
                    }
                    Rect position = new Rect(num9 + mIconSize * 0.65f / num7, num8 + (float)i * (mIconSize + mGapSize), mIconSize, mIconSize);
                    if ((bool)GameData.getExosuit(tempSuitInfo3.mIndex).mGuiLoadoutImage)
                    {
                        GUI.DrawTexture(position, GameData.getExosuit(tempSuitInfo3.mIndex).mGuiLoadoutImage);
                    }
                    GUI.Box(position, GUIContent.none, mShowcaseSkin.GetStyle(text));
                    continue;
                }
                Rect position2 = new Rect(num9, num8 + (float)i * (mIconSize + mGapSize), mIconSize, mIconSize);
                if (position2.Contains(Event.current.mousePosition) && !flag2)
                {
                    num5 = num13;
                    if (Event.current.type == EventType.MouseUp)
                    {
                        SetCurrentSelection(num13);
                    }
                }
                if (mHoverIndex == num13)
                {
                    float num14 = (0.05f + Mathf.Lerp(0f, 0.1f, Mathf.Abs(Mathf.Sin(mHoverTime * 2f)) / (float)Math.PI)) * position2.width;
                    position2.x      -= num14;
                    position2.y      -= num14;
                    position2.width  += num14 + num14;
                    position2.height += num14 + num14;
                    text             += "Hover";
                }
                float a = Mathf.Lerp(1f, 0.1f, Mathf.Clamp((num6 / (float)num - 0.2f) * 2f, 0f, 1f));
                if (Event.current.type == EventType.Repaint)
                {
                    Texture2D texture2D = Resources.Load("SuitChooser/ex_" + GameData.getExosuit(tempSuitInfo3.mIndex).mSuitFileName) as Texture2D;
                    if (texture2D != null)
                    {
                        if (flag2)
                        {
                            GUI.DrawTexture(position2, whitebox.normal.background);
                            GUI.color   = new Color(1f, 1f, 1f, 0.6f);
                            mHoverIndex = -1;
                        }
                        else if (mHoverIndex != num13)
                        {
                            GUI.color = new Color(1f, 1f, 1f, a);
                        }
                        GUI.DrawTexture(position2, texture2D);
                        GUI.color = Color.white;
                    }
                    GUI.Box(position2, GUIContent.none, mShowcaseSkin.GetStyle(text));
                }
                if (mHoverIndex != num13)
                {
                    GUI.color = new Color(1f, 1f, 1f, a);
                }
                if (!flag3 && tempSuitInfo3.mLevelRequirement > GameData.MyLevel)
                {
                    Rect     position3 = new Rect(position2.x + position2.width - 42f - 3f, position2.y + position2.height - 42f - 3f, 42f, 42f);
                    GUIStyle style     = mShowcaseSkin.GetStyle("ChooserLockTag");
                    GUI.Box(position3, tempSuitInfo3.mLevelRequirement.ToString(), style);
                }
                else if (!flag3)
                {
                    Rect     position4 = new Rect(position2.x + 3f, position2.y + position2.height - 30f, position2.width - 6f, 27f);
                    GUIStyle style2    = mShowcaseSkin.GetStyle("ChooserBuyTag");
                    GUI.Box(position4, GameData.getExosuit(tempSuitInfo3.mIndex).mCost.ToString(), style2);
                    GUI.Box(new Rect(position4.x + 5f, position4.y + (position4.height - 23f) / 2f, 23f, 23f), GUIContent.none, mSharedSkin.GetStyle("CreditSymbol"));
                }
                GUI.color = new Color(0f, 0f, 0f, Mathf.Lerp(0f, 0.75f, Mathf.Abs(Mathf.Sin(num6 / (float)(num - 1) * (float)Math.PI))));
                GUI.Box(position2, GUIContent.none, whitebox);
                GUI.color = Color.white;
            }
        }while (num4-- != num3);
        if (Event.current.type == EventType.Repaint)
        {
            if (flag2)
            {
                mHoverIndex = -1;
            }
            else if (mHoverIndex != num5)
            {
                mHoverIndex = num5;
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Suit_Chooser_Over);
            }
        }
        GUI.matrix = Matrix4x4.identity;
        if (mHoverIndex == -1)
        {
            mHoverTime = 0f;
        }
        else
        {
            GUIUtil.Tooltip = mSuits[mHoverIndex].mSuitName;
            mHoverTime     += Time.deltaTime;
        }
        lastHover = b;
    }
 protected override void waitToSpawnPlayer()
 {
     MessageBox.AddMessageCustom("Go Fullscreen?", "We suggest training in fullscreen. Would you like to go fullscreen now?", null, false, FullScreenCallback, "No", "Yes");
     base.waitToSpawnPlayer();
     mHUD.avatarTexture = (Resources.Load("HUD/avatar/HUD_thumb_training") as Texture2D);
 }
    private void OnGUI()
    {
        GUIUtil.GUIEnable(bEnable: true);
        GUI.skin = SharedHudSkin;
        if ((mTextureBundles.isDone && mTextureBundles.assetBundle == null) || mTextureBundles.error != null)
        {
            GUI.Box(screenSpace, GUIContent.none, "blackbox");
            GUI.Label(new Rect(0f, screenSpace.height / 2f, screenSpace.width, 150f), "Loading Assets Error.", "MissionHeader");
            Logger.traceError(mTextureBundles.error);
            return;
        }
        GUI.Box(screenSpace, GUIContent.none, "blackbox");
        GUI.Label(new Rect(0f, screenSpace.height / 2f, screenSpace.width, 30f), "Loading Assets: " + mTextureBundles.progress * 100f + "%", GUIUtil.mInstance.mShowcaseSkin.GetStyle("SuitLoadStyle"));
        if (mTextureBundles.isDone && !bTexturesLoaded)
        {
            return;
        }
        GUI.BeginGroup(screenSpace);
        string b = (Event.current.type != EventType.Repaint) ? lastHover : string.Empty;

        if (bLoading)
        {
            MessageBox.Local("Loading...", "Please wait.", null, false, MessageBox.MessageType.MB_NoButtons);
        }
        Vector2 mousePosition = Event.current.mousePosition;
        float   num           = 0f;

        if (StartAnim == -1)
        {
            if (mFactionSelected == -1)
            {
                num = fMiddle;
            }
            else if (mFactionSelected == 0)
            {
                if (bViewFaction)
                {
                    Vector2 mousePosition2 = Event.current.mousePosition;
                    num = Mathf.Clamp((0f - mousePosition2.x) / (float)Screen.width * 3.25f + 4.55f, 1.75f, 4f);
                }
                else
                {
                    num = 1.75f;
                }
            }
            else if (mFactionSelected == 1)
            {
                if (bViewFaction)
                {
                    Vector2 mousePosition3 = Event.current.mousePosition;
                    num = Mathf.Clamp((0f - mousePosition3.x) / (float)Screen.width * 3.55f - 1.25f, -4f, -1.45f);
                }
                else
                {
                    num = -1.45f;
                }
            }
            mCurrentScroll += (num - mCurrentScroll) * Time.deltaTime;
        }
        num = mCurrentScroll;
        float num2 = num * ScrollFactor;
        float num3 = screenSpace.width / 2f + num2;

        GUI.color = Color.white;
        GUI.DrawTexture(new Rect(((0f - screenSpace.height) * 4.5f + screenSpace.width) / 2f + num2, 0f, screenSpace.height * 4.5f, screenSpace.height), mBackground);
        if (StartAnim != -1)
        {
            if (StartAnim == 3)
            {
                GUI.DrawTexture(new Rect(0f, 0f, screenSpace.width, 23f), ChooseYourFaction);
            }
            GUI.color = new Color(1f, 1f, 1f, 1f - BlackFade);
            GUI.Box(screenSpace, GUIContent.none, "blackbox");
            GUI.color = Color.white;
            GUI.EndGroup();
            return;
        }
        GUI.color = OutlineColor;
        for (int i = 0; i < DrawBanzaiOutlines.Length; i++)
        {
            if (DrawBanzaiOutlines[i])
            {
                GUI.DrawTexture(new Rect(num3 + fObjectOffsetX * BanzaiSuitOutlineRects[i].x, fObjectOffsetX * BanzaiSuitOutlineRects[i].y, fObjectOffsetX * (float)BanzaiSuitOutlineTextures[i].width, fObjectOffsetX * (float)BanzaiSuitOutlineTextures[i].height), BanzaiSuitOutlineTextures[i]);
            }
        }
        GUI.color = Color.white;
        for (int j = 0; j < DrawBanzaiOutlines.Length; j++)
        {
            if (!DrawBanzaiOutlines[j])
            {
                continue;
            }
            GUI.DrawTexture(new Rect(num3 + fObjectOffsetX * BanzaiSuitRects[j].x, fObjectOffsetX * BanzaiSuitRects[j].y, fObjectOffsetX * (float)BanzaiSuitTextures[j].width, fObjectOffsetX * (float)BanzaiSuitTextures[j].height), BanzaiSuitTextures[j]);
            if (Event.current.type != EventType.MouseUp || !(fIgnoreClick <= 0f))
            {
                continue;
            }
            if (mFactionSelected == -1)
            {
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Suit_Chooser_Change_Column);
                mFadeLeft        = 1f;
                mFactionSelected = 0;
                mSuitSelected    = -1;
                for (int k = 0; k < mNameTimer.Length; k++)
                {
                    mNameTimer[k] = 1f;
                }
                break;
            }
            if (mFactionSelected == 0 && mSuitSelected == -1)
            {
                mSuitSelected = mBanzaiSuits[j];
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Equip_Press);
            }
        }
        GUI.color = OutlineColor;
        for (int l = 0; l < DrawAtlasOutlines.Length; l++)
        {
            if (DrawAtlasOutlines[l])
            {
                GUI.DrawTexture(new Rect(num3 + fObjectOffsetX * AtlasSuitOutlineRects[l].x, fObjectOffsetX * AtlasSuitOutlineRects[l].y, fObjectOffsetX * (float)AtlasSuitOutlineTextures[l].width, fObjectOffsetX * (float)AtlasSuitOutlineTextures[l].height), AtlasSuitOutlineTextures[l]);
            }
        }
        GUI.color = Color.white;
        for (int m = 0; m < DrawAtlasOutlines.Length; m++)
        {
            if (!DrawAtlasOutlines[m])
            {
                continue;
            }
            GUI.DrawTexture(new Rect(num3 + fObjectOffsetX * AtlasSuitRects[m].x, fObjectOffsetX * AtlasSuitRects[m].y, fObjectOffsetX * (float)AtlasSuitTextures[m].width, fObjectOffsetX * (float)AtlasSuitTextures[m].height), AtlasSuitTextures[m]);
            if (Event.current.type != EventType.MouseUp || !(fIgnoreClick <= 0f))
            {
                continue;
            }
            if (mFactionSelected == -1)
            {
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Suit_Chooser_Change_Column);
                mFadeLeft        = 1f;
                mFactionSelected = 1;
                mSuitSelected    = -1;
                for (int n = 0; n < mNameTimer.Length; n++)
                {
                    mNameTimer[n] = 1f;
                }
                break;
            }
            if (mFactionSelected == 1 && mSuitSelected == -1)
            {
                mSuitSelected = mAtlasSuits[m];
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Equip_Press);
            }
        }
        if (mFactionSelected == -1)
        {
            GUI.DrawTexture(new Rect(0f, 0f, screenSpace.width, 23f), ChooseYourFaction);
            int num4 = -1;
            for (int num5 = 0; num5 < FactionButtons.Length; num5++)
            {
                Rect rect = FactionButtons[num5];
                rect.x       = num3 + fObjectOffsetX * rect.x;
                rect.y      *= fObjectOffsetX;
                rect.height *= fObjectOffsetX;
                rect.width  *= fObjectOffsetX;
                if (rect.Contains(mousePosition))
                {
                    num4 = num5;
                }
            }
            if (num4 != -1 && mFactionHovered != num4)
            {
                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Suit_Chooser_Over);
            }
            mFactionHovered = num4;
            for (int num6 = 0; num6 < DrawBanzaiOutlines.Length; num6++)
            {
                DrawBanzaiOutlines[num6] = (mFactionHovered == 0);
            }
            for (int num7 = 0; num7 < DrawAtlasOutlines.Length; num7++)
            {
                DrawAtlasOutlines[num7] = (mFactionHovered == 1);
            }
        }
        else
        {
            if (!bViewFaction)
            {
                GUI.DrawTexture(new Rect(0f, 0f, screenSpace.width, 23f), ChooseYourExosuit);
            }
            Rect[] array  = null;
            bool[] array2 = null;
            if (mFactionSelected == 0)
            {
                if (!bViewFaction)
                {
                    for (int num8 = 0; num8 < BanzaiSuitIcons.Length; num8++)
                    {
                        Rect position = BanzaiSuitIconRect[num8];
                        position.x      *= fObjectOffsetX;
                        position.y      *= fObjectOffsetX;
                        position.width  *= fObjectOffsetX;
                        position.height *= fObjectOffsetX;
                        position.x      += num3 + (float)(int)(position.width * mFadeLeft);
                        position.width   = (int)(position.width * (1f - mFadeLeft));
                        GUI.BeginGroup(position);
                        Rect position2 = new Rect((0f - BanzaiSuitIconRect[num8].width) * fObjectOffsetX * mFadeLeft, 0f, (float)BanzaiSuitIcons[num8].width * fObjectOffsetX, (float)BanzaiSuitIcons[num8].height * fObjectOffsetX);
                        GUI.DrawTexture(position2, BanzaiSuitIcons[num8]);
                        GUI.EndGroup();
                        Rect position3 = new Rect(position.x, position.y, (int)((float)FactionTextBG[0].width * fObjectOffsetX * (1f - mNameTimer[num8])), (float)FactionTextBG[0].height * fObjectOffsetX);
                        position3.x -= position3.width;
                        GUI.BeginGroup(position3);
                        GUI.DrawTexture(new Rect((int)((float)(-FactionTextBG[0].width) * fObjectOffsetX * mNameTimer[num8]), 0f, (float)FactionTextBG[0].width * fObjectOffsetX, (float)FactionTextBG[0].height * fObjectOffsetX), FactionTextBG[0]);
                        GUI.DrawTexture(new Rect((float)(int)((float)(-FactionTextBG[0].width) * fObjectOffsetX * mNameTimer[num8]) + ((float)FactionTextBG[0].width * fObjectOffsetX - (float)BanzaiSuitText[num8].width * fObjectOffsetX) / 2f, 10f, (float)BanzaiSuitText[num8].width * fObjectOffsetX, (float)BanzaiSuitText[num8].height * fObjectOffsetX), BanzaiSuitText[num8]);
                        GUI.EndGroup();
                    }
                    switch (GUIUtil.Button(new Rect(10f, 10f, 80f, 38f), "BACK", "ModalButton"))
                    {
                    case GUIUtil.GUIState.Hover:
                    case GUIUtil.GUIState.Active:
                        if (Event.current.type == EventType.Repaint)
                        {
                            b = "BACK";
                            if (lastHover != b)
                            {
                                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                            }
                        }
                        break;

                    case GUIUtil.GUIState.Click:
                        b = "BACK";
                        GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
                        mFactionSelected = -1;
                        mSuitSelected    = -1;
                        mFadeLeft        = 1f;
                        GUI.EndGroup();
                        return;
                    }
                }
                array  = BanzaiButtons;
                array2 = DrawBanzaiOutlines;
                switch (GUIUtil.Button(new Rect(10f, screenSpace.height - 48f, 120f, 38f), (!bViewFaction) ? "VIEW FACTION" : "BACK TO SUITS", "ModalButton"))
                {
                case GUIUtil.GUIState.Hover:
                case GUIUtil.GUIState.Active:
                    if (Event.current.type == EventType.Repaint)
                    {
                        b = "BACK TO SUITS";
                        if (lastHover != b)
                        {
                            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                        }
                    }
                    break;

                case GUIUtil.GUIState.Click:
                    b = "BACK TO SUITS";
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
                    bViewFaction  = !bViewFaction;
                    mSuitSelected = -1;
                    GUI.EndGroup();
                    return;
                }
            }
            else if (mFactionSelected == 1)
            {
                if (!bViewFaction)
                {
                    for (int num9 = 0; num9 < AtlasSuitIcons.Length; num9++)
                    {
                        Rect position4 = AtlasSuitIconRect[num9];
                        position4.x      *= fObjectOffsetX;
                        position4.y      *= fObjectOffsetX;
                        position4.width  *= fObjectOffsetX;
                        position4.height *= fObjectOffsetX;
                        position4.x      += num3;
                        position4.width  *= 1f - mFadeLeft;
                        GUI.BeginGroup(position4);
                        GUI.DrawTexture(new Rect(0f, 0f, (float)AtlasSuitIcons[num9].width * fObjectOffsetX, (float)AtlasSuitIcons[num9].height * fObjectOffsetX), AtlasSuitIcons[num9]);
                        GUI.EndGroup();
                        Rect position5 = new Rect(position4.x + position4.width, position4.y, (float)FactionTextBG[1].width * fObjectOffsetX * (1f - mNameTimer[num9]), (float)FactionTextBG[1].height * fObjectOffsetX);
                        GUI.BeginGroup(position5);
                        GUI.DrawTexture(new Rect(0f, 0f, (float)FactionTextBG[1].width * fObjectOffsetX, (float)FactionTextBG[1].height * fObjectOffsetX), FactionTextBG[1]);
                        GUI.DrawTexture(new Rect(((float)FactionTextBG[1].width * fObjectOffsetX - (float)AtlasSuitText[num9].width * fObjectOffsetX) / 2f, 10f, (float)AtlasSuitText[num9].width * fObjectOffsetX, (float)AtlasSuitText[num9].height * fObjectOffsetX), AtlasSuitText[num9]);
                        GUI.EndGroup();
                    }
                    switch (GUIUtil.Button(new Rect(screenSpace.width - 90f, 10f, 80f, 38f), "BACK", "ModalButton"))
                    {
                    case GUIUtil.GUIState.Hover:
                    case GUIUtil.GUIState.Active:
                        if (Event.current.type == EventType.Repaint)
                        {
                            b = "BACK";
                            if (lastHover != b)
                            {
                                GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                            }
                        }
                        break;

                    case GUIUtil.GUIState.Click:
                        b = "BACK";
                        GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
                        mFactionSelected = -1;
                        mSuitSelected    = -1;
                        mFadeLeft        = 1f;
                        GUI.EndGroup();
                        return;
                    }
                }
                array  = AtlasButtons;
                array2 = DrawAtlasOutlines;
                switch (GUIUtil.Button(new Rect(screenSpace.width - 130f, screenSpace.height - 48f, 120f, 38f), (!bViewFaction) ? "VIEW FACTION" : "BACK TO SUITS", "ModalButton"))
                {
                case GUIUtil.GUIState.Hover:
                case GUIUtil.GUIState.Active:
                    if (Event.current.type == EventType.Repaint)
                    {
                        b = "BACK TO SUITS";
                        if (lastHover != b)
                        {
                            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                        }
                    }
                    break;

                case GUIUtil.GUIState.Click:
                    b = "BACK TO SUITS";
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
                    bViewFaction  = !bViewFaction;
                    mSuitSelected = -1;
                    GUI.EndGroup();
                    return;
                }
            }
            if (mSuitSelected == -1 && !bViewFaction)
            {
                for (int num10 = 0; num10 < array.Length; num10++)
                {
                    Rect rect2 = array[num10];
                    rect2.x      *= fObjectOffsetX;
                    rect2.y      *= fObjectOffsetX;
                    rect2.width  *= fObjectOffsetX;
                    rect2.height *= fObjectOffsetX;
                    rect2.x      += num2;
                    if (rect2.Contains(mousePosition))
                    {
                        if (!array2[num10])
                        {
                            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Suit_Chooser_Over);
                        }
                        array2[num10] = true;
                    }
                    else
                    {
                        array2[num10] = false;
                    }
                }
            }
            SuitInspector.TempSuitInfo tempSuitInfo = new SuitInspector.TempSuitInfo();
            GUIUtil.GUIEnable(bEnable: true);
            if (mSuitSelected != -1)
            {
                tempSuitInfo.mSuitName = GameData.getExosuit(mSuitSelected).mSuitName;
                Exosuit exosuit = GameData.getExosuit(mSuitSelected);
                tempSuitInfo.mSuitShow    = exosuit.mShowName;
                tempSuitInfo.mSuitName    = exosuit.mSuitName;
                tempSuitInfo.mIndex       = mSuitSelected;
                tempSuitInfo.mDescription = exosuit.mDescription;
                tempSuitInfo.mShieldPower = exosuit.mBaseHealth;
                tempSuitInfo.mShieldRegen = exosuit.mBaseRegenHealth;
                tempSuitInfo.mJetpack     = exosuit.mBaseJetFuel;
                tempSuitInfo.mSpeed       = exosuit.mBaseSpeed;
                tempSuitInfo.mTech        = exosuit.mBaseTech;
                Rect position6 = new Rect(150f, 60f, screenSpace.width - 300f, screenSpace.height - 120f);
                GUI.BeginGroup(position6);
                mSuitInspector.DrawSuitInfo(tempSuitInfo, bDraw3D: true);
                float num11 = 230f + (position6.width - 230f) / 2f;
                if (GameData.getExosuit(mSuitSelected).getHighPolyModel() == null)
                {
                    GUI.Label(new Rect(num11 - 200f, position6.height / 2f - 90f, 400f, 40f), "Loading Suit: " + (int)(AssetLoader.GetSuitLoadProgress(tempSuitInfo.mIndex, AssetLoader.SuitAsset.SuitType.high) * 100f) + "%", GUIUtil.mInstance.mShowcaseSkin.GetStyle("SuitLoadStyle"));
                    GUIUtil.DrawLoadingAnim(new Rect(num11 - 64f, (Screen.height - 128) / 2, 128f, 128f), 1);
                }
                GUI.color = Color.white;
                switch (GUIUtil.Button(new Rect(num11 - 70f, position6.height - 45f, 140f, 34f), "CHOOSE EXOSUIT", "ModalButton"))
                {
                case GUIUtil.GUIState.Hover:
                case GUIUtil.GUIState.Active:
                    if (Event.current.type == EventType.Repaint)
                    {
                        b = "CHOOSE EXOSUIT";
                        if (lastHover != b)
                        {
                            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                        }
                    }
                    break;

                case GUIUtil.GUIState.Click:
                    b = "CHOOSE EXOSUIT";
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Press);
                    MessageBox.ResetWindowPosition();
                    MessageBox.AddMessageCustom("Join " + GameData.getFactionDisplayName(mFactionSelected + 1) + "?", "Once you pledge your allegiance to a faction, you can not switch sides. Are you sure you want to select the " + tempSuitInfo.mSuitName + " and join " + GameData.getFactionDisplayName(mFactionSelected + 1) + "?", null, true, OnJoinConfirm, "Yes, Join", "No, Cancel");
                    break;
                }
                switch (GUIUtil.Button(new Rect(position6.width - 64f, 0f, 64f, 42f), GUIContent.none, "Close"))
                {
                case GUIUtil.GUIState.Hover:
                case GUIUtil.GUIState.Active:
                    if (Event.current.type == EventType.Repaint)
                    {
                        b = "Close";
                        if (lastHover != b)
                        {
                            GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Global_Button_Over);
                        }
                    }
                    break;

                case GUIUtil.GUIState.Click:
                    b = "Close";
                    GUIUtil.PlayGUISound(GUIUtil.GUISoundClips.TT_Hangar_Button_Inactive);
                    mSuitSelected = -1;
                    break;
                }
                GUI.EndGroup();
            }
        }
        GUI.EndGroup();
        if (Event.current.type == EventType.MouseUp)
        {
            fIgnoreClick = 0.05f;
        }
        lastHover = b;
    }