Merge pull request #135 from argonui/optionpanel

Option Panel: Adding more fan-made accessories
This commit is contained in:
Chr1Z 2023-01-03 22:03:03 +01:00 committed by GitHub
commit 274a702fcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 97 additions and 17 deletions

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState": "{\"Bless\":8,\"Curse\":0}",
"LuaScriptState": "",
"LuaScript_path": "Fan-MadeAccessories.aa8b38/ChaosBagManager.023240.ttslua",
"MeasureMovement": false,
"Name": "Custom_Token",
@ -48,9 +48,9 @@
"posX": 22.215,
"posY": 5.651,
"posZ": -34.811,
"rotX": 4,
"rotX": 0,
"rotY": 270,
"rotZ": 357,
"rotZ": 0,
"scaleX": 2.5,
"scaleY": 1,
"scaleZ": 2.5

View File

@ -1 +1 @@
{"optionPanel":{"showChaosBagManager":false,"showCleanUpHelper":false,"showDrawButton":false,"showHandHelper":[],"showNavigationOverlay":false,"showTokenArranger":false,"useClueClickers":false,"useSnapTags":true,"showTitleSplash":true}}
{"optionPanel":{"showAttachmentHelper":false,"showChaosBagManager":false,"showCleanUpHelper":false,"useClueClickers":false,"showCustomPlaymatImages":false,"showCYOA":false,"showDisplacementTool":false,"showDrawButton":false,"showHandHelper":[],"showNavigationOverlay":false,"useSnapTags":true,"showTitleSplash":true,"showTokenArranger":false}}

View File

@ -845,9 +845,25 @@ function applyOptionPanelChange(id, state)
elseif id == "showChaosBagManager" then
optionPanel[id] = spawnOrRemoveHelper(state, "Chaos Bag Manager", {-67.8, 1.4, -49.5})
-- option: Show attachment helper
elseif id == "showAttachmentHelper" then
optionPanel[id] = spawnOrRemoveHelper(state, "Attachment Helper", {-64, 1.4, 0})
-- option: Show navigation overlay
elseif id == "showNavigationOverlay" then
optionPanel[id] = spawnOrRemoveHelper(state, "jaqenZann's Navigation Overlay", {-11.7, 1.4, -15})
-- option: Show CYOA campaign guides
elseif id == "showCYOA" then
optionPanel[id] = spawnOrRemoveHelper(state, "CYOA Campaign Guides", {21.2, 1.4, -65.7})
-- option: Show custom playmat images
elseif id == "showCustomPlaymatImages" then
optionPanel[id] = spawnOrRemoveHelper(state, "Custom Playmat Images", {12, 1.4, -46.5})
-- option: Show displacement tool
elseif id == "showDisplacementTool" then
optionPanel[id] = spawnOrRemoveHelper(state, "Displacement Tool", {-60.7, 1.4, -49.5})
end
end
@ -856,8 +872,8 @@ end
---@param name String Name of the helper object
---@param position Vector Position of the object (where it will spawn)
---@param rotation Vector Rotation of the object for spawning (default: {0, 270, 0})
---@param color Color This is only needed for correctly setting the color of the "Hand Helper"
-- returns the GUID of the spawnedObj (or nil if object was removed)
---@param color String This is only needed for correctly setting the color of the "Hand Helper"
---@return. GUID of the spawnedObj (or nil if object was removed)
function spawnOrRemoveHelper(state, name, position, rotation, color)
if state then
Player.getPlayers()[1].pingTable(position)
@ -869,7 +885,7 @@ end
-- copies the specified tool (by name) from the barrel
---@param name String Name of the object that should be copied
---@param position Position Desired position of the object
---@param position Table Desired position of the object
function spawnHelperObject(name, position, rotation, color)
local barrel = getObjectFromGUID(BARREL_GUID)
@ -912,7 +928,11 @@ function removeHelperObject(name)
["Clean Up Helper"] = "showCleanUpHelper",
["Hand Helper"] = "showHandHelper",
["Chaos Bag Manager"] = "showChaosBagManager",
["jaqenZann's Navigation Overlay"] = "showNavigationOverlay"
["jaqenZann's Navigation Overlay"] = "showNavigationOverlay",
["Displacement Tool"] = "showDisplacementTool",
["Custom Playmat Images"] = "showCustomPlaymatImages",
["Attachment Helper"] = "showAttachmentHelper",
["CYOA Campaign Guides"] = "showCYOA"
}
local data = optionPanel[referenceTable[name]]
@ -944,15 +964,19 @@ function onClick_defaultSettings()
-- clean reset of variable
optionPanel = {
useSnapTags = true,
showAttachmentHelper = false,
showCleanUpHelper = false,
showChaosBagManager = false,
showCustomPlaymatImages = false,
showCYOA = false,
showDisplacementTool = false,
showDrawButton = false,
useClueClickers = false,
showHandHelper = {},
showNavigationOverlay = false,
showTitleSplash = true,
showTokenArranger = false,
showCleanUpHelper = false,
showHandHelper = {},
showChaosBagManager = false,
showNavigationOverlay = false
useClueClickers = false,
useSnapTags = true
}
-- update UI

