Skip to content

Commit

Permalink
feat: version info can now be clicked to copy it to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan committed Mar 25, 2023
1 parent 5f9db8f commit 1ad002f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/gui/editors/filmmaker/filmmaker.lua
Expand Up @@ -722,6 +722,15 @@ function gui.WIFilmmaker:OnInitialize()
elVersion:SetColor(Color(200,200,200))
elVersion:SetY(5)
elVersion:SizeToContents()
elVersion:SetCursor(gui.CURSOR_SHAPE_HAND)
elVersion:SetMouseInputEnabled(true)
elVersion:AddCallback("OnMouseEvent",function(el,button,state,mods)
if(button == input.MOUSE_BUTTON_LEFT and state == input.STATE_PRESS) then
util.set_clipboard_string(elVersion:GetText())
pfm.create_popup_message(locale.get_text("pfm_version_copied_to_clipboard"),3)
return util.EVENT_REPLY_HANDLED
end
end)

elVersion:SetX(pMenuBar:GetWidth() -elVersion:GetWidth() -4)
elVersion:SetY(3)
Expand Down

0 comments on commit 1ad002f

Please sign in to comment.