variables.d 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. enum EngineExitCodes {
  16. EXIT_FILE_NOT_FOUND = 2,
  17. EXIT_SCRIPT_ERROR = 3,
  18. EXIT_OK = 0,
  19. }
  20. struct SystemSettings {
  21. int sound_state;
  22. char right_button;
  23. char left_button;
  24. char back_button;
  25. char forward_button;
  26. char dialog_button;
  27. char opmenu_button;
  28. }
  29. struct CharacterTexture {
  30. bool drawTexture;
  31. float width;
  32. float height;
  33. float x;
  34. float y;
  35. Texture2D texture;
  36. float scale;
  37. }
  38. struct InterfaceAudio {
  39. Sound menuMoveSound;
  40. Sound menuChangeSound;
  41. Sound acceptSound;
  42. Sound declineSound;
  43. Sound nonSound;
  44. }
  45. enum GameState {
  46. MainMenu,
  47. InGame,
  48. Exit
  49. }
  50. Camera2D camera;
  51. CharacterTexture[] characterTextures;
  52. SystemSettings systemSettings;
  53. InterfaceAudio audio;
  54. GameState currentGameState;
  55. Font textFont;
  56. Music music;
  57. /* booleans */
  58. bool hintNeeded;
  59. bool playAnimation;
  60. bool audioEnabled;
  61. bool sfxEnabled = true;
  62. bool fullscreenEnabled = true;
  63. bool luaReload = true;
  64. bool videoFinished;
  65. bool neededDraw2D;
  66. bool isCameraMoving;
  67. bool neededCharacterDrawing;
  68. bool showDialog;
  69. bool isTextFullyDisplayed;
  70. /* strings */
  71. string ver = "1.1.8";
  72. string[] messageGlobal;
  73. string[] choices;
  74. string luaExec;
  75. string usedLang = "english";
  76. char* musicPath;
  77. /* floats */
  78. float cameraTargetX = 0;
  79. float cameraTargetY = 0;
  80. float cameraTargetZoom = 1.0f;
  81. float cameraMoveSpeed = 5.0f;
  82. float frameDuration = 0.016f;
  83. float typingSpeed = 0.6f;
  84. /* textures */
  85. Texture2D[] backgrounds;
  86. Texture2D[] framesUI;
  87. Texture2D backgroundTexture;
  88. /* integer values */
  89. int button;
  90. int selectedChoice = 0;
  91. int choicePage;
  92. int currentFrame = 0;
  93. int currentChoiceCharIndex = 0;
  94. /* lua */
  95. lua_State* L;