reuse icons and blbs to remove some content

This commit is contained in:
Redo
2025-01-13 01:55:54 -07:00
parent a25f184c94
commit 38ad0d3058
942 changed files with 1502 additions and 693568 deletions

View File

@ -2,10 +2,10 @@
datablock fxDtsBrickData(LogicGate_ClientIOBrick_Data){
brickFile = $LuaLogic::Path @ "bricks/blb/serialport.blb";
iconName = $LuaLogic::Path @ "icons/serialport";
iconName = $LuaLogic::Path @ "bricks/icons/serialport";
category = "Logic Bricks";
subCategory = "Special I/O";
subCategory = "Inputs";
uiName = "Client I/O Brick";
logicUIName = "Client I/O Brick";
logicUIDesc = "Allows clients to connect and share data with logic bricks.";
@ -179,6 +179,8 @@ function fxDtsBrick::LogicIO_bindClient(%brick, %client) {
%brick.LogicIO_unbindClient();
%client.LogicIO_unbind();
if(!isObject(%client.player)) return;
%client.LogicIO_Brick = %brick;
%brick.LogicIO_Client = %client;
messageClient(%client, 0, "\c6Logic I/O: Bound to \c3" @ %brick);
@ -205,13 +207,13 @@ function LogicIO_rotateVector(%vector, %steps) {
datablock AudioProfile(LogicIO_PlugInSound) {
filename = "./plugIn.wav";
description = MediumClose3D;
description = AudioClose3D;
preload = true;
};
datablock AudioProfile(LogicIO_PlugOutSound) {
filename = "./plugOut.wav";
description = MediumClose3D;
description = AudioClose3D;
preload = true;
};

View File

@ -1,119 +1,107 @@
keyboard_strToBool = {
["0"] = false,
["1"] = true,
}
--Key codes may use only 7 bits, so values must be in range 00-7F
keyboard_keyToCode = {
["backspace"] = 8,
["tab"] = 9,
["return"] = 13,
["backspace"] = 0x08,
["tab"] = 0x09,
["return"] = 0x0A,
["lshift"] = 0x10,
["lcontrol"] = 0x11,
["lalt"] = 0x12,
["rshift"] = 0x14,
["rcontrol"] = 0x15,
["ralt"] = 0x16,
["escape"] = 0x1B,
["lshift"] = 16,
["lcontrol"] = 17,
["lalt"] = 18,
["space"] = 0x20,
["pageup"] = 0x21,
["pagedown"] = 0x22,
["end"] = 0x23,
["home"] = 0x24,
["left"] = 0x25,
["up"] = 0x26,
["right"] = 0x27,
["down"] = 0x28,
["insert"] = 0x29,
["delete"] = 0x2A,
-- this block does not match vkey codes
["rshift"] = 20,
["rcontrol"] = 21,
["ralt"] = 22,
["apostrophe"] = 0x2B,
[","] = 0x2C,
["minus"] = 0x2D,
["."] = 0x2E,
["/"] = 0x2F,
[";"] = 0x3B,
["="] = 0x3D,
["["] = 0x5B,
["\\"] = 0x5C,
["]"] = 0x5D,
["`"] = 0x7E,
-- this block does not match vkey codes
[";"] = 24,
["="] = 25,
[","] = 26,
["."] = 27,
["/"] = 29,
["`"] = 30,
["0"] = 0x30,
["1"] = 0x31,
["2"] = 0x32,
["3"] = 0x33,
["4"] = 0x34,
["5"] = 0x35,
["6"] = 0x36,
["7"] = 0x37,
["8"] = 0x38,
["9"] = 0x39,
["space"] = 32,
["pageup"] = 33,
["pagedown"] = 34,
["end"] = 35,
["home"] = 36,
["left"] = 37,
["up"] = 38,
["right"] = 39,
["down"] = 40,
["insert"] = 45,
["delete"] = 46,
["a"] = 0x41,
["b"] = 0x42,
["c"] = 0x43,
["d"] = 0x44,
["e"] = 0x45,
["f"] = 0x46,
["g"] = 0x47,
["h"] = 0x48,
["i"] = 0x49,
["j"] = 0x4A,
["k"] = 0x4B,
["l"] = 0x4C,
["m"] = 0x4D,
["n"] = 0x4E,
["o"] = 0x4F,
["p"] = 0x50,
["q"] = 0x51,
["r"] = 0x52,
["s"] = 0x53,
["t"] = 0x54,
["u"] = 0x55,
["v"] = 0x56,
["w"] = 0x57,
["x"] = 0x58,
["y"] = 0x59,
["z"] = 0x5A,
["0"] = 48,
["1"] = 49,
["2"] = 50,
["3"] = 51,
["4"] = 52,
["5"] = 53,
["6"] = 54,
["7"] = 55,
["8"] = 56,
["9"] = 57,
["numpad0"] = 0x60,
["numpad1"] = 0x61,
["numpad2"] = 0x62,
["numpad3"] = 0x63,
["numpad4"] = 0x64,
["numpad5"] = 0x65,
["numpad6"] = 0x66,
["numpad7"] = 0x67,
["numpad8"] = 0x68,
["numpad9"] = 0x69,
["*"] = 0x6A,
["+"] = 0x6B,
["numpadenter"] = 0x6C,
-- ["minus"] = 0x6D, -- already exists
["numpaddecimal"] = 0x6E,
-- ["/"] = 0x6F, -- already exists
-- this block does not match vkey codes
["["] = 60,
["\\"] = 61,
["]"] = 62,
["apostrophe"] = 63,
["a"] = 65,
["b"] = 66,
["c"] = 67,
["d"] = 68,
["e"] = 69,
["f"] = 70,
["g"] = 71,
["h"] = 72,
["i"] = 73,
["j"] = 74,
["k"] = 75,
["l"] = 76,
["m"] = 77,
["n"] = 78,
["o"] = 79,
["p"] = 80,
["q"] = 81,
["r"] = 82,
["s"] = 83,
["t"] = 84,
["u"] = 85,
["v"] = 86,
["w"] = 87,
["x"] = 88,
["y"] = 89,
["z"] = 90,
["numpad0"] = 96,
["numpad1"] = 97,
["numpad2"] = 98,
["numpad3"] = 99,
["numpad4"] = 100,
["numpad5"] = 101,
["numpad6"] = 102,
["numpad7"] = 103,
["numpad8"] = 104,
["numpad9"] = 105,
["*"] = 106,
["+"] = 107,
["numpadenter"] = 108,
["minus"] = 109,
["numpaddecimal"] = 110,
["/"] = 111,
["f1"] = 112,
["f2"] = 113,
["f3"] = 114,
["f4"] = 115,
["f5"] = 116,
["f6"] = 117,
["f7"] = 118,
["f8"] = 119,
["f9"] = 120,
["f10"] = 121,
["f11"] = 122,
["f12"] = 123,
["invalid"] = 127,
["f1"] = 0x70,
["f2"] = 0x71,
["f3"] = 0x72,
["f4"] = 0x73,
["f5"] = 0x74,
["f6"] = 0x75,
["f7"] = 0x76,
["f8"] = 0x77,
["f9"] = 0x78,
["f10"] = 0x79,
["f11"] = 0x7A,
["f12"] = 0x7B,
}

View File

@ -6,8 +6,9 @@ end
return function(gate, argv)
if argv[1]=="\\:" then argv[1] = ";" end
local keycode = keyboard_keyToCode[argv[1]] or keyboard_keyToCode["invalid"]
local status = keyboard_strToBool[argv[2]]
local keycode = keyboard_keyToCode[argv[1]]
if not keycode then return end
local status = argv[2]=="1"
local code = keycode+(status and 128 or 0)

View File

@ -2,9 +2,9 @@
datablock fxDTSBrickData(LogicGate_Keyboard_Data){
brickFile = $LuaLogic::Path @ "bricks/blb/keyboardgate.blb";
category = "Logic Bricks";
subCategory = "Special I/O";
subCategory = "Inputs";
uiName = "Input Keyboard";
iconName = $LuaLogic::Path @ "icons/Input Keyboard";
iconName = $LuaLogic::Path @ "bricks/icons/Input Keyboard";
orientationFix = 3;
isLogic = true;
@ -42,7 +42,7 @@ function serverCmdLInputKey(%client, %key, %state){
}
}
function LogicGate_Keyboard_Data::Logic_OnInput(%data, %brick, %pos, %norm, %client){
function LogicGate_Keyboard_Data::Logic_OnInput(%data, %brick, %pos, %norm, %client) {
if(isObject(%client)){
%client.Logic_InputKeyboard = %brick;
%client.Logic_InputActive = true;

View File

@ -4,7 +4,7 @@ datablock fxDTSBrickData(LogicGate_Switch_Data)
category = "Logic Bricks";
subCategory = "Inputs";
uiName = "Switch";
iconName = $LuaLogic::Path @ "icons/Switch";
iconName = $LuaLogic::Path @ "bricks/icons/Switch";
brickFile = $LuaLogic::Path @ "bricks/blb/switch.blb";
hasPrint = 1;
printAspectRatio = "Logic";