-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
extends Node | ||
|
||
const DEV_VERSION = "DEV" | ||
|
||
var version = DEV_VERSION | ||
|
||
var log_level = Logger.Level.DEBUG | ||
var version = "dev" : set = _set_version | ||
var _logger = Logger.new("Env") | ||
|
||
func _ready(): | ||
if is_prod(): | ||
version = Build.VERSION | ||
log_level = Logger.Level.INFO | ||
_logger.info("Running version %s on %s" % [version, OS.get_name()]) | ||
|
||
func _set_version(v: String) -> void: | ||
if v == "": return | ||
version = v | ||
|
||
func is_prod() -> bool: | ||
return version != DEV_VERSION | ||
|
||
return version != "dev" | ||
|
||
func is_web() -> bool: | ||
return OS.get_name() == "HTML5" | ||
return OS.has_feature("web") |