Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit/AppGameKit Studio Showcase / [Plugin] FileExplore (File, Folder and System-Drives Handling)

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Jul 2021 22:32
Thanks Mr Bit. No rush
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 30th Jul 2021 06:55
Ok, I have looked at it.
The error was found and fixed.
However, it is now necessary to initialise FileExplore manually under AgkStudio.
Most functions work without initialisation.
But if you want to be sure, you should initialise FE.

Init example:


FIX - Some functions do not work correctly under AgkStudio. For example, GetWindowX/Y. Is fixed.
ADD - New function Init - returns 1 on successful initialisation.

( Download first post)
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 30th Jul 2021 12:07
Awesome. Thank you Mr Bit
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th Jul 2021 14:56 Edited at: 30th Jul 2021 15:10
I cant remember if its the case with FE but many of the user plugins are 32-bit only. I dont know what's involved but it would be nice to see full support for both classic & studio and 32 & 64 bit with these great plugins.

actually, ive been compiling games as 64 bit simply because "64" sounds better than "32". What do we gain (or lose) with that practice? Should i be concerned with 64 bit or stick with 32?
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
PartTimeCoder
AGK Tool Maker
8
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 30th Jul 2021 17:10
No, stick with 64 bit if you can but offer your users a 32 bit alternative, with 64 bit you have access to more RAM, most machines nowdays have 64 bit processers anyway so it should not be a problem.

I'm a luddite and only recently A. discovered the "Windows 64" option in the AppGameKit settings and B. only used PB 32 ... don't ask I don't know just so used to (oh heck not the 64 bit thing again)
Open Source plugins
Cl - DnD Plugin
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 31st Jul 2021 01:56 Edited at: 31st Jul 2021 03:23
Would it be possible to expose the regular expression functions to search strings?
Would it also be possible to get the date selector dialog?
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 2nd Aug 2021 05:26 Edited at: 2nd Aug 2021 05:35
Since the UPDATE 03-07-2019 a date-time-picker dialog should be available.

I'm still thinking about the regular expression. I have too much to do right now to add new things.

EDIT:
I will see if I can find time for it
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Aug 2021 20:36
Matey that is perfectly ok. Take as long as you want and if you don't want to do it that's fine as well.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 3rd Aug 2021 21:53 Edited at: 3rd Aug 2021 21:55
So far so good.
I am now launching 5 more functions here.

RegExMatch(String str, String regex)
Compares the text (str) with the regular expression (regex). If it matches, 1 is returned, otherwise 0.

RegExSearch(String str, String regex)
Searches the text (str) for regex and returns all found words in a JSON string array.

RegExSearchPosition(String str, String regex)
The same as before, but in this case it returns the position and length of the strings found in a JSON array.
All values are zero based.


RegExReplace(String str, String regex, String replace)
All occurrences of the regex in the string str are replaced with replace.

RegExReplace(String str, String regex, String replace, Integer start, Integer end)
Like the previous function, but here you can specify a range within the text that will be searched and replaced.
If start < 0, the beginning of the text is automatically set.
If end < 0, the end of the text is automatically set.
Both values are zero based.


I hope the functions are sufficient and the description is somewhat understandable.
(Download first post)
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Aug 2021 22:16
You are a champion. Awesome awesome stuff! Thank you very much matey!!
JoeOh45240
7
Years of Service
User Offline
Joined: 14th Feb 2017
Location: USA
Posted: 25th Sep 2021 06:51
I have AppGameKit tier 1 trial...I put the plugin files in the "\The Game Creators\AGK2Trial\Tier 1\Compiler\Plugins" folder, I made sure in the preferences the use plugins option was checked. I made sure the program was restarted. What step have I missed to get this plugin working?
CODE HARD STUDIOS YOUTUBE CHANNEL: [video] channel/UCT6j3UphfDRcpJ0S444rnFA[/video]
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 25th Sep 2021 09:12
For that I would need to know what exactly is not working. Any error message?

