aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordam <dam@gudinoff>2022-03-30 14:52:01 +0000
committerdam <dam@gudinoff>2022-03-30 14:52:01 +0000
commit8d4db7d2c92aa719da8ce218df9490283754d20b (patch)
tree078be5ff293bec0877e9d17df934c9df86928351
parent84524e46a378d3694ebee9ab541feefe01866219 (diff)
downloadsurgery-log-8d4db7d2c92aa719da8ce218df9490283754d20b.tar.zst
surgery-log-8d4db7d2c92aa719da8ce218df9490283754d20b.zip
Fixed database fields being parsed as floats instead of integers by JSON.
-rw-r--r--logic/database.gd8
-rw-r--r--main.gd1
-rw-r--r--readme.md4
3 files changed, 11 insertions, 2 deletions
diff --git a/logic/database.gd b/logic/database.gd
index a6f2747..5694dcc 100644
--- a/logic/database.gd
+++ b/logic/database.gd
@@ -158,6 +158,14 @@ func load_database(file_path: String = DATABASE_FILE_PATH):
return
db = parse_result.result["database"]
+
+ # The JSON specification does not define integer or float types, but only a number type.
+ # Therefore, converting a Variant to JSON text will convert all numerical values to float types.
+ # Thus, we cast all integer values once we load them.
+ for it in db:
+ it.date_year = int(it.date_year)
+ it.date_month = int(it.date_month)
+ it.date_day = int(it.date_day)
func save_database(file_path: String = DATABASE_FILE_PATH):
diff --git a/main.gd b/main.gd
index 37c5ed6..6171409 100644
--- a/main.gd
+++ b/main.gd
@@ -12,6 +12,7 @@ onready var controls_sensible_to_keyboard := [
func _init():
+
Physics2DServer.set_active(false)
PhysicsServer.set_active(false)
diff --git a/readme.md b/readme.md
index 4119da1..4d536ab 100644
--- a/readme.md
+++ b/readme.md
@@ -50,10 +50,10 @@ Surgery Log
- [x] Check if import_option_sets, store_option_sets, store_database require the parameter save_changes; this requires changes on databse, stage and menu scripts;
- [x] Maybe replace fonts with non-mono version;
- [x] Fix option sets GUI element to provide word-wrap, otherwise long texts will be hidden;
+- [x] After save and load, entries opened on stage always detect changes (even when no change occurs);
- [ ] Add to popup:
- - [ ] title;
+ - [x] title;
- [ ] back/close button;
-- [ ] After save and load, entries opened on stage always detect changes (even when no change occurs);
- [ ] Use popup to display confirmation messages;
- [ ] Theming:
- [ ] Make all buttons with same style;