From bfa06420a5c1c6440c4eb93083432edeeab65b20 Mon Sep 17 00:00:00 2001 From: github-is-garbage Date: Tue, 10 Dec 2024 17:00:26 -0500 Subject: [PATCH 1/3] Use window created by context menu for view requests Prevents creating a ghost DFrame that lingers eternally every time the View Requests button is pressed --- lua/wire/client/e2_viewrequest_menu.lua | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lua/wire/client/e2_viewrequest_menu.lua b/lua/wire/client/e2_viewrequest_menu.lua index 8d4092cfc2..bb29430ede 100644 --- a/lua/wire/client/e2_viewrequest_menu.lua +++ b/lua/wire/client/e2_viewrequest_menu.lua @@ -32,18 +32,17 @@ list.Set("DesktopWindows", "WireExpression2_ViewRequestMenu", { title = "View Requests", icon = "beer/wiremod/gate_e2", -- Use whatever icon you want here, I just picked my favourite out of the available E2 ones init = function(icon, window) - local container = vgui.Create("DFrame") - container:SetTitle("Expression 2 View Requests") + window:SetTitle("Expression 2 View Requests") - container:SetSize(ScrW() * 0.3, ScrH() * 0.6) - container:SetSizable(true) - container:SetMinWidth(ScrW() * 0.1) - container:SetMinHeight(ScrH() * 0.2) + window:SetSize(ScrW() * 0.3, ScrH() * 0.6) + window:SetSizable(true) + window:SetMinWidth(ScrW() * 0.1) + window:SetMinHeight(ScrH() * 0.2) - container:Center() - container:MakePopup() + window:Center() + window:MakePopup() - local reqList = vgui.Create("DListView", container) + local reqList = vgui.Create("DListView", window) reqList:Dock(FILL) reqList:SetMultiSelect(false) From 6e6e24a95157b01ea48f6b04800995bdd766faae Mon Sep 17 00:00:00 2001 From: github-is-garbage Date: Tue, 10 Dec 2024 17:23:12 -0500 Subject: [PATCH 2/3] Fix View Request menu duplication --- lua/wire/client/e2_viewrequest_menu.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/wire/client/e2_viewrequest_menu.lua b/lua/wire/client/e2_viewrequest_menu.lua index bb29430ede..72d61ee2af 100644 --- a/lua/wire/client/e2_viewrequest_menu.lua +++ b/lua/wire/client/e2_viewrequest_menu.lua @@ -31,6 +31,8 @@ end) list.Set("DesktopWindows", "WireExpression2_ViewRequestMenu", { title = "View Requests", icon = "beer/wiremod/gate_e2", -- Use whatever icon you want here, I just picked my favourite out of the available E2 ones + onewindow = true, + init = function(icon, window) window:SetTitle("Expression 2 View Requests") @@ -40,7 +42,6 @@ list.Set("DesktopWindows", "WireExpression2_ViewRequestMenu", { window:SetMinHeight(ScrH() * 0.2) window:Center() - window:MakePopup() local reqList = vgui.Create("DListView", window) reqList:Dock(FILL) From e4c054b664165ed6f4a52cfab69d2ef1b984ac7a Mon Sep 17 00:00:00 2001 From: Redox Date: Tue, 10 Dec 2024 23:26:13 +0100 Subject: [PATCH 3/3] Fix linter warnings --- lua/wire/client/e2_viewrequest_menu.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wire/client/e2_viewrequest_menu.lua b/lua/wire/client/e2_viewrequest_menu.lua index 72d61ee2af..619a8dbcdf 100644 --- a/lua/wire/client/e2_viewrequest_menu.lua +++ b/lua/wire/client/e2_viewrequest_menu.lua @@ -99,7 +99,7 @@ list.Set("DesktopWindows", "WireExpression2_ViewRequestMenu", { end mnu:AddOption("Accept Once", function() - local confirm = Derma_Query( + Derma_Query( "Are you SURE you want "..line.initiator:Nick().." to have complete access to the code in your chip '"..viewRequests[line.initiator][line.chip].name.."'?\nThis means they are able to steal and redistribute it, so you should only do this if you are certain you can trust them", "Confirm", "Yes", function() @@ -113,7 +113,7 @@ list.Set("DesktopWindows", "WireExpression2_ViewRequestMenu", { ) end) mnu:AddOption("Accept Always", function() - local confirm = Derma_Query( + Derma_Query( "Are you SURE you want "..line.initiator:Nick().." to have complete access to the code in your chip '"..viewRequests[line.initiator][line.chip].name.."' for the duration the chip entity exists?\nThis means they are able to steal and redistribute it, as well as view any modifications you make to the chip, so you should only do this if you are certain you can trust them", "Confirm", "Yes", function()