Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the FlightLog (WIP) #5636

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fa00843
Fix separator to be a windows one for the user data folder
JonBooth78 Sep 22, 2023
003f19b
Allow Lua scripts to create folders and do io io operations in the us…
JonBooth78 Sep 22, 2023
8ef9835
Add an export tab to the lightlog, allowing users to write out variou…
JonBooth78 Sep 22, 2023
db9f474
Now able to write player logs in basic html
JonBooth78 Sep 22, 2023
252a783
Push some table-oriented views into the FlightLog generic system
JonBooth78 Sep 23, 2023
2dc351d
Push some table-oriented views into the FlightLog generic system
JonBooth78 Sep 23, 2023
d269d5b
Move classes to use Pioneer lua utils class definitions
JonBooth78 Oct 3, 2023
28410fc
Move more of the flight log code into the base module. Now only one …
JonBooth78 Oct 4, 2023
2d516c3
More flight log changes - remove the tabs and allow the user to filte…
JonBooth78 Oct 5, 2023
ae8986e
Don't add a docking flight log when the player starts the game in a s…
JonBooth78 Oct 5, 2023
5827a70
Move FlightLog.lua to moduels/FlightLog/FlightLog
JonBooth78 Oct 6, 2023
b7d6fd4
Start split
JonBooth78 Oct 6, 2023
52d9c9f
temp move
JonBooth78 Oct 6, 2023
62a2232
Merge commit 'b7d6fd4c1bf3591a0b1af5d0dddb60cc62d960fb' into update-t…
Oct 6, 2023
43a12a6
Move the temp back, preserving history on both
JonBooth78 Oct 6, 2023
5782fb4
Split FlightLog into FlightLog and FlightLogEntries
JonBooth78 Oct 6, 2023
786928a
use table.insert to add to the end of a table
JonBooth78 Oct 6, 2023
334718b
Split flightlog export functionality from the gui code and move it to…
JonBooth78 Oct 6, 2023
fd4917d
Missing file from last commit.
JonBooth78 Oct 7, 2023
3046469
Creation of a FileSystem.Open() method that takes the root filesystem…
JonBooth78 Oct 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions data/libs/FileSystem.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---@class FileSystem : FileSystemBase
local FileSystem = package.core["FileSystem"]

--- Wrapper for our patched io.open that ensures files are opened inside the sandbox.
--- Prefer using this to io.open
---
--- Files in the user folder can be read or written to
--- Files in the data folder are read only.
---
---
---
--- Example:
--- > f = FileSystem.Open( "USER", "my_file.txt", "w" )
--- > f:write( "file contents" )
--- > f:close()
---
---@param root string A FileSystemRoot constant. Can be either "DATA" or "USER"
---@param filename string The name of the file to open, relative to the root
---@param mode string|nil The mode to open the file in, defaults to read only
---@return file A lua io file
function FileSystem.Open( root, filename, mode )
if not mode then mode = "r" end

return io.open( filename, mode, root )
end

return FileSystem
Loading
Loading