1 /** 2 * Copyright © Novelate 2020 3 * License: MIT (https://github.com/Novelate/NovelateEngine/blob/master/LICENSE) 4 * Author: Jacob Jensen (bausshf) 5 * Website: https://novelate.com/ 6 * ------ 7 * Novelate is a free and open-source visual novel engine and framework written in the D programming language. 8 * It can be used freely for both personal and commercial projects. 9 * ------ 10 * Module Description: 11 * This module handles the global state of the visual novel. Global states are only available internal in the engine and are used to share data between parts that aren\t interacting with each other. 12 * At some point these states needs to be rewritten so they're used more safely but as of now they function and doesn't require a lot to maintain. 13 */ 14 module novelate.state; 15 16 import novelate.layer; 17 import novelate.core : Screen; 18 19 import novelate.external : ExternalWindow; 20 21 package(novelate): 22 23 /// The resolution width. 24 size_t _width = 800; 25 /// The resolution height. 26 size_t _height = 600; 27 /// The next scene. 28 string nextScene = null; 29 /// Boolean determining whether the game has ended or not. 30 bool endGame = false; 31 /// boolean determining whether the game should exit or not. 32 bool exitGame = false; 33 /// The temp screen to change to. 34 Screen changeTempScreen = Screen.none; 35 /// Boolean determining whether the displayed screen is temp or not. 36 bool _isTempScreen = false; 37 /// Gets a boolean determining whether the displayed screen is temp or not. 38 @property bool isTempScreen() { return _isTempScreen; } 39 /// The current play scene. 40 string playScene; 41 /// Boolean determining whether the game is running. 42 bool running = true; 43 /// The render window. 44 ExternalWindow _window; 45 /// The fps. 46 const _fps = 60; 47 /// The window title. 48 string _title = ""; 49 /// The layers. 50 Layer[] _layers; 51 /// The temp layers. 52 Layer[] _tempLayers; 53 /// The selected layers. Usually refers to _layers or _tempLayers. 54 Layer[] selectedLayers; 55 /// Boolean determining whether the game is in full-screen or not. 56 bool fullScreen = false;