I open this pull request as a way to discuss this plugin migration to Godot 4.0 openly, detail the current roadmap and report the state of the migration. Once merged, this would close #2.
Main goal
My main goal with this migration is to bring this plugin's API closer to Godot's equivalent nodes. In Godot 3.x, I limited myself to creating a wrapper of portable file dialogs, which would make it difficult to use any other library in case it is necessary. By being closer to Godot's API, it would be easier to use this plugin after using some of Godot's nodes, such as FileDialog, as you would already be familiar with its attributes.
Tasks
In order of priority:
[x] Create NativeFileDialog, by merging NativeDialogOpenFile, NativeDialogSaveFile, NativeDialogOpenFolder. Attributes:
[x] Mode Overrides Title
[x] File Mode
[x] Access
[x] Root Subfolder
[x] Filters
[x] Create NativeAcceptDialog, using NativeDialogMessage. Attributes:
[x] Title
[x] Text
[x] Icon
[x] Add to the documentation that an alternative would be using Godot's OS.alert(), indicating the differences.
[x] Create NativeConfirmationDialog, using NativeDialogMessage. Attributes:
[x] Title
[x] Text
[x] Icon
[x] Rename NativeDialogNotify to NativeNotification. Its behaviour would remain mostly the same.
[x] Add a static send method if the user doesn't want to instantiate a node. It doesn't seem to be possible without making the whole class a singleton.
[x] Update Demo project.
[x] Update documentation.
[x] Update CI-CD.
From here is optional:
[x] Add code formatting
[x] Automate the creation of Godot's Assets Library zip.
[ ] Unit testing.
[ ] Integrate Unit testing in the CI.
[ ] Create NativeColorPicker.
As you may see, many work to do. I don't expect to achieve everything but it is good to have it listed.
Disadvantages
NativeDialogMessage would probably lose the YES_NO_CANCEL option. YES_NO can be part of NativeConfirmationDialog. NativeDialogOpenFolder would lose the force_path flag to be a default value, not sure yet what value it would be.
Update:YES_NO is part of NativeConfirmationDialog. The flags force_path and force_overwrite would be disabled. YES_NO_CANCEL can be added as another node in the future, but I'm not considering it now.
Current status
It compiles but crashes on launch, due to this. There is a solution proposed in the thread, but I have yet to apply it to my Scons configuration.
Now it compiles and seems to be working without crashes, features still need to be implemented and tested.
It is now mostly feature-complete with the exception of the optional features, so if anyone has the time feel free to compile it and test it. I would now focus on the CI to create the binaries.
You can now download the artifacts for each platform via GitHub actions. The only thing remaining for the MVP is the documentation.
The documentation is complete and is now usable! Feel free to test it out and report bugs.
Godot 4.0 migration
I open this pull request as a way to discuss this plugin migration to Godot 4.0 openly, detail the current roadmap and report the state of the migration. Once merged, this would close #2.
Main goal
My main goal with this migration is to bring this plugin's API closer to Godot's equivalent nodes. In Godot 3.x, I limited myself to creating a wrapper of portable file dialogs, which would make it difficult to use any other library in case it is necessary. By being closer to Godot's API, it would be easier to use this plugin after using some of Godot's nodes, such as
FileDialog
, as you would already be familiar with its attributes.Tasks
In order of priority:
NativeFileDialog
, by mergingNativeDialogOpenFile
,NativeDialogSaveFile
,NativeDialogOpenFolder
. Attributes:NativeAcceptDialog
, usingNativeDialogMessage
. Attributes:OS.alert()
, indicating the differences.NativeConfirmationDialog
, usingNativeDialogMessage
. Attributes:NativeDialogNotify
toNativeNotification
. Its behaviour would remain mostly the same.Add a static. It doesn't seem to be possible without making the whole class a singleton.send
method if the user doesn't want to instantiate a nodeFrom here is optional:
NativeColorPicker
.As you may see, many work to do. I don't expect to achieve everything but it is good to have it listed.
Disadvantages
NativeDialogMessage
would probably lose theYES_NO_CANCEL
option.YES_NO
can be part ofNativeConfirmationDialog
.NativeDialogOpenFolder
would lose theforce_path
flag to be a default value, not sure yet what value it would be.Update:
YES_NO
is part ofNativeConfirmationDialog
. The flagsforce_path
andforce_overwrite
would be disabled.YES_NO_CANCEL
can be added as another node in the future, but I'm not considering it now.Current status
It compiles but crashes on launch, due to this. There is a solution proposed in the thread, but I have yet to apply it to my Scons configuration.Now it compiles and seems to be working without crashes, features still need to be implemented and tested.It is now mostly feature-complete with the exception of the optional features, so if anyone has the time feel free to compile it and test it. I would now focus on the CI to create the binaries.You can now download the artifacts for each platform via GitHub actions. The only thing remaining for the MVP is the documentation.