Compare commits

..

No commits in common. "96da67ed5006a0e087c4199172a3ce5dc0180b7c" and "ef3f0d917863c18b6f59ef5db4f0d416628c1748" have entirely different histories.

2 changed files with 68 additions and 95 deletions

View File

@ -30,16 +30,6 @@ local function createApp(app)
active = false
})
if (app.iconUrl and app.iconUrl ~= "") then
local img = teverse.construct("guiImage", {
size = guiCoord(1, 0, 1, 0),
image = app.iconUrl,
parent = appGui,
active = false,
zIndex = -1
})
end
return appGui
end
@ -74,29 +64,91 @@ return {
local subtitle = teverse.construct("guiTextBox", {
parent = page,
size = guiCoord(1.0, -20, 0, 18),
position = guiCoord(0, 10, 0, 55),
position = guiCoord(0, 10, 0, 105),
backgroundAlpha = 0,
text = "Loading Apps",
textSize = 18,
textAlign = "middleLeft"
})
local myApps = teverse.construct("guiFrame", {
parent = page,
size = guiCoord(1.0, -20, 0, 38),
position = guiCoord(0, 10, 0, 62),
backgroundAlpha = 0
})
teverse.http:get("https://teverse.com/api/users/" .. teverse.networking.localClient.id .. "/apps", {
["Authorization"] = "BEARER " .. teverse.userToken
}, function(code, body)
if code == 200 then
local apps = teverse.json:decode(body)
for i,app in pairs(apps) do
local appGui = teverse.construct("guiFrame", {
strokeRadius = 2,
dropShadowAlpha = 0.15,
strokeAlpha = 0.05,
parent = myApps,
position = guiCoord(0, (i-1)*140, 0, 0),
size = guiCoord(0, 130, 1, 0)
})
teverse.guiHelper.hoverColour(appGui, colour.rgb(247, 247, 247))
teverse.construct("guiTextBox", {
parent = appGui,
size = guiCoord(1.0, -20, 0, 16),
position = guiCoord(0, 10, 0, 5),
backgroundAlpha = 0,
text = app.name,
textSize = 18,
textAlign = "middleLeft",
textFont = "tevurl:fonts/openSansSemiBold.ttf",
active = false
})
teverse.construct("guiTextBox", {
parent = appGui,
size = guiCoord(1.0, -20, 0, 14),
position = guiCoord(0, 10, 0, 21),
backgroundAlpha = 0,
text = app.approved and "Approved" or "Pending",
textSize = 14,
textAlign = "middleLeft",
textFont = "tevurl:fonts/openSansBold.ttf",
active = false
})
appGui:on("mouseLeftUp", function()
if not loading.visible then
loading.text = "Loading App"
loading.visible = true
teverse.apps:loadRemote(app.id)
teverse.apps:waitFor("download")
loading.visible = false
end
end)
end
end
end)
local appsContainer = teverse.construct("guiFrame", {
parent = page,
size = guiCoord(1.0, -20, 1, -100),
position = guiCoord(0, 10, 0, 80),
size = guiCoord(1.0, -20, 1, -140),
position = guiCoord(0, 10, 0, 130),
backgroundAlpha = 0
})
if _DEVICE:sub(0, 6) == "iPhone" then
teverse.guiHelper
.gridConstraint(appsContainer, {
cellSize = guiCoord(0, page.absoluteSize.x - 20, 0, page.absoluteSize.x - 20),
cellSize = guiCoord(0, page.absoluteSize.x - 20, 0, 50),
cellMargin = guiCoord(0, 15, 0, 25)
})
else
teverse.guiHelper
.gridConstraint(appsContainer, {
cellSize = guiCoord(0, 200, 0, 200),
cellSize = guiCoord(0, 160, 0, 50),
cellMargin = guiCoord(0, 15, 0, 25)
})
end
@ -132,11 +184,7 @@ return {
if not loading.visible then
loading.text = "Loading App"
loading.visible = true
if not app.packageNetworked then
teverse.apps:loadRemote(app.id)
else
teverse.networking:initiate(app.id)
end
teverse.apps:loadRemote(app.id)
teverse.apps:waitFor("download")
loading.visible = false
end

View File

@ -1,37 +1,3 @@
local function createApp(app)
local appGui = teverse.construct("guiFrame", {
strokeRadius = 2,
dropShadowAlpha = 0.15,
strokeAlpha = 0.05
})
teverse.guiHelper.hoverColour(appGui, colour.rgb(247, 247, 247))
teverse.construct("guiTextBox", {
parent = appGui,
size = guiCoord(1.0, -20, 0, 22),
position = guiCoord(0, 10, 0, 5),
backgroundAlpha = 0,
text = app.name,
textSize = 22,
textAlign = "middleLeft",
textFont = "tevurl:fonts/openSansBold.ttf",
active = false
})
if (app.iconUrl and app.iconUrl ~= "") then
local img = teverse.construct("guiImage", {
size = guiCoord(1, 0, 1, 0),
image = app.iconUrl,
parent = appGui,
active = false,
zIndex = -1
})
end
return appGui
end
return {
name = "Develop",
iconId = "layer-group",
@ -124,46 +90,5 @@ return {
active = false
})
end
local appsContainer = teverse.construct("guiFrame", {
parent = page,
size = guiCoord(1.0, -20, 1, -150),
position = guiCoord(0, 10, 0, 150),
backgroundAlpha = 0
})
teverse.guiHelper
.gridConstraint(appsContainer, {
cellSize = guiCoord(0, 200, 0, 200),
cellMargin = guiCoord(0, 15, 0, 25)
})
teverse.http:get("https://teverse.com/api/users/" .. teverse.networking.localClient.id .. "/apps", {
["Authorization"] = "BEARER " .. teverse.userToken
}, function(code, body)
if code == 200 then
local apps = teverse.json:decode(body)
for _,app in pairs(apps) do
local appGui = createApp(app)
appGui.parent = appsContainer
appGui:on("mouseLeftUp", function()
if not loading.visible then
loading.text = "Loading App"
loading.visible = true
if not app.packageNetworked then
teverse.apps:loadRemote(app.id)
else
teverse.networking:initiate(app.id)
end
teverse.apps:waitFor("download")
loading.visible = false
end
end)
end
else
subtitle.text = "Server error."
end
end)
end
}