File browser V2#512
Conversation
Needed to define some enumerations, I figured I would do a bit more while I'm at it
will remove when PR is complete
There are still a lot of fragments of V1 left behind and most things don't work yet, but the basics work and the proof-of-concept at how fast this can be is there Some things here refer to "immediate" - the original idea was a lot more immediate-mode style, but this is more retained in Lua-land than anything at this point
|
Also the huge spacing in-between some parts of the code was my coping mechanism of segmenting things out when I got started (couldn't do-end a lot of it), I'll remove that at the end |
|
The big things left to do are
|
Not sure if this is even used serverside and needs to be shared...
|
I did not looked at the file browser code yet. But I checked the changes in code style which were fine so far I can tell. |
You maintain linting on code you touch, not reformat an entire file. If you want to do a linting pass, do it in a seperate PR. |
|
The other reason is it makes an already hard to review PR even harder. |
|
Will try to get back into this sometime this weekend/next week.
|
|
Also; developer style concerns |
|
Neat Cant wait to see what it will look like :D |
|
You also probably want to update your branch to the latest one to see linter warnings |
| local DescParent = Prompt:Add("Panel") | ||
| DescParent:Dock(TOP) | ||
| DescParent:DockMargin(0, 4, 0, 0) | ||
| DescParent:SetSize(20, 32) | ||
| DescParent:SetPaintBackgroundEnabled(false) | ||
| DescParent:SetZPos(10000) | ||
|
|
||
| local Cancel = DescParent:Add("DImageButton") | ||
| Cancel:Dock(RIGHT) | ||
| Cancel:SetSize(20) | ||
| Cancel:SetStretchToFit(false) | ||
| Cancel:SetImage("icon16/cancel.png") | ||
|
|
||
| local Delete = DescParent:Add("DImageButton") | ||
| Delete:Dock(RIGHT) | ||
| Delete:SetSize(24) | ||
| Delete:SetStretchToFit(false) | ||
| Delete:SetImage("icon16/bin.png") | ||
|
|
||
| local Name = DescParent:Add("DLabel") | ||
| Name:Dock(FILL) | ||
| Name:SetDark(true) | ||
| Name:SetText("Are you sure to want to delete\n" .. Node.Path .. "?") | ||
| Name:SetAutoStretchVertical(true) | ||
| Name:SetZPos(1) |
There was a problem hiding this comment.
This styling looks kinda strange
|
This pull request has been marked as stale as there haven't been any changes in the past month. It will be closed in 15 days. |
|
I tried to rebase this on master, but it really did not work. So I'm trying again on a different branch based on master. Will finish implementing whats left as well. #525 |
This is a rewrite of the file browser that I've been wanting to do for three years at this point but never got around to actually doing. It is still a WIP, I only got started rewriting almost everything today, but I figured I'd put it up as I work on it.
This pull request works off the initial gripes from #467 ["Make browser loading faster"]. AdvDupe2's file browser (quite frankly, any file browser in Wiremod's suite) is insanely slow. For me, even with the work I did in #467, it still takes about 10 seconds of very-laggy time to fully load the browser. Not to mention the browser tanking my FPS to nearly 20 while active, if not lower sometimes. And this isn't just anecdotal - I've seen streams of my friends AdvDupe2 taking 15+ seconds to load with large enough dupe folders.
The work I've done here resolves both problems - the FPS drop is practically non-existent. The browser now is almost entirely separate from VGUI, while still using Derma skin functions and values to render most of the menu.
That's just what it does to minimize runtime lag - for initial lag:
There's also a lot of API restructuring going on under the hood, to expose the ability to create folders underneath the Adv. Dupe 2 tab. I've abstracted away most of the operations to IRootFolder implementations (advdupe1 and advdupe2 folders now use this implementation). Other addons could totally add their own IRootFolder implementations if they wanted to provide some shared advdupe2 folder or something. Kind of niche but it was something that I think @LiddulBOFH wanted for his gamemode a while back, and that logic desperately needed refactoring anyway.
Please do not review this in full or critique it in full until I've asked for a review - or at least keep in mind that this is not the final product at all. There are still a ton of fragments of V1 left in there and almost everything doesn't work right now, but the basics do work and I wanted to show a proof of concept
Also, as a proposal in general, I also wouldn't mind this file browser being pulled into other Wire and unrelated projects - I would actually like to see it adopted once it reaches its stable form in the Wiremod file browsers too. We could also use this for the sound browser DTree which is also hilariously slow for the same reasons.