public static void MainMenuOnGUI() { VersionControl.DrawInfoInCorner(); Rect rect = new Rect((float)(Screen.width / 2) - MainMenuDrawer.PaneSize.x / 2f, (float)(Screen.height / 2) - MainMenuDrawer.PaneSize.y / 2f, MainMenuDrawer.PaneSize.x, MainMenuDrawer.PaneSize.y); rect.y += 50f; rect.x = (float)Screen.width - rect.width - 30f; Vector2 a = MainMenuDrawer.TitleSize; if (a.x > (float)Screen.width) { a *= (float)Screen.width / a.x; } a *= 0.7f; Rect rect2 = new Rect((float)(Screen.width / 2) - a.x / 2f, rect.y - a.y - 10f, a.x, a.y); rect2.x = (float)Screen.width - a.x - 50f; GUI.DrawTexture(rect2, MainMenuDrawer.TexTitle, ScaleMode.StretchToFill, true); Rect rect3 = rect2; rect3.y += rect2.height; rect3.xMax -= 55f; rect3.height = 30f; rect3.y += 3f; string text = "MainPageCredit".Translate(); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.UpperRight; if (Screen.width < 990) { Rect position = rect3; position.xMin = position.xMax - Text.CalcSize(text).x; position.xMin -= 4f; position.xMax += 4f; GUI.color = new Color(0.2f, 0.2f, 0.2f, 0.5f); GUI.DrawTexture(position, BaseContent.WhiteTex); GUI.color = Color.white; } Widgets.Label(rect3, text); Text.Anchor = TextAnchor.UpperLeft; Text.Font = GameFont.Small; GUI.color = new Color(1f, 1f, 1f, 0.5f); Rect position2 = new Rect((float)(Screen.width - 8) - MainMenuDrawer.LudeonLogoSize.x, 8f, MainMenuDrawer.LudeonLogoSize.x, MainMenuDrawer.LudeonLogoSize.y); GUI.DrawTexture(position2, MainMenuDrawer.TexLudeonLogo, ScaleMode.StretchToFill, true); GUI.color = Color.white; Rect rect4 = rect.ContractedBy(17f); GUI.BeginGroup(rect4); MainMenuDrawer.DoMainMenuButtons(rect4, MainMenuDrawer.anyWorldFiles, MainMenuDrawer.anyMapFiles, null); GUI.EndGroup(); }
public override void DoWindowContents(Rect rect) { base.DoWindowContents(rect); MainMenuDrawer.DoMainMenuButtons(rect, this.anyWorldFiles, this.anyMapFiles, null); }