Skip to content

Commit 0c508b6

Browse files
committed
switch to nativefiledialog fork that implements NFD_PickFolder
1 parent 7c033ff commit 0c508b6

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@
2828
[submodule "3rdParty/rapidjson"]
2929
path = 3rdParty/rapidjson
3030
url = https://github.com/miloyip/rapidjson.git
31+
[submodule "3rdParty/nativefiledialog"]
32+
path = 3rdParty/nativefiledialog
33+
url = https://github.com/paulsapps/nativefiledialog.git
34+
branch = NFD_PickFolder

3rdParty/nativefiledialog

Submodule nativefiledialog added at 3f96999

src/gameselectionscreen.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,24 @@ void GameSelectionScreen::Render(int /*w*/, int /*h*/, Renderer& /*renderer*/)
2929

3030
if (gui_button(mGui, "Start game"))
3131
{
32+
nfdchar_t* outPath = NULL;
33+
nfdresult_t result = NFD_PickFolder(NULL, &outPath);
3234

33-
nfdchar_t *outPath = NULL;
34-
nfdresult_t result = NFD_OpenDialog(NULL, NULL, &outPath);
35-
36-
if (result == NFD_OKAY) {
35+
if (result == NFD_OKAY)
36+
{
3737
puts("Success!");
3838
puts(outPath);
3939
free(outPath);
4040
}
41-
else if (result == NFD_CANCEL) {
41+
else if (result == NFD_CANCEL)
42+
{
4243
puts("User pressed cancel.");
4344
}
44-
else {
45+
else
46+
{
4547
printf("Error: %s\n", NFD_GetError());
4648
}
4749

48-
4950
const GameDefinition& userSelectedGameDef = *mVisibleGameDefinitions[mSelectedGameDefintionIndex];
5051

5152
DataSetMap requiredDataSets;

0 commit comments

Comments
 (0)