-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: moving time methods to ModLoaderTime
#346
Open
AlajeBash
wants to merge
6
commits into
GodotModding:development
Choose a base branch
from
AlajeBash:main
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
53d7ca5
Spliting Date & Time Methods in to Dedicated Class
AlajeBash 76505f1
Update addons/mod_loader/api/time.gd
AlajeBash 364600c
Update addons/mod_loader/api/time.gd
AlajeBash c66631d
Update addons/mod_loader/api/time.gd
AlajeBash 4f82dd9
resolved the suggestions
AlajeBash a73641f
Update addons/mod_loader/api/time.gd
AlajeBash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This class provides utility functions to retrieve the current time, date, and date-time in specific string formats. | ||
class_name ModLoaderTime | ||
extends Node | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One empty line missing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The empty line is still missing. |
||
# Returns the current time as a string in the format hh:mm:ss | ||
static func get_time_string() -> String: | ||
var date_time := Time.get_datetime_dict_from_system() | ||
return "%02d:%02d:%02d" % [ date_time.hour, date_time.minute, date_time.second ] | ||
|
||
AlajeBash marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Returns the current date as a string in the format yyyy-mm-dd | ||
static func get_date_string() -> String: | ||
var date_time := Time.get_datetime_dict_from_system() | ||
return "%s-%02d-%02d" % [ date_time.year, date_time.month, date_time.day ] | ||
|
||
|
||
# Returns the current date and time as a string in the format yyyy-mm-dd_hh:mm:ss | ||
static func get_date_time_string() -> String: | ||
return "%s_%s" % [ _get_date_string(), _get_time_string() ] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please search the entire codebase for calls to the Time utility functions and update them to
ModLoaderTime
. In Godot, you can pressCtrl
+Alt
+F
to search the entire project. Additionally, please perform a test run. You can create an empty Godot project and symlink the repository into the addons folder for testing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KANAjetzt is there need for
Internal Date Time
functions in addons/mod_loader/setup/setup_log.gd ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can keep everything related to the setup (everything in the setup directory) as it is. The setup has to be completely separate, which is why there is a lot of duplicated code in these files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one more call to
_get_date_time_string()
godot-mod-loader/addons/mod_loader/api/log.gd
Line 479 in a73641f