Added support for ID searching
This commit is contained in:
parent
3bbece0d06
commit
6f87e9c1e8
@ -33,7 +33,7 @@
|
|||||||
"IgnoreFoW": false,
|
"IgnoreFoW": false,
|
||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": true,
|
"Locked": true,
|
||||||
"LuaScript": "require(\"playercards/CardSearch\")",
|
"LuaScript": "require(\"playercards/Search-A-Card\")",
|
||||||
"LuaScriptState": "[true,false,\"\"]",
|
"LuaScriptState": "[true,false,\"\"]",
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
"Name": "Custom_Tile",
|
"Name": "Custom_Tile",
|
||||||
@ -48,9 +48,9 @@
|
|||||||
"rotX": 0,
|
"rotX": 0,
|
||||||
"rotY": 270,
|
"rotY": 270,
|
||||||
"rotZ": 0,
|
"rotZ": 0,
|
||||||
"scaleX": 4,
|
"scaleX": 4.5,
|
||||||
"scaleY": 1,
|
"scaleY": 1,
|
||||||
"scaleZ": 4
|
"scaleZ": 4.5
|
||||||
},
|
},
|
||||||
"Value": 0,
|
"Value": 0,
|
||||||
"XmlUI": ""
|
"XmlUI": ""
|
||||||
|
@ -11,15 +11,15 @@ BUTTON_LABELS["search"][true] = "Name equals search term"
|
|||||||
BUTTON_LABELS["search"][false] = "Name contains search term"
|
BUTTON_LABELS["search"][false] = "Name contains search term"
|
||||||
|
|
||||||
local inputParameters = {}
|
local inputParameters = {}
|
||||||
inputParameters.label = "Click to enter card name"
|
inputParameters.label = "Enter name / ID"
|
||||||
inputParameters.input_function = "input_func"
|
inputParameters.input_function = "input_func"
|
||||||
inputParameters.function_owner = self
|
inputParameters.function_owner = self
|
||||||
inputParameters.alignment = 2
|
inputParameters.alignment = 2
|
||||||
inputParameters.position = { x = 0, y = 0.1, z = -0.62 }
|
inputParameters.position = { x = 0, y = 0.1, z = -0.6 }
|
||||||
inputParameters.width = 3750
|
inputParameters.width = 3500
|
||||||
inputParameters.height = 380
|
inputParameters.height = 450
|
||||||
inputParameters.font_size = 350
|
inputParameters.font_size = 400
|
||||||
inputParameters.scale = { 0.1, 1, 0.1 }
|
inputParameters.scale = { 0.12, 1, 0.12 }
|
||||||
inputParameters.color = { 0.9, 0.7, 0.5 }
|
inputParameters.color = { 0.9, 0.7, 0.5 }
|
||||||
inputParameters.font_color = { 0, 0, 0 }
|
inputParameters.font_color = { 0, 0, 0 }
|
||||||
|
|
||||||
@ -103,11 +103,13 @@ function startSearch()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- if the search string is a number, assume it's an ID and spawn the card directly
|
-- if the search string doesn't contain whitespace, attempt to treat it as ID
|
||||||
if tonumber(inputParameters.value) then
|
if not string.find(inputParameters.value, "%s") then
|
||||||
local singleCard = allCardsBagApi.getCardById(inputParameters.value)
|
local singleCard = allCardsBagApi.getCardById(inputParameters.value)
|
||||||
spawnCardList({ singleCard })
|
if singleCard ~= nil then
|
||||||
return
|
spawnCardList({ singleCard })
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- search all objects in bag
|
-- search all objects in bag
|
Loading…
x
Reference in New Issue
Block a user