Skip to content

Conversation

@whatsavalue3
Copy link
Contributor

Feel free to change anything you want. Please give feedback!

@Denneisk
Copy link
Member

Please make sure to follow the style guide.

@whatsavalue3
Copy link
Contributor Author

Can you run the linter again? i need to see the output

@Astralcircle
Copy link
Contributor

Why does the linter now even ask for approve on run? It didn't require this before

@whatsavalue3
Copy link
Contributor Author

Should i also add this to the text screen and normal screen?

Comment on lines 221 to 240
local body = vgui.Create("DFrame")
body:SetTitle(data.title)
body:SetSize(data.width, data.height)
body:SetVisible(true)
body.Paint = function( self, w, h ) -- 'function Frame:Paint( w, h )' works too
-- surface.SetDrawColor(255,255,255)
-- surface.DrawOutlinedRect(0, 0, w, h)
-- surface.SetDrawColor(0,0,0)
-- surface.DrawOutlinedRect(1, 1, w-2, h-2)
draw.RoundedBox( 4, 0, 0, w, h, Color( 255, 255, 255 ) )
draw.RoundedBox( 4, 1, 1, w-2, h-2, Color( 64, 64, 64 ) )
end
body:SetDraggable(false)
body:Center()
body:ShowCloseButton(true)
body:MakePopup()
for id, widget in ipairs( data.widgets ) do
WidgetBuilders[widget.type](ent, widget, body, id)
end
return body
Copy link
Contributor

Choose a reason for hiding this comment

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

This code styling is really strange

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is strange about it?

Copy link
Contributor

Choose a reason for hiding this comment

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

This styling is almost never used anywhere in wiremod, i recommend restyle it like this:

local body = vgui.Create("DFrame")
body:SetTitle(data.title)
body:SetSize(data.width, data.height)
body:MakePopup()
body:Center()

function body:Paint(w, h)
	draw.RoundedBox(4, 0, 0, w, h, color_white)
	draw.RoundedBox(4, 1, 1, w - 2, h - 2, Color(64, 64, 64))
end

for id, widget in ipairs(data.widgets) do
	WidgetBuilders[widget.type](ent, widget, body, id)
end

return body

body:SetSize(data.width, data.height)
body:SetVisible(true)
body:SetDraggable(false)
body:ShowCloseButton(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's already visible, no need to call body:SetVisible(true) or body:ShowCloseButton(true)

@Astralcircle
Copy link
Contributor

Also can you show the usecase for this PR? I don't quite understand what it adds

Copy link
Member

@Denneisk Denneisk left a comment

Choose a reason for hiding this comment

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

I'm not against the idea, but one of the biggest problems that made me hesitant to review this was how much duplicated code there is. I guess I can't complain too much since half of Wiremod (especially screens) can be described as that, and the other half of the problems I have with the code are just carry-overs from Interactive Props themselves.

Now, for an actual review. Interactive Prop functionality should be optional. I'm just going to guess there's going to be bugs or at least someone who doesn't want this to happen to a prop for whatever reason. Add a tickbox in each STool to enable/disable the IP feature. (Which'll add even more duplicated code and make me wish even more that we could just port screen->IP instead of IP->screen but...)

@Denneisk
Copy link
Member

Denneisk commented Sep 3, 2025

I'll try to test this later this week. Looked fine from a quick scan.

@whatsavalue3
Copy link
Contributor Author

Bump

Copy link
Member

@Denneisk Denneisk left a comment

Choose a reason for hiding this comment

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

Alright, finally got around to it. It looks fine. Feel free to yell at me if it breaks Wiremod.

Someone should really modularize screens so we can avoid copying so much code. I want to suggest adding text screens, screens, and RT screens to have interactivity, but...

@Denneisk Denneisk merged commit da8f615 into wiremod:master Sep 23, 2025
1 check passed
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.

3 participants