diff --git a/.gitignore b/.gitignore index 57eebd1..eb4b3ca 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ export.cfg export_presets.cfg *.import .godot/ +godot/.import/ +godot/.godot/ # Imported translations (automatically generated from CSV files) *.translation diff --git a/COPYRIGHTS.md b/COPYRIGHTS.md new file mode 100644 index 0000000..4344f47 --- /dev/null +++ b/COPYRIGHTS.md @@ -0,0 +1,39 @@ +# Copyrights + +This document attributes the different components used to build the Wellbeing App. + +## The engine: Godot + +This app uses Godot Engine, available under the following license: + +Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. Copyright (c) 2014-2022 Godot Engine contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +## Fonts (as part of Godot) + +Portions of this software are copyright © 2022 The FreeType Project (www.freetype.org). All rights reserved. The app uses the Noto font family, for which the full license is available here. + +## Internet module Mbed TLS (as part of Godot) + +Copyright The Mbed TLS Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +## Multiplayer module ENET (as part of Godot) + +Copyright (c) 2002-2020 Lee Salzman + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/FEATURES.md b/FEATURES.md new file mode 100644 index 0000000..cdab4d4 --- /dev/null +++ b/FEATURES.md @@ -0,0 +1,22 @@ +# A list of features currently implemented + +- Saving & loading of persistent variables to user.ini on the default folder. This should work across all devices. (Currently tested across MacOS and Linux) +- Ability to add your own name. +- Coded several controllers in separate scripts that access different variables and portions of the app, to allow for flexible future development. + +# A list of features "in progress" + +- Working with the system time to present time-related information. +- Bug-testing and a robust "welcome new user" approach to the saving of persistent data. +- A "reset" button to remove the user.ini file from within the app. + +# A list of future features to come before next release + +- Wellbeing Cards (one-a-day) depending on user-selected categories. +- A serviceable GUI. +- A name (and logo, icon, etc). + +# Bucket list of features for future releases + +- White Noise sound section +- Journal section \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..ca3e242 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1 @@ +Creative Commons Licence
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. \ No newline at end of file diff --git a/PRIVACY.md b/PRIVACY.md new file mode 100644 index 0000000..a93fe3c --- /dev/null +++ b/PRIVACY.md @@ -0,0 +1,7 @@ +# Privacy Statement + +- As can be seen by inspecting the source code, the app contains no tracking features or advertisement systems of ANY kind. I am not interested in your data. +- Any data entered into the app (your name, birthdate, etc) is stored locally on your device. +- The only internet connectivity that the app employs is to check for app updates online (by checking the file version_stuff.csv here on GitHub). If you're not online, the check fails, simple as that. The code for this function will only trigger if you press the "Check for Updates" button. It can be inspected in start_menu.gd + +Too often "free" apps make you their product. Or are free with a hefty subscription lurking around the corner. I get it, for some people, such apps are their livelihood. For me, it's something I wish to develop and hope other people find useful. There is no monetary gain here. Of course I'm curious to see who uses the app. That's why I offer the option to subscribe to a newsletter, which is different. It's opt-in privacy-by-design stuff. You don't want to sign up? Don't press the button. It's really that simple. :) \ No newline at end of file diff --git a/README.md b/README.md index a8e5200..1ddae26 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,43 @@ +

+ +

