resolving review comments
This commit is contained in:
parent
e76cb430ff
commit
751be191e8
@ -238,12 +238,12 @@ function canTouchChaosTokens()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- called by playermats (by the "Draw chaos token" button)
|
-- called by playermats (by the "Draw chaos token" button)
|
||||||
function drawChaosToken(param)
|
function drawChaosToken(params)
|
||||||
if not canTouchChaosTokens() then return end
|
if not canTouchChaosTokens() then return end
|
||||||
|
|
||||||
local mat = param[1]
|
local mat = params[1]
|
||||||
local tokenOffset = param[2]
|
local tokenOffset = params[2]
|
||||||
local isRightClick = param[3]
|
local isRightClick = params[3]
|
||||||
chaosbag = findChaosBag()
|
chaosbag = findChaosBag()
|
||||||
|
|
||||||
-- return token(s) on other playmat first
|
-- return token(s) on other playmat first
|
||||||
@ -289,9 +289,9 @@ end
|
|||||||
|
|
||||||
-- DEPRECATED. Use TokenManager instead.
|
-- DEPRECATED. Use TokenManager instead.
|
||||||
-- Spawns a single token.
|
-- Spawns a single token.
|
||||||
---@param param Table. Array with arguments to the method. 1 = position, 2 = type, 3 = rotation
|
---@param params Table. Array with arguments to the method. 1 = position, 2 = type, 3 = rotation
|
||||||
function spawnToken(param)
|
function spawnToken(params)
|
||||||
return tokenManager.spawnToken(param[1], param[2], param[3])
|
return tokenManager.spawnToken(params[1], params[2], params[3])
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
@ -687,15 +687,14 @@ end
|
|||||||
|
|
||||||
-- the download button on the placeholder objects calls this to directly initiate a download
|
-- the download button on the placeholder objects calls this to directly initiate a download
|
||||||
---@param param Table contains url and guid of replacement object
|
---@param param Table contains url and guid of replacement object
|
||||||
function placeholder_download(param)
|
function placeholder_download(params)
|
||||||
local url = SOURCE_REPO .. '/' .. param.url
|
local url = SOURCE_REPO .. '/' .. params.url
|
||||||
requestObj = WebRequest.get(url, function (request) contentDownloadCallback(request, param) end)
|
requestObj = WebRequest.get(url, function (request) contentDownloadCallback(request, params) end)
|
||||||
startLuaCoroutine(Global, 'downloadCoroutine')
|
startLuaCoroutine(Global, 'downloadCoroutine')
|
||||||
end
|
end
|
||||||
|
|
||||||
function downloadCoroutine()
|
function downloadCoroutine()
|
||||||
-- show progress bar
|
-- show progress bar
|
||||||
UI.setAttribute('download_button', 'active', false)
|
|
||||||
UI.setAttribute('download_progress', 'active', true)
|
UI.setAttribute('download_progress', 'active', true)
|
||||||
|
|
||||||
-- update progress bar
|
-- update progress bar
|
||||||
@ -711,7 +710,6 @@ function downloadCoroutine()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- hide progress bar
|
-- hide progress bar
|
||||||
UI.setAttribute('download_button', 'active', true)
|
|
||||||
UI.setAttribute('download_progress', 'active', false)
|
UI.setAttribute('download_progress', 'active', false)
|
||||||
|
|
||||||
-- hide download window
|
-- hide download window
|
||||||
@ -732,7 +730,8 @@ function onClick_toggleUi(player, title)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if xmlVisibility[title] then
|
if xmlVisibility[title] then
|
||||||
UI.hide(title)
|
-- small delay to allow button click sounds to play
|
||||||
|
Wait.time(function() UI.hide(title) end, 0.1)
|
||||||
else
|
else
|
||||||
UI.show(title)
|
UI.show(title)
|
||||||
end
|
end
|
||||||
@ -742,6 +741,7 @@ end
|
|||||||
-- updates the preview window
|
-- updates the preview window
|
||||||
function updatePreviewWindow()
|
function updatePreviewWindow()
|
||||||
local item = library[contentToShow][currentListItem]
|
local item = library[contentToShow][currentListItem]
|
||||||
|
local tempImage = "http://cloud-3.steamusercontent.com/ugc/2115061845788345842/2CD6ABC551555CCF58F9D0DDB7620197BA398B06/"
|
||||||
|
|
||||||
-- set default image if not defined
|
-- set default image if not defined
|
||||||
if item.boxsize == nil or item.boxsize == "" or item.boxart == nil or item.boxart == "" then
|
if item.boxsize == nil or item.boxsize == "" or item.boxart == nil or item.boxart == "" then
|
||||||
@ -750,7 +750,7 @@ function updatePreviewWindow()
|
|||||||
end
|
end
|
||||||
|
|
||||||
UI.setValue("previewTitle", item.name)
|
UI.setValue("previewTitle", item.name)
|
||||||
UI.setValue("previewAuthor", "by " .. (item.author) or "- Author not found -")
|
UI.setValue("previewAuthor", "by " .. (item.author or "- Author not found -"))
|
||||||
UI.setValue("previewDescription", item.description or "- Description not found -")
|
UI.setValue("previewDescription", item.description or "- Description not found -")
|
||||||
|
|
||||||
-- update mask according to size (hardcoded values to align image in mask)
|
-- update mask according to size (hardcoded values to align image in mask)
|
||||||
@ -778,6 +778,9 @@ function updatePreviewWindow()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- loading empty image as placeholder until real image is loaded
|
||||||
|
UI.setAttribute("previewArtImage", "image", tempImage)
|
||||||
|
|
||||||
-- insert the image itself
|
-- insert the image itself
|
||||||
UI.setAttribute("previewArtImage", "image", item.boxart)
|
UI.setAttribute("previewArtImage", "image", item.boxart)
|
||||||
UI.setAttributes("previewArtMask", maskData)
|
UI.setAttributes("previewArtMask", maskData)
|
||||||
@ -852,7 +855,7 @@ end
|
|||||||
|
|
||||||
-- called after the webrequest of downloading an item
|
-- called after the webrequest of downloading an item
|
||||||
-- deletes the placeholder and spawns the downloaded item
|
-- deletes the placeholder and spawns the downloaded item
|
||||||
function contentDownloadCallback(request, param)
|
function contentDownloadCallback(request, params)
|
||||||
requestObj = nil
|
requestObj = nil
|
||||||
|
|
||||||
-- error handling
|
-- error handling
|
||||||
@ -863,8 +866,8 @@ function contentDownloadCallback(request, param)
|
|||||||
|
|
||||||
-- initiate content spawning
|
-- initiate content spawning
|
||||||
local spawnTable = { json = request.text }
|
local spawnTable = { json = request.text }
|
||||||
if param.replace then
|
if params.replace then
|
||||||
local replacedObject = getObjectFromGUID(param.replace)
|
local replacedObject = getObjectFromGUID(params.replace)
|
||||||
if replacedObject then
|
if replacedObject then
|
||||||
spawnTable.position = replacedObject.getPosition()
|
spawnTable.position = replacedObject.getPosition()
|
||||||
spawnTable.rotation = replacedObject.getRotation()
|
spawnTable.rotation = replacedObject.getRotation()
|
||||||
@ -874,7 +877,7 @@ function contentDownloadCallback(request, param)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- if spawned from menu, ping the position
|
-- if spawned from menu, ping the position
|
||||||
if param.name then
|
if params.name then
|
||||||
spawnTable["callback_function"] = function(obj)
|
spawnTable["callback_function"] = function(obj)
|
||||||
Player.getPlayers()[1].pingTable(obj.getPosition())
|
Player.getPlayers()[1].pingTable(obj.getPosition())
|
||||||
end
|
end
|
||||||
|
@ -114,15 +114,6 @@
|
|||||||
|
|
||||||
<!-- download button / progress bar (visibility handled by lua code)-->
|
<!-- download button / progress bar (visibility handled by lua code)-->
|
||||||
<Panel preferredHeight="60">
|
<Panel preferredHeight="60">
|
||||||
<!-- download progress bar -->
|
|
||||||
<ProgressBar id="download_progress"
|
|
||||||
active="false"
|
|
||||||
height="50"
|
|
||||||
width="270"
|
|
||||||
percentage="0"
|
|
||||||
color="#111111"
|
|
||||||
textColor="#aaaaaa"
|
|
||||||
fillImageColor="#333333"/>
|
|
||||||
<!-- download button -->
|
<!-- download button -->
|
||||||
<Button id="download_button"
|
<Button id="download_button"
|
||||||
hoverClass="bGrey"
|
hoverClass="bGrey"
|
||||||
@ -134,6 +125,15 @@
|
|||||||
width="270"
|
width="270"
|
||||||
fontSize="28"
|
fontSize="28"
|
||||||
font="font_teutonic-arkham">Download</Button>
|
font="font_teutonic-arkham">Download</Button>
|
||||||
|
<!-- download progress bar -->
|
||||||
|
<ProgressBar id="download_progress"
|
||||||
|
active="false"
|
||||||
|
height="50"
|
||||||
|
width="270"
|
||||||
|
percentage="0"
|
||||||
|
color="#111111"
|
||||||
|
textColor="#aaaaaa"
|
||||||
|
fillImageColor="#333333"/>
|
||||||
</Panel>
|
</Panel>
|
||||||
</VerticalLayout>
|
</VerticalLayout>
|
||||||
</HorizontalLayout>
|
</HorizontalLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user