By the way, activating the plugins in the preferences only applies to the geany editor plugins.

In the code you load a plugin with #import_plugin <foldername of the plugin> at the beginning of the code. (Without the <>
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
JoeOh45240
7
Years of Service
User Offline
Joined: 14th Feb 2017
Location: USA
Posted: 25th Sep 2021 20:34
I tried that #import_plugin code and it doesn't work or even recognized by the editor/compiler.
CODE HARD STUDIOS YOUTUBE CHANNEL: [video] channel/UCT6j3UphfDRcpJ0S444rnFA[/video]
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 25th Sep 2021 21:07
Please give a code snippet of how you use the plugin and check if you copied the files to the right place.

It should look something like this.
"The Game Creators\AGK2Trial\Tier 1\Compiler\Plugins\FileExplore"
this is where these files should be.
Commands.txt
Windows.dll
Windows64.dll
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
JoeOh45240
7
Years of Service
User Offline
Joined: 14th Feb 2017
Location: USA
Posted: 25th Sep 2021 21:47 Edited at: 25th Sep 2021 21:47


Here is a pic of where the files for FileExplorer are. I restarted AppGameKit, still no dice
CODE HARD STUDIOS YOUTUBE CHANNEL: [video] channel/UCT6j3UphfDRcpJ0S444rnFA[/video]

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Sep 2021 00:21
I would say it isn't working because it is a trial version
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Sep 2021 01:49
Quote: "I would say it isn't working because it is a trial version"