View File

@ -36,7 +36,7 @@
<!-- options -->
<Row class="option-text"
preferredHeight="85"/>
preferredHeight="70"/>
<Cell class="option-text"
color="#333333"/>
<Cell class="option-button"
@ -105,7 +105,7 @@
<Cell class="option-text">
<VerticalLayout class="text-column">
<Text class="option-header">Enable snap tags</Text>
<Text class="description">Only cards with the tag "Asset" will snap (official cards are supported by default).&#xA;Disable this if you are having issues with custom content.</Text>
<Text class="description">Only cards with the tag "Asset" will snap (official cards are supported by default). Disable this if you are having issues with custom content.</Text>
</VerticalLayout>
</Cell>
<Cell class="option-button">
@ -199,7 +199,7 @@
<Cell class="option-text">
<VerticalLayout class="text-column">
<Text class="option-header">Hand Helper</Text>
<Text class="description">Never count your hand cards again! This tool does that for you and can even take "Dream-Enhancing Serum" into account. Also includes a button for randomly discard a card.</Text>
<Text class="description">Never count your hand cards again! This tool does that for you and additionally enables easy discarding of random cards.</Text>
</VerticalLayout>
</Cell>
<Cell class="option-button">
@ -222,6 +222,20 @@
</Cell>
</Row>
<!-- Option: show attachment helper -->
<Row class="option-text">
<Cell class="option-text">
<VerticalLayout class="text-column">
<Text class="option-header">Attachment Helper</Text>
<Text class="description">Provides a card-sized bag for cards that are attached to other cards (e.g. Backpack).</Text>
</VerticalLayout>
</Cell>
<Cell class="option-button">
<Toggle id="showAttachmentHelper"
onValueChanged="onClick_toggleOption(showAttachmentHelper)"/>
</Cell>
</Row>
<!-- Option: show navigation overlay -->
<Row class="option-text">
<Cell class="option-text">
@ -235,6 +249,48 @@
onValueChanged="onClick_toggleOption(showNavigationOverlay)"/>
</Cell>
</Row>
<!-- Option: show CYOA campaign guides -->
<Row class="option-text">
<Cell class="option-text">
<VerticalLayout class="text-column">
<Text class="option-header">CYOA Campaign Guides</Text>
<Text class="description">Displays in a "Choose Your Own Adventure" style redesigned campaign guides.</Text>
</VerticalLayout>
</Cell>
<Cell class="option-button">
<Toggle id="showCYOA"
onValueChanged="onClick_toggleOption(showCYOA)"/>
</Cell>
</Row>
<!-- Option: show custom playmat images -->
<Row class="option-text">
<Cell class="option-text">
<VerticalLayout class="text-column">
<Text class="option-header">Custom Playmat Images</Text>
<Text class="description">Places a tool that displays custom playmat images for all cycles in a gallery-like fashion.</Text>
</VerticalLayout>
</Cell>
<Cell class="option-button">
<Toggle id="showCustomPlaymatImages"
onValueChanged="onClick_toggleOption(showCustomPlaymatImages)"/>
</Cell>
</Row>
<!-- Option: show displacement tool -->
<Row class="option-text">
<Cell class="option-text">
<VerticalLayout class="text-column">
<Text class="option-header">Displacement Tool</Text>
<Text class="description">This allows moving all objects on the main playmat in a chosen direction.</Text>
</VerticalLayout>
</Cell>
<Cell class="option-button">
<Toggle id="showDisplacementTool"
onValueChanged="onClick_toggleOption(showDisplacementTool)"/>
</Cell>
</Row>
</TableLayout>
</VerticalScrollView>
</Cell>