variables.d 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. backgroundTextures = [];
  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 TextureEngine {
  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. TextureEngine[] characterTextures;
  52. TextureEngine[] backgroundTextures;
  53. SystemSettings systemSettings;
  54. InterfaceAudio audio;
  55. int currentGameState = 1;
  56. Font textFont;
  57. Music music;
  58. /* booleans */
  59. bool hintNeeded = false;
  60. bool playAnimation = false;
  61. bool audioEnabled = false;
  62. bool sfxEnabled = false;
  63. bool fullscreenEnabled = true;
  64. bool luaReload = true;
  65. bool videoFinished = false;
  66. bool neededDraw2D = false;
  67. bool isCameraMoving = false;
  68. bool neededCharacterDrawing = false;
  69. bool showDialog = false;
  70. bool isTextFullyDisplayed = false;
  71. /* strings */
  72. string ver = "1.1.8";
  73. string[] messageGlobal;
  74. string[] choices;
  75. string[] backlogText;
  76. string luaExec;
  77. string usedLang = "english";
  78. char* musicPath;
  79. /* floats */
  80. float cameraTargetX = 0;
  81. float cameraTargetY = 0;
  82. float cameraTargetZoom = 1.0f;
  83. float cameraMoveSpeed = 5.0f;
  84. float frameDuration = 0.016f;
  85. float typingSpeed = 0.6f;
  86. /* textures */
  87. Texture2D[] framesUI;
  88. /* integer values */
  89. int button;
  90. int selectedChoice = 0;
  91. int choicePage = -1;
  92. int currentFrame = 0;
  93. int currentChoiceCharIndex = 0;
  94. /* lua */
  95. lua_State* L;