Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using Microsoft.Xna.Framework.Input;
- using Microsoft.Xna.Framework.Audio;
- using Microsoft.Xna.Framework.Media;
- namespace StarAttack
- {
- // TODO:
- // 1) SaveLoad - test it
- // 4) xbox standart keys: y - backspace etc.
- public class HighScoreScreen
- {
- public bool inputMode = false;
- public static int MAX_NAME_LENGTH = 20;
- public bool capsLock = true;
- int score = 91110;
- public StarGame.GameState goBackState = StarGame.GameState.MAIN_MENU;
- public Menu areYouSureMenu;
- public bool areYouSureMode = false;
- public List<MyParticleEffect> effects = new List<MyParticleEffect>();
- Animation top3;
- private Animation x_button;
- private Animation y_button;
- public HighScoreScreen()
- {
- List<string> mainMenuOptions1 = new List<string>();
- mainMenuOptions1.Add("No");
- mainMenuOptions1.Add("Yes");
- Vector2 start = new Vector2(1280 / 2 - 77, 250);
- areYouSureMenu = new Menu(null, mainMenuOptions1.ToArray(), MainMenu.menuFont, start, true, StarGame.graphics);
- areYouSureMenu.color = MainMenu.TEXT_COLOR;
- areYouSureMenu.title = "Are you sure?";
- effects.Add(new MyParticleEffect(TextureManager.pipe_smoke_n_little_emmiter, TextureManager.pipe_smoke_n_renderer, new Vector2(382-32, 728), false, false));
- effects.Add(new MyParticleEffect(TextureManager.pipe_smoke_n_little_emmiter, TextureManager.pipe_smoke_n_renderer, new Vector2(900+32, 728), false, false));
- effects.Add(new MyParticleEffect(TextureManager.pipe_smoke_w_emmiter, TextureManager.pipe_smoke_w_renderer, new Vector2(1149, 100), true, false));
- effects.Add(new MyParticleEffect(TextureManager.pipe_smoke_e_emmiter, TextureManager.pipe_smoke_e_renderer, new Vector2(124, 100), true, false));
- top3 = StarGame.textureManager.GetBonusAnimation(Bonus.BonusType.MISSLE);
- x_button = TextureManager.buttonX.MakeAnim();
- y_button = TextureManager.buttonY.MakeAnim();
- //for (int i = 0; i < 4; i++ )
- // effects.Add(new MyParticleEffect(TextureManager.pipe_smoke_n_little_emmiter, TextureManager.pipe_smoke_n_renderer, new Vector2(210 + i * 64*4, 668), false, false));
- }
- public void UpdateAreYouSure(GameTime gameTime)
- {
- KeyboardState ks = Keyboard.GetState();
- if (AnyGamePad.OnButtonDown(Buttons.DPadDown) || AnyGamePad.OnThumbstickDown(Buttons.DPadDown) || (ks.IsKeyDown(Keys.Down) && StarGame.oldKeyboardState.IsKeyUp(Keys.Down)))
- {
- areYouSureMenu.Down();
- }
- else if (AnyGamePad.OnButtonDown(Buttons.DPadUp) || AnyGamePad.OnThumbstickDown(Buttons.DPadUp) || (ks.IsKeyDown(Keys.Up) && StarGame.oldKeyboardState.IsKeyUp(Keys.Up)))
- {
- areYouSureMenu.Up();
- }
- #if WINDOWS
- MainMenu.countdown -= gameTime.ElapsedGameTime.Milliseconds;
- if (MainMenu.countdown <= 0 && Mouse.GetState().Y > Misc.screenHeight / 2 + MainMenu.MINIMAL_MOUSE_MOVE && !areYouSureMenu.cursor.IsMax())
- {
- areYouSureMenu.Down();
- MainMenu.countdown = MainMenu.MOUSE_MENU_MOVE_DELAY_MS * 15;
- }
- else if (MainMenu.countdown <= 0 && Mouse.GetState().Y < Misc.screenHeight / 2 - MainMenu.MINIMAL_MOUSE_MOVE && !areYouSureMenu.cursor.IsMin())
- {
- areYouSureMenu.Up();
- MainMenu.countdown = MainMenu.MOUSE_MENU_MOVE_DELAY_MS * 15;
- }
- MainMenu.ResetMousePosition();
- int wheel = Mouse.GetState().ScrollWheelValue - StarGame.oldMouseState.ScrollWheelValue;
- if (wheel < 0 && !areYouSureMenu.cursor.IsMax())
- {
- areYouSureMenu.Down();
- }
- else if (wheel > 0 && !areYouSureMenu.cursor.IsMin())
- {
- areYouSureMenu.Up();
- }
- #endif
- if (AnyGamePad.OnButtonDown(Buttons.B) || AnyGamePad.OnButtonDown(Buttons.Start))
- {
- AudioManager.PlaySound(AudioManager.menuSelectSnd);
- areYouSureMode = false;
- }
- bool mouseSelect = false;
- #if WINDOWS
- mouseSelect = Mouse.GetState().LeftButton == ButtonState.Pressed && StarGame.oldMouseState.LeftButton == ButtonState.Released;
- #endif
- if (StarGame.OnKeyDown(Keys.Y) || mouseSelect
- || AnyGamePad.OnButtonDown(Buttons.A)
- || (ks.IsKeyDown(Keys.Enter) && StarGame.oldKeyboardState.IsKeyUp(Keys.Enter))
- || (ks.IsKeyDown(Keys.Z) && StarGame.oldKeyboardState.IsKeyUp(Keys.Z))
- )
- {
- if (areYouSureMenu.getSelectedMenuOption().Equals("No"))
- {
- AudioManager.PlaySound(AudioManager.menuSelectSnd);
- areYouSureMode = false;
- }
- else if (areYouSureMenu.getSelectedMenuOption().Equals("Yes"))
- {
- StarGame.GetInstance().gameState = goBackState;
- if (goBackState == StarGame.GameState.CONTINUE)
- {
- StarGame.GetInstance().continueScreen.Activate();
- }
- goBackState = StarGame.GameState.MAIN_MENU;
- inputMode = false;
- areYouSureMode = false;
- }
- }
- }
- public void Update(GameTime gameTime)
- {
- foreach (MyParticleEffect pe in effects)
- {
- pe.Update(gameTime, Vector2.Zero);
- }
- if (areYouSureMode)
- {
- UpdateAreYouSure(gameTime);
- return;
- }
- bool mouseSelect = false;
- #if WINDOWS
- mouseSelect = Mouse.GetState().LeftButton == ButtonState.Pressed && StarGame.oldMouseState.LeftButton == ButtonState.Released;
- #endif
- if (!inputMode)
- {
- if (AnyGamePad.OnButtonDown(Buttons.A)
- || AnyGamePad.OnButtonDown(Buttons.B)
- || AnyGamePad.OnButtonDown(Buttons.X)
- || AnyGamePad.OnButtonDown(Buttons.Y)
- || AnyGamePad.OnButtonDown(Buttons.Start)
- || AnyGamePad.OnButtonDown(Buttons.Back)
- || AnyGamePad.OnRightTriggerDown()
- || StarGame.OnKeyDown(Keys.Escape)
- || StarGame.OnKeyDown(Keys.Enter)
- || StarGame.OnKeyDown(Keys.Space)
- || StarGame.OnKeyDown(Keys.LeftControl)
- || StarGame.OnKeyDown(Keys.X)
- || StarGame.OnKeyDown(Keys.Z)
- || StarGame.OnKeyDown(Keys.Y)
- || mouseSelect
- )
- {
- AudioManager.PlaySound(AudioManager.menuSelectSnd);
- StarGame.GetInstance().gameState = goBackState;
- if (goBackState == StarGame.GameState.CONTINUE)
- {
- StarGame.GetInstance().continueScreen.Activate();
- }
- goBackState = StarGame.GameState.MAIN_MENU;
- }
- }
- else
- {
- // CURSOR
- KeyboardState ks = Keyboard.GetState();
- if (AnyGamePad.OnButtonDown(Buttons.DPadDown) || AnyGamePad.OnThumbstickDown(Buttons.DPadDown) || (ks.IsKeyDown(Keys.Down) && StarGame.oldKeyboardState.IsKeyUp(Keys.Down)))
- {
- yCursor.Increment();
- }
- else if (AnyGamePad.OnButtonDown(Buttons.DPadUp) || AnyGamePad.OnThumbstickDown(Buttons.DPadUp) || (ks.IsKeyDown(Keys.Up) && StarGame.oldKeyboardState.IsKeyUp(Keys.Up)))
- {
- yCursor.Decrement();
- }
- else if (AnyGamePad.OnButtonDown(Buttons.DPadLeft) || AnyGamePad.OnThumbstickDown(Buttons.DPadLeft) || (ks.IsKeyDown(Keys.Left) && StarGame.oldKeyboardState.IsKeyUp(Keys.Left)))
- {
- xCursor.Decrement();
- }
- else if (AnyGamePad.OnButtonDown(Buttons.DPadRight) || AnyGamePad.OnThumbstickDown(Buttons.DPadRight) || (ks.IsKeyDown(Keys.Right) && StarGame.oldKeyboardState.IsKeyUp(Keys.Right)))
- {
- xCursor.Increment();
- }
- if (AnyGamePad.OnButtonDown(Buttons.LeftStick))
- {
- yCursor.SetValue(2);
- xCursor.SetValue(9);
- mouseSelect = true;
- }
- if (AnyGamePad.OnButtonDown(Buttons.Start))
- {
- yCursor.SetValue(3);
- xCursor.SetValue(10);
- mouseSelect = true;
- }
- // INPUT FROM ONSCREEN KEYBOARD
- if (AnyGamePad.OnButtonDown(Buttons.A)
- || AnyGamePad.OnButtonDown(Buttons.X)
- || AnyGamePad.OnButtonDown(Buttons.Y)
- || AnyGamePad.OnButtonDown(Buttons.Start)
- || AnyGamePad.OnRightTriggerDown()
- || StarGame.OnKeyDown(Keys.Enter)
- || StarGame.OnKeyDown(Keys.LeftControl)
- || mouseSelect
- )
- {
- // Y - SPACE
- if (AnyGamePad.OnButtonDown(Buttons.Y))
- {
- xCursor.SetValue(4);
- yCursor.SetValue(2);
- }
- // X - BACKSPACE
- if (AnyGamePad.OnButtonDown(Buttons.X))
- {
- xCursor.SetValue(10);
- yCursor.SetValue(2);
- }
- char c = 'A';
- c += (char)(KEYBOARD_X_SIZE * yCursor.GetValue() + xCursor.GetValue());
- if (yCursor.GetValue() == 2)
- {
- if (xCursor.GetValue() == 4)
- {
- c = ' ';
- }
- if (xCursor.GetValue() == 5)
- {
- c = '_';
- }
- if (xCursor.GetValue() == 6)
- {
- c = '-';
- }
- if (xCursor.GetValue() == 7)
- {
- c = ',';
- }
- if (xCursor.GetValue() == 8)
- {
- c = '.';
- }
- }
- if (yCursor.GetValue() == 3 && xCursor.GetValue() != 11)
- {
- c = (char)('0' + xCursor.GetValue());
- }
- if (yCursor.GetValue() == 3 && xCursor.GetValue() == 10)
- {
- // ENTER
- if (usernameBuffer.Length == 0)
- {
- AudioManager.PlaySound(AudioManager.no);
- }
- else
- {
- AudioManager.PlaySound(AudioManager.yes);
- inputMode = false;
- RecordTableEntry e = new RecordTableEntry();
- e.name = usernameBuffer;
- e.score = score;
- e.difficulty = Balance.DIFF_STRING.ToLower();
- if (e.difficulty == "easy")
- e.difficulty += " ";
- if (e.difficulty == "hard")
- e.difficulty += " ";
- RecordTable.AddRecord(e);
- RecordTable.Save();
- }
- }
- else if (yCursor.GetValue() == 2 && xCursor.GetValue() == 10)
- {
- // BACKSPACE
- if (usernameBuffer.Length > 0)
- {
- usernameBuffer = usernameBuffer.Remove(usernameBuffer.Length - 1);
- }
- else
- {
- AudioManager.PlaySound(AudioManager.no);
- }
- }
- else if (yCursor.GetValue() == 2 && xCursor.GetValue() == 9)
- {
- capsLock = !capsLock;
- }
- else if (usernameBuffer.Length < MAX_NAME_LENGTH)
- {
- string aa = capsLock ? c.ToString().ToUpper() : c.ToString().ToLower();
- usernameBuffer += aa;
- AudioManager.PlaySound(AudioManager.yes);
- }
- else
- {
- AudioManager.PlaySound(AudioManager.no);
- }
- }
- if (AnyGamePad.OnButtonDown(Buttons.B)
- || StarGame.OnKeyDown(Keys.Escape)
- || StarGame.OnKeyDown(Keys.B)
- || StarGame.OnKeyDown(Keys.X)
- )
- {
- areYouSureMode = true;
- }
- #if WINDOWS
- if (StarGame.OnKeyDown(Keys.CapsLock))
- {
- capsLock = !capsLock;
- }
- Nullable<Char> cc = null;
- if (StarGame.OnKeyDown(Keys.A))
- cc = 'a';
- if (StarGame.OnKeyDown(Keys.B))
- cc = 'b';
- if (StarGame.OnKeyDown(Keys.C))
- cc = 'c';
- if (StarGame.OnKeyDown(Keys.D))
- cc = 'd';
- if (StarGame.OnKeyDown(Keys.E))
- cc = 'e';
- if (StarGame.OnKeyDown(Keys.F))
- cc = 'f';
- if (StarGame.OnKeyDown(Keys.G))
- cc = 'g';
- if (StarGame.OnKeyDown(Keys.H))
- cc = 'h';
- if (StarGame.OnKeyDown(Keys.I))
- cc = 'i';
- if (StarGame.OnKeyDown(Keys.J))
- cc = 'j';
- if (StarGame.OnKeyDown(Keys.K))
- cc = 'k';
- if (StarGame.OnKeyDown(Keys.L))
- cc = 'l';
- if (StarGame.OnKeyDown(Keys.N))
- cc = 'n';
- if (StarGame.OnKeyDown(Keys.M))
- cc = 'm';
- if (StarGame.OnKeyDown(Keys.O))
- cc = 'o';
- if (StarGame.OnKeyDown(Keys.P))
- cc = 'p';
- if (StarGame.OnKeyDown(Keys.Q))
- cc = 'q';
- if (StarGame.OnKeyDown(Keys.R))
- cc = 'r';
- if (StarGame.OnKeyDown(Keys.S))
- cc = 's';
- if (StarGame.OnKeyDown(Keys.T))
- cc = 't';
- if (StarGame.OnKeyDown(Keys.U))
- cc = 'u';
- if (StarGame.OnKeyDown(Keys.V))
- cc = 'v';
- if (StarGame.OnKeyDown(Keys.W))
- cc = 'w';
- if (StarGame.OnKeyDown(Keys.X))
- cc = 'x';
- if (StarGame.OnKeyDown(Keys.Y))
- cc = 'y';
- if (StarGame.OnKeyDown(Keys.Z))
- cc = 'z';
- if (StarGame.OnKeyDown(Keys.NumPad0))
- cc = '0';
- if (StarGame.OnKeyDown(Keys.NumPad1))
- cc = '1';
- if (StarGame.OnKeyDown(Keys.NumPad2))
- cc = '2';
- if (StarGame.OnKeyDown(Keys.NumPad3))
- cc = '3';
- if (StarGame.OnKeyDown(Keys.NumPad4))
- cc = '4';
- if (StarGame.OnKeyDown(Keys.NumPad5))
- cc = '5';
- if (StarGame.OnKeyDown(Keys.NumPad6))
- cc = '6';
- if (StarGame.OnKeyDown(Keys.NumPad7))
- cc = '7';
- if (StarGame.OnKeyDown(Keys.NumPad8))
- cc = '8';
- if (StarGame.OnKeyDown(Keys.NumPad9))
- cc = '9';
- if (StarGame.OnKeyDown(Keys.D0))
- cc = '0';
- if (StarGame.OnKeyDown(Keys.D1))
- cc = '1';
- if (StarGame.OnKeyDown(Keys.D2))
- cc = '2';
- if (StarGame.OnKeyDown(Keys.D3))
- cc = '3';
- if (StarGame.OnKeyDown(Keys.D4))
- cc = '4';
- if (StarGame.OnKeyDown(Keys.D5))
- cc = '5';
- if (StarGame.OnKeyDown(Keys.D6))
- cc = '6';
- if (StarGame.OnKeyDown(Keys.D7))
- cc = '7';
- if (StarGame.OnKeyDown(Keys.D8))
- cc = '8';
- if (StarGame.OnKeyDown(Keys.D9))
- cc = '9';
- if (StarGame.OnKeyDown(Keys.Space))
- cc = ' ';
- if (cc != null)
- {
- if (usernameBuffer.Length < MAX_NAME_LENGTH)
- {
- string cl = cc.ToString();
- if (capsLock)
- {
- if (Keyboard.GetState().IsKeyDown(Keys.LeftShift))
- {
- cl = cl.ToLower();
- }
- else
- {
- cl = cl.ToUpper();
- }
- }
- else
- {
- if (Keyboard.GetState().IsKeyDown(Keys.LeftShift))
- {
- cl = cl.ToUpper();
- }
- else
- {
- cl = cl.ToLower();
- }
- }
- usernameBuffer += cl;
- AudioManager.PlaySound(AudioManager.yes);
- }
- else
- {
- AudioManager.PlaySound(AudioManager.no);
- }
- }
- if (StarGame.OnKeyDown(Keys.Back) || StarGame.OnKeyDown(Keys.Delete))
- {
- if (usernameBuffer.Length > 0)
- {
- usernameBuffer = usernameBuffer.Remove(usernameBuffer.Length - 1);
- }
- else
- {
- AudioManager.PlaySound(AudioManager.no);
- }
- }
- #endif
- }
- }
- public static Rectangle doubled = new Rectangle(0, 0, 640 * 2, 360 * 2);
- static Color alphaBg = new Color(0.6f, 0.6f, 0.6f, .6f);
- int img = 1;
- Color outgray = new Color(.0f, .0f, .0f, .5f);
- readonly static Vector2 startPos = new Vector2(160, 170);
- Vector2 pos = new Vector2();
- int Y_STEP = 40;
- public void Draw(Camera camera)
- {
- camera.Draw(TextureManager.whitePixel, Misc.titleSafeArea, MainMenu.BG_COLOR);
- camera.GetSpriteBatch().Draw(TextureManager.intro_comic, doubled, new Rectangle(0, 360 * img, 640, 360), alphaBg);
- //camera.Draw(StarGame.GetInstance().splashScreen, Vector2.Zero, alphaBg);
- pos = new Vector2(0, 50);
- SpriteFont font = TextureManager.scoreFontBig;
- string str = "HIGH SCORES";
- Vector2 size = font.MeasureString(str);
- pos.X = 1280 / 2 - size.X / 2;
- camera.DrawString(font, str, pos + Misc.v6, MainMenu.SHADOW_COLOR);
- camera.DrawString(font, str, pos, MainMenu.TEXT_HIGHLIGHT);
- pos = startPos;
- int i = 1;
- foreach (RecordTableEntry e in RecordTable.rt.records)
- {
- pos.X = startPos.X;
- string record = (i == 10 ? "" : " ") + i + ". " + e.name;
- camera.DrawString(TextureManager.scoreFont2, record, pos + DialogItem.shadowOffset, MainMenu.SHADOW_COLOR);
- camera.DrawString(TextureManager.scoreFont2, record, pos, i >= 4 ? MainMenu.TEXT_COLOR : Color.Gold);
- pos.X = 590;
- record = e.GetScoreAsString(7) + " " + e.difficulty + " (" + e.GetTitle() + ")";
- camera.DrawString(TextureManager.scoreFont2, record, pos + DialogItem.shadowOffset, MainMenu.SHADOW_COLOR);
- camera.DrawString(TextureManager.scoreFont2, record, pos, i >= 4 ? MainMenu.TEXT_COLOR : Color.Gold);
- pos.Y += Y_STEP;
- i++;
- }
- Vector2 a = startPos + new Vector2(-24, 4);
- camera.Draw(top3, a);
- a.Y += Y_STEP;
- camera.Draw(top3, a);
- a.Y += Y_STEP;
- camera.Draw(top3, a);
- if (inputMode && !areYouSureMode)
- {
- camera.Draw(TextureManager.whitePixel, Misc.titleSafeArea, outgray);
- int size_t = 64;
- Rectangle src = new Rectangle(size_t * 6, size_t * 7, size_t, size_t);
- Rectangle src_enter = new Rectangle(size_t * 7, size_t * 0, size_t, size_t);
- Rectangle src_backspace = new Rectangle(size_t * 3, size_t * 0, size_t, size_t);
- Rectangle src_capslock_on = new Rectangle(size_t * 2, size_t * 0, size_t, size_t);
- Rectangle src_capslock_off = new Rectangle(size_t * 5, size_t * 0, size_t, size_t);
- #if XBOX
- camera.Draw(x_button, new Vector2(1024, 500-48));
- camera.Draw(y_button, new Vector2(1024 + 48, 500 - 48));
- camera.GetSpriteBatch().DrawString(TextureManager.scoreFont2, "Backspace", new Vector2(4+1024+3+32, 500+3-10), MainMenu.SHADOW_COLOR, MathHelper.PiOver2, Vector2.Zero, 1, SpriteEffects.None, 1);
- camera.GetSpriteBatch().DrawString(TextureManager.scoreFont2, "Backspace", new Vector2(4 + 1024 + 32, 500 - 10), MainMenu.TEXT_HIGHLIGHT, MathHelper.PiOver2, Vector2.Zero, 1, SpriteEffects.None, 1);
- camera.GetSpriteBatch().DrawString(TextureManager.scoreFont2, "Space", new Vector2(4 + 1024 + 3 + 32 + 48, 500 + 3 - 10), MainMenu.SHADOW_COLOR, MathHelper.PiOver2, Vector2.Zero, 1, SpriteEffects.None, 1);
- camera.GetSpriteBatch().DrawString(TextureManager.scoreFont2, "Space", new Vector2(4 + 1024 + 32 + 48, 500 - 10), MainMenu.TEXT_HIGHLIGHT, MathHelper.PiOver2, Vector2.Zero, 1, SpriteEffects.None, 1);
- #endif
- Vector2 p = klavaStartPos;
- char c = 'A';
- for (int y = 0; y < KEYBOARD_Y_SIZE; y++)
- {
- for (int x = 0; x < KEYBOARD_X_SIZE; x++)
- {
- Rectangle img_src = src;
- p.X = klavaStartPos.X + (size_t + 4) * x;
- p.Y = klavaStartPos.Y + (size_t + 4) * y;
- Color bgColor = Color.White;
- if (10 == x && 3 == y)
- {
- bgColor = Color.LightGreen;
- img_src = src_enter;
- }
- if (10 == x && 2 == y)
- {
- bgColor = Color.LightSalmon;
- img_src = src_backspace;
- }
- if (9 == x && 2 == y)
- {
- bgColor = Color.LightYellow;
- img_src = capsLock ? src_capslock_on : src_capslock_off;
- }
- if (x == xCursor.GetValue() && y == yCursor.GetValue())
- {
- bgColor = Color.Gray;
- }
- camera.Draw(TextureManager.klava.images[0], p, img_src, bgColor);
- char cc = c;
- if (c >= 65 + 26)
- {
- switch (c)
- {
- case (char)(65 + 26):
- cc = ' ';
- break;
- case (char)(65 + 27):
- cc = '_';
- break;
- case (char)(65 + 28):
- cc = '-';
- break;
- case (char)(65 + 29):
- cc = ',';
- break;
- case (char)(65 + 30):
- cc = '.';
- break;
- case (char)(65 + 31):
- cc = ' ';
- break;
- case (char)(65 + 32):
- cc = ' ';
- break;
- case (char)(65 + 33):
- cc = '0';
- break;
- case (char)(65 + 34):
- cc = '1';
- break;
- case (char)(65 + 35):
- cc = '2';
- break;
- case (char)(65 + 36):
- cc = '3';
- break;
- case (char)(65 + 37):
- cc = '4';
- break;
- case (char)(65 + 38):
- cc = '5';
- break;
- case (char)(65 + 39):
- cc = '6';
- break;
- case (char)(65 + 40):
- cc = '7';
- break;
- case (char)(65 + 41):
- cc = '8';
- break;
- case (char)(65 + 42):
- cc = '9';
- break;
- case (char)(65 + 43):
- cc = ' ';
- break;
- }
- }
- string output = cc.ToString();
- if (capsLock)
- {
- output = output.ToUpper();
- }
- else
- {
- output = output.ToLower();
- }
- camera.DrawString(TextureManager.scoreFont2, output, p + DialogItem.shadowOffset + charOffset, MainMenu.SHADOW_COLOR);
- Color clr = MainMenu.TEXT_HIGHLIGHT;
- if (x == xCursor.GetValue() && y == yCursor.GetValue())
- {
- clr = Color.Gold;
- }
- camera.DrawString(TextureManager.scoreFont2, output, p + charOffset, clr);
- c++;
- }
- }
- string uname = usernameBuffer;
- if (uname.Length == 0)
- {
- uname = "<YOUR SCORE: " + score + ", ENTER NAME>";
- }
- Vector2 tpos = usernamePos;
- Vector2 tsize = TextureManager.scoreFont2.MeasureString(uname);
- tpos.X = 1280 / 2 - tsize.X / 2;
- camera.DrawString(TextureManager.scoreFont2, uname, tpos + DialogItem.shadowOffset, MainMenu.SHADOW_COLOR);
- camera.DrawString(TextureManager.scoreFont2, uname, tpos, MainMenu.TEXT_COLOR);
- }
- if (areYouSureMode)
- {
- camera.Draw(TextureManager.whitePixel, Misc.titleSafeArea, new Color(.1f, .1f, .1f, .9f));
- Color old = areYouSureMenu.color;
- areYouSureMenu.color = MainMenu.SHADOW_COLOR;
- areYouSureMenu.start += new Vector2(4);
- areYouSureMenu.Draw(camera);
- areYouSureMenu.color = old;
- areYouSureMenu.start -= new Vector2(4);
- areYouSureMenu.Draw(camera);
- }
- foreach (MyParticleEffect pe in effects)
- {
- pe.Draw(camera);
- }
- }
- public void SetInputMode(bool inputMode, int score, StarGame.GameState goBackState)
- {
- this.inputMode = inputMode;
- this.score = score;
- xCursor.SetValue(0);
- yCursor.SetValue(0);
- this.goBackState = goBackState;
- usernameBuffer = "";
- }
- Vector2 klavaStartPos = new Vector2(1280 / 2 - (64 + 4) * 11 / 2, 420 - 64);
- Vector2 charOffset = new Vector2(24, 5);
- static int KEYBOARD_X_SIZE = 11;
- static int KEYBOARD_Y_SIZE = 4;
- Ring xCursor = new Ring(KEYBOARD_X_SIZE);
- Ring yCursor = new Ring(KEYBOARD_Y_SIZE);
- string usernameBuffer = "";
- Vector2 usernamePos = new Vector2(200, 370 - 64);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement