Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy load userpanel #1407

Merged
merged 8 commits into from
Mar 1, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions MainModule/Client/UI/Default/UserPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,7 @@ return function(data, env)
end

if window then
local playerData = Remote.Get("PlayerData")
local chatMod = Remote.Get("Setting",{"Prefix","SpecialPrefix","BatchKey","AnyPrefix","DonorCommands","DonorCapes"})
local settingsData = Remote.Get("AllSettings")

Variables.Aliases = playerData.Aliases or {}

local commandPrefix = ":"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woah woah woah whats this. what about when the prefix isn't :

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened to chatMod??????? GRRRRRRR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who knows

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or you can just
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly

local tabFrame = window:Add("TabFrame", {
Size = UDim2.new(1, -10, 1, -10);
Position = UDim2.new(0, 5, 0, 5);
Expand Down Expand Up @@ -364,7 +359,7 @@ return function(data, env)
BackgroundTransparency = 0.5;
Events = {
MouseButton1Down = function()
Remote.Send("ProcessCommand", `{chatMod.Prefix}cmds`)
Remote.Send("ProcessCommand", `{commandPrefix}cmds`)
end
}
})
Expand Down Expand Up @@ -434,13 +429,36 @@ return function(data, env)

end

local LOAD_TEXT = {
BackgroundTransparency = 1;
Size = UDim2.new(1, 0, 1, 0);
Text = "Loading...";
TextScaled = true;
TextColor3 = Color3.new(1, 1, 1);
TextXAlignment = Enum.TextXAlignment.Center;
TextYAlignment = Enum.TextYAlignment.Center;
Font = Enum.Font.SourceSansSemibold
}

local donorLoad, keyLoad, aliasLoad, clientLoad, gameLoad = donorTab:Add("TextLabel", LOAD_TEXT), keyTab:Add("TextLabel", LOAD_TEXT), aliasTab:Add("TextLabel", LOAD_TEXT), clientTab:Add("TextLabel", LOAD_TEXT), gameTab:Add("TextLabel", LOAD_TEXT)
gTable = window.gTable
window:Ready()
local playerData = Remote.Get("PlayerData")
local chatMod = Remote.Get("Setting",{"Prefix","SpecialPrefix","BatchKey","AnyPrefix","DonorCommands","DonorCapes"})
local settingsData = Remote.Get("AllSettings")
Variables.Aliases = playerData.Aliases or {}
commandPrefix = chatMod.Prefix

for _, v in {donorLoad, keyLoad, aliasLoad, clientLoad, gameLoad} do
v:Destroy()
end

--// Donor Tab
do
local donorData = playerData.Donor
local donorData = playerData.Donor
local currentMaterial = donorData and donorData.Cape.Material
local currentTexture = donorData and donorData.Cape.Image
local currentColor = donorData and donorData.Cape.Color
local currentTexture = donorData and donorData.Cape.Image
local currentColor = donorData and donorData.Cape.Color

if type(currentColor) == "table" then
currentColor = Color3.new(currentColor[1],currentColor[2],currentColor[3])
Expand Down
Loading