PageRenderTime 48ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/TEditXna/View/Popups/NewWorldView.xaml.cs

https://github.com/Surfpup/Terraria-Map-Editor
C# | 67 lines | 59 code | 5 blank | 3 comment | 0 complexity | 7b5f31f940c9873a12887c0364f23129 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Shapes;
  13. using TEditXNA.Terraria;
  14. using TEditXNA.Terraria.Objects;
  15. namespace TEditXna.View.Popups
  16. {
  17. /// <summary>
  18. /// Interaction logic for NewWorldView.xaml
  19. /// </summary>
  20. public partial class NewWorldView : Window
  21. {
  22. private readonly World _newWorld;
  23. public NewWorldView()
  24. {
  25. InitializeComponent();
  26. _newWorld = new World(1200, 4300, "TEdit World");
  27. _newWorld.Version = World.CompatibleVersion;
  28. _newWorld.GroundLevel = 350;
  29. _newWorld.RockLevel = 480;
  30. _newWorld.ResetTime();
  31. AddCharNames();
  32. this.DataContext = NewWorld;
  33. }
  34. private void AddCharNames()
  35. {
  36. _newWorld.CharacterNames.Add(new NpcName(17, "Harold"));
  37. _newWorld.CharacterNames.Add(new NpcName(18, "Molly"));
  38. _newWorld.CharacterNames.Add(new NpcName(19, "Dominique"));
  39. _newWorld.CharacterNames.Add(new NpcName(20, "Felicitae"));
  40. _newWorld.CharacterNames.Add(new NpcName(22, "Steve"));
  41. _newWorld.CharacterNames.Add(new NpcName(54, "Fitz"));
  42. _newWorld.CharacterNames.Add(new NpcName(38, "Gimut"));
  43. _newWorld.CharacterNames.Add(new NpcName(107, "Knogs"));
  44. _newWorld.CharacterNames.Add(new NpcName(108, "Fizban"));
  45. _newWorld.CharacterNames.Add(new NpcName(124, "Nancy"));
  46. }
  47. public World NewWorld
  48. {
  49. get { return _newWorld; }
  50. }
  51. private void CancelClick(object sender, RoutedEventArgs e)
  52. {
  53. this.DialogResult = false;
  54. this.Close();
  55. }
  56. private void OkClick(object sender, RoutedEventArgs e)
  57. {
  58. this.DialogResult = true;
  59. this.Close();
  60. }
  61. }
  62. }