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

Added: Initial revision of button interacted slider #1935

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

dvdvideo1234
Copy link
Contributor

@dvdvideo1234 dvdvideo1234 commented Jan 21, 2023

I see people really tend to like this feature, so I am sharing the code of this panel here ;)
image

@dvdvideo1234
Copy link
Contributor Author

It will inherit DSizeToContents, then attach slider and buttons ( below ) to it. Buttons can used to interact with the slider:
https://github.com/dvdvideo1234/TrackAssemblyTool/wiki/Additional-features#button-controlled-slider-panels

@robotboy655
Copy link
Collaborator

...What is it?

@dvdvideo1234
Copy link
Contributor Author

dvdvideo1234 commented Jan 22, 2023

@robotboy655

Hi, a Button-interacted slider

gm_flatgrass.2023-1-22.20-25-58.webm

Fixed: Clear buttons removing buttons array also
@dvdvideo1234
Copy link
Contributor Author

dvdvideo1234 commented Jan 22, 2023

The idea is for the user to interact with slider faster. It requites one action to snap to 45 degrees for example and can be customized for the buttons to do different actions:

https://github.com/dvdvideo1234/TrackAssemblyTool/blob/master/lua/vgui/dasminsliderbutton.lua

@Grocel
Copy link

Grocel commented Jan 24, 2023

You might want to rework your coding style according to https://github.com/Facepunch/garrysmod/blob/master/CONTRIBUTING.md, though.

@dvdvideo1234
Copy link
Contributor Author

@Grocel

Yes, sir, sadly I do not really have time during the day of work and pretty tired to do in the evening. Finished the final revision though. Works like a charm!

Fixed: SetTall in lazt mode updating element padding
@dvdvideo1234
Copy link
Contributor Author

Done. Fixed also Set(Tall/Wide) when passing only panel size

@dvdvideo1234
Copy link
Contributor Author

Hi, @Grocel @robotboy655

I wonder is it worth it to do some factorization:
https://github.com/dvdvideo1234/TrackAssemblyTool/pull/47/files

Or this panel is fine as it is ?

@robotboy655 robotboy655 added the Addition The pull request adds new functionality. label Apr 17, 2023
@Grocel
Copy link

Grocel commented Apr 4, 2024

@dvdvideo1234 What's the status of this PR? Did you take a look into the coding style the game base file requires? These short variable names BDX and BDY are not good variable names in this project.

Other stuff I noticed is: Statements like these:

if(iSiz <= 0) then return 0 end

Should look like these:

if ( iSiz <= 0 ) then
    return 0
end

Please take a look at: https://github.com/Facepunch/garrysmod/blob/master/CONTRIBUTING.md

@dvdvideo1234
Copy link
Contributor Author

Done.. I think I got them all but if some are remaining pls point them out

@Grocel
Copy link

Grocel commented Apr 5, 2024

The ifs are still off, mind the space between brackets, also those before and after them.

@dvdvideo1234
Copy link
Contributor Author

Should be good now

@Grocel
Copy link

Grocel commented Apr 21, 2024

Looks much better now. I am not sure what Rubat thinks of this, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Addition The pull request adds new functionality.
Projects
None yet
3 participants