Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lua/wire/client/node_editor/nodeeditor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ function Editor:InitComponents()
local node2 = node:AddNode(gate.name or "No name found :(")
node2.name = gate.name
node2.action = action
if gate.description then
node2:SetTooltip(gate.description)
end
function node2:DoClick()
editor.SelectedInMenu = { type = type, gate = self.action }
end
Expand Down
3 changes: 3 additions & 0 deletions lua/wire/cpu_gates/memory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local i = 1
CPUGateActions["memory-program-counter-edge-trigger"] = {
order = i,
name = "Program Counter (Edge Triggered)",
description = "A program counter that supports loading from addresses, resetting, and incrementing when Clock changes and isnt 0",
inputs = {"Increment", "Load", "LoadAddress", "Reset", "Clock"},
outputs = {"Address"},
output = function(gate, Increment, Load, LoadAddress, Reset, Clock)
Expand Down Expand Up @@ -33,6 +34,7 @@ i = i + 1
CPUGateActions["memory-register"] = {
order = i,
name = "Register",
description = "Updates its value from Data when Clock isnt 0",
inputs = {"Data", "Clock"},
output = function(gate, Data, Clock)
if (Clock ~= 0) then
Expand All @@ -49,6 +51,7 @@ i = i + 1
CPUGateActions["memory-register-edge-trigger"] = {
order = i,
name = "Register (Edge Triggered)",
description = "Updates its value from Data when Clock changes and isnt 0",
inputs = {"Data", "Clock"},
output = function(gate, Data, Clock)
local clock = (Clock ~= 0)
Expand Down
8 changes: 8 additions & 0 deletions lua/wire/cpu_gates/selection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local i = 1
CPUGateActions["selection-2-mux"] = {
order = i,
name = "2-to-1 Mux",
description = "Selects a value out of 2 choices and outputs 1",
inputs = {"Select", "A", "B"},
output = function(gate, S, ...)
local s = math.floor(S)
Expand All @@ -20,6 +21,7 @@ i = i + 1
CPUGateActions["selection-4-mux"] = {
order = i,
name = "4-to-1 Mux",
description = "Selects a value out of 4 choices and outputs 1",
inputs = {"Select", "A", "B", "C", "D"},
output = function(gate, S, ...)
local s = math.floor(S)
Expand All @@ -36,6 +38,7 @@ i = i + 1
CPUGateActions["selection-8-mux"] = {
order = i,
name = "8-to-1 Mux",
description = "Selects a value out of 8 choices and outputs 1",
inputs = {"Select", "A", "B", "C", "D", "E", "F", "G", "H"},
output = function(gate, S, ...)
local s = math.floor(S)
Expand All @@ -52,6 +55,7 @@ i = i + 1
CPUGateActions["selection-16-mux"] = {
order = i,
name = "16-to-1 Mux",
description = "Selects a value out of 16 choices and outputs 1",
inputs = {"Select", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"},
output = function(gate, S, ...)
local s = math.floor(S)
Expand All @@ -68,6 +72,7 @@ i = i + 1
CPUGateActions["selection-2-demux"] = {
order = i,
name = "1-to-2 Demux",
description = "Depending on what Select is, routes In to a specific output",
inputs = {"Select", "In"},
outputs = {"A", "B"},
output = function(gate, S, I)
Expand All @@ -87,6 +92,7 @@ i = i + 1
CPUGateActions["selection-4-demux"] = {
order = i,
name = "1-to-4 Demux",
description = "Depending on what Select is, routes In to a specific output",
inputs = {"Select", "In"},
outputs = {"A", "B", "C", "D"},
output = function(gate, S, I)
Expand All @@ -106,6 +112,7 @@ i = i + 1
CPUGateActions["selection-8-demux"] = {
order = i,
name = "1-to-8 Demux",
description = "Depending on what Select is, routes In to a specific output",
inputs = {"Select", "In"},
outputs = {"A", "B", "C", "D", "E", "F", "G", "H"},
output = function(gate, S, I)
Expand All @@ -125,6 +132,7 @@ i = i + 1
CPUGateActions["selection-16-demux"] = {
order = i,
name = "1-to-16 Demux",
description = "Depending on what Select is, routes In to a specific output",
inputs = {"Select", "In"},
outputs = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"},
output = function(gate, S, I)
Expand Down
3 changes: 3 additions & 0 deletions lua/wire/fpga_gates/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ i = i + 1
FPGAGateActions["entity-self"] = {
order = i,
name = "Self",
description = "Gets this FPGA",
inputs = {},
outputs = {"Out"},
outputtypes = {"ENTITY"},
Expand All @@ -57,6 +58,7 @@ i = i + 1
FPGAGateActions["entity-owner"] = {
order = i,
name = "Owner",
description = "Gets you!",
inputs = {},
outputs = {"Out"},
outputtypes = {"ENTITY"},
Expand All @@ -69,6 +71,7 @@ i = i + 1
FPGAGateActions["server-tickrate"] = {
order = i,
name = "Tickrate",
description = "Gets the server tickrate",
inputs = {},
outputs = {"Out"},
outputtypes = {"NORMAL"},
Expand Down
14 changes: 14 additions & 0 deletions lua/wire/fpga_gates/execution.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ i = i + 1
FPGAGateActions["execution-delta"] = {
order = i,
name = "Execution Delta",
description = "Gets the time since the last execution of this FPGA",
inputs = {},
outputs = {"Out"},
outputtypes = {"NORMAL"},
Expand All @@ -19,6 +20,7 @@ i = i + 1
FPGAGateActions["execution-count"] = {
order = i,
name = "Execution Count",
description = "Gets the amount of times this FPGA has executed",
inputs = {},
outputs = {"Out"},
outputtypes = {"NORMAL"},
Expand All @@ -33,6 +35,7 @@ i = i + 1
FPGAGateActions["execution-last-normal"] = {
order = i,
name = "Last Normal",
description = "Outputs what A was last execution",
inputs = {"A"},
inputtypes = {"NORMAL"},
outputs = {"Out"},
Expand All @@ -55,6 +58,7 @@ i = i + 1
FPGAGateActions["execution-last-vector"] = {
order = i,
name = "Last Vector",
description = "Outputs what A was last execution",
inputs = {"A"},
inputtypes = {"VECTOR"},
outputs = {"Out"},
Expand All @@ -77,6 +81,7 @@ i = i + 1
FPGAGateActions["execution-last-angle"] = {
order = i,
name = "Last Angle",
description = "Outputs what A was last execution",
inputs = {"A"},
inputtypes = {"ANGLE"},
outputs = {"Out"},
Expand All @@ -99,6 +104,7 @@ i = i + 1
FPGAGateActions["execution-last-string"] = {
order = i,
name = "Last String",
description = "Outputs what A was last execution",
inputs = {"A"},
inputtypes = {"STRING"},
outputs = {"Out"},
Expand All @@ -121,6 +127,7 @@ i = i + 1
FPGAGateActions["execution-timed-last-normal"] = {
order = i,
name = "Timed Last Normal",
description = "Outputs what A was last execution",
inputs = {"A"},
inputtypes = {"NORMAL"},
outputs = {"Out"},
Expand All @@ -141,6 +148,7 @@ i = i + 1
FPGAGateActions["execution-timed-last-vector"] = {
order = i,
name = "Timed Last Vector",
description = "Outputs what A was last execution",
inputs = {"A"},
inputtypes = {"VECTOR"},
outputs = {"Out"},
Expand All @@ -162,6 +170,7 @@ i = i + 1
FPGAGateActions["execution-timed-last-angle"] = {
order = i,
name = "Timed Last Angle",
description = "Outputs what A was last execution",
inputs = {"A"},
inputtypes = {"ANGLE"},
outputs = {"Out"},
Expand All @@ -183,6 +192,7 @@ i = i + 1
FPGAGateActions["execution-timed-last-string"] = {
order = i,
name = "Timed Last String",
description = "Outputs what A was last execution",
inputs = {"A"},
inputtypes = {"STRING"},
outputs = {"Out"},
Expand All @@ -204,6 +214,7 @@ i = i + 1
FPGAGateActions["execution-previous-normal"] = {
order = i,
name = "Previous Normal",
description = "Outputs what A was last tick",
inputs = {"A"},
inputtypes = {"NORMAL"},
outputs = {"Out"},
Expand All @@ -228,6 +239,7 @@ i = i + 1
FPGAGateActions["execution-previous-vector"] = {
order = i,
name = "Previous Vector",
description = "Outputs what A was last tick",
inputs = {"A"},
inputtypes = {"VECTOR"},
outputs = {"Out"},
Expand All @@ -252,6 +264,7 @@ i = i + 1
FPGAGateActions["execution-previous-angle"] = {
order = i,
name = "Previous Angle",
description = "Outputs what A was last tick",
inputs = {"A"},
inputtypes = {"ANGLE"},
outputs = {"Out"},
Expand All @@ -276,6 +289,7 @@ i = i + 1
FPGAGateActions["execution-previous-string"] = {
order = i,
name = "Previous String",
description = "Outputs what A was last tick",
inputs = {"A"},
inputtypes = {"STRING"},
outputs = {"Out"},
Expand Down
Loading