public override void Draw(CoreGraphics.CGRect rect) { if (TopBar != null) { TopBar.Draw(new CoreGraphics.CGRect(0, 0, 0, 0)); //(new CoreGraphics.CGPoint (0, 0)); } DrawDayLabels(rect); DrawMonthLabel(rect); }
public override void Draw(RectangleF rect) { if (TopBar != null) { TopBar.Draw(new PointF(0, 0)); } DrawDayLabels(rect); DrawMonthLabel(rect); }
public void Draw(SpriteBatch spriteBatch) { topBar.Draw(spriteBatch); endTurnButton.Draw(spriteBatch); techTreeButton.Draw(spriteBatch); if (planetMenu == true) { foreach (Line line in lines) { line.Draw(spriteBatch); } spriteBatch.Draw(Game1.whiteCircle, selection, Color.White * 0.25f); } for (int x = 0; x < playerList.Count; x++) { for (int y = 0; y < playerList[x].ownedPlanets.Count; y++) { textSize = Arial15.MeasureString(playerList[x].ownedPlanets[y].planetName); temporaryPlanetRect = new Rectangle((int)playerList[x].ownedPlanets[y].position.X, (int)playerList[x].ownedPlanets[y].position.Y, playerList[x].ownedPlanets[y].size * 25, playerList[x].ownedPlanets[y].size * 25); spriteBatch.DrawString(Arial15, playerList[x].ownedPlanets[y].planetName, new Vector2(temporaryPlanetRect.Center.X - (textSize.X / 2), temporaryPlanetRect.Bottom), playerList[x].empireColor); positionsDrawnAlready.Add(new Vector2(temporaryPlanetRect.Center.X - (textSize.X / 2), temporaryPlanetRect.Bottom)); } } for (int x = 0; x < PlanetNames.Count; x++) { skipPlanet = false; textSize = Arial15.MeasureString(PlanetNames[x]); for (int y = 0; y < positionsDrawnAlready.Count; y++) { if (new Vector2(PlanetRectangles[x].Center.X - (textSize.X / 2), PlanetRectangles[x].Bottom) == positionsDrawnAlready[y]) { skipPlanet = true; } } if (skipPlanet) { continue; } spriteBatch.DrawString(Arial15, PlanetNames[x], new Vector2(PlanetRectangles[x].Center.X - (textSize.X / 2), PlanetRectangles[x].Bottom), Color.White); } if (planetManagementMenuOpen) { spriteBatch.Draw(whiteTexture, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle, Color.Navy); closePlanetManagementMenuButton.Draw(spriteBatch); spriteBatch.DrawString(Castellar20, "Planet Name: " + playerList[playerID].ownedPlanets[indexOfPlanetSelected].planetName, new Vector2(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y), Color.White); changePlanetNameTextBox.Draw(spriteBatch); confirmChangePlanetNameButton.Draw(spriteBatch); topLine.Draw(spriteBatch); lineUnderResources.Draw(spriteBatch); spriteBatch.DrawString(Castellar20, "Resources: ", new Vector2(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 105), Color.White); spriteBatch.Draw(ironResourceTexture, new Rectangle(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + (int)Castellar20.MeasureString("Resources: ").X, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 110, 25, 25), Color.White); spriteBatch.DrawString(Castellar20, "" + playerList[playerID].ownedPlanets[indexOfPlanetSelected].resourceNumbers[0], new Vector2(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + (int)Castellar20.MeasureString("Resources: ").X + 35, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 105), Color.White); spriteBatch.Draw(uraniumResourceTexture, new Rectangle(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 250, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 108, 25, 25), Color.White); spriteBatch.DrawString(Castellar20, "" + playerList[playerID].ownedPlanets[indexOfPlanetSelected].resourceNumbers[1], new Vector2(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 280, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 105), Color.White); spriteBatch.Draw(tungstenResourceTexture, new Rectangle(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 325, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 108, 25, 25), Color.White); spriteBatch.DrawString(Castellar20, "" + playerList[playerID].ownedPlanets[indexOfPlanetSelected].resourceNumbers[2], new Vector2(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 355, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 105), Color.White); spriteBatch.Draw(hydrogenResourceTexture, new Rectangle(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 410, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 108, 25, 25), Color.White); spriteBatch.DrawString(Castellar20, "" + playerList[playerID].ownedPlanets[indexOfPlanetSelected].resourceNumbers[3], new Vector2(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 445, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 105), Color.White); spriteBatch.Draw(nitrogenResourceTexture, new Rectangle(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 490, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 108, 25, 25), Color.White); spriteBatch.DrawString(Castellar20, "" + playerList[playerID].ownedPlanets[indexOfPlanetSelected].resourceNumbers[4], new Vector2(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 520, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 105), Color.White); spriteBatch.Draw(oxygenResourceTexture, new Rectangle(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 570, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 108, 25, 25), Color.White); spriteBatch.DrawString(Castellar20, "" + playerList[playerID].ownedPlanets[indexOfPlanetSelected].resourceNumbers[5], new Vector2(playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.X + 605, playerList[playerID].ownedPlanets[indexOfPlanetSelected].managementMenuObject.menuRectangle.Y + 105), Color.White); for (int x = 0; x < tabButtons.Count; x++) { tabButtons[x].Draw(spriteBatch); } lineAboveTabs.Draw(spriteBatch); if (tabSelected == Tabs.Ships) { for (int x = 0; x < shipIconRects.Count; x++) { for (int y = 0; y < shipsSelected.Count; y++) { if (currentPlanet.planetShips[x] == shipsSelected[y]) { spriteBatch.Draw(whiteTexture, shipIconRects[x], Color.White * 0.50f); } } spriteBatch.Draw(shipTexture, shipIconRects[x], Color.White); textSize = Castellar12.MeasureString(playerList[playerID].ownedPlanets[indexOfPlanetSelected].planetShips[x].getName()); spriteBatch.DrawString(Castellar12, playerList[playerID].ownedPlanets[indexOfPlanetSelected].planetShips[x].getName(), new Vector2(shipIconRects[x].Center.X - (textSize.X / 2), shipIconRects[x].Bottom), Color.White); spriteBatch.DrawString(Castellar15, "" + playerList[playerID].ownedPlanets[indexOfPlanetSelected].planetShips[x].currentmove, new Vector2(shipIconRects[x].Center.X - ((int)Castellar15.MeasureString("" + playerList[playerID].ownedPlanets[indexOfPlanetSelected].planetShips[x].currentmove).X / 2), shipIconRects[x].Bottom - Castellar15.MeasureString("" + playerList[playerID].ownedPlanets[indexOfPlanetSelected].planetShips[x].currentmove).Y), Color.White); } addMovesButton.Draw(spriteBatch); } if (tabSelected == Tabs.Buildings) { buildingsTabObject.Draw(spriteBatch); } if (tabSelected == Tabs.UnitProduction) { unitProductionTabObject.Draw(spriteBatch); //unitProductionMenu.Draw(spriteBatch, playerList[playerID].ownedPlanets[indexOfPlanetSelected].unitProduction); } } }
private void OnGUI() { Rect r = new Rect((float)Screen.width / 2f - GUIM.YRES(160f), (float)Screen.height / 2f - GUIM.YRES(30f), GUIM.YRES(400f), GUIM.YRES(80f)); if (GameData.gSteam) { if (!Steam.active) { GUIM.DrawBox(r, Main.tBlack); GUIM.DrawText(r, Lang.Get("_STEAM_NOT_LAUNCHED"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); return; } if (!Steam.logged) { GUIM.DrawBox(r, Main.tBlack); GUIM.DrawText(r, Lang.Get("_STEAM_NOT_LOGGEDON"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); return; } } if (!ContentLoader_.proceed) { UIManager.SetLoadingActive(true); return; } UIManager.SetLoadingActive(false); if (BaseData.banCost != string.Empty) { GUIM.DrawBox(r, Main.tBlack); Rect r2 = new Rect(r.x, r.y, r.width, r.height - GUIM.YRES(36f)); string str = "$" + BaseData.banCost; if (GameData.gVK) { str = BaseData.banCost + " г."; } if (GameData.gFB) { int num = Convert.ToInt32(BaseData.banCost); str = string.Format("{0:C}", (float)num * 0.12f); } GUIM.DrawText(r2, Lang.Get("_YOU_BANNED!_UNBAN_COST") + " - " + str, TextAnchor.MiddleCenter, BaseColor.White, 1, 16, true); Rect r3 = new Rect(r.x + GUIM.YRES(84f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f)); if (GameData.gSocial) { r3 = new Rect(r.x + GUIM.YRES(150f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f)); } if (Main.inbuySteam || Main.inbuySocial) { GUIM.Button(r3, BaseColor.Gray, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); } else { if (GameData.gSteam && GUIM.Button(r3, BaseColor.Green, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { WebHandler.get_buy("&itemid=10000"); Main.inbuySteam = true; } if (GameData.gVK && GUIM.Button(r3, BaseColor.Green, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { Main.inbuySocial = true; Application.ExternalCall("order", new object[] { "item10000" }); } if (GameData.gFB && GUIM.Button(r3, BaseColor.Green, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { Main.inbuySocial = true; FBManager.BuyUnbun(Convert.ToInt32(BaseData.banCost)); } } if (GameData.gSteam) { Rect r4 = new Rect(r.x + GUIM.YRES(216f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f)); if (GUIM.Button(r4, BaseColor.Red, Lang.Get("_EXIT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { Application.Quit(); } } return; } if (!Client.actualVersion) { GUIM.DrawBox(r, Main.tBlack); Rect r5 = new Rect(r.x, r.y, r.width, r.height - GUIM.YRES(36f)); if (GameData.gSteam) { GUIM.DrawText(r5, Lang.Get("_UPDATE_VERSION"), TextAnchor.MiddleCenter, BaseColor.White, 1, 16, true); Rect r6 = new Rect(r.x + GUIM.YRES(150f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f)); if (GUIM.Button(r6, BaseColor.Red, Lang.Get("_EXIT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true)) { Application.Quit(); } } if (GameData.gSocial) { GUIM.DrawText(r, Lang.Get("_UPDATE_VERSION"), TextAnchor.MiddleCenter, BaseColor.White, 1, 16, true); } return; } if (!BaseData.Auth) { GUIM.DrawBox(r, Main.tBlack); GUIM.DrawText(r, Lang.Get("_AUTHORIZATION"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true); return; } if (Main.tVig) { GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), Main.tVig); } TopBar.Draw(); BottomBar.Draw(); Profile.Draw(); MenuPlayer.Draw(); MenuGold.Draw(); MenuServers.Draw(); MenuShop.Draw(); MenuOptions.Draw(); MenuInventory.Draw(); MenuPreview.Draw(); if (GameData.gSteam) { MenuFriends.Draw(); } }