MapOptions.cpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #include "MapOptions.h"
  2. #include <DateiSystem.h>
  3. #include "Globals.h"
  4. #include "Initialisierung.h"
  5. MapOptions::MapOptions()
  6. : Fenster()
  7. {
  8. Framework::LTDBDatei iconsDat;
  9. iconsDat.setDatei(new Framework::Text("data/images/gui_icons.ltdb"));
  10. iconsDat.leseDaten(0);
  11. setStyle(
  12. Fenster::Style::Erlaubt | Fenster::Style::Rahmen
  13. | Fenster::Style::BodyHAlpha | Fenster::Style::Titel
  14. | Fenster::Style::TitelHAlpha | Fenster::Style::Closable
  15. | Fenster::Style::ClosingHAlpha | Fenster::Style::ClosingKlickBuffer
  16. | Fenster::Style::TitelHintergrund | Fenster::Style::BodyHintergrund
  17. | Fenster::Style::ClosingHintergrund | Fenster::Style::MEIgnoreInside
  18. | Fenster::Style::Beweglich | Style::ClosingHBild
  19. | Style::ClosingBuffer);
  20. removeStyle(Fenster::Style::Sichtbar);
  21. setTitel("Map options");
  22. setClosingMe([this](void* p, void* o, Framework::MausEreignis me) {
  23. if (me.id == Framework::ME_RLinks)
  24. {
  25. removeStyle(Fenster::Style::Sichtbar);
  26. }
  27. return 1;
  28. });
  29. setSize(210, 125);
  30. setPosition(uiFactory.initParam.bildschirm->getBackBufferSize().x / 2
  31. - getBreite() / 2,
  32. uiFactory.initParam.bildschirm->getBackBufferSize().y / 2
  33. - getHeight() / 2);
  34. setMausEreignis(Framework::_ret1ME);
  35. setTastaturEreignis(Framework::_ret1TE);
  36. setRBreite(1);
  37. setRFarbe(0xFF52525E);
  38. setKBgFarbe(0xA0000000);
  39. setTBgFarbe(0xA0000000);
  40. setSBgFarbe(0xA0000000);
  41. setTSchriftZ(
  42. dynamic_cast<Schrift*>(uiFactory.initParam.schrift->getThis()));
  43. zTTextFeld()->setSize(0, 20);
  44. zTTextFeld()->addStyle(TextFeld::Style::Center);
  45. setSAfStrength(10);
  46. setSAfFarbe(0x5F9C0A0A);
  47. setSBgBildZ(iconsDat.laden(0, new Text("close.png")));
  48. setSKAfFarbe(0xFF9C0A0A);
  49. setSKAfStrength(10);
  50. underground = initKontrollKnopf(5,
  51. 5,
  52. 200,
  53. 20,
  54. Framework::KontrollKnopf::Style::Normal
  55. & ~Framework::KontrollKnopf::Style::Rahmen,
  56. "Show underground map");
  57. underground->setNMausEreignis(_ret1ME);
  58. addMember(underground);
  59. followPlayer = initKontrollKnopf(5,
  60. 30,
  61. 200,
  62. 20,
  63. Framework::KontrollKnopf::Style::Normal
  64. & ~Framework::KontrollKnopf::Style::Rahmen,
  65. "Follow player");
  66. followPlayer->setNMausEreignis(_ret1ME);
  67. addMember(followPlayer);
  68. showPlayers = initKontrollKnopf(5,
  69. 55,
  70. 200,
  71. 20,
  72. (Framework::KontrollKnopf::Style::Normal
  73. | Framework::KontrollKnopf::Style::Selected)
  74. & ~Framework::KontrollKnopf::Style::Rahmen,
  75. "Show Players");
  76. showPlayers->setNMausEreignis(_ret1ME);
  77. addMember(showPlayers);
  78. showChunkBorders = initKontrollKnopf(5,
  79. 80,
  80. 200,
  81. 20,
  82. (Framework::KontrollKnopf::Style::Normal
  83. | Framework::KontrollKnopf::Style::Selected)
  84. & ~Framework::KontrollKnopf::Style::Rahmen,
  85. "Show Chunk Borders");
  86. showChunkBorders->setNMausEreignis(_ret1ME);
  87. addMember(showChunkBorders);
  88. }
  89. bool MapOptions::isUnderground()
  90. {
  91. return underground->hatStyle(KontrollKnopf::Style::Selected);
  92. }
  93. bool MapOptions::isFollowPlayer()
  94. {
  95. return followPlayer->hatStyle(KontrollKnopf::Style::Selected);
  96. }
  97. bool MapOptions::isShowPlayers()
  98. {
  99. return showPlayers->hatStyle(KontrollKnopf::Style::Selected);
  100. }
  101. bool MapOptions::isShowChunkBorders()
  102. {
  103. return showChunkBorders->hatStyle(KontrollKnopf::Style::Selected);
  104. }