yes!
[My Itch.io Home] [AGK on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 27th Sep 2021 05:02 Edited at: 27th Sep 2021 05:04
The following code should display a file selection box and display the selected files.
If it does not work, then it will be as Virtual Nomad and blink0k have already explained that plugins do not work with the trial version.

The files are in any case in the right place.

Code:
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Sep 2021 05:19 Edited at: 27th Sep 2021 05:19
if all else fails you could try ChooseRawFile()
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 28th Sep 2021 00:25
Quote: "you could try ChooseRawFile()"

except it copies said file into your write folder (unless that's what you want).
could always delete the copy but that's not a proper work around. the command should have the OPTION to copy it.
[My Itch.io Home] [AGK on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Sep 2021 03:47
Quote: "except it copies said file into your write folder "

Optionally
Quote: "
string ChooseRawFile( ext, returnFullPath )
ext - The extensions to allow
returnFullPath - 1 to return the full path, 0 to copy it to the write folder and return the write folder path
"
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 28th Sep 2021 05:56
ack!
[My Itch.io Home] [AGK on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 19th Nov 2021 04:55
hey, MadBit.

i know you're busy but can i get a working example of returning a folder path via FileExplore.ChooseFolderDialog() ?

i can't figure out the parameters which show: FileExplore.ChooseFolderDialog(Title$, Filter$, MultiSelect) syntax.

and,

FileExplore.ChooseFolderDialog("Choose Folder", " " , 0)

errors with "choosefolderdialog" does not accept the parameters (String, String, Integer)

not sure what the Filter param might be but any guidance is appreciated!

PartTimeCoder
AGK Tool Maker
8
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 19th Nov 2021 05:14
Folder dialog does not support filters, that should probably read "DefaultPath", and drop the last param, Folder dialog also does not support multiselect





Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 19th Nov 2021 05:53
@PTC, ok, that calls the dialog but if i...

WriteDIR$ = FileExplore.ChooseFolderDialog("Choose Folder",WriteDIR$)

...it lanches a small browser but doesn't change the title and doesn't go to WriteDIR$

it does set WriteDIR$ to wherever i browse, tho. so, it'll work.

otherwise, maybe i have some old tag files or something re: those params.

...moving Forward, now (just not as far as i wanted to). alas, i'll take it.

THANKS!
PartTimeCoder
AGK Tool Maker
8
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 19th Nov 2021 06:05
Title = info text, the message displayed above the folder tree. works here

and its the trailing slash, the return path does not contain one but the default path requires one





Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 20th Nov 2021 06:50
Quote: "i can't figure out the parameters which show: FileExplore.ChooseFolderDialog(Title$, Filter$, MultiSelect) syntax.
"

Maah that's my fault. It is a typo in the tag definition file.
The correct parameters should be ChooseFolderDialog(Title$, InitPath$)
The title is also more of a message that appears below the title.
Sorry is a bit misleading.



Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 20th Nov 2021 16:34 Edited at: 20th Nov 2021 16:36
ok, and choosing much more than 20 files at once in the file dialog seems bugged or i'm doing something wrong?

i'm writing a batch image scaler and loading the images thusly:

tokens 0 and 1 are odd. isn't 0 the path? then, 1? i have to get at 2 to start feeding images.

then, if Num > ~22, nothing gets loaded and the path at 1 is a single (seemingly random) character. some of the animation files i want to convert have over 70 frames.

then, the choose folder dialog is tiny and un-scalable? ie, can't resize?

still learning, here
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 20th Nov 2021 17:39
Quote: "ok, and choosing much more than 20 files at once in the file dialog seems bugged or i'm doing something wrong? "

The problem will be that the string that is returned can only be a maximum of 780 characters long. (MAX_PATH * 3)
I can still change this but only after the TD competition.

Quote: "tokens 0 and 1 are odd. isn't 0 the path? then, 1? i have to get at 2 to start feeding images."

Since AGK-Basic starts counting with 1 and not with 0, 1 is the path when you use GetStringToken. The rest that comes after that would be the files.

Quote: "then, the choose folder dialog is tiny and un-scalable? ie, can't resize?"

It is the standard Windows BrowseFolder dialogue. I don't think you can resize it.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 20th Nov 2021 17:55 Edited at: 20th Nov 2021 18:21
Quote: "I can still change this but only after the TD competition."

understood it's not much of an inconvenience to limit to the "20 files at a time" in the meantime. i'll (try to) code in a limit "780 characters" for now.

thanks again, madbit!
PartTimeCoder
AGK Tool Maker
8
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 21st Nov 2021 08:31 Edited at: 21st Nov 2021 08:41
Quote: "can only be a maximum of 780 characters long. (MAX_PATH * 3)"


for my plugins I use an internal linked list and allocate the memory dynamically for each path with agk::CreateString, see my CL plugin

Quote: " I don't think you can resize it."


ulFlags parameter of BROWSEINFO structure allows you to BIF_NEWDIALOGSTYLE which will allow resize and add "New Folder" button

Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 10th Feb 2022 02:10 Edited at: 10th Feb 2022 02:11
wrote: "The problem will be that the string that is returned can only be a maximum of 780 characters long. (MAX_PATH * 3).
I can still change this but only after the TD competition. "

...and then the deadline was extended and i almost forgot about this

no rush. just hopefully before the next comp
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 10th Feb 2022 19:53
Yes, I will take care of it. Thank you for reminding me.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 13th Feb 2022 20:47
Ok,
here's the problem. If I do it the way PTC suggested. So if I use the flag BIF_NEWDIALOGSTYLE or BIF_USENEWUI. The plugin crashes and terminates the programme. I don't know what the problem is, it should work.
The good news is that I have found a solution. By using the IFileDialog interface instead of SHBrowseForFolder. Then we have the typical new and fancy design of Windows.
The catch is. It is only compatible with Windows Vista and newer.
The question is how important is Win-XP support to you? Does anyone still use XP at all?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Feb 2022 21:41
I would have 2 versions
1) The current one (Which won't be updated again) for XP
2) The new version which will be updated but is not compatible with XP
So have two downloads in the first post
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 15th Feb 2022 01:05
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 15th Feb 2022 08:53
OK!
Then - " This is the Way "
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Feb 2022 16:44
I have now uploaded the new version in the first post.

As you suggested, the old version is still available.

So download the right one
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
kazuki
5
Years of Service
User Offline
Joined: 8th Feb 2019
Location: Japan
Posted: 31st Mar 2022 15:41
Hi MadBit

Can I implement PrintCMD()?
This function prints text to cmd.exe.

Alternatively, you can use PrintNotePad().
It may be easier to use notepad.exe, which can output in utf-8 format, considering the encoding of Windows terminals.

This is useful for monitoring whether the game is working as intended.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 3rd Apr 2022 12:37
Hi,
I had already thought about integrating some console and logging functions.
I will think about it.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
kazuki
5
Years of Service
User Offline
Joined: 8th Feb 2019
Location: Japan
Posted: 3rd Apr 2022 18:27
Madbit, thanks for the reply.

This feature would be very helpful when checking events while actually operating the game.

I look forward to seeing it implemented.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 5th Apr 2022 21:34
Quote: "Can I implement PrintCMD()?
This function prints text to cmd.exe."

I forgot that I have already implemented a similar function.
You first have to open a console (OpenConsole).
Then you can output text to the console with ConsoleWrite.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
kazuki
5
Years of Service
User Offline
Joined: 8th Feb 2019
Location: Japan
Posted: 6th Apr 2022 12:42 Edited at: 6th Apr 2022 12:43

---------------------------------------------------
I didn't realize that the function was already provided.
Thank you very much.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 16th Apr 2022 16:41 Edited at: 16th Apr 2022 17:53
i must be dense but i don't see RenameFile/Folder() ? i want to batch Lower() selected/all files in a given directory.

we don't have it in the native File commands.

ACK! FileExplore.ChooseFolderDialog is now crashing with the new version
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Apr 2022 22:47
Quote: "i must be dense but i don't see RenameFile/Folder() ? i want to batch Lower() selected/all files in a given directory."

This is because the command is not called what you expect it to be. You should reach your goal with FileMove/FolderMove
You can use it to move or rename files or folders.

Quote: "ACK! FileExplore.ChooseFolderDialog is now crashing with the new version "

The ChooseFolder command works for me. What exactly happens (how does it crash)?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 31st Aug 2022 18:59
MB wrote: "The ChooseFolder command works for me. What exactly happens (how does it crash)?"

sorry for the delayed response. revisiting the project and rediscovering/experiencing the issue, i had been calling it thusly:

...for some reason. removing the "raw:" and i'm back in business
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 1st Sep 2022 20:36
I am glad that it works after all.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 1st Sep 2022 22:19 Edited at: 1st Sep 2022 22:23
btw, i'll be reporting another issue once i test it more.

using any dialog while the app is maximized doesnt set the dialog to the front.

having to SetWindowAllowResize( 0 ) (and fearing some wont be able to accomodate 1280,720) for now until i investigate more...
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 2nd Sep 2022 06:18 Edited at: 2nd Sep 2022 06:31
[Request] Windows System Sounds

at least some of the MessageBox or Dialog stuff is without accompanying Windows system sounds.

short of adding them to play automatically**, can we get PlaySystemSound(sound) functionality somehow?

i'm unsure of the terminology but THIS is along the lines of what i'm looking for:
  • Beep
  • Exclamation
  • Question


...while WIN 10 shows:
  • "Windows Background.wav"
  • "Windows Foreground.wav"
  • "Device Hardware Insert"
  • etc

...for various Program Events in Control Panel/Change System Sounds; you get the idea.

right now i'd be happy with the standard windows Beep!

** i dont mind if certain things play appropriate sounds automatically but since we can customize some of the stuff, i'd like to decide when/if a given sound gets played, so...
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 2nd Sep 2022 15:07
I think something can be done
I hope it is not too urgent.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Login to post a reply

Server time is: 2024-02-25 11:36:06
Your offset time is: 2024-02-25 11:36:06