Skip to content

Add Multi-segment LCD component.#3621

Draft
whatsavalue3 wants to merge 60 commits into
wiremod:masterfrom
whatsavalue3:newMSLCDeditor
Draft

Add Multi-segment LCD component.#3621
whatsavalue3 wants to merge 60 commits into
wiremod:masterfrom
whatsavalue3:newMSLCDeditor

Conversation

@whatsavalue3
Copy link
Copy Markdown
Contributor

Adds a customizable segmented "LCD" along with a graphical editor to create layouts.
elevator screen

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this file is not used, it should not be part of the PR

self.Mode = mode
end

function Transform(self,x,y)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be a local function. Using function without local will make it a global and pollute the global table. This increases the risks of addon conflicts. Please sure you check all functions to not be global. All functions should be local until they have a good reason not to be.

This advice does not apply to function stuff:method() as these functions (methods) stay in the scope of stuff in context of the file Editor.

Comment thread lua/wire/gpulib.lua
end

//
// Create basic fonts
Copy link
Copy Markdown
Contributor

@Grocel Grocel Jun 1, 2026

Choose a reason for hiding this comment

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

Better stick with -- commits.

Edit: Changing commit style in gpulib might be out of scope for your PR though.

end
--[[
function TOOL.BuildCPanel(panel)
WireDermaExts.ModelSelect(panel, "wire_multisegmentlcd_model", list.Get( "WireScreenModels" ), 5)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems to be a large unused part of the code, you might want to remove, refactor or repurpose.

for i = 1,4 do
if iname == "Memory"..i then
self.Memory[i] = self.Inputs["Memory"..i].Src
self.Memory[i] = self.Inputs["Memory"..i].Src and self.Inputs["Memory"..i].Src:GetTable() or nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question to other wire developers: Does it have any unintended side effect? This used to be an Entity, now it is an Entity:GetTable().

function ENT:SendSerializedTree(ply)
if self.Tree == nil then return end
local serialized = WireLib.von.serialize(self.Tree)
if #serialized > 65535 then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The real limit of net messages is less then 65535, especially if you add other data such as color and resolution. I would recommend to limit it to like 60000 to have a large enough margin for every thing combined.

}
end

function ENT:TransformOffset(x,y)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like duplicate code. (see: https://github.com/wiremod/wire/pull/3621/changes#diff-9b6da116555147f580bc459531de15346269b3499bc2df686ff3f4805752f3d0R78) You might want to build a sub library for your project to reduce duplicated logic.

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.

2 participants