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

(WIP) VGUI Library #1413

Closed
wants to merge 0 commits into from
Closed

(WIP) VGUI Library #1413

wants to merge 0 commits into from

Conversation

ZH-Hristov
Copy link
Contributor

Not much has changed since the last PR that I closed, if anything. Just wanted to leave this here so people don't think it was lost forever or something.

Still needs permissions and an efficient way to override the panels' Paint functions.

@ZH-Hristov ZH-Hristov marked this pull request as ready for review February 20, 2023 21:22
@anormaltwig
Copy link
Contributor

Should probably use normal Lua operators instead of GLua specific ones. Breaks like 90% of code editors.

@anormaltwig
Copy link
Contributor

anormaltwig commented Feb 20, 2023

Also might want to default the permission for these to owner only and add a system to limit the amount of panels you can create, probably using SF.LimitObject.

@ZH-Hristov
Copy link
Contributor Author

I'll add the LimitObject

@thegrb93
Copy link
Owner

thegrb93 commented Mar 7, 2023

Will start looking at it soon. One downside I forsee is this is going to pollute the docs.

@thegrb93
Copy link
Owner

thegrb93 commented Mar 7, 2023

Maybe all the type names can be prefixed UI so that they all appear together at the bottom of the type list.

@thegrb93
Copy link
Owner

thegrb93 commented Mar 7, 2023

For example, instead of DTextEntry, UITextEntry.

@ZH-Hristov
Copy link
Contributor Author

Is it possible to have undocumented aliases?

@adamnejm
Copy link
Collaborator

adamnejm commented Mar 8, 2023

Is it possible to have undocumented aliases?

-- Backward compatability
function SF.Instance:DoAliases()
self.env.holograms = self.env.hologram
self.env.sounds = self.env.sound
local trace = self.env.trace
if trace then
trace.trace = trace.line
trace.traceHull = trace.hull
end
local bass_methods = self.Types.Bass and self.Types.Bass.Methods
if bass_methods then
bass_methods.destroy = bass_methods.stop
end
local ents_methods = self.Types.Entity and self.Types.Entity.Methods
if ents_methods then
ents_methods.unparent = ents_methods.setParent
end
self.env.quotaUsed = self.env.cpuUsed
self.env.quotaAverage = self.env.cpuAverage
self.env.quotaTotalUsed = self.env.cpuTotalUsed
self.env.quotaTotalAverage = self.env.cpuTotalAverage
self.env.quotaMax = self.env.cpuMax
end

These do not show up in the documentation. Unfortunately they are not syntax highlighted because of that ;f

@thegrb93
Copy link
Owner

thegrb93 commented Mar 8, 2023

Those are just aliases for backwards compatibility. If you want something to be undocumented, just change the --- to --.

Why do you want aliases?

@Vurv78
Copy link
Contributor

Vurv78 commented Mar 8, 2023

Unfortunately they are not syntax highlighted because of that ;f

That's a good thing, otherwise you'd never know if your script is using now deprecated functions since starfall doesn't have a warning system or anything.

@ZH-Hristov
Copy link
Contributor Author

Alright, renamed all of the types to start with UI instead of D. That was painful.

I don't think I missed any of them, if there are any typos they are hopefully only in the docs.

@anormaltwig
Copy link
Contributor

1000 default panel limit and no default permission for vgui.create?

@Vurv78
Copy link
Contributor

Vurv78 commented May 16, 2023

Code could be slimmed down a ton if you didn't create the temporary variables for the unwrapped vgui element

lua/starfall/libs_cl/vgui.lua Outdated Show resolved Hide resolved
lua/starfall/libs_cl/vgui.lua Outdated Show resolved Hide resolved
lua/starfall/libs_cl/vgui.lua Outdated Show resolved Hide resolved
@ZH-Hristov
Copy link
Contributor Author

1000 default panel limit and no default permission for vgui.create?

Forgot to make it owner only by default. Fixed.

lua/starfall/libs_cl/vgui.lua Outdated Show resolved Hide resolved
@ZH-Hristov ZH-Hristov closed this Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants