Open your operating system's file browser from Garry's Mod.

Overview

gm_fsdialog

Open your operating system's file browser from Garry's Mod.

Examples

Opening a file:

require("fsdialog")

-- prompts the user to open a lua file
file.OpenDialog({
	path = "lua",
	filters = {
		["scripts"] = "lua" -- 'scripts' is the name of the filter, "lua" is the extension that it allows
	},
	on_completed = function(path, err)
		if not path then error(err) end

		print("User picked file: " .. path)
	end,
})

Opening multiple files:

require("fsdialog")

-- prompts the user to open his pac3 files in the data folder
file.OpenDialog({
	path = "data/pac3/",
	filters = {
		["pac3"] = "txt"
	},
	on_completed = function(paths)
		print("User selected the following files:")
		PrintTable(paths)
	end,
})

Opening a folder:

require("fsdialog")

-- prompts the user to open a lua file
file.OpenDialog({
	path = "data",
	is_folder = true,
	on_completed = function(path, err)
		if not path then error(err) end

		print("User selected folder: " .. path)
	end,
})

Saving a file:

require("fsdialog")

file.OpenDialog({
	path = "lua",
	is_save = true,
	default_save_name = "my_script.lua",
	filters = {
		["scripts"] = "lua"
	},
	on_completed = function(path, err)
		if not path then error(err) end

		print("User wants to save the file at: " .. path)
	end,
})

