variables.d 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. // quantumde1 developed software, licensed under MIT license.
  2. module variables;
  3. import std.typecons;
  4. import raylib;
  5. import bindbc.lua;
  6. import system.abstraction;
  7. extern (C) char* get_file_data_from_archive(const char *input_file, const char *file_name, uint *file_size_out);
  8. void resetAllScriptValues() {
  9. debugWriteln("Resetting all values!");
  10. selectedChoice = 0;
  11. characterTextures = [];
  12. backgrounds = [];
  13. }
  14. /* system */
  15. struct SystemSettings {
  16. int sound_state;
  17. char right_button;
  18. char left_button;
  19. char back_button;
  20. char forward_button;
  21. char dialog_button;
  22. char opmenu_button;
  23. }
  24. struct CharacterTexture {
  25. bool drawTexture;
  26. float width;
  27. float height;
  28. float x;
  29. float y;
  30. Texture2D texture;
  31. float scale;
  32. }
  33. struct InterfaceAudio {
  34. Sound menuMoveSound;
  35. Sound menuChangeSound;
  36. Sound acceptSound;
  37. Sound declineSound;
  38. Sound nonSound;
  39. }
  40. enum GameState {
  41. MainMenu = 1,
  42. InGame = 2,
  43. Exit = 3
  44. }
  45. enum EngineExitCodes {
  46. EXIT_FILE_NOT_FOUND = 2,
  47. EXIT_SCRIPT_ERROR = 3,
  48. EXIT_OK = 0,
  49. }
  50. Camera2D camera;
  51. CharacterTexture[] characterTextures;
  52. SystemSettings systemSettings;
  53. InterfaceAudio audio;
  54. int currentGameState = 1;
  55. Font textFont;
  56. Music music;
  57. /* booleans */
  58. bool hintNeeded = false;
  59. bool playAnimation = false;
  60. bool audioEnabled = false;
  61. bool sfxEnabled = false;
  62. bool fullscreenEnabled = true;
  63. bool luaReload = true;
  64. bool videoFinished = false;
  65. bool neededDraw2D = false;
  66. bool isCameraMoving = false;
  67. bool neededCharacterDrawing = false;
  68. bool showDialog = false;
  69. bool isTextFullyDisplayed = false;
  70. /* strings */
  71. string ver = "1.1.8";
  72. string[] messageGlobal;
  73. string[] choices;
  74. string[] backlogText;
  75. string luaExec;
  76. string usedLang = "english";
  77. char* musicPath;
  78. /* floats */
  79. float cameraTargetX = 0;
  80. float cameraTargetY = 0;
  81. float cameraTargetZoom = 1.0f;
  82. float cameraMoveSpeed = 5.0f;
  83. float frameDuration = 0.016f;
  84. float typingSpeed = 0.6f;
  85. /* textures */
  86. Texture2D[] backgrounds;
  87. Texture2D[] framesUI;
  88. Texture2D backgroundTexture;
  89. /* integer values */
  90. int button;
  91. int selectedChoice = 0;
  92. int choicePage = -1;
  93. int currentFrame = 0;
  94. int currentChoiceCharIndex = 0;
  95. /* lua */
  96. lua_State* L;