private void ShowPreview() { SuitInspector.TempSuitInfo suitInfo = mSuits[mSelectedIndex]; mSuitInspector.DrawSuitInfo(suitInfo, bDraw3D: false); GUI.color = Color.white; }
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; }