Skip to content

Commit b110f69

Browse files
authored
Merge pull request #3542 from llysdal/fpga-add-tooltips
Added tooltips to the FPGA gate selector along with some more descriptions for FPGA specific gates
2 parents 171fffb + 1496ec1 commit b110f69

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

lua/wire/client/node_editor/nodeeditor.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,9 @@ function Editor:InitComponents()
453453
local node2 = node:AddNode(gate.name or "No name found :(")
454454
node2.name = gate.name
455455
node2.action = action
456+
if gate.description then
457+
node2:SetTooltip(gate.description)
458+
end
456459
function node2:DoClick()
457460
editor.SelectedInMenu = { type = type, gate = self.action }
458461
end

lua/wire/cpu_gates/memory.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local i = 1
44
CPUGateActions["memory-program-counter-edge-trigger"] = {
55
order = i,
66
name = "Program Counter (Edge Triggered)",
7+
description = "A program counter that supports loading from addresses, resetting, and incrementing when Clock changes and isnt 0",
78
inputs = {"Increment", "Load", "LoadAddress", "Reset", "Clock"},
89
outputs = {"Address"},
910
output = function(gate, Increment, Load, LoadAddress, Reset, Clock)
@@ -33,6 +34,7 @@ i = i + 1
3334
CPUGateActions["memory-register"] = {
3435
order = i,
3536
name = "Register",
37+
description = "Updates its value from Data when Clock isnt 0",
3638
inputs = {"Data", "Clock"},
3739
output = function(gate, Data, Clock)
3840
if (Clock ~= 0) then
@@ -49,6 +51,7 @@ i = i + 1
4951
CPUGateActions["memory-register-edge-trigger"] = {
5052
order = i,
5153
name = "Register (Edge Triggered)",
54+
description = "Updates its value from Data when Clock changes and isnt 0",
5255
inputs = {"Data", "Clock"},
5356
output = function(gate, Data, Clock)
5457
local clock = (Clock ~= 0)

lua/wire/cpu_gates/selection.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local i = 1
44
CPUGateActions["selection-2-mux"] = {
55
order = i,
66
name = "2-to-1 Mux",
7+
description = "Selects a value out of 2 choices and outputs 1",
78
inputs = {"Select", "A", "B"},
89
output = function(gate, S, ...)
910
local s = math.floor(S)
@@ -20,6 +21,7 @@ i = i + 1
2021
CPUGateActions["selection-4-mux"] = {
2122
order = i,
2223
name = "4-to-1 Mux",
24+
description = "Selects a value out of 4 choices and outputs 1",
2325
inputs = {"Select", "A", "B", "C", "D"},
2426
output = function(gate, S, ...)
2527
local s = math.floor(S)
@@ -36,6 +38,7 @@ i = i + 1
3638
CPUGateActions["selection-8-mux"] = {
3739
order = i,
3840
name = "8-to-1 Mux",
41+
description = "Selects a value out of 8 choices and outputs 1",
3942
inputs = {"Select", "A", "B", "C", "D", "E", "F", "G", "H"},
4043
output = function(gate, S, ...)
4144
local s = math.floor(S)
@@ -52,6 +55,7 @@ i = i + 1
5255
CPUGateActions["selection-16-mux"] = {
5356
order = i,
5457
name = "16-to-1 Mux",
58+
description = "Selects a value out of 16 choices and outputs 1",
5559
inputs = {"Select", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"},
5660
output = function(gate, S, ...)
5761
local s = math.floor(S)
@@ -68,6 +72,7 @@ i = i + 1
6872
CPUGateActions["selection-2-demux"] = {
6973
order = i,
7074
name = "1-to-2 Demux",
75+
description = "Depending on what Select is, routes In to a specific output",
7176
inputs = {"Select", "In"},
7277
outputs = {"A", "B"},
7378
output = function(gate, S, I)
@@ -87,6 +92,7 @@ i = i + 1
8792
CPUGateActions["selection-4-demux"] = {
8893
order = i,
8994
name = "1-to-4 Demux",
95+
description = "Depending on what Select is, routes In to a specific output",
9096
inputs = {"Select", "In"},
9197
outputs = {"A", "B", "C", "D"},
9298
output = function(gate, S, I)
@@ -106,6 +112,7 @@ i = i + 1
106112
CPUGateActions["selection-8-demux"] = {
107113
order = i,
108114
name = "1-to-8 Demux",
115+
description = "Depending on what Select is, routes In to a specific output",
109116
inputs = {"Select", "In"},
110117
outputs = {"A", "B", "C", "D", "E", "F", "G", "H"},
111118
output = function(gate, S, I)
@@ -125,6 +132,7 @@ i = i + 1
125132
CPUGateActions["selection-16-demux"] = {
126133
order = i,
127134
name = "1-to-16 Demux",
135+
description = "Depending on what Select is, routes In to a specific output",
128136
inputs = {"Select", "In"},
129137
outputs = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"},
130138
output = function(gate, S, I)

lua/wire/fpga_gates/constants.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ i = i + 1
4444
FPGAGateActions["entity-self"] = {
4545
order = i,
4646
name = "Self",
47+
description = "Gets this FPGA",
4748
inputs = {},
4849
outputs = {"Out"},
4950
outputtypes = {"ENTITY"},
@@ -57,6 +58,7 @@ i = i + 1
5758
FPGAGateActions["entity-owner"] = {
5859
order = i,
5960
name = "Owner",
61+
description = "Gets you!",
6062
inputs = {},
6163
outputs = {"Out"},
6264
outputtypes = {"ENTITY"},
@@ -69,6 +71,7 @@ i = i + 1
6971
FPGAGateActions["server-tickrate"] = {
7072
order = i,
7173
name = "Tickrate",
74+
description = "Gets the server tickrate",
7275
inputs = {},
7376
outputs = {"Out"},
7477
outputtypes = {"NORMAL"},

lua/wire/fpga_gates/execution.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ i = i + 1
55
FPGAGateActions["execution-delta"] = {
66
order = i,
77
name = "Execution Delta",
8+
description = "Gets the time since the last execution of this FPGA",
89
inputs = {},
910
outputs = {"Out"},
1011
outputtypes = {"NORMAL"},
@@ -19,6 +20,7 @@ i = i + 1
1920
FPGAGateActions["execution-count"] = {
2021
order = i,
2122
name = "Execution Count",
23+
description = "Gets the amount of times this FPGA has executed",
2224
inputs = {},
2325
outputs = {"Out"},
2426
outputtypes = {"NORMAL"},
@@ -33,6 +35,7 @@ i = i + 1
3335
FPGAGateActions["execution-last-normal"] = {
3436
order = i,
3537
name = "Last Normal",
38+
description = "Outputs what A was last execution",
3639
inputs = {"A"},
3740
inputtypes = {"NORMAL"},
3841
outputs = {"Out"},
@@ -55,6 +58,7 @@ i = i + 1
5558
FPGAGateActions["execution-last-vector"] = {
5659
order = i,
5760
name = "Last Vector",
61+
description = "Outputs what A was last execution",
5862
inputs = {"A"},
5963
inputtypes = {"VECTOR"},
6064
outputs = {"Out"},
@@ -77,6 +81,7 @@ i = i + 1
7781
FPGAGateActions["execution-last-angle"] = {
7882
order = i,
7983
name = "Last Angle",
84+
description = "Outputs what A was last execution",
8085
inputs = {"A"},
8186
inputtypes = {"ANGLE"},
8287
outputs = {"Out"},
@@ -99,6 +104,7 @@ i = i + 1
99104
FPGAGateActions["execution-last-string"] = {
100105
order = i,
101106
name = "Last String",
107+
description = "Outputs what A was last execution",
102108
inputs = {"A"},
103109
inputtypes = {"STRING"},
104110
outputs = {"Out"},
@@ -121,6 +127,7 @@ i = i + 1
121127
FPGAGateActions["execution-timed-last-normal"] = {
122128
order = i,
123129
name = "Timed Last Normal",
130+
description = "Outputs what A was last execution",
124131
inputs = {"A"},
125132
inputtypes = {"NORMAL"},
126133
outputs = {"Out"},
@@ -141,6 +148,7 @@ i = i + 1
141148
FPGAGateActions["execution-timed-last-vector"] = {
142149
order = i,
143150
name = "Timed Last Vector",
151+
description = "Outputs what A was last execution",
144152
inputs = {"A"},
145153
inputtypes = {"VECTOR"},
146154
outputs = {"Out"},
@@ -162,6 +170,7 @@ i = i + 1
162170
FPGAGateActions["execution-timed-last-angle"] = {
163171
order = i,
164172
name = "Timed Last Angle",
173+
description = "Outputs what A was last execution",
165174
inputs = {"A"},
166175
inputtypes = {"ANGLE"},
167176
outputs = {"Out"},
@@ -183,6 +192,7 @@ i = i + 1
183192
FPGAGateActions["execution-timed-last-string"] = {
184193
order = i,
185194
name = "Timed Last String",
195+
description = "Outputs what A was last execution",
186196
inputs = {"A"},
187197
inputtypes = {"STRING"},
188198
outputs = {"Out"},
@@ -204,6 +214,7 @@ i = i + 1
204214
FPGAGateActions["execution-previous-normal"] = {
205215
order = i,
206216
name = "Previous Normal",
217+
description = "Outputs what A was last tick",
207218
inputs = {"A"},
208219
inputtypes = {"NORMAL"},
209220
outputs = {"Out"},
@@ -228,6 +239,7 @@ i = i + 1
228239
FPGAGateActions["execution-previous-vector"] = {
229240
order = i,
230241
name = "Previous Vector",
242+
description = "Outputs what A was last tick",
231243
inputs = {"A"},
232244
inputtypes = {"VECTOR"},
233245
outputs = {"Out"},
@@ -252,6 +264,7 @@ i = i + 1
252264
FPGAGateActions["execution-previous-angle"] = {
253265
order = i,
254266
name = "Previous Angle",
267+
description = "Outputs what A was last tick",
255268
inputs = {"A"},
256269
inputtypes = {"ANGLE"},
257270
outputs = {"Out"},
@@ -276,6 +289,7 @@ i = i + 1
276289
FPGAGateActions["execution-previous-string"] = {
277290
order = i,
278291
name = "Previous String",
292+
description = "Outputs what A was last tick",
279293
inputs = {"A"},
280294
inputtypes = {"STRING"},
281295
outputs = {"Out"},

0 commit comments

Comments
 (0)