Added Perf-Info button to Dump a system to systemeditor compatible JSON#5888
Conversation
|
I apologise for the terrible grammar / phrasing above, it's the weekend, clearly my brains know that! 😆 |
|
Welcome back! I assume it then deprecates the code snippet I have on my local copy for adding system export (to lua!) from debug screen (adds a "system" tab with an export button) -- Copyright © 2008-2024 Pioneer Developers. See AUTHORS.txt for details
-- Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
local Game = require 'Game'
local ui = require 'pigui'
local debugView = require 'pigui.views.debug'
local Lang = require 'Lang'
local l = Lang.GetResource("ui-core")
debugView.registerTab("System-debug", function()
if Game.player == nil then return end
if not ui.beginTabItem("System") then return end
if ui.button("Export system", Vector2(100, 0)) then
Game.system:ExportToLua()
end
end)
|
|
Different results but the same idea, one is to Lua the other to JSON 🤷 |
|
I completely forgot I originally added the button to the perf info window, or I'd have updated it myself - thanks, this will be useful. The original plan was for the system editor to have an embedded sector map and be able to visually pick systems to edit, but this way means you don't have to load the editor and remember the system you wanted to edit. I'll take a look at the |
Whilst debugging #5885 and #5830 today I wanted a quick way of getting a dumped system into the system editor so I've added a 2nd button to the Perf-Info screen which already allowed dumping the JSON to the output log.
Instead it now generates a JSON file which can be directly loaded into the system editor for viewing / modification and outputs it into the users pioneer directory where screenshots, savefiles, etc folders are located.
This should also make it easier for people to create custom systems based on generated ones they've found interesting to make that process a little easier.