+ # Wellbeing App (currently unnamed) -I have moved all code and future development to my self-hosted Gitea: [click here to view this repo there](https://gitea.defiantjc.synology.me/jaap/wellbeingapp). \ No newline at end of file +A freeware and open source wellbeing app. + +## Guiding Principles + +This app is being developed, researched and released using the following guiding principles: + +1. **Research-informed**: Wherever possible, any intervention or activity suggested by the app will be supported by academic research. An up-to-date list of academic references (APA style) will be kept within the app with a very brief description on what segment of the app it informed. A more detailed breakdown may appear on my private website, or here, at some point. +2. **Agile practises**: I will try to adopt agile coding practises as I go through. This means I aim to release useful features as soon as possible and reiterate, refactor and improve based on feedback. Using the in-app feedback button to let me know how things work for you is therefore the best way to gather this information at this stage. +3. **Cross-platform**: The app will (when a first release happens, see the [Features document for an overview](FEATURES.md)) be cross-platform, available initially for Windows, MacOS, Linux & iOS. Android may happen, I currently don't have any Android devices to play with. +4. **Free, Open Source**: Inspired by the likes of the NOBA project, the Linux community and countless other highly successful Free, Open Source Software (FOSS) projects out there, my aim is to offer a wide-ranging wellbeing tool available for free to anyone who seeks to use this. The only exception may be future iOS versions, due to the requirement for a paid Developer account with Apple. This will depend on any changes in my personal financial situation. +5. **Potentially informing my own research**: This guiding principle may develop into something cohesive or fall away completely. I am currently a student at Glasgow University, completing my Master's in Science in Psychology (online conversion). Depending on how successful I am with developing this project, I may end up designing a research project around it to inform my dissertation / thesis. This is an idea I'm toying with. If this pans out, the research project will run separate from this app, but I will seek volunteers to gather anonymous usage data from. I will not build *any* telemetry into this app. Ever. Any sampling and data collection will run through a separate platform (most likely LimeSurvey). + +## Psychological Principles, Definitions and Criteria + +Equally important are the psychological principles that guide decisions about what to include in this app. Since many concepts have varying definitions I will keep an overview here. + +1. All activities and interventions available in the app will be *research-informed*. As explained by Ashman (2018), it is noted where evidence exists and where it does not, with decisions made accordingly. This approach acknowledges that, even where evidence exists, it may have other considerations, e.g. a very small number of participants or participants from a similar background or ethnicity. +2. There is no conclusive definition of *wellbeing*. For the purposes of this app, wellbeing is seen not as a state or fixed endpoint. Similar to work-life balance, it is seen as something we must always strive to maintain. A number of *self-care* interventions can assist with this balancing. +3. The concept of a psychologically rich life, as defined by Oishi & Westgate (2022) which states three related, but distinct aspects of a good life: happiness, meaning and psychological richness. + +## Development Logs + +My aim is to write a development log (or potentially record one on YouTube now and again) whenever I have something meaningful to say. These are hosted on my personal blog. Links to these dev logs are listed below, for easy reference. + +- DevLog #1 + +## License & Attributions + +Creative Commons Licence
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. + +For an overview of all underlying licences, copyrights and attributions, please see the [Copyrights document](COPYRIGHTS.md). + +## References + +Ashman, G. (2018). The truth about teaching: An evidence-informed guide for new teachers. SAGE. + +Oishi, S., & Westgate, E. C. (2022). A psychologically rich life: Beyond happiness and meaning. Psychological Review, 129(4), 790–811. [https://doi.org/10.1037/rev0000317](https://doi.org/10.1037/rev0000317) \ No newline at end of file diff --git a/data/main_icon_smaller.png b/data/main_icon_smaller.png new file mode 100644 index 0000000..8a86ee7 Binary files /dev/null and b/data/main_icon_smaller.png differ diff --git a/data/wellbeing_cards.csv b/data/wellbeing_cards.csv new file mode 100644 index 0000000..bf7af22 --- /dev/null +++ b/data/wellbeing_cards.csv @@ -0,0 +1,3 @@ +id,category,title,description,picture_id,audio_id,language +00001,GWB,Nostalgic Media Consumption,,,,en +,,,,,, \ No newline at end of file diff --git a/design_files/colour_scheme.png b/design_files/colour_scheme.png new file mode 100644 index 0000000..23642ed --- /dev/null +++ b/design_files/colour_scheme.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:885178caa393ec57a9b6254fca940d116a44571c7e0b57d74c2534f39b56a936 +size 671 diff --git a/design_files/journal_idea.md b/design_files/journal_idea.md new file mode 100644 index 0000000..002221c --- /dev/null +++ b/design_files/journal_idea.md @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:261fcdfdd6eb1c589b0fb4a6bd97fc3b7e7e5f48d53ce1c2ca9ed9bb1d1f2d32 +size 565 diff --git a/design_files/main_icon.afdesign b/design_files/main_icon.afdesign new file mode 100644 index 0000000..a68db81 --- /dev/null +++ b/design_files/main_icon.afdesign @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9840e54c8af1038a8ceb52fe3c47cfb4ce9611d5a1dc6701522b4d6a584b3509 +size 110645 diff --git a/godot/Assets/fonts/NotoSansDisplay-Black.ttf b/godot/Assets/fonts/NotoSansDisplay-Black.ttf new file mode 100644 index 0000000..f670256 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-Black.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdff906bb52299af0846d1b301137b597ac904fd7561b8d41746181c0c84ed39 +size 359396 diff --git a/godot/Assets/fonts/NotoSansDisplay-BlackItalic.ttf b/godot/Assets/fonts/NotoSansDisplay-BlackItalic.ttf new file mode 100644 index 0000000..25b82ce --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-BlackItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cf33bb96e0cc2930237e15648a95ca1924760d9cfc41ef3f3de4aee746480a3 +size 381644 diff --git a/godot/Assets/fonts/NotoSansDisplay-Bold.ttf b/godot/Assets/fonts/NotoSansDisplay-Bold.ttf new file mode 100644 index 0000000..0dadc86 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-Bold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be531a8036d721a54555469ac64803d10ecc5f7095ba1551948b061bf46e5be0 +size 358984 diff --git a/godot/Assets/fonts/NotoSansDisplay-BoldItalic.ttf b/godot/Assets/fonts/NotoSansDisplay-BoldItalic.ttf new file mode 100644 index 0000000..b959bd5 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-BoldItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ffd6b6c07277ed241f8016ec0e73b074fc75b8c34d73ec155de228f5d623812 +size 381080 diff --git a/godot/Assets/fonts/NotoSansDisplay-ExtraBold.ttf b/godot/Assets/fonts/NotoSansDisplay-ExtraBold.ttf new file mode 100644 index 0000000..753355a --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-ExtraBold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8710940e0c006c5262f7b36f79a7c030be27c9224aeee840aad929590da4af2 +size 359372 diff --git a/godot/Assets/fonts/NotoSansDisplay-ExtraBoldItalic.ttf b/godot/Assets/fonts/NotoSansDisplay-ExtraBoldItalic.ttf new file mode 100644 index 0000000..b441556 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-ExtraBoldItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3606472f7545728586c7e0c49ec830b5d6805c82d7973ba547e0b356962f752b +size 381824 diff --git a/godot/Assets/fonts/NotoSansDisplay-ExtraLight.ttf b/godot/Assets/fonts/NotoSansDisplay-ExtraLight.ttf new file mode 100644 index 0000000..3c7500f --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-ExtraLight.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:817224c71ec6ed8293c3ce0dc98c28f7ee91fb3cbcab9917c366790059097478 +size 359372 diff --git a/godot/Assets/fonts/NotoSansDisplay-ExtraLightItalic.ttf b/godot/Assets/fonts/NotoSansDisplay-ExtraLightItalic.ttf new file mode 100644 index 0000000..d419bd4 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-ExtraLightItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d9e9ab7a39b0de1d0ab4024009634b2304883a07921084f6ea8917fe24f580e +size 382696 diff --git a/godot/Assets/fonts/NotoSansDisplay-Italic.ttf b/godot/Assets/fonts/NotoSansDisplay-Italic.ttf new file mode 100644 index 0000000..0bfd6e9 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-Italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db1e4162de01dc354072b1e415cbabe5959dcd4bd84108e4b83b4563db1b606d +size 380956 diff --git a/godot/Assets/fonts/NotoSansDisplay-Light.ttf b/godot/Assets/fonts/NotoSansDisplay-Light.ttf new file mode 100644 index 0000000..bd2737d --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-Light.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf3f8a9e427b76e627f7fa68e259a3a2d4ef50ed14244fa7359bc19284d72228 +size 359312 diff --git a/godot/Assets/fonts/NotoSansDisplay-LightItalic.ttf b/godot/Assets/fonts/NotoSansDisplay-LightItalic.ttf new file mode 100644 index 0000000..4e6a7cf --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-LightItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbbc4fe0eed3bd498dcd29e8e4ac30730fa9d0dac20a3ec149c796c0dcb83a04 +size 382292 diff --git a/godot/Assets/fonts/NotoSansDisplay-Medium.ttf b/godot/Assets/fonts/NotoSansDisplay-Medium.ttf new file mode 100644 index 0000000..93d6547 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-Medium.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3c477b0c2d251286b1ae60b18622b6df47c723940bbc21327d37a9e2e30304e +size 359156 diff --git a/godot/Assets/fonts/NotoSansDisplay-MediumItalic.ttf b/godot/Assets/fonts/NotoSansDisplay-MediumItalic.ttf new file mode 100644 index 0000000..3be7cb3 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-MediumItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f45d976d7f360bc3b4c644f5c215467783b6fe0932cf87078b7a999a0d981de0 +size 381476 diff --git a/godot/Assets/fonts/NotoSansDisplay-Regular.ttf b/godot/Assets/fonts/NotoSansDisplay-Regular.ttf new file mode 100644 index 0000000..696c37f --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-Regular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01db28ade3499d9e464f6aa5c8ba77874e6349adf53814fb8c46ab436b848040 +size 358696 diff --git a/godot/Assets/fonts/NotoSansDisplay-SemiBold.ttf b/godot/Assets/fonts/NotoSansDisplay-SemiBold.ttf new file mode 100644 index 0000000..3660d53 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-SemiBold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a5eee4de8be4c66bd1d6dd920c20d64352ee7fd40dac7dbc2ca4c16c3b7aecb +size 359316 diff --git a/godot/Assets/fonts/NotoSansDisplay-SemiBoldItalic.ttf b/godot/Assets/fonts/NotoSansDisplay-SemiBoldItalic.ttf new file mode 100644 index 0000000..b8c82de --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-SemiBoldItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8987d29af4ae0cb4ffbbefdb1069dcf41b8b3413a0b0c032c533cb26f394d769 +size 381588 diff --git a/godot/Assets/fonts/NotoSansDisplay-Thin.ttf b/godot/Assets/fonts/NotoSansDisplay-Thin.ttf new file mode 100644 index 0000000..20ee7b4 --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-Thin.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8c83a81aeeac6dc596831e8c9cabb882898be75a09719449f58e651cbfcc2f2 +size 359084 diff --git a/godot/Assets/fonts/NotoSansDisplay-ThinItalic.ttf b/godot/Assets/fonts/NotoSansDisplay-ThinItalic.ttf new file mode 100644 index 0000000..79b692b --- /dev/null +++ b/godot/Assets/fonts/NotoSansDisplay-ThinItalic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:108c532e8b271c38dd5771fd7c799143c8b63327fc90ea803c4fd2bc4ffb2c52 +size 382296 diff --git a/godot/Assets/fonts/noto_sans_display.ttf b/godot/Assets/fonts/noto_sans_display.ttf new file mode 100644 index 0000000..e101ec3 --- /dev/null +++ b/godot/Assets/fonts/noto_sans_display.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77ecfaaa94e223c71e63bbc6f274fd12a1e37047b9ed6fc68e5ef894239156b8 +size 1537148 diff --git a/godot/Assets/fonts/noto_sans_display_bold.ttf b/godot/Assets/fonts/noto_sans_display_bold.ttf new file mode 100644 index 0000000..0dadc86 --- /dev/null +++ b/godot/Assets/fonts/noto_sans_display_bold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be531a8036d721a54555469ac64803d10ecc5f7095ba1551948b061bf46e5be0 +size 358984 diff --git a/godot/Assets/fonts/noto_sans_display_italic.ttf b/godot/Assets/fonts/noto_sans_display_italic.ttf new file mode 100644 index 0000000..6327188 --- /dev/null +++ b/godot/Assets/fonts/noto_sans_display_italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42bdd3fc5b04fc82ca84575cd8ea53b3d0bff18e86d8c0831db7b6f9a84f4190 +size 1693248 diff --git a/godot/Assets/icons/mac_icon.icns b/godot/Assets/icons/mac_icon.icns new file mode 100644 index 0000000..e3454fa --- /dev/null +++ b/godot/Assets/icons/mac_icon.icns @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e929a8e2a2f236f73e8be3f52a42e74cfa522cedaa8ac03368571acf901006f +size 388952 diff --git a/godot/Assets/icons/main_icon.png b/godot/Assets/icons/main_icon.png new file mode 100644 index 0000000..abec645 --- /dev/null +++ b/godot/Assets/icons/main_icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d9bfdd6bfa6a89872cc6ea2a794a61811fc827081a4b025397271b073310793 +size 331171 diff --git a/godot/Assets/icons/main_icon_big_sur_small.png b/godot/Assets/icons/main_icon_big_sur_small.png new file mode 100644 index 0000000..cc1d92e --- /dev/null +++ b/godot/Assets/icons/main_icon_big_sur_small.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a38d6ddd8ce18b9770ea311dd969236df6631ba30a920e80cceaf9b6daeca32e +size 17810 diff --git a/godot/Assets/icons/main_icon_smaller.png b/godot/Assets/icons/main_icon_smaller.png new file mode 100644 index 0000000..39ce0f4 --- /dev/null +++ b/godot/Assets/icons/main_icon_smaller.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7e3b5c12c841f19d7589c9def5540ffa08231d5b2decce56ad8997590be8388 +size 76314 diff --git a/godot/apps/daily_prompts.tscn b/godot/apps/daily_prompts.tscn new file mode 100644 index 0000000..fc4acb4 --- /dev/null +++ b/godot/apps/daily_prompts.tscn @@ -0,0 +1,3 @@ +[gd_scene format=2] + +[node name="daily_prompts" type="CanvasLayer"] diff --git a/godot/apps/pomodoro.tscn b/godot/apps/pomodoro.tscn new file mode 100644 index 0000000..bc8baf0 --- /dev/null +++ b/godot/apps/pomodoro.tscn @@ -0,0 +1,5 @@ +[gd_scene format=2] + +[node name="pomodoro" type="CanvasLayer"] + +[node name="25min_timer" type="Timer" parent="."] diff --git a/godot/birthday_selector.gd b/godot/birthday_selector.gd new file mode 100644 index 0000000..050f90d --- /dev/null +++ b/godot/birthday_selector.gd @@ -0,0 +1,31 @@ +extends GridContainer + + +@onready var user_values = get_node("/root/UserValues") + + +func _ready(): + # Access the "country_menu" PopupMenu through this. + var birth_month_popup_menu: PopupMenu = $button_birth_month.get_popup() + var birth_day_popup_menu: PopupMenu = $button_birth_day.get_popup() + # Signal for when the user selects an PopupMenu item. + var _error = birth_month_popup_menu.connect("id_pressed",Callable(self,"_on_month_selected")) + var _error2 = birth_day_popup_menu.connect("id_pressed",Callable(self,"_on_day_selected")) + + if user_values.user_birth_month != 0: + $button_birth_month.text = str("Month " + str(user_values.user_birth_month)) + + if user_values.user_birth_day != 0: + $button_birth_day.text = str("Day " + str(user_values.user_birth_day)) + + +func _on_month_selected( id ): + print(id) + user_values.user_birth_month = id + $button_birth_month.text = str("Month " + str(id)) + + +func _on_day_selected( id ): + print(id) + user_values.user_birth_day = id + $button_birth_day.text = str("Day " + str(id)) diff --git a/godot/button_email_feedback.gd b/godot/button_email_feedback.gd new file mode 100644 index 0000000..d319895 --- /dev/null +++ b/godot/button_email_feedback.gd @@ -0,0 +1,9 @@ +extends Button + + +func _ready(): + pass # Replace with function body. + + +func _on_button_email_feedback_pressed(): + var _error = OS.shell_open("mailto:feedback@jaapmarsman.com") diff --git a/godot/button_name.gd b/godot/button_name.gd new file mode 100644 index 0000000..7ced471 --- /dev/null +++ b/godot/button_name.gd @@ -0,0 +1,8 @@ +extends Button + + +@onready var ui_control = get_node("/root/UiControl") + + +func _on_button_name_pressed(): + ui_control.show_user_menu() diff --git a/godot/button_open_github.gd b/godot/button_open_github.gd new file mode 100644 index 0000000..eef0b9f --- /dev/null +++ b/godot/button_open_github.gd @@ -0,0 +1,5 @@ +extends Button + + +func _on_button_open_github_pressed(): + var _error = OS.shell_open("https://gitea.defiantjc.synology.me/jaap/wellbeingapp") diff --git a/godot/button_user_save.gd b/godot/button_user_save.gd new file mode 100644 index 0000000..bcbbe1a --- /dev/null +++ b/godot/button_user_save.gd @@ -0,0 +1,39 @@ +extends Button + + +@onready var node_variables = get_node("/root/NodeVariables") +@onready var ui_control = get_node("/root/UiControl") +@onready var user_values = get_node("/root/UserValues") +@onready var user_name = get_node("%textbox_user_name") + + +func _on_button_user_save_pressed(): + + if user_name.text == "": + # Prettify this later with a friendly user prompt + print("Won't continue. Put in name.") + + else: + # First time label turns off - this is done every time - no harm in that? + node_variables.first_time_label.visible = false + + # Stores values in ini file + user_values.config.set_value("User", "user_name", user_name.text) + user_values.user_first_name = user_name.text + user_values.config.set_value("User", "user_birth_month", user_values.user_birth_month) + user_values.config.set_value("User", "user_birth_day", user_values.user_birth_day) + + #config.set_value("Player1", "best_score", 10) + #onfig.set_value("Player2", "player_name", "V3geta") + #config.set_value("Player2", "best_score", 9001) + + # Save it to a file (overwrite if already exists). + # Need to make sure I never lose any values I add. + # This seems to be a manual thing to program. + # So per value, make sure to read it upon load. + # And write it out again as well. + + user_values.config.save("user://user.ini") + + node_variables.welcome_label.text = user_values.welcome_day_part + user_values.user_first_name + "!" + ui_control.show_start_menu() diff --git a/godot/data/wellbeings_cards.json b/godot/data/wellbeings_cards.json new file mode 100644 index 0000000..a7bd645 --- /dev/null +++ b/godot/data/wellbeings_cards.json @@ -0,0 +1,3 @@ +[ +{"id": "", "category": "", "title": "", "description": "", "picture_id": "", "audio_id": "", "language": ""} +] diff --git a/godot/default_env.tres b/godot/default_env.tres new file mode 100644 index 0000000..8be2d12 --- /dev/null +++ b/godot/default_env.tres @@ -0,0 +1,7 @@ +[gd_resource type="Environment" load_steps=2 format=3 uid="uid://dkny61n28xihu"] + +[sub_resource type="Sky" id="1"] + +[resource] +background_mode = 2 +sky = SubResource("1") diff --git a/godot/main_screen.gd b/godot/main_screen.gd new file mode 100644 index 0000000..1dc5cd3 --- /dev/null +++ b/godot/main_screen.gd @@ -0,0 +1,33 @@ +extends CanvasLayer + + +@onready var node_variables = get_node("/root/NodeVariables") +@onready var ui_control = get_node("/root/UiControl") +@onready var user_values = get_node("/root/UserValues") + + +func _ready(): + # Read config file if it exists + # otherwise set up new user data + + if user_values.err != OK: + ui_control.show_user_menu() + node_variables.first_time_label.visible = true + + else: + + # Set starting state visibility + ui_control.show_start_menu() + node_variables.first_time_label.visible = false + + # define variables from ini file + node_variables.user_name.text = user_values.user_first_name + +# Iterate over all sections. +# for player in config.get_sections(): +# # Fetch the data for each section. +# var player_name = config.get_value(player, "player_name") +# var player_score = config.get_value(player, "best_score") + +#func _process(delta): +# pass diff --git a/godot/node_variables.gd b/godot/node_variables.gd new file mode 100644 index 0000000..65f8525 --- /dev/null +++ b/godot/node_variables.gd @@ -0,0 +1,16 @@ +extends Node + + +@onready var main_screen = get_node("/root/main_screen") +@onready var start_menu = get_node("/root/main_screen/UI/top_container/start_menu") +@onready var user_menu = get_node("/root/main_screen/UI/top_container/user_details") +@onready var daily_prompts = get_node("/root/main_screen/UI/top_container/daily_prompts") + + +@onready var user_name = get_node("/root/main_screen/UI/top_container/user_details/user_menu/green_panel/textbox_user_name") +@onready var first_time_label = get_node("/root/main_screen/UI/top_container/user_details/user_menu/green_panel/label_first_time") +@onready var welcome_label = get_node("/root/main_screen/UI/top_container/start_menu/welcome_title") + + +func _ready(): + pass diff --git a/godot/program_values.gd b/godot/program_values.gd new file mode 100644 index 0000000..1985990 --- /dev/null +++ b/godot/program_values.gd @@ -0,0 +1,18 @@ +extends Node + + +# This variable lists the release number. +# This is "the number of releases". + +var release_version : int = 1 + +# The var web_release_version is pulled from GitHub +# when the update button is checked. A higher value means +# an update is available + +var web_release_version : int = 0 +var current_version : String = "0.0.8" + + +func _ready(): + pass diff --git a/godot/project.godot b/godot/project.godot new file mode 100644 index 0000000..819f6e3 --- /dev/null +++ b/godot/project.godot @@ -0,0 +1,46 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="Wellbeing App" +run/main_scene="res://start_screen.tscn" +config/features=PackedStringArray("4.1") +run/low_processor_mode=true +config/icon="res://Assets/icons/main_icon.png" + +[autoload] + +UserValues="*res://user_values.gd" +ProgramValues="*res://program_values.gd" +UiControl="*res://ui_control.gd" +NodeVariables="*res://node_variables.gd" + +[display] + +window/size/viewport_width=1280 +window/size/viewport_height=720 +window/size/window_width_override=2560 +window/size/window_height_override=1440 +window/energy_saving/keep_screen_on=false +window/stretch/mode="2d" +window/stretch/aspect="keep_width" + +[gui] + +theme/use_hidpi=true + +[physics] + +common/enable_pause_aware_picking=true + +[rendering] + +environment/defaults/default_environment="res://default_env.tres" diff --git a/godot/start_menu.gd b/godot/start_menu.gd new file mode 100644 index 0000000..038a201 --- /dev/null +++ b/godot/start_menu.gd @@ -0,0 +1,33 @@ +extends CanvasLayer + +var csv_url : String = "https://gitea.defiantjc.synology.me/jaap/wellbeingapp/raw/branch/main/version_info.csv" +var welcome_day_part : String = " " + + +func _ready(): + $version_label.text = "Version " + str(ProgramValues.current_version) + + UserValues.get_device_time() + UserValues.set_welcome_day_part() + + $welcome_title.text = UserValues.welcome_day_part + UserValues.user_first_name + "!" + + +func _on_button_update_check_pressed(): + $HTTPRequest.request(csv_url) + + +func update_user_name_label(): + $welcome_title.text = "Good morning, " + UserValues.user_first_name + "!" + + +func _on_HTTPRequest_request_completed(_result, _response_code, _headers, body): + var test_json_conv = JSON.new() + test_json_conv.parse(body.get_string_from_utf8()) + var json = test_json_conv.get_data() + print(json) + ProgramValues.web_release_version = json + if ProgramValues.web_release_version > ProgramValues.release_version: + print("There's an update!") + elif ProgramValues.web_release_version == ProgramValues.release_version: + print("There is no update!") diff --git a/godot/start_menu.tscn b/godot/start_menu.tscn new file mode 100644 index 0000000..4ca2790 --- /dev/null +++ b/godot/start_menu.tscn @@ -0,0 +1,95 @@ +[gd_scene load_steps=6 format=3 uid="uid://wp6d880w6h6u"] + +[ext_resource type="Script" path="res://start_menu.gd" id="1"] +[ext_resource type="Script" path="res://button_name.gd" id="2"] +[ext_resource type="Script" path="res://button_email_feedback.gd" id="3"] +[ext_resource type="Script" path="res://button_open_github.gd" id="4"] +[ext_resource type="Theme" uid="uid://cqlpsmjde8oae" path="res://wb_theme.tres" id="5"] + +[node name="start_menu" type="CanvasLayer"] +script = ExtResource("1") + +[node name="welcome_title" type="Label" parent="."] +unique_name_in_owner = true +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -185.0 +offset_top = 2.0 +offset_right = 185.0 +offset_bottom = 36.0 +theme = ExtResource("5") +text = "All your base are belong to us" + +[node name="HTTPRequest" type="HTTPRequest" parent="."] + +[node name="version_label" type="Label" parent="."] +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_left = 5.0 +offset_top = -31.0 +offset_right = 1280.0 +offset_bottom = -1.0 +theme = ExtResource("5") +text = "Version" + +[node name="GridContainer" type="HFlowContainer" parent="."] +offset_left = 10.0 +offset_top = 55.0 +offset_right = 1270.0 +offset_bottom = 665.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="button_daily_action" type="Button" parent="GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme = ExtResource("5") +text = "Daily Action" + +[node name="button_open_github" type="Button" parent="GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme = ExtResource("5") +text = "GitHub" +script = ExtResource("4") + +[node name="button_email_feedback" type="Button" parent="GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme = ExtResource("5") +text = "Feedback" +script = ExtResource("3") + +[node name="button_name" type="Button" parent="GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme = ExtResource("5") +text = "Name" +script = ExtResource("2") + +[node name="button_update_check" type="Button" parent="GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme = ExtResource("5") +text = "Check for Updates" + +[node name="button_journal" type="Button" parent="GridContainer"] +visible = false +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme = ExtResource("5") +text = "Journal" + +[connection signal="request_completed" from="HTTPRequest" to="." method="_on_HTTPRequest_request_completed"] +[connection signal="pressed" from="GridContainer/button_open_github" to="GridContainer/button_open_github" method="_on_button_open_github_pressed"] +[connection signal="pressed" from="GridContainer/button_email_feedback" to="GridContainer/button_email_feedback" method="_on_button_email_feedback_pressed"] +[connection signal="pressed" from="GridContainer/button_name" to="GridContainer/button_name" method="_on_button_name_pressed"] +[connection signal="pressed" from="GridContainer/button_update_check" to="." method="_on_button_update_check_pressed"] diff --git a/godot/start_screen.tscn b/godot/start_screen.tscn new file mode 100644 index 0000000..e6159e1 --- /dev/null +++ b/godot/start_screen.tscn @@ -0,0 +1,141 @@ +[gd_scene load_steps=7 format=3 uid="uid://dqlqsachnxomy"] + +[ext_resource type="Script" path="res://main_screen.gd" id="1"] +[ext_resource type="PackedScene" path="res://user_details.tscn" id="2"] +[ext_resource type="PackedScene" uid="uid://wp6d880w6h6u" path="res://start_menu.tscn" id="3"] +[ext_resource type="PackedScene" path="res://apps/daily_prompts.tscn" id="4"] +[ext_resource type="Theme" uid="uid://cqlpsmjde8oae" path="res://wb_theme.tres" id="5"] +[ext_resource type="PackedScene" path="res://apps/pomodoro.tscn" id="6"] + +[node name="main_screen" type="CanvasLayer"] +script = ExtResource("1") + +[node name="UI" type="CanvasLayer" parent="."] + +[node name="background_light" type="ColorRect" parent="UI"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +color = Color(0.94902, 0.937255, 0.85098, 1) + +[node name="top_bar" type="Panel" parent="UI"] +custom_minimum_size = Vector2(0, 40) +offset_right = 1280.0 +offset_bottom = 40.0 + +[node name="top_container" type="VBoxContainer" parent="UI"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = 42.0 +offset_bottom = -48.0 +theme = ExtResource("5") + +[node name="start_menu" parent="UI/top_container" instance=ExtResource("3")] +visible = false + +[node name="welcome_title" parent="UI/top_container/start_menu" index="0"] +anchors_preset = 5 +offset_top = 0.0 +offset_bottom = 34.0 +grow_horizontal = 2 + +[node name="version_label" parent="UI/top_container/start_menu" index="2"] +anchors_preset = 2 +offset_left = 0.0 +offset_top = -30.0 +offset_right = 1275.0 +offset_bottom = 0.0 +grow_vertical = 0 + +[node name="button_daily_action" parent="UI/top_container/start_menu/GridContainer" index="0"] +layout_mode = 2 + +[node name="button_open_github" parent="UI/top_container/start_menu/GridContainer" index="1"] +layout_mode = 2 + +[node name="button_email_feedback" parent="UI/top_container/start_menu/GridContainer" index="2"] +layout_mode = 2 + +[node name="button_name" parent="UI/top_container/start_menu/GridContainer" index="3"] +layout_mode = 2 + +[node name="button_update_check" parent="UI/top_container/start_menu/GridContainer" index="4"] +layout_mode = 2 + +[node name="button_journal" parent="UI/top_container/start_menu/GridContainer" index="5"] +layout_mode = 2 + +[node name="user_details" parent="UI/top_container" instance=ExtResource("2")] +visible = false + +[node name="user_menu" parent="UI/top_container/user_details" index="0"] +anchors_preset = 8 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="green_panel" parent="UI/top_container/user_details/user_menu" index="0"] +layout_mode = 2 + +[node name="label_first_time" parent="UI/top_container/user_details/user_menu/green_panel" index="0"] +layout_mode = 0 +anchor_right = 0.0 +offset_top = 0.0 +offset_right = 1.0 +offset_bottom = 34.0 + +[node name="textbox_user_name" parent="UI/top_container/user_details/user_menu/green_panel" index="1"] +layout_mode = 0 +anchor_left = 0.0 +anchor_right = 0.0 +offset_left = 0.0 +offset_top = 0.0 +offset_right = 700.0 +offset_bottom = 34.0 + +[node name="birthday_selector" parent="UI/top_container/user_details/user_menu/green_panel" index="2"] +layout_mode = 0 +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +offset_left = 0.0 +offset_top = 0.0 +offset_right = 267.0 +offset_bottom = 34.0 + +[node name="button_birth_month" parent="UI/top_container/user_details/user_menu/green_panel/birthday_selector" index="0"] +layout_mode = 2 + +[node name="button_birth_day" parent="UI/top_container/user_details/user_menu/green_panel/birthday_selector" index="1"] +layout_mode = 2 + +[node name="button_user_save" parent="UI/top_container/user_details/user_menu/green_panel" index="3"] +layout_mode = 0 +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +offset_left = 0.0 +offset_top = 0.0 +offset_right = 148.57 +offset_bottom = 34.0 + +[node name="daily_prompts" parent="UI/top_container" instance=ExtResource("4")] +visible = false + +[node name="pomodoro" parent="UI/top_container" instance=ExtResource("6")] +visible = false + +[node name="bottom_bar" type="Panel" parent="UI"] +custom_minimum_size = Vector2(0, 40) +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -40.0 + +[editable path="UI/top_container/start_menu"] +[editable path="UI/top_container/user_details"] +[editable path="UI/top_container/daily_prompts"] +[editable path="UI/top_container/pomodoro"] diff --git a/godot/ui_control.gd b/godot/ui_control.gd new file mode 100644 index 0000000..8b1327f --- /dev/null +++ b/godot/ui_control.gd @@ -0,0 +1,30 @@ +extends Node + + +@onready var node_variables = get_node("/root/NodeVariables") +@onready var user_values = get_node("/root/UserValues") + + +func _ready(): + pass + + +func show_start_menu(): + node_variables.main_screen.visible = true + node_variables.start_menu.visible = true + node_variables.user_menu.visible = false + node_variables.daily_prompts.visible = false + + +func show_user_menu(): + node_variables.main_screen.visible = true + node_variables.start_menu.visible = false + node_variables.user_menu.visible = true + node_variables.daily_prompts.visible = false + + +func show_daily_prompts(): + node_variables.main_screen.visible = true + node_variables.start_menu.visible = false + node_variables.user_menu.visible = false + node_variables.daily_prompts.visible = true diff --git a/godot/user_details.tscn b/godot/user_details.tscn new file mode 100644 index 0000000..1bfed46 --- /dev/null +++ b/godot/user_details.tscn @@ -0,0 +1,89 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://button_user_save.gd" type="Script" id=1] +[ext_resource path="res://wb_theme.tres" type="Theme" id=2] +[ext_resource path="res://birthday_selector.gd" type="Script" id=3] + +[node name="user_details" type="CanvasLayer"] + +[node name="user_menu" type="PanelContainer" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -500.0 +offset_top = -300.0 +offset_right = 500.0 +offset_bottom = 300.0 +theme = ExtResource( 2 ) + +[node name="green_panel" type="Panel" parent="user_menu"] +offset_right = 1000.0 +offset_bottom = 600.0 +theme = ExtResource( 2 ) + +[node name="label_first_time" type="Label" parent="user_menu/green_panel"] +unique_name_in_owner = true +anchor_right = 1.0 +offset_top = 3.0 +offset_bottom = 37.0 +theme = ExtResource( 2 ) +text = "First time user: Please fill in your first name below." +align = 1 + +[node name="textbox_user_name" type="LineEdit" parent="user_menu/green_panel"] +unique_name_in_owner = true +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -350.0 +offset_top = 41.0 +offset_right = 350.0 +offset_bottom = 75.0 +theme = ExtResource( 2 ) +caret_blink = true +caret_blink_interval = 0.5 + +[node name="birthday_selector" type="GridContainer" parent="user_menu/green_panel"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -134.0 +offset_top = -150.0 +offset_right = 133.0 +offset_bottom = -116.0 +columns = 2 +script = ExtResource( 3 ) + +[node name="button_birth_month" type="MenuButton" parent="user_menu/green_panel/birthday_selector"] +offset_right = 130.0 +offset_bottom = 34.0 +size_flags_horizontal = 3 +text = "Month" +items = [ "January", null, 0, false, false, 1, 0, null, "", false, "February", null, 0, false, false, 2, 0, null, "", false, "March", null, 0, false, false, 3, 0, null, "", false, "April", null, 0, false, false, 4, 0, null, "", false, "May", null, 0, false, false, 5, 0, null, "", false, "June", null, 0, false, false, 6, 0, null, "", false, "July", null, 0, false, false, 7, 0, null, "", false, "August", null, 0, false, false, 8, 0, null, "", false, "September", null, 0, false, false, 9, 0, null, "", false, "October", null, 0, false, false, 10, 0, null, "", false, "November", null, 0, false, false, 11, 0, null, "", false, "December", null, 0, false, false, 12, 0, null, "", false ] + +[node name="button_birth_day" type="MenuButton" parent="user_menu/green_panel/birthday_selector"] +offset_left = 138.0 +offset_right = 267.0 +offset_bottom = 34.0 +focus_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource( 2 ) +text = "Day" +items = [ "1", null, 0, false, false, 1, 0, null, "", false, "2", null, 0, false, false, 2, 0, null, "", false, "3", null, 0, false, false, 3, 0, null, "", false, "4", null, 0, false, false, 4, 0, null, "", false, "5", null, 0, false, false, 5, 0, null, "", false, "6", null, 0, false, false, 6, 0, null, "", false, "7", null, 0, false, false, 7, 0, null, "", false, "8", null, 0, false, false, 8, 0, null, "", false, "9", null, 0, false, false, 9, 0, null, "", false, "10", null, 0, false, false, 10, 0, null, "", false, "11", null, 0, false, false, 11, 0, null, "", false, "12", null, 0, false, false, 12, 0, null, "", false, "13", null, 0, false, false, 13, 0, null, "", false, "14", null, 0, false, false, 14, 0, null, "", false, "15", null, 0, false, false, 15, 0, null, "", false, "16", null, 0, false, false, 16, 0, null, "", false, "17", null, 0, false, false, 17, 0, null, "", false, "18", null, 0, false, false, 18, 0, null, "", false, "19", null, 0, false, false, 19, 0, null, "", false, "20", null, 0, false, false, 20, 0, null, "", false, "21", null, 0, false, false, 21, 0, null, "", false, "22", null, 0, false, false, 22, 0, null, "", false, "23", null, 0, false, false, 23, 0, null, "", false, "24", null, 0, false, false, 24, 0, null, "", false, "25", null, 0, false, false, 25, 0, null, "", false, "26", null, 0, false, false, 26, 0, null, "", false, "27", null, 0, false, false, 27, 0, null, "", false, "28", null, 0, false, false, 28, 0, null, "", false, "29", null, 0, false, false, 29, 0, null, "", false, "30", null, 0, false, false, 30, 0, null, "", false, "31", null, 0, false, false, 31, 0, null, "", false ] + +[node name="button_user_save" type="Button" parent="user_menu/green_panel"] +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -74.0 +offset_top = -49.0 +offset_right = 74.5701 +offset_bottom = -15.0 +theme = ExtResource( 2 ) +text = "Done" +expand_icon = true +script = ExtResource( 1 ) + +[connection signal="pressed" from="user_menu/green_panel/button_user_save" to="user_menu/green_panel/button_user_save" method="_on_button_user_save_pressed"] diff --git a/godot/user_values.gd b/godot/user_values.gd new file mode 100644 index 0000000..55e60b5 --- /dev/null +++ b/godot/user_values.gd @@ -0,0 +1,62 @@ +extends Node + +# User values + +var user_first_name = " " +var user_birth_month = 0 +var user_birth_day = 0 + +# System time values + +var date +var date_month +var date_day + +var date_time +var date_time_hour + +var welcome_day_part = " " + +# For the login-streak thing + +#var user_login_streak +#var user_last_login_year +#var user_last_login_month +#var user_last_login_day + + +var config = ConfigFile.new() +var err = config.load("user://user.ini") + +# This function can be triggered to update the known system time. +func get_device_time(): + date = Time.get_date_dict_from_system() + date_time = Time.get_time_dict_from_system() + date_time_hour = date_time.hour + date_month = date.month + date_day = date.day + print(date_month) + print(date_day) + print(date_time_hour) + +func set_welcome_day_part(): + if date_time_hour < 24: + welcome_day_part = "Good evening, " + if date_time_hour < 18: + welcome_day_part = "Good afternoon, " + if date_time_hour < 12: + welcome_day_part = "Good morning, " + if date_time_hour < 6: + welcome_day_part = "Good night, " + +func _ready(): + get_device_time() + # Read config file if it exists + # define variables from ini file + if err == OK: + user_first_name = config.get_value("User", "user_name") + user_birth_month = config.get_value("User", "user_birth_month") + user_birth_day = config.get_value("User", "user_birth_day") + + else: + pass diff --git a/godot/wb_theme.tres b/godot/wb_theme.tres new file mode 100644 index 0000000..b2ff36f --- /dev/null +++ b/godot/wb_theme.tres @@ -0,0 +1,102 @@ +[gd_resource type="Theme" load_steps=14 format=3 uid="uid://cqlpsmjde8oae"] + +[ext_resource type="FontFile" uid="uid://xsnm8cium6dl" path="res://Assets/fonts/noto_sans_display_bold.ttf" id="1"] +[ext_resource type="FontFile" uid="uid://cvcedf0p6452r" path="res://Assets/fonts/noto_sans_display.ttf" id="2"] + +[sub_resource type="FontFile" id="1"] +fallbacks = Array[Font]([ExtResource("1")]) +cache/0/16/0/ascent = 0.0 +cache/0/16/0/descent = 0.0 +cache/0/16/0/underline_position = 0.0 +cache/0/16/0/underline_thickness = 0.0 +cache/0/16/0/scale = 1.0 +cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0) + +[sub_resource type="StyleBoxFlat" id="4"] +bg_color = Color(0.207843, 0.219608, 0.317647, 1) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="StyleBoxFlat" id="5"] +bg_color = Color(0.862745, 0.435294, 0.329412, 1) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="StyleBoxFlat" id="6"] +bg_color = Color(0.941176, 0.772549, 0.517647, 1) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="StyleBoxFlat" id="2"] +bg_color = Color(0.862745, 0.435294, 0.329412, 1) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="StyleBoxFlat" id="7"] +bg_color = Color(0.941176, 0.772549, 0.517647, 1) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="FontFile" id="3"] +fallbacks = Array[Font]([ExtResource("2")]) +cache/0/16/0/ascent = 0.0 +cache/0/16/0/descent = 0.0 +cache/0/16/0/underline_position = 0.0 +cache/0/16/0/underline_thickness = 0.0 +cache/0/16/0/scale = 1.0 +cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0) + +[sub_resource type="FontFile" id="8"] +fallbacks = Array[Font]([ExtResource("2")]) +cache/0/16/0/ascent = 0.0 +cache/0/16/0/descent = 0.0 +cache/0/16/0/underline_position = 0.0 +cache/0/16/0/underline_thickness = 0.0 +cache/0/16/0/scale = 1.0 +cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0) + +[sub_resource type="StyleBoxFlat" id="9"] +content_margin_left = 15.0 +content_margin_right = 5.0 +bg_color = Color(0.207843, 0.219608, 0.317647, 1) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="StyleBoxFlat" id="11"] +bg_color = Color(0.462745, 0.662745, 0.560784, 1) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color(0.207843, 0.219608, 0.317647, 1) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="StyleBoxEmpty" id="12"] + +[resource] +Button/fonts/font = SubResource("1") +Button/styles/disabled = SubResource("4") +Button/styles/focus = SubResource("5") +Button/styles/hover = SubResource("6") +Button/styles/normal = SubResource("2") +Button/styles/pressed = SubResource("7") +Label/fonts/font = SubResource("3") +LineEdit/fonts/font = SubResource("8") +LineEdit/styles/normal = SubResource("9") +Panel/styles/panel = SubResource("11") +PanelContainer/styles/panel = SubResource("12") diff --git a/version_info.csv b/version_info.csv new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/version_info.csv @@ -0,0 +1 @@ +1 \ No newline at end of file