Building / Compiling

  • Open a terminal
  • Install cargo if you dont have it (on Windows => https://win.rustup.rs) (on Linux/Macos => curl https://sh.rustup.rs -sSf | sh)
  • Get git or download the archive for the repository directly
  • git clone https://github.com/Earu/gm_fsdialog (ignore this if you've downloaded the archive)
  • Run cd gm_fsdialog
  • cargo build
  • Go in target/debug and rename the binary according to your branch and realm (gmsv_fsdialog_win64.dll, gmcl_fsdialog_win64.dll, gmsv_fsdialog_linux.dll, gmcl_fsdialog_linux.dll, gmcl_fsdialog_osx64.dll)
  • Put the binary in your gmod lua/bin directory

Note: Even on other platforms than Windows the extension of your modules need to be .dll

You might also like...
Search Confluence from Alfred and open results in your browser.

Alfred Confluence Workflow Search Confluence from Alfred and open results in your browser. Features Search Confluence from Alfred and open results in

rust-browser-game but native and rendered with ncurses in C without the Browser
rust-browser-game but native and rendered with ncurses in C without the Browser

Spin-off of rust-browser-game-but-sdl but with ncurses Nothing much to say. Just see rust-browser-game-but-sdl and rust-browser-game. Quick Start $ ma

The Bloat-Free Browser Game in Rust but in C and not in a Browser
The Bloat-Free Browser Game in Rust but in C and not in a Browser

rust-browser-game but native and rendered with SDL in C without the Browser The original idea of rust-browser-game is that the game.wasm module is com

Rslide - A web service that allows you to move through multiple html pages in the browser like a slide, even without focusing on the app console or the browser. Currently only supports Windows.

rslide rslide is a web service that allows you to move through multiple html pages in the browser like a slide, even without focusing on the app conso

A lightweight microkernel/IPC based operating system built with Rust which is not a clone of any existing operating system
A lightweight microkernel/IPC based operating system built with Rust which is not a clone of any existing operating system

Noble Operating System Noble is a lightweight microkernel and IPC based operating system built with Rust which is not a clone of any existing operatin

A comparison of operating systems written in Rust

Rust OS comparison A comparison of operating systems written in Rust. There are several open source operating systems written in Rust. Most of them ar

Hubris is a microcontroller operating environment designed for deeply-embedded systems

A lightweight, memory-protected, message-passing kernel for deeply embedded systems.

A Real Time Operating System in Rust for Cortex M3 embedded systems

A Real Time Operating System in Rust for Cortex M3 embedded systems

⚡ Garry's Mod module that boosts performance by moving -condebug file I/O to a separate thread

This is a Garry's Mod server module that moves -condebug file I/O out of the main thread, which should significantly improve performance for noisy servers.

Build SQLite virtual file systems (VFS) by implementing a simple Rust trait.

sqlite-vfs Build SQLite virtual file systems (VFS) by implementing a simple Rust trait. Documentation | Example This library is build for my own use-c

rpsc is a *nix command line tool to quickly search for file systems items matching varied criterions like permissions, extended attributes and much more.

rpsc rpsc is a *nix command line tool to quickly search for file systems items matching varied criterions like permissions, extended attributes and mu

A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.
A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.

Pup A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the return

Koofr Vault is an open-source, client-side encrypted folder for your Koofr cloud storage offering an extra layer of security for your most sensitive files.

Koofr Vault https://vault.koofr.net Koofr Vault is an open-source, client-side encrypted folder for your Koofr cloud storage offering an extra layer o

Play Onitama in your browser, compete with friends or lose to a bot

Play Onitama in your browser, compete with friends or lose to a bot

A Rust ESP stack trace decoder that can also runs in your browser thanks to WebAssembly
A Rust ESP stack trace decoder that can also runs in your browser thanks to WebAssembly

ESP Stack Trace Decoder A Rust ESP stack trace decoder that can also runs in your browser thanks to WebAssembly. It is composed of a ⌨️ Rust library,

V86 - x86 virtualization in your browser, recompiling x86 to wasm on the fly

v86 emulates an x86-compatible CPU and hardware. Machine code is translated to WebAssembly modules at runtime in order to achieve decent performance.

A git sub-command to view your git repository in the web browser
A git sub-command to view your git repository in the web browser

git-view A git sub-command to view your git repository in the web browser! About Are you also frustrated from moving your hands away from the keyboard

Configurable quick search engine shortcuts for your terminal and browser.

Quicksearch Configurable quick search engine shortcuts for your terminal and browser. Installation Run cargo install quicksearch to install Configurat

🐘 Query your Postgres Database directly from the Browser.

Postgres Browser Proxy Query your Postgres Database directly from the Browser. Video: https://youtu.be/ohr9gBPC3cE Download the latest binaries: https

Owner
Earu
Willing to learn and practice the most niche and craziest things to achieve my goals! Analyst programmer. Highly competent with the .NET and Lua stacks.
Earu
Spacedrive is an open source cross-platform file explorer, powered by a virtual distributed filesystem written in Rust.

Spacedrive A file explorer from the future. spacedrive.com » Download for macOS · Windows · Linux · iOS · watchOS · Android ~ Links will be added once

Spacedrive 16.2k Jan 7, 2023
Temporary file library for rust

tempfile A secure, cross-platform, temporary file library for Rust. In addition to creating temporary files, this library also allows users to securel

Steven Allen 782 Dec 27, 2022
Zero-details, privacy-focused in-app file system.

ZboxFS ZboxFS is a zero-details, privacy-focused in-app file system. Its goal is to help application store files securely, privately and reliably. By

Zbox 1.4k Jan 2, 2023
the file filesystem: mount semi-structured data (like JSON) as a Unix filesystem

ffs: the file filesystem ffs, the file filessytem, let's you mount semi-structured data as a fileystem---a tree structure you already know how to work

Michael Greenberg 176 Dec 31, 2022
fftp is the "Fast File Transport Protocol". It transfers files quickly between computers on a network with low overhead.

fftp fftp is the "Fast File Transport Protocol". It transfers files quickly between computers on a network with low overhead. Motivation FTP uses two

leo 4 May 12, 2022
rswatch 🔎 is simple, efficient and reliable file watcher.

rswatch File watcher rswatch is a simple, reliable and efficient file watcher, it can watch a single file or a directory and run arbitrary commands wh

Eugene 3 Sep 23, 2022
Rustronomy-fits - a Rustronomy tool for FITS file I/O

Rustronomy-fits - a Rustronomy tool for FITS file I/O Rustronomy-fits provides I/O tools for reading, writing and parsing FITS files. It is currently

Raúl 3 Dec 8, 2022
Minty is an amazingly fast file deduplication app built in rust with a rust user interface.

minty Project Minty has a new look and feel!!! Minty is an amazingly fast file deduplication app built in rust with a rust user interface. I say super

null 26 Nov 20, 2022
Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav...

Dufs (Old Name: Duf) Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav... Featur

null 2.1k Dec 31, 2022
🌲 Open the current remote repository in your browser

gitweb Some of the flags and options are subject to change in the future. Ideas are welcome. Ideas are bulletproof (V). gitweb is a command line inter

Yoann Fleury 26 Dec 17, 2022