Skip to content

Commit

Permalink
Feature: Import/Export campaign options
Browse files Browse the repository at this point in the history
  • Loading branch information
rhagelstrom committed Aug 20, 2023
1 parent 6fab860 commit 3b882c1
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extension.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<root release="3.0" version="3">
<announcement text="https://www.fantasygrounds.com/forums/showthread.php?74616-Power-Up\rPower Up v1.6 by Ryan Hagelstrom\rContribution: bmos 2022-2023\rtype: /powerup /powerupman" icon="PowerUp" font="emotefont" />
<announcement text="Power Up v1.7 by Ryan Hagelstrom\rContribution: bmos 2022-2023\rtype: /powerup /powerupman" icon="PowerUp" font="emotefont" />
<properties>
<loadorder>10</loadorder>
<name>Feature: Power Up</name>
<version>1.6</version>
<version>1.7</version>
<author>Ryan Hagelstrom</author>
<description>Show what extensions have been updated since last campaign as well as some GM module management of players</description>
</properties>
<base>
<script name="PowerUp" file="scripts/PowerUp.lua" />
<includefile source="strings/strings.xml" />
<includefile source="graphics/graphics.xml" />
<includefile source="utility/utility_options.xml" />
</base>
</root>
2 changes: 2 additions & 0 deletions strings/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
<string name="option_label_PU_AUTO_RUN">Chat: Post new extension versions on load</string>
<string name="option_label_PU_NO_EXTRA">Modules: Client only load GM player modules</string>
<string name="option_label_PU_FORCE_LOAD">Modules: Client force load GM player modules</string>
<string name="options_label_PU_import">Import Options</string>
<string name="options_label_PU_export">Export Options</string>
</root>
51 changes: 51 additions & 0 deletions utility/utility_options.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<windowclass name="options" merge="join">
<sheetdata>
<buttoncontrol name="options_import">
<anchored to="title" position="righthigh" offset="70,25" width="20" height="20" />
<icon normal="button_import" pressed="button_import_down" />
<tooltip textres="options_label_PU_import" />
<script>
function onInit()
if not Session.IsHost then
setVisible(false);
end
end

function onButtonPress()
local dialogOpen = Interface.dialogFileOpen(onFileSelection, { xml = "XML Files" });
end

function onFileSelection(result, path)
if result == "ok" then
DB.import(path, "options");
end
end
</script>
</buttoncontrol>
<buttoncontrol name="options_export">
<anchored to="options_import" position="righthigh" offset="5,0" width="20" height="20" />
<icon normal="button_export" pressed="button_export_down" />
<tooltip textres="options_label_PU_export" />
<script>
function onInit()
if not Session.IsHost then
setVisible(false);
end
end

function onButtonPress()
local dialogOpen = Interface.dialogFileSave(onFileSelection, { xml = "XML Files" });
end

function onFileSelection(result, path)
if result == "ok" then
DB.export(path, "options");
end
end
</script>
</buttoncontrol>
</sheetdata>
</windowclass>
</root>

0 comments on commit 3b882c1

Please sign in to comment.