Actually write the damn tool

This commit is contained in:
MichaelYick 2024-02-04 22:47:17 -06:00
parent fc0202ec46
commit 6193299dfb
7 changed files with 44 additions and 2 deletions

3
.gitignore vendored
View File

@ -52,3 +52,6 @@ Module.symvers
Mkfile.old
dkms.conf
# outputs
reader
saver

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "tinyfiledialogs"]
path = tinyfiledialogs
url = https://git.code.sf.net/p/tinyfiledialogs/code

8
Makefile Normal file
View File

@ -0,0 +1,8 @@
CC = gcc
build:
$(CC) renpy-filepicker-saver.c tinyfiledialogs/tinyfiledialogs.c -o saver
$(CC) renpy-filepicker-reader.c tinyfiledialogs/tinyfiledialogs.c -o reader
clean:
rm -vf saver reader

View File

@ -1,4 +1,5 @@
# renpy-filepicker
>current year
>ren'py doesn't have a file picker
>current year
>ren'py doesn't have a file picker

14
renpy-filepicker-reader.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
#include "./tinyfiledialogs/tinyfiledialogs.h"
int main () {
char const * imageFilterPatterns[2] = {"*.png", "*.jpg"};
char* filename = tinyfd_openFileDialog("Please select an image",
"",
2,
imageFilterPatterns,
"Image Files",
0);
printf("%s\n", filename);
}

12
renpy-filepicker-saver.c Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
#include "./tinyfiledialogs/tinyfiledialogs.h"
int main () {
char* filename = tinyfd_saveFileDialog("Please select an export location",
"wani-export.zip",
0,
NULL,
NULL);
printf("%s\n", filename);
}

1
tinyfiledialogs Submodule

@ -0,0 +1 @@
Subproject commit e60005e2592f13c22dbad8100de66f6dfa0d0d7c