internal void UpdateItemSelected(GameTime gameTime, IPageItem item) { if (item.CanGift()) { present.Update(gameTime); } else { presentDisabled.Update(gameTime); presentDisabledText.SetText(RetroEnvironment.GetLanguageManager().TryGetValue(presentDisabledText.GetOriginalText())); presentDisabledText.Update(gameTime); } buy.Update(gameTime); Amount.SetText(RetroEnvironment.GetLanguageManager().TryGetValue(Amount.GetOriginalText())); Price.SetText(RetroEnvironment.GetLanguageManager().TryGetValue(Price.GetOriginalText())); amountText.SetText("10"); amountText.Update(gameTime); Amount.Update(gameTime); Price.Update(gameTime); priceOneText.SetText((item.GetPrices()[0] * int.Parse(amountText.GetText())).ToString()); priceTwoText.SetText("+ " + (item.GetPrices()[1] * int.Parse(amountText.GetText())).ToString()); priceOneText.Update(gameTime); priceTwoText.Update(gameTime); }
internal void DrawItemIsSelected(SpriteBatch spriteBatch, IPageItem item, float depth = 0.92f) { if (item.CanGift()) { present.Draw(spriteBatch, position + new Vector2i(207, headerHeight + rootContainer.GetHeight() + 5 + 90 + 439), depth); } else { presentDisabled.Draw(spriteBatch, position + new Vector2i(207, headerHeight + rootContainer.GetHeight() + 5 + 90 + 439), depth - 0.01f); presentDisabledText.Draw(spriteBatch, new Vector2i((presentDisabled.Size.X / 2) - (presentDisabledText.measureString().X / 2), (presentDisabled.Size.Y / 2) - (presentDisabledText.measureString().Y / 2)) + position + new Vector2i(207, headerHeight + rootContainer.GetHeight() + 5 + 90 + 439), depth); } buy.Draw(spriteBatch, position + new Vector2i(387, headerHeight + rootContainer.GetHeight() + 5 + 90 + 439), depth); Amount.Draw(spriteBatch, position + new Vector2i(207, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (Amount.measureString().Y / 2))), depth); Price.Draw(spriteBatch, position + new Vector2i(387, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (Price.measureString().Y / 2))), depth); amountText.Draw(spriteBatch, position + new Vector2i(207 + Amount.measureString().X + 20, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (amountText.measureString().Y / 2))), depth); if (item.IsDubbelPriced()) { priceOneText.Draw(spriteBatch, position + new Vector2i(536 - priceCredits.GetTexture().Width - priceTwoText.measureString().X - 5 - priceOneText.measureString().X, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceOneText.measureString().Y / 2))), depth); priceCredits.Draw(spriteBatch, position + new Vector2i(536 - priceCredits.GetTexture().Width - priceTwoText.measureString().X, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceCredits.GetTexture().Height / 2))), depth); priceTwoText.Draw(spriteBatch, position + new Vector2i(536 - priceTwoText.measureString().X, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceTwoText.measureString().Y / 2))), depth); switch (item.GetPricesTypes()[1]) { case PriceTypes.DUCKETS: priceDuckets.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceDuckets.GetTexture().Height / 2))), depth); break; case PriceTypes.DIAMONDS: priceDiamonds.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceDiamonds.GetTexture().Height / 2))), depth); break; case PriceTypes.GOTW: priceGotw.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceGotw.GetTexture().Height / 2))), depth); break; default: Logger.Error("Unknown price type:", item.GetPricesTypes()[0].ToString()); break; } } else { priceOneText.Draw(spriteBatch, position + new Vector2i(536 - priceOneText.measureString().X, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceOneText.measureString().Y / 2))), depth); switch (item.GetPricesTypes()[0]) { case PriceTypes.CREDITS: priceCredits.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceCredits.GetTexture().Height / 2))), depth); break; case PriceTypes.DUCKETS: priceDuckets.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceDuckets.GetTexture().Height / 2))), depth); break; case PriceTypes.DIAMONDS: priceDiamonds.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceDiamonds.GetTexture().Height / 2))), depth); break; case PriceTypes.GOTW: priceGotw.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceGotw.GetTexture().Height / 2))), depth); break; default: Logger.Error("Unknown price type:", item.GetPricesTypes()[0].ToString()); break; } } }