From 7e5488f10b8b930ec132fb7179e5814d265f5a0f Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Mon, 13 Sep 2021 14:34:41 +0300 Subject: [PATCH 01/89] small optimizing --- gamemode/core/meta/inventory/sv_base_inventory.lua | 2 +- plugins/playerinjuries/sv_hooks.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gamemode/core/meta/inventory/sv_base_inventory.lua b/gamemode/core/meta/inventory/sv_base_inventory.lua index cff23a0a..412f6e83 100644 --- a/gamemode/core/meta/inventory/sv_base_inventory.lua +++ b/gamemode/core/meta/inventory/sv_base_inventory.lua @@ -285,7 +285,7 @@ function Inventory:sync(recipients) net.WriteType(self.id) net.WriteString(self.typeID) net.WriteTable(self.data) - net.WriteUInt(table.Count(self.items), 32) + net.WriteUInt(table.Count(self.items), 32) local function writeItem(item) net.WriteUInt(item:getID(), 32) net.WriteString(item.uniqueID) diff --git a/plugins/playerinjuries/sv_hooks.lua b/plugins/playerinjuries/sv_hooks.lua index 4b9bf722..01e6bb66 100644 --- a/plugins/playerinjuries/sv_hooks.lua +++ b/plugins/playerinjuries/sv_hooks.lua @@ -38,7 +38,7 @@ end function PLUGIN:PlayerDeath(client) local deathSound = hook.Run("GetPlayerDeathSound", client) - or table.Random(DEATH_SOUNDS) + or DEATH_SOUNDS[math.random(#DEATH_SOUNDS)] if (client:isFemale() and !deathSound:find("female")) then deathSound = deathSound:gsub("male", "female") end @@ -48,14 +48,14 @@ end function PLUGIN:GetPlayerPainSound(client) if (client:WaterLevel() >= 3) then - return table.Random(DROWN_SOUNDS) + return DROWN_SOUNDS[math.random(#DROWN_SOUNDS)] end end function PLUGIN:PlayerHurt(client, attacker, health, damage) if ((client.nutNextPain or 0) < CurTime() and health > 0) then local painSound = hook.Run("GetPlayerPainSound", client) - or table.Random(PAIN_SOUNDS) + or PAIN_SOUNDS[math.random(#PAIN_SOUNDS)] if (client:isFemale() and !painSound:find("female")) then painSound = painSound:gsub("male", "female") end From 26eb35f233c1f6ab5ef36f37c1d87049c7cd1fb1 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Mon, 20 Sep 2021 10:09:56 +0300 Subject: [PATCH 02/89] trailing whitespaces, who needs them? --- gamemode/core/libs/sh_player.lua | 2 +- gamemode/core/meta/item/sv_item.lua | 2 +- gamemode/items/base/sh_ammo.lua | 2 +- gamemode/items/base/sh_pacoutfit.lua | 4 +-- gamemode/items/base/sh_weapons.lua | 6 ++--- .../derma/cl_list_inventory_panel.lua | 4 +-- .../simpleinv/plugins/listinvui/sh_plugin.lua | 2 +- .../derma/cl_grid_inventory_panel.lua | 6 ++--- plugins/gridinv/sh_grid_inv.lua | 26 +++++++++---------- plugins/mapscene.lua | 6 ++--- .../plugins/charselect/derma/cl_character.lua | 2 +- plugins/vendor/sv_hooks.lua | 6 ++--- 12 files changed, 34 insertions(+), 34 deletions(-) diff --git a/gamemode/core/libs/sh_player.lua b/gamemode/core/libs/sh_player.lua index 22753891..90f49505 100644 --- a/gamemode/core/libs/sh_player.lua +++ b/gamemode/core/libs/sh_player.lua @@ -42,7 +42,7 @@ do end -- Whitelist networking information here. -do +do function playerMeta:hasWhitelist(faction) local data = nut.faction.indices[faction] diff --git a/gamemode/core/meta/item/sv_item.lua b/gamemode/core/meta/item/sv_item.lua index 950c1074..a2ded7a5 100644 --- a/gamemode/core/meta/item/sv_item.lua +++ b/gamemode/core/meta/item/sv_item.lua @@ -112,7 +112,7 @@ function ITEM:transfer(newInventory,bBypass) :next(function() newInventory:add(self) end) - + return true end diff --git a/gamemode/items/base/sh_ammo.lua b/gamemode/items/base/sh_ammo.lua index eb97bbfa..03047848 100644 --- a/gamemode/items/base/sh_ammo.lua +++ b/gamemode/items/base/sh_ammo.lua @@ -14,7 +14,7 @@ end function ITEM:paintOver(item, w, h) local quantity = item:getQuantity() - + nut.util.drawText(quantity, 8, 5, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP, "nutChatFont") end diff --git a/gamemode/items/base/sh_pacoutfit.lua b/gamemode/items/base/sh_pacoutfit.lua index ee6da84d..fc070026 100644 --- a/gamemode/items/base/sh_pacoutfit.lua +++ b/gamemode/items/base/sh_pacoutfit.lua @@ -50,7 +50,7 @@ end function ITEM:removePart(client) local char = client:getChar() - + self:setData("equip", false) if (client.removePart) then @@ -116,7 +116,7 @@ ITEM.functions.Equip = { char:addBoost(item.uniqueID, attribute, boost) end end - + return false end, onCanRun = function(item) diff --git a/gamemode/items/base/sh_weapons.lua b/gamemode/items/base/sh_weapons.lua index edc2e10b..deb9f53d 100644 --- a/gamemode/items/base/sh_weapons.lua +++ b/gamemode/items/base/sh_weapons.lua @@ -50,12 +50,12 @@ ITEM.functions.EquipUn = { -- sorry, for name order. local weapon = item.player.carryWeapons[item.weaponCategory] if (!weapon or !IsValid(weapon)) then - weapon = item.player:GetWeapon(item.class) + weapon = item.player:GetWeapon(item.class) end if (weapon and weapon:IsValid()) then item:setData("ammo", weapon:Clip1()) - + item.player:StripWeapon(item.class) else print(Format("[Nutscript] Weapon %s does not exist!", item.class)) @@ -101,7 +101,7 @@ ITEM.functions.Equip = { end end end - + if (client:HasWeapon(item.class)) then client:StripWeapon(item.class) end diff --git a/plugins/_disabled/simpleinv/plugins/listinvui/derma/cl_list_inventory_panel.lua b/plugins/_disabled/simpleinv/plugins/listinvui/derma/cl_list_inventory_panel.lua index e5261d8b..fbc6252f 100644 --- a/plugins/_disabled/simpleinv/plugins/listinvui/derma/cl_list_inventory_panel.lua +++ b/plugins/_disabled/simpleinv/plugins/listinvui/derma/cl_list_inventory_panel.lua @@ -23,7 +23,7 @@ function PANEL:Init() self.weightBar:Dock(FILL) self.weightBar:DockMargin(PADDING, PADDING, PADDING, PADDING) self.weightBar.Paint = function(this, w, h) self:paintWeightBar(w, h) end - + self.weightLabel = self.weight:Add("DLabel") self.weightLabel:SetText("WEIGHT: 0/10KG") self.weightLabel:SetFont("nutChatFont") @@ -122,7 +122,7 @@ end function PANEL:Center() local parent = self:GetParent() local centerX, centerY = ScrW() * 0.5, ScrH() * 0.5 - + self:SetPos( centerX - (self:GetWide() * 0.5), centerY - (self:GetTall() * 0.5) diff --git a/plugins/_disabled/simpleinv/plugins/listinvui/sh_plugin.lua b/plugins/_disabled/simpleinv/plugins/listinvui/sh_plugin.lua index 23398557..f27423a5 100644 --- a/plugins/_disabled/simpleinv/plugins/listinvui/sh_plugin.lua +++ b/plugins/_disabled/simpleinv/plugins/listinvui/sh_plugin.lua @@ -13,7 +13,7 @@ if (CLIENT) then local panel = parent:Add("nutListInventory") panel:setInventory(inventory) panel:Center() - + return panel end diff --git a/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory_panel.lua b/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory_panel.lua index 3b5d8d53..440d342f 100644 --- a/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory_panel.lua +++ b/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory_panel.lua @@ -153,7 +153,7 @@ function PANEL:drawHeldItemRectangle() local trimX, trimY local maxOffsetY = (item.height or 1) - 1 local maxOffsetX = (item.width or 1) - 1 - local drawTarget = nil + local drawTarget = nil for itemID, invItem in pairs(self.inventory.items) do if (item:getID() == itemID) then continue end @@ -162,7 +162,7 @@ function PANEL:drawHeldItemRectangle() if ( x + (item.width - 1) >= targetX and x <= targetX + targetW and - y + (item.height - 1) >= targetY and y <= targetY + targetH and + y + (item.height - 1) >= targetY and y <= targetY + targetH and (invItem.onCombine or item.onCombineTo) ) then drawTarget = { @@ -221,7 +221,7 @@ end function PANEL:Center() local parent = self:GetParent() local centerX, centerY = ScrW() * 0.5, ScrH() * 0.5 - + self:SetPos( centerX - (self:GetWide() * 0.5), centerY - (self:GetTall() * 0.5) diff --git a/plugins/gridinv/sh_grid_inv.lua b/plugins/gridinv/sh_grid_inv.lua index 69440480..5f127074 100644 --- a/plugins/gridinv/sh_grid_inv.lua +++ b/plugins/gridinv/sh_grid_inv.lua @@ -5,7 +5,7 @@ local GridInv = nut.Inventory:extend("GridInv") -- Useful access rules: local function CanAccessInventoryIfCharacterIsOwner(inventory, action, context) - if (inventory.virtual) then return (action == "transfer") end + if (inventory.virtual) then return (action == "transfer") end local ownerID = inventory:getData("char") local client = context.client @@ -19,7 +19,7 @@ local function CanNotAddItemIfNoSpace(inventory, action, context) return end - if (inventory.virtual) then return true end + if (inventory.virtual) then return true end local x, y = context.x, context.y if (not x or not y) then return false, "noFit" end @@ -195,7 +195,7 @@ if (SERVER) then if (not item) then return d:reject("invalid item type") end - + local targetInventory = self if (not x or not y) then x, y = self:findFreePosition(item) @@ -210,7 +210,7 @@ if (SERVER) then break end end - end + end end end @@ -223,23 +223,23 @@ if (SERVER) then if (isStackCommand) then local items = targetInventory:getItemsOfType(itemTypeOrItem) - + if (items) then for _, targetItem in pairs(items) do - if (remainingQuantity == 0) then -- nothing to fill. - break + if (remainingQuantity == 0) then -- nothing to fill. + break end local freeSpace = targetItem.maxQuantity - targetItem:getQuantity() - + if (freeSpace > 0) then local filler = freeSpace - remainingQuantity if (filler > 0) then - targetAssignments[targetItem] = remainingQuantity + targetAssignments[targetItem] = remainingQuantity remainingQuantity = 0 else - targetAssignments[targetItem] = freeSpace + targetAssignments[targetItem] = freeSpace remainingQuantity = math.abs(filler) end end @@ -304,7 +304,7 @@ if (SERVER) then for targetItem, assignedQuantity in pairs(targetAssignments) do targetItem:addQuantity(assignedQuantity) end - + local overStacks = math.ceil(remainingQuantity/item.maxQuantity) - 1 if (overStacks > 0) then @@ -318,7 +318,7 @@ if (SERVER) then item:setQuantity(remainingQuantity - (item.maxQuantity * overStacks)) targetInventory:addItem(item) - + return d:resolve(items) else item:setQuantity(remainingQuantity) @@ -367,7 +367,7 @@ else ) then destinationID = nil end - + net.Start("nutTransferItem") net.WriteUInt(itemID, 32) net.WriteUInt(x, 32) diff --git a/plugins/mapscene.lua b/plugins/mapscene.lua index 6004f725..f7d9e227 100644 --- a/plugins/mapscene.lua +++ b/plugins/mapscene.lua @@ -52,7 +52,7 @@ if (CLIENT) then if (fraction >= 1) then self.startTime = curTime self.finishTime = curTime + 30 - + if (ordered) then self.orderedIndex = self.orderedIndex + 1 @@ -92,13 +92,13 @@ if (CLIENT) then local HIDE_WEAPON = Vector(0, 0, -100000) local HIDE_ANGLE = Angle(0, 0, 0) - + function PLUGIN:CalcViewModelView(weapon, viewModel, oldEyePos, oldEyeAngles, eyePos, eyeAngles) local scenes = self.scenes if (IsValid(nut.gui.character)) then return HIDE_WEAPON, HIDE_ANGLE - end + end end local PLUGIN = PLUGIN diff --git a/plugins/multichar/plugins/charselect/derma/cl_character.lua b/plugins/multichar/plugins/charselect/derma/cl_character.lua index 4b66b974..9e801eb9 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_character.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_character.lua @@ -187,7 +187,7 @@ function PANEL:Init() self.tabs:DockMargin(64, 32, 64, 0) self.tabs:SetTall(48) self.tabs:SetPaintBackground(false) - + self.content = self:Add("DPanel") self.content:Dock(FILL) self.content:DockMargin(64, 0, 64, 64) diff --git a/plugins/vendor/sv_hooks.lua b/plugins/vendor/sv_hooks.lua index 873397b3..dfe2d766 100644 --- a/plugins/vendor/sv_hooks.lua +++ b/plugins/vendor/sv_hooks.lua @@ -96,14 +96,14 @@ function PLUGIN:VendorTradeAttempt( return end - client.vendorTransaction = true + client.vendorTransaction = true client.vendorTimeout = RealTime() + .1 -- Then, transfer the money and item. if (isSellingToVendor) then local inventory = character:getInv() local item = inventory:getFirstItemOfType(itemType) - + if (item) then local context = { client = client, @@ -121,7 +121,7 @@ function PLUGIN:VendorTradeAttempt( local canTransferItem, reason = hook.Run("CanItemBeTransfered", item, inventory, VENDOR_INVENTORY_MEASURE, client) if (canTransferItem == false) then client:notifyLocalized(reason or "vendorError") - + return end From 359de4306d9606c6b3572b9b2af9a57135c9c1eb Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sun, 7 Nov 2021 21:26:37 +0100 Subject: [PATCH 03/89] Deprication fixes --- entities/entities/nut_item.lua | 6 ++- gamemode/config/sh_config.lua | 5 ++ gamemode/core/libs/sh_chatbox.lua | 7 ++- gamemode/core/libs/thirdparty/cl_ikon.lua | 48 +++++++++---------- gamemode/core/meta/sh_base_inventory.lua | 2 +- gamemode/core/sh_util.lua | 2 +- plugins/gridinv/items/base/sh_bags.lua | 2 + .../plugins/charselect/derma/cl_creation.lua | 15 ++++-- plugins/observer.lua | 2 +- 9 files changed, 56 insertions(+), 33 deletions(-) diff --git a/entities/entities/nut_item.lua b/entities/entities/nut_item.lua index 9630103a..6e81c9c3 100644 --- a/entities/entities/nut_item.lua +++ b/entities/entities/nut_item.lua @@ -47,15 +47,17 @@ if (SERVER) then local model = itemTable.onGetDropModel and itemTable:onGetDropModel(self) - or itemTable.model + or itemTable:getModel() or itemTable.model if (itemTable.worldModel) then model = itemTable.worldModel == true and "models/props_junk/cardboard_box004a.mdl" or itemTable.worldModel end - self:SetSkin(itemTable.skin or 0) self:SetModel(model) + self:SetSkin(itemTable.skin or 0) + self:SetMaterial(itemTable.material or "") + self:SetColor(itemTable.color or Color(255,255,255)) self:PhysicsInit(SOLID_VPHYSICS) self:SetSolid(SOLID_VPHYSICS) self:setNetVar("id", itemTable.uniqueID) diff --git a/gamemode/config/sh_config.lua b/gamemode/config/sh_config.lua index 4a73606e..91a6b232 100644 --- a/gamemode/config/sh_config.lua +++ b/gamemode/config/sh_config.lua @@ -55,6 +55,11 @@ nut.config.add("oocDelay", 10, "The delay before a player can use OOC chat again category = "chat" }) +nut.config.add("oocLimit", 0, "Character limit per OOC message. 0 means no limit", nil, { + data = {min = 0, max = 1000}, + category = "chat" +}) + nut.config.add("oocDelayAdmin", false, "Whether or not OOC chat delay is enabled for admins.", nil, { category = "chat" }) diff --git a/gamemode/core/libs/sh_chatbox.lua b/gamemode/core/libs/sh_chatbox.lua index 8efd7614..4ddb183e 100644 --- a/gamemode/core/libs/sh_chatbox.lua +++ b/gamemode/core/libs/sh_chatbox.lua @@ -301,7 +301,6 @@ do return false end end - -- Save the last time they spoke in OOC. speaker.nutLastOOC = CurTime() end @@ -331,6 +330,9 @@ do icon = "icon16/heart.png" end + if (nut.config.get("oocLimit", 0) ~= 0) and (#text > nut.config.get("oocLimit", 0)) then + text = string.sub(text, 1, nut.config.get("oocLimit", 0)) .. "..." + end icon = Material(hook.Run("GetPlayerIcon", speaker) or icon) chat.AddText(icon, nut.chat.timestamp(true), Color(255, 50, 50), " [OOC] ", speaker, color_white, ": " .. text) @@ -361,6 +363,9 @@ do speaker.nutLastLOOC = CurTime() end, onChatAdd = function(speaker, text) + if (nut.config.get("oocLimit", 0) ~= 0) and (#text > nut.config.get("oocLimit", 0)) then + text = string.sub(text, 1, nut.config.get("oocLimit", 0)) .. "..." + end chat.AddText(nut.chat.timestamp(false), Color(255, 50, 50), "[LOOC] ", nut.config.get("chatColor"), speaker:Name() .. ": " .. text) end, radius = function() diff --git a/gamemode/core/libs/thirdparty/cl_ikon.lua b/gamemode/core/libs/thirdparty/cl_ikon.lua index 1e560f7a..c6243ce9 100644 --- a/gamemode/core/libs/thirdparty/cl_ikon.lua +++ b/gamemode/core/libs/thirdparty/cl_ikon.lua @@ -21,18 +21,18 @@ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + TL;DR: https://tldrlegal.com/license/mit-license - OK - + OK - Commercial Use Modify Distribute Sublicense Private Use - + NOT OK - Hold Liable - + MUST - Include Copyright Include License @@ -58,7 +58,7 @@ function ikon:init() hook.Add("HUDPaint", "ikon_dev2", ikon.showResult) else hook.Remove("HUDPaint", "ikon_dev2") - end + end /* Being good at gmod is knowing all of stinky hacks @@ -101,7 +101,7 @@ local TEXTURE_FLAGS_CLAMP_T = 0x0008 ikon.max = ikon.maxSize * 64 ikon.RT = GetRenderTargetEx("nsIconRendered", ikon.max, - ikon.max, + ikon.max, RT_SIZE_NO_CHANGE, MATERIAL_RT_DEPTH_SHARED, bit.bor(TEXTURE_FLAGS_CLAMP_S, TEXTURE_FLAGS_CLAMP_T), @@ -133,10 +133,10 @@ function ikon:renderHook() local w, h = ikon.curWidth * 64, ikon.curHeight * 64 local x, y = 0, 0 - + local tab if (ikon.info) then - tab = + tab = { origin = ikon.info.pos, angles = ikon.info.ang, @@ -183,24 +183,24 @@ function ikon:renderHook() render.SetStencilPassOperation(STENCILOPERATION_REPLACE) render.SetStencilFailOperation(STENCILOPERATION_REPLACE) end - + /* Add more effects on the Models! */ if (tab.drawHook) then tab.drawHook(ikon.renderEntity, w, h) end - - - cam.Start3D(tab.origin, tab.angles, tab.fov, 0, 0, w, h) + + + cam.Start3D(tab.origin, tab.angles, tab.fov, 0, 0, w, h) if (tab.entAng) then ikon.renderEntity:SetAngles(tab.entAng) else ikon.renderEntity:SetAngles(Angle()) end - + render.SetBlend(1) - ikon.renderEntity:DrawModel() + ikon.renderEntity:DrawModel() cam.End3D() if (tab.drawPostHook) then @@ -208,7 +208,7 @@ function ikon:renderHook() tab.drawPostHook(ikon.renderEntity, w, h) end - + if (tab.outline) then render.PushRenderTarget( tex_effect ) @@ -217,7 +217,7 @@ function ikon:renderHook() cam.Start2D() cam.Start3D(tab.origin, tab.angles, tab.fov, 0, 0, w, h) render.SetBlend(0) - ikon.renderEntity:DrawModel() + ikon.renderEntity:DrawModel() render.SetStencilWriteMask(138) -- could you please? render.SetStencilTestMask(1) @@ -232,10 +232,10 @@ function ikon:renderHook() cam.End3D() cam.End2D() render.PopRenderTarget() - + render.SetBlend(1) render.SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_NOTEQUAL) - + /* Thanks for Noiwex NxServ.eu @@ -250,7 +250,7 @@ function ikon:renderHook() render.SetStencilEnable(false) end - + render.SuppressEngineLighting( false ) render.SetWriteDepthToDestAlpha( true ) end, function(rrer) print(rrer) end) @@ -293,7 +293,7 @@ function ikon:renderIcon(name, w, h, mdl, camInfo, updateCache) local w, h = ikon.curWidth * 64, ikon.curHeight * 64 local sw, sh = ScrW(), ScrH() - + if (ikon.renderModel) then if (!IsValid(ikon.renderEntity)) then ikon.renderEntity = ClientsideModel(ikon.renderModel, RENDERGROUP_BOTH) @@ -304,7 +304,7 @@ function ikon:renderIcon(name, w, h, mdl, camInfo, updateCache) ikon.renderEntity:SetModel(ikon.renderModel) local oldRT = render.GetRenderTarget() render.PushRenderTarget(ikon.RT) - + ikon.rendering = true ikon:renderHook() ikon.rendering = nil @@ -320,7 +320,7 @@ function ikon:renderIcon(name, w, h, mdl, camInfo, updateCache) file.Write("nsIcon/" .. schemaName .. "/" .. name .. ".png", capturedIcon) ikon.info = nil render.PopRenderTarget() - + if (updateCache) then local iconString = tostring(os.time()) file.Write(iconString .. ".png", capturedIcon) @@ -348,7 +348,7 @@ function ikon:getIcon(name) if (file.Exists("nsIcon/" .. schemaName .. "/" .. name .. ".png", "DATA")) then ikon.cache[name] = Material("../data/nsIcon/" .. schemaName .. "/".. name ..".png") - return ikon.cache[name] -- yeah return cache + return ikon.cache[name] -- yeah return cache else return false -- retryd end @@ -359,7 +359,7 @@ end concommand.Add("nut_flushicon", function() ikon.cache = {} local caf = "nsIcon/" .. schemaName .. "/*.png" - + for k, v in ipairs(file.Find(caf, "DATA")) do file.Delete("nsIcon/" .. schemaName .. "/" .. v) end diff --git a/gamemode/core/meta/sh_base_inventory.lua b/gamemode/core/meta/sh_base_inventory.lua index 338f69c2..80e35773 100644 --- a/gamemode/core/meta/sh_base_inventory.lua +++ b/gamemode/core/meta/sh_base_inventory.lua @@ -167,7 +167,7 @@ end function Inventory:getItemCount(itemType) local count = 0 for _, item in pairs(self:getItems()) do - if (item.uniqueID == itemType) then + if (itemType and item.uniqueID == itemType or true) then count = count + item:getQuantity() end end diff --git a/gamemode/core/sh_util.lua b/gamemode/core/sh_util.lua index 61201589..24598565 100644 --- a/gamemode/core/sh_util.lua +++ b/gamemode/core/sh_util.lua @@ -177,7 +177,7 @@ do local vectorLength2D = FindMetaTable("Vector").Length2D function playerMeta:isRunning() - return vectorLength2D(self.GetVelocity(self)) > (self.GetWalkSpeed(self) + 10) + return vectorLength2D(self:GetVelocity()) > (self:GetWalkSpeed() + 10) end -- Checks if the player has a female model. diff --git a/plugins/gridinv/items/base/sh_bags.lua b/plugins/gridinv/items/base/sh_bags.lua index 33815f55..1e05c709 100644 --- a/plugins/gridinv/items/base/sh_bags.lua +++ b/plugins/gridinv/items/base/sh_bags.lua @@ -6,6 +6,8 @@ ITEM.model = "models/props_c17/suitcase001a.mdl" ITEM.category = "Storage" ITEM.isBag = true +local SOUND_BAG_RESPONSE = {"physics/cardboard/cardboard_box_impact_soft2.wav", 50} + -- The size of the inventory held by this item. ITEM.invWidth = 2 ITEM.invHeight = 2 diff --git a/plugins/multichar/plugins/charselect/derma/cl_creation.lua b/plugins/multichar/plugins/charselect/derma/cl_creation.lua index 85ad0f04..5231b193 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_creation.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_creation.lua @@ -6,6 +6,15 @@ function PANEL:configureSteps() self:addStep(vgui.Create("nutCharacterModel")) self:addStep(vgui.Create("nutCharacterBiography")) hook.Run("ConfigureCharacterCreationSteps", self) + + local stepKeys = table.GetKeys(self.steps) + table.sort(stepKeys, function(a, b) return a < b end) + local stepsCopy = table.Copy(self.steps) + self.steps = {} + + for newKey, oldKey in pairs(stepKeys) do + self.steps[newKey] = stepsCopy[oldKey] + end end -- If the faction and model character data has been set, updates the @@ -176,7 +185,7 @@ function PANEL:addStep(step, priority) assert(IsValid(step), "Invalid panel for step") assert(step.isCharCreateStep, "Panel must inherit nutCharacterCreateStep") if (isnumber(priority)) then - table.insert(self.steps, math.min(priority, #self.steps + 1), step) + table.insert(self.steps, priority, step) else self.steps[#self.steps + 1] = step end @@ -343,14 +352,14 @@ function PANEL:Init() self.prev = self.buttons:Add("nutCharButton") self.prev:SetText(L("back"):upper()) self.prev:Dock(LEFT) - self.prev:SetWide(96) + self.prev:SizeToContents() self.prev.DoClick = function(prev) self:previousStep() end self.prev:SetAlpha(0) self.next = self.buttons:Add("nutCharButton") self.next:SetText(L("next"):upper()) self.next:Dock(RIGHT) - self.next:SetWide(96) + self.next:SizeToContents() self.next.DoClick = function(next) self:nextStep() end self.cancel = self.buttons:Add("nutCharButton") diff --git a/plugins/observer.lua b/plugins/observer.lua index f40ee69f..02081cae 100644 --- a/plugins/observer.lua +++ b/plugins/observer.lua @@ -14,7 +14,7 @@ if (CLIENT) then client = LocalPlayer() if (client:IsAdmin() and client:GetMoveType() == MOVETYPE_NOCLIP and !client:InVehicle() and NUT_CVAR_ADMINESP:GetBool()) then - sx, sy = surface.ScreenWidth(), surface.ScreenHeight() + sx, sy = ScrW(), ScrH() for k, v in ipairs(player.GetAll()) do if (v == client) then continue end From d34d3b09c2d4ffe2c23ae86aff4235ee41ae0685 Mon Sep 17 00:00:00 2001 From: Rorkh <78957156+Rorkh@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:24:13 +0500 Subject: [PATCH 04/89] GetMoneyModel hook (#86) --- entities/entities/nut_money.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entities/entities/nut_money.lua b/entities/entities/nut_money.lua index f0666cad..b23bdf19 100644 --- a/entities/entities/nut_money.lua +++ b/entities/entities/nut_money.lua @@ -8,7 +8,7 @@ ENT.Spawnable = false if (SERVER) then function ENT:Initialize() self:SetModel( - nut.config.get("moneyModel", "models/props_lab/box01a.mdl") + hook.Run("GetMoneyModel", self:getAmount()) or nut.config.get("moneyModel", "models/props_lab/box01a.mdl") ) self:SetSolid(SOLID_VPHYSICS) self:PhysicsInit(SOLID_VPHYSICS) From e3c4b0c50c90e2126a067df7f0b53f469b5d3402 Mon Sep 17 00:00:00 2001 From: Rorkh <78957156+Rorkh@users.noreply.github.com> Date: Mon, 8 Nov 2021 19:59:16 +0500 Subject: [PATCH 05/89] ItemShouldTakeDamage hook added (#87) --- entities/entities/nut_item.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entities/entities/nut_item.lua b/entities/entities/nut_item.lua index 9630103a..143242e7 100644 --- a/entities/entities/nut_item.lua +++ b/entities/entities/nut_item.lua @@ -30,6 +30,8 @@ if (SERVER) then end function ENT:OnTakeDamage(dmginfo) + if (hook.Run("ItemShouldTakeDamage", self, dmginfo) == false) then return end + local damage = dmginfo:GetDamage() self:setHealth(self.health - damage) From 589535f90cf2c87db82156f4bbe68031316161a2 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Tue, 9 Nov 2021 10:12:55 +0200 Subject: [PATCH 06/89] Revert "ItemShouldTakeDamage hook added (#87)" This reverts commit e3c4b0c50c90e2126a067df7f0b53f469b5d3402. --- entities/entities/nut_item.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/entities/entities/nut_item.lua b/entities/entities/nut_item.lua index 143242e7..9630103a 100644 --- a/entities/entities/nut_item.lua +++ b/entities/entities/nut_item.lua @@ -30,8 +30,6 @@ if (SERVER) then end function ENT:OnTakeDamage(dmginfo) - if (hook.Run("ItemShouldTakeDamage", self, dmginfo) == false) then return end - local damage = dmginfo:GetDamage() self:setHealth(self.health - damage) From b5c16a801bf46709873e9ae9dd93c46e60bc5ace Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Thu, 2 Dec 2021 12:49:51 +0100 Subject: [PATCH 07/89] unnecessary brackets --- gamemode/core/util/cl_draw.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemode/core/util/cl_draw.lua b/gamemode/core/util/cl_draw.lua index 3966751d..d587c2a6 100644 --- a/gamemode/core/util/cl_draw.lua +++ b/gamemode/core/util/cl_draw.lua @@ -26,7 +26,7 @@ function nut.util.wrapText(text, width, font) local maxW = 0 if (w <= width) then - return {(text:gsub("%s", " "))}, w + return {text:gsub("%s", " ")}, w end for i = 1, #exploded do From 33950d38eedc454489fa90b1e8d65e32600efb0d Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 4 Dec 2021 17:09:43 +0100 Subject: [PATCH 08/89] Update sh_outfit.lua Make it so that bodygroups persist after taking off an item that modifies your bodygroups c: --- gamemode/items/base/sh_outfit.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index eb91b0af..0957a67d 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -60,11 +60,13 @@ function ITEM:removeOutfit(client) client:SetSkin(character:getData("oldSkin", character:getData("skin", 0))) character:setData("oldSkin", nil) + + local oldGroups = character:getData("oldGroups", {}) for k, v in pairs(self.bodyGroups or {}) do local index = client:FindBodygroupByName(k) if (index > -1) then - client:SetBodygroup(index, 0) + client:SetBodygroup(index, oldGroups[index] or 0) local groups = character:getData("groups", {}) @@ -74,6 +76,7 @@ function ITEM:removeOutfit(client) end end end + character:setData("oldGroups", nil) end -- Then, remove PAC parts from this outfit. @@ -185,18 +188,21 @@ ITEM.functions.Equip = { -- Then set appropriate body groups for the model. if (istable(item.bodyGroups)) then + local oldGroups = {} local groups = {} for k, value in pairs(item.bodyGroups) do local index = item.player:FindBodygroupByName(k) if (index > -1) then + oldGroups[index] = item.player:GetBodygroup(index) groups[index] = value end end - local newGroups = char:getData("groups", {}) + char:setData("oldGroups", oldGroups) + local newGroups = char:getData("groups", {}) for index, value in pairs(groups) do newGroups[index] = value item.player:SetBodygroup(index, value) From 0ca7ba91f0476a0a16debe0ce11b44a43749226b Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 4 Dec 2021 17:23:40 +0100 Subject: [PATCH 09/89] Revert "Update sh_outfit.lua" This reverts commit 33950d38eedc454489fa90b1e8d65e32600efb0d. --- gamemode/items/base/sh_outfit.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index 0957a67d..eb91b0af 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -60,13 +60,11 @@ function ITEM:removeOutfit(client) client:SetSkin(character:getData("oldSkin", character:getData("skin", 0))) character:setData("oldSkin", nil) - - local oldGroups = character:getData("oldGroups", {}) for k, v in pairs(self.bodyGroups or {}) do local index = client:FindBodygroupByName(k) if (index > -1) then - client:SetBodygroup(index, oldGroups[index] or 0) + client:SetBodygroup(index, 0) local groups = character:getData("groups", {}) @@ -76,7 +74,6 @@ function ITEM:removeOutfit(client) end end end - character:setData("oldGroups", nil) end -- Then, remove PAC parts from this outfit. @@ -188,21 +185,18 @@ ITEM.functions.Equip = { -- Then set appropriate body groups for the model. if (istable(item.bodyGroups)) then - local oldGroups = {} local groups = {} for k, value in pairs(item.bodyGroups) do local index = item.player:FindBodygroupByName(k) if (index > -1) then - oldGroups[index] = item.player:GetBodygroup(index) groups[index] = value end end - char:setData("oldGroups", oldGroups) - local newGroups = char:getData("groups", {}) + for index, value in pairs(groups) do newGroups[index] = value item.player:SetBodygroup(index, value) From 54ff569077d19f1e42620306e4db8d25860eab42 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 4 Dec 2021 17:26:15 +0100 Subject: [PATCH 10/89] Update sh_outfit.lua Allow bodygroups to persist after outfits that edit bodygroups change them --- gamemode/items/base/sh_outfit.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index eb91b0af..e99f30ee 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -60,11 +60,13 @@ function ITEM:removeOutfit(client) client:SetSkin(character:getData("oldSkin", character:getData("skin", 0))) character:setData("oldSkin", nil) - for k, v in pairs(self.bodyGroups or {}) do + + local oldGroups = character:getData("oldGroups", {}) + for k in pairs(self.bodyGroups or {}) do local index = client:FindBodygroupByName(k) if (index > -1) then - client:SetBodygroup(index, 0) + client:SetBodygroup(index, oldGroups[index] or 0) local groups = character:getData("groups", {}) @@ -74,6 +76,7 @@ function ITEM:removeOutfit(client) end end end + character:setData("oldGroups", nil) end -- Then, remove PAC parts from this outfit. @@ -134,7 +137,7 @@ ITEM.functions.Equip = { local char = item.player:getChar() local items = char:getInv():getItems() - for id, other in pairs(items) do + for _, other in pairs(items) do if ( item ~= other and item.outfitCategory == other.outfitCategory and @@ -167,7 +170,7 @@ ITEM.functions.Equip = { ):lower() char:setModel(newModel) else - for k, v in ipairs(item.replacements) do + for _, v in ipairs(item.replacements) do char:setModel(item.player:GetModel():gsub(v[1], v[2])) end end @@ -185,18 +188,21 @@ ITEM.functions.Equip = { -- Then set appropriate body groups for the model. if (istable(item.bodyGroups)) then + local oldGroups = {} local groups = {} for k, value in pairs(item.bodyGroups) do local index = item.player:FindBodygroupByName(k) if (index > -1) then + oldGroups[index] = item.player:GetBodygroup(index) groups[index] = value end end - local newGroups = char:getData("groups", {}) + char:setData("oldGroups", oldGroups) + local newGroups = char:getData("groups", {}) for index, value in pairs(groups) do newGroups[index] = value item.player:SetBodygroup(index, value) @@ -239,11 +245,9 @@ function ITEM:onLoadout() end function ITEM:onRemoved() - local inv = nut.item.inventories[self.invID] - if (IsValid(receiver) and receiver:IsPlayer()) then - if (self:getData("equip")) then - self:removeOutfit(receiver) - end + --local inv = nut.item.inventories[self.invID] + if (IsValid(receiver) and receiver:IsPlayer()) and (self:getData("equip")) then + self:removeOutfit(receiver) end end From bcc06ed78770c2f10e07fae387c1828b74bf65fd Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 4 Dec 2021 17:28:36 +0100 Subject: [PATCH 11/89] Allow bodygroups to persist after outfits that edit bodygroups change them (#89) * unnecessary brackets * Update sh_outfit.lua Make it so that bodygroups persist after taking off an item that modifies your bodygroups c: * Revert "Update sh_outfit.lua" This reverts commit 33950d38eedc454489fa90b1e8d65e32600efb0d. * Update sh_outfit.lua Allow bodygroups to persist after outfits that edit bodygroups change them --- gamemode/core/util/cl_draw.lua | 2 +- gamemode/items/base/sh_outfit.lua | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gamemode/core/util/cl_draw.lua b/gamemode/core/util/cl_draw.lua index 3966751d..d587c2a6 100644 --- a/gamemode/core/util/cl_draw.lua +++ b/gamemode/core/util/cl_draw.lua @@ -26,7 +26,7 @@ function nut.util.wrapText(text, width, font) local maxW = 0 if (w <= width) then - return {(text:gsub("%s", " "))}, w + return {text:gsub("%s", " ")}, w end for i = 1, #exploded do diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index eb91b0af..e99f30ee 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -60,11 +60,13 @@ function ITEM:removeOutfit(client) client:SetSkin(character:getData("oldSkin", character:getData("skin", 0))) character:setData("oldSkin", nil) - for k, v in pairs(self.bodyGroups or {}) do + + local oldGroups = character:getData("oldGroups", {}) + for k in pairs(self.bodyGroups or {}) do local index = client:FindBodygroupByName(k) if (index > -1) then - client:SetBodygroup(index, 0) + client:SetBodygroup(index, oldGroups[index] or 0) local groups = character:getData("groups", {}) @@ -74,6 +76,7 @@ function ITEM:removeOutfit(client) end end end + character:setData("oldGroups", nil) end -- Then, remove PAC parts from this outfit. @@ -134,7 +137,7 @@ ITEM.functions.Equip = { local char = item.player:getChar() local items = char:getInv():getItems() - for id, other in pairs(items) do + for _, other in pairs(items) do if ( item ~= other and item.outfitCategory == other.outfitCategory and @@ -167,7 +170,7 @@ ITEM.functions.Equip = { ):lower() char:setModel(newModel) else - for k, v in ipairs(item.replacements) do + for _, v in ipairs(item.replacements) do char:setModel(item.player:GetModel():gsub(v[1], v[2])) end end @@ -185,18 +188,21 @@ ITEM.functions.Equip = { -- Then set appropriate body groups for the model. if (istable(item.bodyGroups)) then + local oldGroups = {} local groups = {} for k, value in pairs(item.bodyGroups) do local index = item.player:FindBodygroupByName(k) if (index > -1) then + oldGroups[index] = item.player:GetBodygroup(index) groups[index] = value end end - local newGroups = char:getData("groups", {}) + char:setData("oldGroups", oldGroups) + local newGroups = char:getData("groups", {}) for index, value in pairs(groups) do newGroups[index] = value item.player:SetBodygroup(index, value) @@ -239,11 +245,9 @@ function ITEM:onLoadout() end function ITEM:onRemoved() - local inv = nut.item.inventories[self.invID] - if (IsValid(receiver) and receiver:IsPlayer()) then - if (self:getData("equip")) then - self:removeOutfit(receiver) - end + --local inv = nut.item.inventories[self.invID] + if (IsValid(receiver) and receiver:IsPlayer()) and (self:getData("equip")) then + self:removeOutfit(receiver) end end From bb40b7a739c23c2a5307e2b4f20251ebba871ec2 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 4 Dec 2021 19:21:43 +0100 Subject: [PATCH 12/89] Update sh_outfit.lua --- gamemode/items/base/sh_outfit.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index e99f30ee..2e78bc96 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -67,6 +67,7 @@ function ITEM:removeOutfit(client) if (index > -1) then client:SetBodygroup(index, oldGroups[index] or 0) + oldGroups[index] = nil local groups = character:getData("groups", {}) @@ -76,7 +77,7 @@ function ITEM:removeOutfit(client) end end end - character:setData("oldGroups", nil) + character:setData("oldGroups", oldGroups) end -- Then, remove PAC parts from this outfit. @@ -188,7 +189,7 @@ ITEM.functions.Equip = { -- Then set appropriate body groups for the model. if (istable(item.bodyGroups)) then - local oldGroups = {} + local oldGroups = char:getData("oldGroups", {}) local groups = {} for k, value in pairs(item.bodyGroups) do From 262f36792df83cbac46a53bdb939ec54e7aa0f29 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 4 Dec 2021 19:22:29 +0100 Subject: [PATCH 13/89] 1.2.3 wip (#90) * unnecessary brackets * Update sh_outfit.lua Make it so that bodygroups persist after taking off an item that modifies your bodygroups c: * Revert "Update sh_outfit.lua" This reverts commit 33950d38eedc454489fa90b1e8d65e32600efb0d. * Update sh_outfit.lua Allow bodygroups to persist after outfits that edit bodygroups change them From 4c46796907cdfd50450403bd69de2d945a58bfe9 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 4 Dec 2021 19:24:59 +0100 Subject: [PATCH 14/89] Revert "1.2.3 wip (#90)" (#92) This reverts commit 262f36792df83cbac46a53bdb939ec54e7aa0f29. From ebeb2fc408e0c9e678cc00950d758ef2b3178034 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 4 Dec 2021 19:34:38 +0100 Subject: [PATCH 15/89] 1.2.3 wip (#93) * unnecessary brackets * Update sh_outfit.lua Make it so that bodygroups persist after taking off an item that modifies your bodygroups c: * Revert "Update sh_outfit.lua" This reverts commit 33950d38eedc454489fa90b1e8d65e32600efb0d. * Update sh_outfit.lua Allow bodygroups to persist after outfits that edit bodygroups change them * Update sh_outfit.lua --- gamemode/items/base/sh_outfit.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index e99f30ee..6d4a2e51 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -67,6 +67,7 @@ function ITEM:removeOutfit(client) if (index > -1) then client:SetBodygroup(index, oldGroups[index] or 0) + oldGroups[index] = nil local groups = character:getData("groups", {}) @@ -76,7 +77,8 @@ function ITEM:removeOutfit(client) end end end - character:setData("oldGroups", nil) + + character:setData("oldGroups", oldGroups) end -- Then, remove PAC parts from this outfit. @@ -188,7 +190,7 @@ ITEM.functions.Equip = { -- Then set appropriate body groups for the model. if (istable(item.bodyGroups)) then - local oldGroups = {} + local oldGroups = char:getData("oldGroups", {}) local groups = {} for k, value in pairs(item.bodyGroups) do From 91606ddc4c2572e3a02d1e8ccd5350e08b62954c Mon Sep 17 00:00:00 2001 From: Sam Nyashev <12237569+Heyter@users.noreply.github.com> Date: Mon, 20 Dec 2021 14:11:25 +0300 Subject: [PATCH 16/89] inventory:destroy null id (#95) --- gamemode/core/meta/inventory/sv_base_inventory.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamemode/core/meta/inventory/sv_base_inventory.lua b/gamemode/core/meta/inventory/sv_base_inventory.lua index 412f6e83..6fe884dc 100644 --- a/gamemode/core/meta/inventory/sv_base_inventory.lua +++ b/gamemode/core/meta/inventory/sv_base_inventory.lua @@ -312,10 +312,12 @@ function Inventory:delete() end function Inventory:destroy() + local id = self:getID() + for _, item in pairs(self:getItems()) do item:destroy() end - nut.inventory.instances[self:getID()] = nil + nut.inventory.instances[id] = nil net.Start("nutInventoryDelete") net.WriteType(id) net.Broadcast() From a38344d17af1737301df2cc3b9e75572c0b263fd Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Tue, 4 Jan 2022 12:32:22 +0100 Subject: [PATCH 17/89] minor bug fixes --- gamemode/core/hooks/cl_hooks.lua | 3 +-- gamemode/core/libs/sh_date.lua | 19 ++++++++++++------- .../core/meta/inventory/sv_base_inventory.lua | 4 +--- gamemode/core/util/cl_draw.lua | 3 ++- gamemode/items/base/sh_outfit.lua | 6 ++---- plugins/nscredits.lua | 1 + 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/gamemode/core/hooks/cl_hooks.lua b/gamemode/core/hooks/cl_hooks.lua index ce0d3e0f..51001acf 100644 --- a/gamemode/core/hooks/cl_hooks.lua +++ b/gamemode/core/hooks/cl_hooks.lua @@ -296,8 +296,7 @@ function GM:CharacterListLoaded() end RunConsoleCommand("stopsound") -- Show the intro if needed, then show the character menu. - local intro = - shouldPlayIntro and hook.Run("CreateIntroduction") or nil + local intro = shouldPlayIntro and hook.Run("CreateIntroduction") or nil if (IsValid(intro)) then intro.nutLoadOldRemove = intro.OnRemove intro.OnRemove = function(panel) diff --git a/gamemode/core/libs/sh_date.lua b/gamemode/core/libs/sh_date.lua index 6c6651ad..3ef5700f 100644 --- a/gamemode/core/libs/sh_date.lua +++ b/gamemode/core/libs/sh_date.lua @@ -59,7 +59,7 @@ nut.config.add("yearAppendix", "", "Add a custom appendix to your date, if you u } ) --- function returns a number that represents the custom time. the year is always the current year for +-- function returns a number that represents the custom time. the year is always the current year for -- compatibility, though it can be editted with nut.date.getFormatted function nut.date.get() @@ -81,7 +81,7 @@ end if SERVER then - -- This is internal, though you can use it you probably shouldn't. + -- This is internal, though you can use it you probably shouldn't. -- Checks the time difference between the old time values and current time, and updates month and day to advance in the time difference -- creates a timer that updates the month and day values, in case the server runs continuously without restarts. function nut.date.initialize() @@ -113,17 +113,22 @@ if SERVER then -- the reason for this complication instead of just upvaluing day/month by 1 is that some months have 28, 30 or 31 days. -- and its simpler for the server to decide what the next month should be rather than manually computing that local function updateDateConfigs() - local curDateTable = os.date("*t") -- get the current date table - local remainingSeconds = (curDateTable.hour * -3600 - curDateTable.min * 60 - curDateTable.sec) % 86400 -- get the remaining seconds until the new day + local dateTable = os.date("*t") -- get the current date table + local curSeconds = os.time(dateTable) + dateTable.day = dateTable.day + 1 + dateTable.hour = 0 + dateTable.min = 0 + dateTable.sec = 0 + local remainingSeconds = os.time(dateTable) - curSeconds -- get the remaining seconds until the new day timer.Simple(remainingSeconds, function() -- run this code only once the day changes local newTime = os.time({ year = tonumber(os.date("%Y")), month = tonumber(nut.config.get("month")), day = tonumber(nut.config.get("day")), - hour = tonumber(os.date("%H")), - min = os.date("%M"), - sec = os.date("%S") + hour = 0, + min = 0, + sec = 0 }) + 86400 -- 24 hours. nut.config.set("month", tonumber(os.date("%m", newTime))) diff --git a/gamemode/core/meta/inventory/sv_base_inventory.lua b/gamemode/core/meta/inventory/sv_base_inventory.lua index 6fe884dc..412f6e83 100644 --- a/gamemode/core/meta/inventory/sv_base_inventory.lua +++ b/gamemode/core/meta/inventory/sv_base_inventory.lua @@ -312,12 +312,10 @@ function Inventory:delete() end function Inventory:destroy() - local id = self:getID() - for _, item in pairs(self:getItems()) do item:destroy() end - nut.inventory.instances[id] = nil + nut.inventory.instances[self:getID()] = nil net.Start("nutInventoryDelete") net.WriteType(id) net.Broadcast() diff --git a/gamemode/core/util/cl_draw.lua b/gamemode/core/util/cl_draw.lua index d587c2a6..e3ed900c 100644 --- a/gamemode/core/util/cl_draw.lua +++ b/gamemode/core/util/cl_draw.lua @@ -26,7 +26,8 @@ function nut.util.wrapText(text, width, font) local maxW = 0 if (w <= width) then - return {text:gsub("%s", " ")}, w + text, _ = text:gsub("%s", " ") + return {text}, w end for i = 1, #exploded do diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index 6d4a2e51..e99f30ee 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -67,7 +67,6 @@ function ITEM:removeOutfit(client) if (index > -1) then client:SetBodygroup(index, oldGroups[index] or 0) - oldGroups[index] = nil local groups = character:getData("groups", {}) @@ -77,8 +76,7 @@ function ITEM:removeOutfit(client) end end end - - character:setData("oldGroups", oldGroups) + character:setData("oldGroups", nil) end -- Then, remove PAC parts from this outfit. @@ -190,7 +188,7 @@ ITEM.functions.Equip = { -- Then set appropriate body groups for the model. if (istable(item.bodyGroups)) then - local oldGroups = char:getData("oldGroups", {}) + local oldGroups = {} local groups = {} for k, value in pairs(item.bodyGroups) do diff --git a/plugins/nscredits.lua b/plugins/nscredits.lua index a3fd08de..fd4fccda 100644 --- a/plugins/nscredits.lua +++ b/plugins/nscredits.lua @@ -43,6 +43,7 @@ function PANEL:Init() self.name = self:Add("DLabel") self.name:SetFont("nutBigCredits") + self.name:SetText("Loading...") self.desc = self:Add("DLabel") self.desc:SetFont("nutSmallCredits") From dba95927cd6a50ce759105cbf43d0ebd298ebe79 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 26 Mar 2022 19:08:47 +0200 Subject: [PATCH 18/89] improved Faction model bodygroups --- gamemode/core/hooks/cl_hooks.lua | 1 + gamemode/core/hooks/sv_hooks.lua | 2 + gamemode/core/libs/sh_faction.lua | 61 +++++++++++++++++++++++++++---- gamemode/shared.lua | 10 +++-- 4 files changed, 63 insertions(+), 11 deletions(-) diff --git a/gamemode/core/hooks/cl_hooks.lua b/gamemode/core/hooks/cl_hooks.lua index 51001acf..3f5de1af 100644 --- a/gamemode/core/hooks/cl_hooks.lua +++ b/gamemode/core/hooks/cl_hooks.lua @@ -312,6 +312,7 @@ end function GM:InitPostEntity() nut.joinTime = RealTime() - 0.9716 + nut.faction.formatModelData() end function GM:CalcView(client, origin, angles, fov) diff --git a/gamemode/core/hooks/sv_hooks.lua b/gamemode/core/hooks/sv_hooks.lua index a1911aa7..6416ea47 100644 --- a/gamemode/core/hooks/sv_hooks.lua +++ b/gamemode/core/hooks/sv_hooks.lua @@ -487,6 +487,8 @@ function GM:InitPostEntity() end end + nut.faction.formatModelData() + timer.Simple(2, function() nut.entityDataLoaded = true end) diff --git a/gamemode/core/libs/sh_faction.lua b/gamemode/core/libs/sh_faction.lua index 7a67acd5..81fa4042 100644 --- a/gamemode/core/libs/sh_faction.lua +++ b/gamemode/core/libs/sh_faction.lua @@ -28,7 +28,7 @@ local CITIZEN_MODELS = { } function nut.faction.loadFromDir(directory) - for k, v in ipairs(file.Find(directory.."/*.lua", "LUA")) do + for _, v in ipairs(file.Find(directory.."/*.lua", "LUA")) do local niceName = v:sub(4, -5) FACTION = nut.faction.teams[niceName] or {index = table.Count(nut.faction.teams) + 1, isDefault = true} @@ -58,14 +58,13 @@ function nut.faction.loadFromDir(directory) FACTION.models = FACTION.models or CITIZEN_MODELS FACTION.uniqueID = FACTION.uniqueID or niceName - for k, v in pairs(FACTION.models) do - if (isstring(v)) then - util.PrecacheModel(v) - elseif (istable(v)) then - util.PrecacheModel(v[1]) + for _, modelData in pairs(FACTION.models) do + if (isstring(modelData)) then + util.PrecacheModel(modelData) + elseif (istable(modelData)) then + util.PrecacheModel(modelData[1]) end end - nut.faction.indices[FACTION.index] = FACTION nut.faction.teams[niceName] = FACTION FACTION = nil @@ -80,6 +79,54 @@ function nut.faction.getIndex(uniqueID) return nut.faction.teams[uniqueID] and nut.faction.teams[uniqueID].index end + +--[[ + Purpose: Formats the bodygroup data into a uniform style. + This allows bodygroup data per model to be submitted in 3 ways: + 1. as a string ("0121200") + 2. as a table with the bodygroup ID as the key {[1] = 2, [2] = 1, [3] = 2, [4] = 0} + 3. as a table with the bodygroup name as the key {head = 2, shoulders = 1, knees = 2, toes = 0} +]] +function nut.faction.formatModelData() + for name, faction in pairs(nut.faction.teams) do + if (faction.models) then + for modelIndex, modelData in pairs(faction.models) do + local newGroups + if (istable(modelData)) and modelData[3] then + local groups = {} + if istable(modelData[3]) then + local dummy + if SERVER then + dummy = ents.Create("prop_physics") + dummy:SetModel(modelData[1]) + else + dummy = ClientsideModel(modelData[1]) + end + local groupData = dummy:GetBodyGroups() + for _, group in ipairs(groupData) do + if group.id > 0 then + if modelData[3][group.id] then + groups[group.id] = modelData[3][group.id] + elseif modelData[3][group.name] then + groups[group.id] = modelData[3][group.name] + end + end + end + dummy:Remove() + newGroups = groups + elseif isstring(modelData[3]) then + newGroups = string.Explode("", modelData[3]) + end + end + if newGroups then + nut.faction.teams[name].models[modelIndex][3] = newGroups + nut.faction.indices[faction.index].models[modelIndex][3] = newGroups + end + end + end + end +end + if (CLIENT) then function nut.faction.hasWhitelist(faction) local data = nut.faction.indices[faction] diff --git a/gamemode/shared.lua b/gamemode/shared.lua index 8ec58efd..ea1a940c 100644 --- a/gamemode/shared.lua +++ b/gamemode/shared.lua @@ -1,9 +1,9 @@ -- Define gamemode information. -GM.Name = "NutScript 2.0" -GM.Author = "Chessnut and Black Tea" +GM.Name = "NutScript 1.2" +GM.Author = "Chessnut, Black Tea and the NutScript team" GM.Website = "http://nutscript.net/" -nut.version = "2.0" +nut.version = "1.2.2" -- Fix for client:SteamID64() returning nil when in single-player. do @@ -94,6 +94,8 @@ function GM:OnReloaded() NUT_PLUGINS_ALREADY_LOADED = true end + + nut.faction.formatModelData() end -- Include default NutScript chat commands. @@ -103,6 +105,6 @@ if (SERVER and game.IsDedicated()) then concommand.Remove("gm_save") concommand.Add("gm_save", function(client, command, arguments) - + end) end From 89bb013269dcecb400acc0e387e0d5afac53b7d5 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 26 Mar 2022 19:09:04 +0200 Subject: [PATCH 19/89] Fix charCreation icons not displaying bodygroups --- .../charselect/derma/steps/cl_model.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/plugins/multichar/plugins/charselect/derma/steps/cl_model.lua b/plugins/multichar/plugins/charselect/derma/steps/cl_model.lua index cd2bc3d8..6f886c80 100644 --- a/plugins/multichar/plugins/charselect/derma/steps/cl_model.lua +++ b/plugins/multichar/plugins/charselect/derma/steps/cl_model.lua @@ -38,11 +38,23 @@ function PANEL:onDisplay() icon.model = v icon.skin = 0 icon.bodyGroups = {} - else - icon:SetModel(v[1], v[2] or 0, v[3]) + elseif istable(v) then + local groups = "" -- SpawnIcon:SetBodyGroup starts with 0 for some reason + for i = 0, 9 do + groups = groups .. (v[3][i] or 0) + end + if #groups < 9 then + for i = 1, 9-#groups do + groups = groups .. "0" + end + elseif #groups > 9 then + groups = groups:sub(1, 9) + end + + icon:SetModel(v[1], v[2] or 0, groups) icon.model = v[1] icon.skin = v[2] or 0 - icon.bodyGroups = v[3] + icon.bodyGroups = groups end icon.index = k From 1198b804dbc997dc4abf67b197ec93b320669a78 Mon Sep 17 00:00:00 2001 From: Yshera Date: Wed, 6 Apr 2022 20:05:12 +0100 Subject: [PATCH 20/89] Update sv_base_inventory.lua --- .../core/meta/inventory/sv_base_inventory.lua | 57 +++++++++++-------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/gamemode/core/meta/inventory/sv_base_inventory.lua b/gamemode/core/meta/inventory/sv_base_inventory.lua index 412f6e83..1e7edc50 100644 --- a/gamemode/core/meta/inventory/sv_base_inventory.lua +++ b/gamemode/core/meta/inventory/sv_base_inventory.lua @@ -280,31 +280,38 @@ function Inventory:syncData(key, recipients) end function Inventory:sync(recipients) - net.Start("nutInventoryInit") - -- ID is not always a number. - net.WriteType(self.id) - net.WriteString(self.typeID) - net.WriteTable(self.data) - net.WriteUInt(table.Count(self.items), 32) - local function writeItem(item) - net.WriteUInt(item:getID(), 32) - net.WriteString(item.uniqueID) - net.WriteTable(item.data) - net.WriteUInt(item:getQuantity(), 32) - end - - -- TODO: - -- Roughly 150 bytes per item * n items - 325 bytes < 64000 bytes - -- => n is roughly less than 428 items before net message limit reached. - -- Is this safe to assume inventories have at most 400 items? - for _, item in pairs(self.items) do - writeItem(item) - end - local res = net.Send(recipients or self:getRecipients()) - - for _, item in pairs(self.items) do - item:onSync(recipients) - end + net.Start("nutInventoryInit") + -- ID is not always a number. + net.WriteType(self.id) + net.WriteString(self.typeID) + net.WriteTable(self.data) + local items = {} + + local function writeItem(item) + items[#items + 1] = { + i = item:getID(), + u = item.uniqueID, + d = item.data, + q = item:getQuantity() + } + end + + for _, item in pairs(self.items) do + writeItem(item) + end + + local compressedTable = util.Compress(util.TableToJSON(items)) + net.WriteUInt(#compressedTable, 32) + net.WriteData(compressedTable, #compressedTable) + --local currentBytes, currentBits = net.BytesWritten() + --print("Current net message size: " .. currentBytes .. " bytes (" .. currentBits .. " bits)") + + + local res = net.Send(recipients or self:getRecipients()) + + for _, item in pairs(self.items) do + item:onSync(recipients) + end end function Inventory:delete() From 12817f4e4f561c1491d3151345192649351275cb Mon Sep 17 00:00:00 2001 From: Yshera Date: Wed, 6 Apr 2022 20:05:26 +0100 Subject: [PATCH 21/89] Update cl_base_inventory.lua --- .../core/meta/inventory/cl_base_inventory.lua | 67 +++++++++++-------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/gamemode/core/meta/inventory/cl_base_inventory.lua b/gamemode/core/meta/inventory/cl_base_inventory.lua index a1300f51..8e068dbf 100644 --- a/gamemode/core/meta/inventory/cl_base_inventory.lua +++ b/gamemode/core/meta/inventory/cl_base_inventory.lua @@ -18,39 +18,48 @@ net.Receive("nutInventoryData", function() end) net.Receive("nutInventoryInit", function() - local id = net.ReadType() - local typeID = net.ReadString() - local data = net.ReadTable() - local instance = nut.inventory.new(typeID) - instance.id = id - instance.data = data - instance.items = {} + local id = net.ReadType() + local typeID = net.ReadString() + local data = net.ReadTable() + local instance = nut.inventory.new(typeID) + instance.id = id + instance.data = data + instance.items = {} + local length = net.ReadUInt(32) + local data2 = net.ReadData(length) + local uncompressed_data = util.Decompress(data2) + print("=====HELLO====") + print(uncompressed_data) + local items = util.JSONToTable(uncompressed_data) - local expectedItems = net.ReadUInt(32) - local function readItem() - return net.ReadUInt(32), net.ReadString(), net.ReadTable(), net.ReadUInt(32) - end + local function readItem(I) + local c = items[I] -- i + return c.i, c.u, c.d, c.q + end - for i = 1, expectedItems do - local itemID, itemType, data, quantity = readItem() - local item = nut.item.new(itemType, itemID) - item.data = table.Merge(item.data, data) - item.invID = instance.id - item.quantity = quantity - instance.items[itemID] = item - hook.Run("ItemInitialized", item) - end + local datatable = items + local expectedItems = #datatable - nut.inventory.instances[instance.id] = instance - hook.Run("InventoryInitialized", instance) + for i = 1, expectedItems do + local itemID, itemType, data, quantity = readItem(i) + local item = nut.item.new(itemType, itemID) + item.data = table.Merge(item.data, data) + item.invID = instance.id + item.quantity = quantity + instance.items[itemID] = item + hook.Run("ItemInitialized", item) + end - for _, character in pairs(nut.char.loaded) do - for index, inventory in pairs(character.vars.inv) do - if (inventory:getID() == id) then - character.vars.inv[index] = instance - end - end - end + nut.inventory.instances[instance.id] = instance + hook.Run("InventoryInitialized", instance) + + for _, character in pairs(nut.char.loaded) do + for index, inventory in pairs(character.vars.inv) do + if inventory:getID() == id then + character.vars.inv[index] = instance + end + end + end end) net.Receive("nutInventoryAdd", function() From 0c726c6e878e0524e74352815a4e62c9657991a1 Mon Sep 17 00:00:00 2001 From: Yshera Date: Wed, 6 Apr 2022 20:09:22 +0100 Subject: [PATCH 22/89] Update cl_base_inventory.lua removed debug prints --- gamemode/core/meta/inventory/cl_base_inventory.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gamemode/core/meta/inventory/cl_base_inventory.lua b/gamemode/core/meta/inventory/cl_base_inventory.lua index 8e068dbf..7f27b90b 100644 --- a/gamemode/core/meta/inventory/cl_base_inventory.lua +++ b/gamemode/core/meta/inventory/cl_base_inventory.lua @@ -28,8 +28,7 @@ net.Receive("nutInventoryInit", function() local length = net.ReadUInt(32) local data2 = net.ReadData(length) local uncompressed_data = util.Decompress(data2) - print("=====HELLO====") - print(uncompressed_data) + local items = util.JSONToTable(uncompressed_data) local function readItem(I) From b90995b6444d16ab9ec15bc83ef22b06dede371a Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 15 Jun 2022 20:07:55 +0200 Subject: [PATCH 23/89] fixed a bug with Inv:getItemCount --- gamemode/core/meta/sh_base_inventory.lua | 2 +- plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua | 2 +- plugins/nscredits.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gamemode/core/meta/sh_base_inventory.lua b/gamemode/core/meta/sh_base_inventory.lua index 80e35773..7311007c 100644 --- a/gamemode/core/meta/sh_base_inventory.lua +++ b/gamemode/core/meta/sh_base_inventory.lua @@ -167,7 +167,7 @@ end function Inventory:getItemCount(itemType) local count = 0 for _, item in pairs(self:getItems()) do - if (itemType and item.uniqueID == itemType or true) then + if (itemType == nil and true or item.uniqueID == itemType) then count = count + item:getQuantity() end end diff --git a/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua b/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua index b2458182..48ea9728 100644 --- a/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua +++ b/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua @@ -42,7 +42,7 @@ end function PANEL:Center() local parent = self:GetParent() local centerX, centerY = ScrW() * 0.5, ScrH() * 0.5 - + self:SetPos( centerX - (self:GetWide() * 0.5), centerY - (self:GetTall() * 0.5) diff --git a/plugins/nscredits.lua b/plugins/nscredits.lua index fd4fccda..3e080ce6 100644 --- a/plugins/nscredits.lua +++ b/plugins/nscredits.lua @@ -63,7 +63,7 @@ function PANEL:setAvatarImage(id) end function PANEL:setName(name, isID, color) - if not self.name then return end + if not IsValid(self.name) then return end if isID then steamworks.RequestPlayerInfo(name, function(steamName) self.name:SetText(steamName or "Loading...") From 1ee575679d953bd2f97f0c137f11ae4ef96ec994 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 15 Jun 2022 20:10:39 +0200 Subject: [PATCH 24/89] Revert "fixed a bug with Inv:getItemCount" This reverts commit b90995b6444d16ab9ec15bc83ef22b06dede371a. --- gamemode/core/meta/sh_base_inventory.lua | 2 +- plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua | 2 +- plugins/nscredits.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gamemode/core/meta/sh_base_inventory.lua b/gamemode/core/meta/sh_base_inventory.lua index 7311007c..80e35773 100644 --- a/gamemode/core/meta/sh_base_inventory.lua +++ b/gamemode/core/meta/sh_base_inventory.lua @@ -167,7 +167,7 @@ end function Inventory:getItemCount(itemType) local count = 0 for _, item in pairs(self:getItems()) do - if (itemType == nil and true or item.uniqueID == itemType) then + if (itemType and item.uniqueID == itemType or true) then count = count + item:getQuantity() end end diff --git a/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua b/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua index 48ea9728..b2458182 100644 --- a/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua +++ b/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua @@ -42,7 +42,7 @@ end function PANEL:Center() local parent = self:GetParent() local centerX, centerY = ScrW() * 0.5, ScrH() * 0.5 - + self:SetPos( centerX - (self:GetWide() * 0.5), centerY - (self:GetTall() * 0.5) diff --git a/plugins/nscredits.lua b/plugins/nscredits.lua index 3e080ce6..fd4fccda 100644 --- a/plugins/nscredits.lua +++ b/plugins/nscredits.lua @@ -63,7 +63,7 @@ function PANEL:setAvatarImage(id) end function PANEL:setName(name, isID, color) - if not IsValid(self.name) then return end + if not self.name then return end if isID then steamworks.RequestPlayerInfo(name, function(steamName) self.name:SetText(steamName or "Loading...") From 3d6bb137d8cde4da7b9cd81222dd2a2c62e2dda6 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 15 Jun 2022 20:11:12 +0200 Subject: [PATCH 25/89] Revert "Revert "fixed a bug with Inv:getItemCount"" This reverts commit 1ee575679d953bd2f97f0c137f11ae4ef96ec994. --- gamemode/core/meta/sh_base_inventory.lua | 2 +- plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua | 2 +- plugins/nscredits.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gamemode/core/meta/sh_base_inventory.lua b/gamemode/core/meta/sh_base_inventory.lua index 80e35773..7311007c 100644 --- a/gamemode/core/meta/sh_base_inventory.lua +++ b/gamemode/core/meta/sh_base_inventory.lua @@ -167,7 +167,7 @@ end function Inventory:getItemCount(itemType) local count = 0 for _, item in pairs(self:getItems()) do - if (itemType and item.uniqueID == itemType or true) then + if (itemType == nil and true or item.uniqueID == itemType) then count = count + item:getQuantity() end end diff --git a/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua b/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua index b2458182..48ea9728 100644 --- a/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua +++ b/plugins/gridinv/plugins/gridinvui/derma/cl_grid_inventory.lua @@ -42,7 +42,7 @@ end function PANEL:Center() local parent = self:GetParent() local centerX, centerY = ScrW() * 0.5, ScrH() * 0.5 - + self:SetPos( centerX - (self:GetWide() * 0.5), centerY - (self:GetTall() * 0.5) diff --git a/plugins/nscredits.lua b/plugins/nscredits.lua index fd4fccda..3e080ce6 100644 --- a/plugins/nscredits.lua +++ b/plugins/nscredits.lua @@ -63,7 +63,7 @@ function PANEL:setAvatarImage(id) end function PANEL:setName(name, isID, color) - if not self.name then return end + if not IsValid(self.name) then return end if isID then steamworks.RequestPlayerInfo(name, function(steamName) self.name:SetText(steamName or "Loading...") From 3274631271eed17ec565e236d5b987b00bf438e9 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 3 Jul 2022 15:00:23 +0100 Subject: [PATCH 26/89] Update cl_modelpanel.lua - Removed Indents from file - Negated if statements and added returns - Removed stupid found logic in animations - Moved SetIK up in run order its not affected by anims - Removed multiple string lowers - Removed unused variable y - Added Check for ik to only disable if valid - Localised double global table index --- gamemode/core/derma/cl_modelpanel.lua | 152 +++++++++++++------------- 1 file changed, 78 insertions(+), 74 deletions(-) diff --git a/gamemode/core/derma/cl_modelpanel.lua b/gamemode/core/derma/cl_modelpanel.lua index 8bbc8526..dbf3c42d 100644 --- a/gamemode/core/derma/cl_modelpanel.lua +++ b/gamemode/core/derma/cl_modelpanel.lua @@ -1,102 +1,106 @@ local PANEL = {} - local MODEL_ANGLE = Angle(0, 45, 0) +local MODEL_ANGLE = Angle(0, 45, 0) - function PANEL:Init() - self.brightness = 1 +function PANEL:Init() + self.brightness = 1 - self:SetCursor("none") - self.OldSetModel = self.SetModel - self.SetModel = function(self, model) - self:OldSetModel(model) + self:SetCursor("none") + self.OldSetModel = self.SetModel + self.SetModel = function(self, model) + self:OldSetModel(model) - local entity = self.Entity - - if (IsValid(entity)) then - local sequence = entity:SelectWeightedSequence(ACT_IDLE) - - if (sequence <= 0) then - sequence = entity:LookupSequence("idle_unarmed") - end - - if (sequence > 0) then - entity:ResetSequence(sequence) - else - local found = false + local entity = self.Entity - for k, v in ipairs(entity:GetSequenceList()) do - if ((v:lower():find("idle") or v:lower():find("fly")) and v ~= "idlenoise") then - entity:ResetSequence(v) - found = true + if (not IsValid(entity)) then return end + local sequence = entity:SelectWeightedSequence(ACT_IDLE) - break - end - end + if (sequence <= 0) then + sequence = entity:LookupSequence("idle_unarmed") + end - if (!found) then - entity:ResetSequence(4) - end - end + entity:SetIK(false) - entity:SetIK(false) - end + if (sequence > 0) then + entity:ResetSequence(sequence) + return end - end - - function PANEL:LayoutEntity() - local scrW, scrH = ScrW(), ScrH() - local xRatio = gui.MouseX() / scrW - local yRatio = gui.MouseY() / scrH - local x, y = self:LocalToScreen(self:GetWide() / 2) - local xRatio2 = x / scrW - local entity = self.Entity - entity:SetPoseParameter("head_pitch", yRatio*90 - 30) - entity:SetPoseParameter("head_yaw", (xRatio - xRatio2)*90 - 5) - entity:SetAngles(MODEL_ANGLE) - entity:SetIK(false) + for _, seqName in ipairs(entity:GetSequenceList()) do + local seqNameLower = seqName:lower() + if seqNameLower == "idlenoise" then continue end + if not (seqNameLower:find("idle") or seqNameLower:find("fly")) then continue end - if (self.copyLocalSequence) then - entity:SetSequence(LocalPlayer():GetSequence()) - entity:SetPoseParameter("move_yaw", 360 * LocalPlayer():GetPoseParameter("move_yaw") - 180) + entity:ResetSequence(seqName) end - self:RunAnimation() + entity:ResetSequence(4) + end +end + +local gui_MouseX = gui.MouseX +local gui_MouseY = gui.MouseY + +function PANEL:LayoutEntity() + local scrW, scrH = ScrW(), ScrH() + local xRatio = gui_MouseX() / scrW + local yRatio = gui_MouseY() / scrH + local x, _ = self:LocalToScreen(self:GetWide() / 2) + local xRatio2 = x / scrW + local entity = self.Entity + + entity:SetPoseParameter("head_pitch", yRatio*90 - 30) + entity:SetPoseParameter("head_yaw", (xRatio - xRatio2)*90 - 5) + entity:SetAngles(MODEL_ANGLE) + if entity:GetIK() then + entity:SetIK(false) end - function PANEL:PreDrawModel(entity) - if (self.brightness) then - local brightness = self.brightness * 0.4 - local brightness2 = self.brightness * 1.5 + if (self.copyLocalSequence) then + local ply = LocalPlayer() + entity:SetSequence(ply:GetSequence()) + entity:SetPoseParameter("move_yaw", 360 * ply:GetPoseParameter("move_yaw") - 180) + end - render.SetModelLighting(0, brightness2, brightness2, brightness2) + self:RunAnimation() +end - for i = 1, 4 do - render.SetModelLighting(i, brightness, brightness, brightness) - end +function PANEL:PreDrawModel(entity) + if (self.brightness) then + local brightness = self.brightness * 0.4 + local brightness2 = self.brightness * 1.5 - local fraction = (brightness / 1) * 0.1 + render.SetModelLighting(0, brightness2, brightness2, brightness2) - render.SetModelLighting(5, fraction, fraction, fraction) + for i = 1, 4 do + render.SetModelLighting(i, brightness, brightness, brightness) end - -- Excecute Some stuffs - if (self.enableHook) then - hook.Run("DrawNutModelView", self, entity) - end + local fraction = (brightness / 1) * 0.1 - return true + render.SetModelLighting(5, fraction, fraction, fraction) end - function PANEL:OnMousePressed() + if (self.enableHook) then + hook.Run("DrawNutModelView", self, entity) end - function PANEL:fitFOV() - local entity = self:GetEntity() - if (not IsValid(entity)) then return end + return true +end - local mins, maxs = entity:GetRenderBounds() - local height = math.abs(maxs.z) + math.abs(mins.z) + 8 - local distance = self:GetCamPos():Length() - self:SetFOV(math.deg(2 * math.atan(height / (2 * distance)))) - end +function PANEL:OnMousePressed() +end + +local math_abs = math.abs +local math_deg = math.deg +local math_atan = math.atan + +function PANEL:fitFOV() + local entity = self:GetEntity() + if (not IsValid(entity)) then return end + + local mins, maxs = entity:GetRenderBounds() + local height = math_abs(maxs.z) + math_abs(mins.z) + 8 + local distance = self:GetCamPos():Length() + self:SetFOV(math_deg(2 * math_atan(height / (2 * distance)))) +end vgui.Register("nutModelPanel", PANEL, "DModelPanel") From 18806341aa8b90ccc8f610afd94b2fac832e5848 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 3 Jul 2022 15:30:56 +0100 Subject: [PATCH 27/89] Update cl_dev_icon.lua - Removed adjustSize duplicate code - Removed Action text being duplicated - Renamed fagLord variable to isIconUpdating - Removed unneeded inline comments - Cleaned up if mode fallback (could be cleaned up better with enums and lookup) --- gamemode/core/derma/cl_dev_icon.lua | 250 +++++++++++++--------------- 1 file changed, 119 insertions(+), 131 deletions(-) diff --git a/gamemode/core/derma/cl_dev_icon.lua b/gamemode/core/derma/cl_dev_icon.lua index c4de1e64..2afcbdc9 100644 --- a/gamemode/core/derma/cl_dev_icon.lua +++ b/gamemode/core/derma/cl_dev_icon.lua @@ -22,7 +22,14 @@ local bTxt = { "reset angles" } local PANEL = {} -local iconSize = 64 + + +local function adjustSize(pnl, x, y) + x = x or 1 + y = y or 1 + pnl:SetSize(10 + x*64, 27 + y*64) + pnl.model:SetSize(x*64, y*64) +end --[[------------------------------------------------------------------------- 3D ICON PREVIEW WINDOW @@ -51,10 +58,8 @@ function PANEL:Paint(w, h) surface.DrawOutlinedRect(0, 0, w, h) end -function PANEL:AdjustSize(x, y) - self:SetSize(10 + (x or 1)*64, 27 + (y or 1)*64) - self.model:SetSize((x or 1)*64, (y or 1)*64) -end +PANEL.AdjustSize = adjustSize + vgui.Register("iconPreview", PANEL, "DFrame") --[[------------------------------------------------------------------------- @@ -95,103 +100,88 @@ function PANEL:Paint(w, h) surface.DrawOutlinedRect(0, 0, w, h) end -function PANEL:AdjustSize(x, y) - self:SetSize(10 + (x or 1)*64, 27 + (y or 1)*64) - self.model:SetSize((x or 1)*64, (y or 1)*64) -end +PANEL.AdjustSize = adjustSize + vgui.Register("iconRenderPreview", PANEL, "DFrame") --[[------------------------------------------------------------------------- EDITOR FUNCTION ---------------------------------------------------------------------------]] -local function action(self) - local p1 = self.prev - local p = self.prev2 - local icon = p.model - local iconModel = p1.model - - local ent = iconModel:GetEntity() - local tab = {} - tab.ent = ent - tab.cam_pos = iconModel:GetCamPos() - tab.cam_ang = iconModel:GetLookAng() - tab.cam_fov = iconModel:GetFOV() - - local text = - "ITEM.model = \""..ICON_INFO.modelName:gsub("\\", "/"):lower().."\"" .. "\n".. - "ITEM.width = "..ICON_INFO.w .."\n".. - "ITEM.height = "..ICON_INFO.h .."\n".. - "ITEM.iconCam = {" .."\n".. - "\tpos = Vector("..tab.cam_pos.x..", "..tab.cam_pos.y..", "..tab.cam_pos.z.."),\n".. - "\tang = Angle("..tab.cam_ang.p..", "..tab.cam_ang.y..", "..tab.cam_ang.r.."),\n".. - "\tfov = "..tab.cam_fov .. "," .."\n" - if (ICON_INFO.outline) then - text = text .. "\toutline = true," .. "\n" .. - "\toutlineColor = Color(".. - ICON_INFO.outlineColor.r .. ", " .. - ICON_INFO.outlineColor.g .. ", " .. - ICON_INFO.outlineColor.b .. ")," .. "\n" - end - text = text .. "}" - SetClipboardText(text) -end +local function buildActionText(self, setModel) -local function renderAction(self) local p1 = self.prev + local p = self.prev2 local icon = p.model + local iconModel = p1.model + if (not iconModel) then return end - if (icon and iconModel) then - local ent = iconModel:GetEntity() - local tab = {} - tab.ent = ent - tab.cam_pos = iconModel:GetCamPos() - tab.cam_ang = iconModel:GetLookAng() - tab.cam_fov = iconModel:GetFOV() + local ent = iconModel:GetEntity() + local tab = {} + tab.ent = ent + tab.cam_pos = iconModel:GetCamPos() + tab.cam_ang = iconModel:GetLookAng() + tab.cam_fov = iconModel:GetFOV() + if (setModel and icon) then icon:SetModel(ent:GetModel()) + end - ikon:renderIcon( - "iconEditor", - ICON_INFO.w, - ICON_INFO.h, - ICON_INFO.modelName, - { - pos = ICON_INFO.camPos, - ang = ICON_INFO.camAng, - fov = ICON_INFO.FOV, - outline = ICON_INFO.outline, - outlineColor = ICON_INFO.outlineColor, - drawHook = ICON_INFO.drawHook, - entAng = ICON_INFO.entAng, - drawPostHook = ICON_INFO.drawPostHook, - }, - true - ) - - local text = - "ITEM.model = \""..ICON_INFO.modelName:gsub("\\", "/"):lower().."\"" .. "\n".. - "ITEM.width = "..ICON_INFO.w .."\n".. - "ITEM.height = "..ICON_INFO.h .."\n".. - "ITEM.exRender = true\n".. - "ITEM.iconCam = {" .."\n".. - "\tpos = Vector("..tab.cam_pos.x..", "..tab.cam_pos.y..", "..tab.cam_pos.z..")," .."\n".. - "\tang = Angle("..tab.cam_ang.p..", "..tab.cam_ang.y..", "..tab.cam_ang.r..")," .."\n".. - "\tentAng = Angle("..ICON_INFO.entAng.p..", "..ICON_INFO.entAng.y..", "..ICON_INFO.entAng.r..")," .."\n".. - "\tfov = "..tab.cam_fov .. "," .."\n" - if (ICON_INFO.outline) then - text = text .. "\toutline = true," .. "\n" .. - "\toutlineColor = Color(".. - ICON_INFO.outlineColor.r .. ", " .. - ICON_INFO.outlineColor.g .. ", " .. - ICON_INFO.outlineColor.b .. ")" .. "\n" - end - text = text .. "}" - - print(text) + local text = + "ITEM.model = \""..ICON_INFO.modelName:gsub("\\", "/"):lower().."\"" .. "\n".. + "ITEM.width = "..ICON_INFO.w .."\n".. + "ITEM.height = "..ICON_INFO.h .."\n".. + "ITEM.iconCam = {" .."\n".. + "\tpos = Vector("..tab.cam_pos.x..", "..tab.cam_pos.y..", "..tab.cam_pos.z.."),\n".. + "\tang = Angle("..tab.cam_ang.p..", "..tab.cam_ang.y..", "..tab.cam_ang.r.."),\n".. + "\tfov = "..tab.cam_fov .. "," .."\n" + if (ICON_INFO.outline) then + text = text .. "\toutline = true," .. "\n" .. + "\toutlineColor = Color(".. + ICON_INFO.outlineColor.r .. ", " .. + ICON_INFO.outlineColor.g .. ", " .. + ICON_INFO.outlineColor.b .. ")," .. "\n" end + text = text .. "}" + + return text +end + + + +local function action(self) + local text = buildActionText(self) + + if not text then return end + + SetClipboardText(text) +end + +local function renderAction(self) + + local text = buildActionText(self, true) + + if (not text) then return end + + ikon:renderIcon( + "iconEditor", + ICON_INFO.w, + ICON_INFO.h, + ICON_INFO.modelName, + { + pos = ICON_INFO.camPos, + ang = ICON_INFO.camAng, + fov = ICON_INFO.FOV, + outline = ICON_INFO.outline, + outlineColor = ICON_INFO.outlineColor, + drawHook = ICON_INFO.drawHook, + entAng = ICON_INFO.entAng, + drawPostHook = ICON_INFO.drawPostHook, + }, + true + ) end PANEL = {} @@ -302,7 +292,7 @@ function PANEL:Init() self.camFOV:SetValue(ICON_INFO.FOV) self.camFOV:DockMargin(10, 0, 0, 5) self.camFOV.OnValueChanged = function(cfg, value) - if (!fagLord) then + if (!isIconUpdating) then ICON_INFO.FOV = value local p = self.prev @@ -324,8 +314,8 @@ function PANEL:Init() self.camPos[i]:SetDecimals(3) self.camPos[i]:SetValue(ICON_INFO.camPos[i]) self.camPos[i]:DockMargin(10, 0, 0, 5) - self.camPos[i].OnValueChanged = function(cfg, value) - if (!fagLord) then + self.camPos[i].OnValueChanged = function(_, value) + if (!isIconUpdating) then ICON_INFO.camPos[i] = value end end @@ -343,8 +333,8 @@ function PANEL:Init() self.camAng[i]:SetDecimals(3) self.camAng[i]:SetValue(ICON_INFO.camAng[i]) self.camAng[i]:DockMargin(10, 0, 0, 5) - self.camAng[i].OnValueChanged = function(cfg, value) - if (!fagLord) then + self.camAng[i].OnValueChanged = function(_, value) + if (!isIconUpdating) then ICON_INFO.camAng[i] = value end end @@ -362,8 +352,8 @@ function PANEL:Init() self.entAng[i]:SetDecimals(3) self.entAng[i]:SetValue(ICON_INFO.entAng[i]) self.entAng[i]:DockMargin(10, 0, 0, 5) - self.entAng[i].OnValueChanged = function(cfg, value) - if (!fagLord) then + self.entAng[i].OnValueChanged = function(_, value) + if (!isIconUpdating) then ICON_INFO.entAng[i] = value self.prev.model.Entity:SetAngles(ICON_INFO.entAng) end @@ -385,11 +375,11 @@ function PANEL:Init() end self.colormixer = aaoa:Add("DColorMixer") - self.colormixer:Dock(FILL) -- Make self.colormixer fill place of Frame - self.colormixer:SetPalette(true) -- Show/hide the palette (true by default) - self.colormixer:SetAlphaBar(false) -- Show/hide the alpha bar (true by default) - self.colormixer:SetWangs(true) -- Show/hide the R G B A indicators (true by default) - self.colormixer:SetColor(ICON_INFO.outlineColor ) -- Set the default color + self.colormixer:Dock(FILL) + self.colormixer:SetPalette(true) + self.colormixer:SetAlphaBar(false) + self.colormixer:SetWangs(true) + self.colormixer:SetColor(ICON_INFO.outlineColor ) self.colormixer:DockMargin(10, 5, 0, 5) function self.colormixer:ValueChanged(value) ICON_INFO.outlineColor = value @@ -400,54 +390,53 @@ function PANEL:Init() end function PANEL:UpdateIcon() - fagLord = true + isIconUpdating = true self.camFOV:SetValue(ICON_INFO.FOV) - local p = self.prev for i = 1, 3 do self.camPos[i]:SetValue(ICON_INFO.camPos[i]) self.camAng[i]:SetValue(ICON_INFO.camAng[i]) self.entAng[i]:SetValue(ICON_INFO.entAng[i]) end - fagLord = false + isIconUpdating = false end function PANEL:SetupEditor(update, mode) local p = self.prev local p2 = self.prev2 - if (p and p:IsVisible() and p2 and p2:IsVisible()) then - p.model:SetModel(ICON_INFO.modelName) - p2.model:SetModel(ICON_INFO.modelName) - if (!update) then - self.mdl:SetText(ICON_INFO.modelName) - end + if not (p and p:IsVisible() and p2 and p2:IsVisible()) then return end - if (mode) then - if (mode == 1) then - self:BestGuessLayout() - elseif (mode == 2) then - self:FullFrontalLayout() - elseif (mode == 3) then - self:AboveLayout() - elseif (mode == 4) then - self:RightLayout() - elseif (mode == 5) then - self:OriginLayout() - elseif (mode == 6) then - ICON_INFO.entAng = Angle() - end - else - self:BestGuessLayout() - end + p.model:SetModel(ICON_INFO.modelName) + p2.model:SetModel(ICON_INFO.modelName) + if (not update) then + self.mdl:SetText(ICON_INFO.modelName) + end - p.model:SetCamPos(ICON_INFO.camPos) - p.model:SetFOV(ICON_INFO.FOV) - p.model:SetLookAng(ICON_INFO.camAng) + if (not mode) then + mode = 1 + end - if (IsValid(p.model.Entity)) then - p.model.Entity:SetAngles(ICON_INFO.entAng) - end + if (mode == 1) then + self:BestGuessLayout() + elseif (mode == 2) then + self:FullFrontalLayout() + elseif (mode == 3) then + self:AboveLayout() + elseif (mode == 4) then + self:RightLayout() + elseif (mode == 5) then + self:OriginLayout() + elseif (mode == 6) then + ICON_INFO.entAng = Angle() + end + + p.model:SetCamPos(ICON_INFO.camPos) + p.model:SetFOV(ICON_INFO.FOV) + p.model:SetLookAng(ICON_INFO.camAng) + + if (IsValid(p.model.Entity)) then + p.model.Entity:SetAngles(ICON_INFO.entAng) end end @@ -461,7 +450,6 @@ function PANEL:BestGuessLayout() ICON_INFO.camPos = tab.origin ICON_INFO.FOV = tab.fov ICON_INFO.camAng = tab.angles - --ICON_INFO.entAng = Angle() end end From 88d3bc4364e34a2a80a40ebdb20ebf59dd5de286 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 3 Jul 2022 15:34:08 +0100 Subject: [PATCH 28/89] Update cl_horizontal_scroll_bar.lua - Removed multiple calls to GetWide - Removed unused variables that caused a shadow binding --- gamemode/core/derma/cl_horizontal_scroll_bar.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gamemode/core/derma/cl_horizontal_scroll_bar.lua b/gamemode/core/derma/cl_horizontal_scroll_bar.lua index 7e2af3c0..c8aa85a5 100644 --- a/gamemode/core/derma/cl_horizontal_scroll_bar.lua +++ b/gamemode/core/derma/cl_horizontal_scroll_bar.lua @@ -31,7 +31,7 @@ function PANEL:SetScroll(offset) end end -function PANEL:OnCursorMoved(x, y) +function PANEL:OnCursorMoved() if (not self.Enabled or not self.Dragging) then return end local x = self:ScreenToLocal(gui.MouseX(), 0) x = x - self.btnLeft:GetWide() - self.HoldPos @@ -49,13 +49,14 @@ end function PANEL:PerformLayout() local tall = self:GetTall() + local wide = self:GetWide() local btnHeight = self:GetHideButtons() and 0 or tall local scroll = self:GetScroll() / self.CanvasSize local barSize = math.max( - self:BarScale() * (self:GetWide() - btnHeight * 2), + self:BarScale() * (wide - btnHeight * 2), 10 ) - local track = (self:GetWide() - (btnHeight * 2) - barSize) + 1 + local track = (wide - (btnHeight * 2) - barSize) + 1 scroll = scroll * track self.btnGrip:SetPos(btnHeight + scroll, 0) @@ -66,7 +67,7 @@ function PANEL:PerformLayout() self.btnLeft:SetSize(btnHeight, tall) self.btnLeft:SetVisible(true) - self.btnRight:SetPos(self:GetWide() - btnHeight, 0) + self.btnRight:SetPos(wide - btnHeight, 0) self.btnRight:SetSize(btnHeight, tall) self.btnRight:SetVisible(true) else From 2717464976255becacd793eb3376c2ce5d317c87 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 3 Jul 2022 15:49:07 +0100 Subject: [PATCH 29/89] cl_inventory and cl_dev_icon - Removed code duplication - Removed unneeded code indent - Negated ifs in hook to remove indents - Removed some trailing spaces in cl_dev_icon --- gamemode/core/derma/cl_dev_icon.lua | 14 +- gamemode/core/derma/cl_inventory.lua | 243 +++++++++++---------------- 2 files changed, 108 insertions(+), 149 deletions(-) diff --git a/gamemode/core/derma/cl_dev_icon.lua b/gamemode/core/derma/cl_dev_icon.lua index 2afcbdc9..70ad2d82 100644 --- a/gamemode/core/derma/cl_dev_icon.lua +++ b/gamemode/core/derma/cl_dev_icon.lua @@ -49,7 +49,7 @@ function PANEL:Init() function self.model:LayoutEntity() end - + self:AdjustSize(ICON_INFO.w, ICON_INFO.h) end @@ -81,7 +81,7 @@ function PANEL:Init() surface.SetDrawColor(255, 255, 255) surface.DrawOutlinedRect(0, 0, w, h) end - + self.model.Icon:SetVisible(false) self.model.Paint = function(self, x, y) local exIcon = ikon:getIcon("iconEditor") @@ -114,7 +114,7 @@ local function buildActionText(self, setModel) local p = self.prev2 local icon = p.model - + local iconModel = p1.model if (not iconModel) then return end @@ -255,7 +255,7 @@ function PANEL:Init() local cfg = self.list:Add("DNumSlider") cfg:Dock(TOP) - cfg:SetText("W") + cfg:SetText("W") cfg:SetMin(0) cfg:SetMax(10) cfg:SetDecimals(0) @@ -269,7 +269,7 @@ function PANEL:Init() local cfg = self.list:Add("DNumSlider") cfg:Dock(TOP) - cfg:SetText("H") + cfg:SetText("H") cfg:SetMin(0) cfg:SetMax(10) cfg:SetDecimals(0) @@ -285,7 +285,7 @@ function PANEL:Init() self.camFOV = self.list:Add("DNumSlider") self.camFOV:Dock(TOP) - self.camFOV:SetText("CAMFOV") + self.camFOV:SetText("CAMFOV") self.camFOV:SetMin(0) self.camFOV:SetMax(180) self.camFOV:SetDecimals(3) @@ -361,7 +361,7 @@ function PANEL:Init() end local aaoa = self.list:Add("DPanel") - aaoa:Dock(TOP) + aaoa:Dock(TOP) aaoa:DockMargin(10, 0, 0, 5) aaoa:SetHeight(250) diff --git a/gamemode/core/derma/cl_inventory.lua b/gamemode/core/derma/cl_inventory.lua index bc3d8abd..88c89a94 100644 --- a/gamemode/core/derma/cl_inventory.lua +++ b/gamemode/core/derma/cl_inventory.lua @@ -128,6 +128,33 @@ function PANEL:Paint(w, h) self:ExtraPaint(w, h) end +local buildActionFunc = function(action, actionIndex, itemTable, invID, sub) + return function() + itemTable.player = LocalPlayer() + local send = true + + if (action.onClick) then + send = action.onClick(itemTable, sub and sub.data) + end + + local snd = action.sound or SOUND_INVENTORY_INTERACT + if (snd) then + if (istable(snd)) then + LocalPlayer():EmitSound(unpack(snd)) + elseif (isstring(snd)) then + surface.PlaySound(snd) + end + end + + if (send ~= false) then + netstream.Start("invAct", actionIndex, itemTable.id, invID, sub and sub.data) + end + itemTable.player = nil + end +end + + + function PANEL:openActionMenu() local itemTable = self.itemTable @@ -151,28 +178,8 @@ function PANEL:openActionMenu() -- TODO: refactor custom menu options as a method for items if (v.isMulti) then local subMenu, subMenuOption = - menu:AddSubMenu(L(v.name or k), function() - itemTable.player = LocalPlayer() - local send = true - - if (v.onClick) then - send = v.onClick(itemTable) - end - - local snd = v.sound or SOUND_INVENTORY_INTERACT - if (snd) then - if (istable(snd)) then - LocalPlayer():EmitSound(unpack(snd)) - elseif (isstring(snd)) then - surface.PlaySound(snd) - end - end - - if (send ~= false) then - netstream.Start("invAct", k, itemTable.id, self.invID) - end - itemTable.player = nil - end) + menu:AddSubMenu(L(v.name or k), buildActionFunc(v, k, itemTable, self.invID)) + ) subMenuOption:SetImage(v.icon or "icon16/brick.png") if (not v.multiOptions) then return end @@ -181,59 +188,12 @@ function PANEL:openActionMenu() and v.multiOptions(itemTable, LocalPlayer()) or v.multiOptions for _, sub in pairs(options) do - subMenu:AddOption(L(sub.name or "subOption"), function() - itemTable.player = LocalPlayer() - local send = true - - if (v.onClick) then - send = v.onClick(itemTable, sub.data) - end - - local snd = v.sound or SOUND_INVENTORY_INTERACT - if (snd) then - if (type(snd) == 'table') then - LocalPlayer():EmitSound(unpack(snd)) - elseif (type(snd) == 'string') then - surface.PlaySound(snd) - end - end - - if (send ~= false) then - netstream.Start( - "invAct", - k, - itemTable.id, - self.invID, - sub.data - ) - end - itemTable.player = nil - end) + subMenu:AddOption(L(sub.name or "subOption"), buildActionFunc(v, k, itemTable, self.invID, sub)) + :SetImage(sub.icon or "icon16/brick.png") end else - menu:AddOption(L(v.name or k), function() - -- TODO: refactor this action click function - itemTable.player = LocalPlayer() - local send = true - - if (v.onClick) then - send = v.onClick(itemTable) - end - - local snd = v.sound or SOUND_INVENTORY_INTERACT - if (snd) then - if (istable(snd)) then - LocalPlayer():EmitSound(unpack(snd)) - elseif (isstring(snd)) then - surface.PlaySound(snd) - end - end - - if (send ~= false) then - netstream.Start("invAct", k, itemTable.id, self.invID) - end - itemTable.player = nil - end):SetImage(v.icon or "icon16/brick.png") + menu:AddOption(L(v.name or k), buildActionFunc(v, k, itemTable, self.invID)) + :SetImage(v.icon or "icon16/brick.png") end end @@ -244,96 +204,95 @@ end vgui.Register("nutItemIcon", PANEL, "SpawnIcon") PANEL = {} - function PANEL:Init() - self:MakePopup() - self:Center() - self:ShowCloseButton(false) - self:SetDraggable(true) - self:SetTitle(L"inv") - end +function PANEL:Init() + self:MakePopup() + self:Center() + self:ShowCloseButton(false) + self:SetDraggable(true) + self:SetTitle(L"inv") +end - -- Sets which inventory this panel is representing. - function PANEL:setInventory(inventory) - self.inventory = inventory - self:nutListenForInventoryChanges(inventory) - end +-- Sets which inventory this panel is representing. +function PANEL:setInventory(inventory) + self.inventory = inventory + self:nutListenForInventoryChanges(inventory) +end - -- Called when the data for the local inventory has been initialized. - -- This shouldn't run unless the inventory got resync'd. - function PANEL:InventoryInitialized() - end +-- Called when the data for the local inventory has been initialized. +-- This shouldn't run unless the inventory got resync'd. +function PANEL:InventoryInitialized() +end - -- Called when a data value has been changed for the inventory. - function PANEL:InventoryDataChanged(key, oldValue, newValue) - end +-- Called when a data value has been changed for the inventory. +function PANEL:InventoryDataChanged(key, oldValue, newValue) +end - -- Called when the inventory for this panel has been deleted. This may - -- be because the local player no longer has access to the inventory! - function PANEL:InventoryDeleted(inventory) - if (self.inventory == inventory) then - self:Remove() - end +-- Called when the inventory for this panel has been deleted. This may +-- be because the local player no longer has access to the inventory! +function PANEL:InventoryDeleted(inventory) + if (self.inventory == inventory) then + self:Remove() end +end - -- Called when the given item has been added to the inventory. - function PANEL:InventoryItemAdded(item) - end +-- Called when the given item has been added to the inventory. +function PANEL:InventoryItemAdded(item) +end - -- Called when the given item has been removed from the inventory. - function PANEL:InventoryItemRemoved(item) - end +-- Called when the given item has been removed from the inventory. +function PANEL:InventoryItemRemoved(item) +end - -- Called when an item within this inventory has its data changed. - function PANEL:InventoryItemDataChanged(item, key, oldValue, newValue) - end +-- Called when an item within this inventory has its data changed. +function PANEL:InventoryItemDataChanged(item, key, oldValue, newValue) +end - -- Make sure to clean up hooks before removing the panel. - function PANEL:OnRemove() - self:nutDeleteInventoryHooks() - end +-- Make sure to clean up hooks before removing the panel. +function PANEL:OnRemove() + self:nutDeleteInventoryHooks() +end vgui.Register("nutInventory", PANEL, "DFrame") local margin = 10 hook.Add("CreateMenuButtons", "nutInventory", function(tabs) - if (hook.Run("CanPlayerViewInventory") ~= false) then - tabs["inv"] = function(panel) - local inventory = LocalPlayer():getChar():getInv() + if (hook.Run("CanPlayerViewInventory") == false) then return end - if (inventory) then - local mainPanel = inventory:show(panel) + tabs["inv"] = function(panel) + local inventory = LocalPlayer():getChar():getInv() - local sortPanels = {} - local totalSize = {x = 0, y = 0, p = 0} - table.insert(sortPanels, mainPanel) + if (not inventory) then return end + local mainPanel = inventory:show(panel) - totalSize.x = totalSize.x + mainPanel:GetWide() + margin - totalSize.y = math.max(totalSize.y, mainPanel:GetTall()) + local sortPanels = {} + local totalSize = {x = 0, y = 0, p = 0} + table.insert(sortPanels, mainPanel) - for id, item in pairs(inventory:getItems()) do - if (item.isBag and hook.Run("CanOpenBagPanel", item) ~= false) then - local inventory = item:getInv() + totalSize.x = totalSize.x + mainPanel:GetWide() + margin + totalSize.y = math.max(totalSize.y, mainPanel:GetTall()) - local childPanels = inventory:show(mainPanel) - nut.gui["inv"..inventory:getID()] = childPanels - table.insert(sortPanels, childPanels) + for id, item in pairs(inventory:getItems()) do + if (item.isBag and hook.Run("CanOpenBagPanel", item) ~= false) then + local inventory = item:getInv() - totalSize.x = totalSize.x + childPanels:GetWide() + margin - totalSize.y = math.max(totalSize.y, childPanels:GetTall()) - end - end + local childPanels = inventory:show(mainPanel) + nut.gui["inv"..inventory:getID()] = childPanels + table.insert(sortPanels, childPanels) - local px, py, pw, ph = mainPanel:GetBounds() - local x, y = px + pw/2 - totalSize.x / 2, py + ph/2 - for _, panel in pairs(sortPanels) do - panel:ShowCloseButton(true) - panel:SetPos(x, y - panel:GetTall()/2) - x = x + panel:GetWide() + margin - end - - hook.Add("PostRenderVGUI", mainPanel, function() - hook.Run("PostDrawInventory", mainPanel) - end) + totalSize.x = totalSize.x + childPanels:GetWide() + margin + totalSize.y = math.max(totalSize.y, childPanels:GetTall()) end end + + local px, py, pw, ph = mainPanel:GetBounds() + local x, y = px + pw/2 - totalSize.x / 2, py + ph/2 + for _, panel in pairs(sortPanels) do + panel:ShowCloseButton(true) + panel:SetPos(x, y - panel:GetTall()/2) + x = x + panel:GetWide() + margin + end + + hook.Add("PostRenderVGUI", mainPanel, function() + hook.Run("PostDrawInventory", mainPanel) + end) end end) \ No newline at end of file From 11172b8520afb2a7df29927a8827a2a6bad7c011 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 3 Jul 2022 16:00:28 +0100 Subject: [PATCH 30/89] Code Cleanup - Added a missing return - Removed unneeded indents - Removed unused variable - Added changes to sequence --- gamemode/core/derma/cl_modelpanel.lua | 1 + gamemode/core/derma/cl_quick.lua | 264 +++++++++++++------------- gamemode/core/derma/cl_spawnicon.lua | 141 +++++++------- gamemode/core/derma/cl_tooltip.lua | 27 ++- 4 files changed, 218 insertions(+), 215 deletions(-) diff --git a/gamemode/core/derma/cl_modelpanel.lua b/gamemode/core/derma/cl_modelpanel.lua index dbf3c42d..02f1c148 100644 --- a/gamemode/core/derma/cl_modelpanel.lua +++ b/gamemode/core/derma/cl_modelpanel.lua @@ -31,6 +31,7 @@ function PANEL:Init() if not (seqNameLower:find("idle") or seqNameLower:find("fly")) then continue end entity:ResetSequence(seqName) + return end entity:ResetSequence(4) diff --git a/gamemode/core/derma/cl_quick.lua b/gamemode/core/derma/cl_quick.lua index 7883ddc0..d418af75 100644 --- a/gamemode/core/derma/cl_quick.lua +++ b/gamemode/core/derma/cl_quick.lua @@ -1,165 +1,165 @@ local PANEL = {} - function PANEL:Init() - if (IsValid(nut.gui.quick)) then - nut.gui.quick:Remove() - end - nut.gui.quick = self - - self:SetSize(400, 36) - self:SetPos(ScrW() - 36, -36) - self:MakePopup() - self:SetKeyboardInputEnabled(false) - self:SetZPos(999) - self:SetMouseInputEnabled(true) - - self.title = self:Add("DLabel") - self.title:SetTall(36) - self.title:Dock(TOP) - self.title:SetFont("nutMediumFont") - self.title:SetText(L"quickSettings") - self.title:SetContentAlignment(4) - self.title:SetTextInset(44, 0) - self.title:SetTextColor(Color(250, 250, 250)) - self.title:SetExpensiveShadow(1, Color(0, 0, 0, 175)) - self.title.Paint = function(this, w, h) - surface.SetDrawColor(nut.config.get("color")) - surface.DrawRect(0, 0, w, h) - end +function PANEL:Init() + if (IsValid(nut.gui.quick)) then + nut.gui.quick:Remove() + end + nut.gui.quick = self + + self:SetSize(400, 36) + self:SetPos(ScrW() - 36, -36) + self:MakePopup() + self:SetKeyboardInputEnabled(false) + self:SetZPos(999) + self:SetMouseInputEnabled(true) + + self.title = self:Add("DLabel") + self.title:SetTall(36) + self.title:Dock(TOP) + self.title:SetFont("nutMediumFont") + self.title:SetText(L"quickSettings") + self.title:SetContentAlignment(4) + self.title:SetTextInset(44, 0) + self.title:SetTextColor(Color(250, 250, 250)) + self.title:SetExpensiveShadow(1, Color(0, 0, 0, 175)) + self.title.Paint = function(this, w, h) + surface.SetDrawColor(nut.config.get("color")) + surface.DrawRect(0, 0, w, h) + end - self.expand = self:Add("DButton") - self.expand:SetContentAlignment(5) - self.expand:SetText("`") - self.expand:SetFont("nutIconsMedium") - self.expand:SetPaintBackground(false) - self.expand:SetTextColor(color_white) - self.expand:SetExpensiveShadow(1, Color(0, 0, 0, 150)) - self.expand:SetSize(36, 36) - self.expand.DoClick = function(this) - if (self.expanded) then - self:SizeTo(self:GetWide(), 36, 0.15, nil, nil, function() - self:MoveTo(ScrW() - 36, 30, 0.15) - end) - - self.expanded = false - else - self:MoveTo(ScrW() - 400, 30, 0.15, nil, nil, function() - local height = 0 - - for k, v in pairs(self.items) do - if (IsValid(v)) then - height = height + v:GetTall() + 1 - end + self.expand = self:Add("DButton") + self.expand:SetContentAlignment(5) + self.expand:SetText("`") + self.expand:SetFont("nutIconsMedium") + self.expand:SetPaintBackground(false) + self.expand:SetTextColor(color_white) + self.expand:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + self.expand:SetSize(36, 36) + self.expand.DoClick = function(this) + if (self.expanded) then + self:SizeTo(self:GetWide(), 36, 0.15, nil, nil, function() + self:MoveTo(ScrW() - 36, 30, 0.15) + end) + + self.expanded = false + else + self:MoveTo(ScrW() - 400, 30, 0.15, nil, nil, function() + local height = 0 + + for k, v in pairs(self.items) do + if (IsValid(v)) then + height = height + v:GetTall() + 1 end + end - height = math.min(height, ScrH() * 0.5) - self:SizeTo(self:GetWide(), height, 0.15) - end) + height = math.min(height, ScrH() * 0.5) + self:SizeTo(self:GetWide(), height, 0.15) + end) - self.expanded = true - end + self.expanded = true end - - self.scroll = self:Add("DScrollPanel") - self.scroll:SetPos(0, 36) - self.scroll:SetSize(self:GetWide(), ScrH() * 0.5) - - self:MoveTo(self.x, 30, 0.05) - - self.items = {} - - hook.Run("SetupQuickMenu", self) end - local function paintButton(button, w, h) - local alpha = 0 + self.scroll = self:Add("DScrollPanel") + self.scroll:SetPos(0, 36) + self.scroll:SetSize(self:GetWide(), ScrH() * 0.5) - if (button.Depressed or button.m_bSelected) then - alpha = 5 - elseif (button.Hovered) then - alpha = 2 - end + self:MoveTo(self.x, 30, 0.05) - surface.SetDrawColor(255, 255, 255, alpha) - surface.DrawRect(0, 0, w, h) - end + self.items = {} - function PANEL:addButton(text, callback) - local button = self.scroll:Add("DButton") - button:SetText(text) - button:SetTall(36) - button:Dock(TOP) - button:DockMargin(0, 1, 0, 0) - button:SetFont("nutMediumLightFont") - button:SetExpensiveShadow(1, Color(0, 0, 0, 150)) - button:SetContentAlignment(4) - button:SetTextInset(8, 0) - button:SetTextColor(color_white) - button.Paint = paintButton + hook.Run("SetupQuickMenu", self) +end - if (callback) then - button.DoClick = callback - end +local function paintButton(button, w, h) + local alpha = 0 - self.items[#self.items + 1] = button + if (button.Depressed or button.m_bSelected) then + alpha = 5 + elseif (button.Hovered) then + alpha = 2 + end - return button + surface.SetDrawColor(255, 255, 255, alpha) + surface.DrawRect(0, 0, w, h) +end + +function PANEL:addButton(text, callback) + local button = self.scroll:Add("DButton") + button:SetText(text) + button:SetTall(36) + button:Dock(TOP) + button:DockMargin(0, 1, 0, 0) + button:SetFont("nutMediumLightFont") + button:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + button:SetContentAlignment(4) + button:SetTextInset(8, 0) + button:SetTextColor(color_white) + button.Paint = paintButton + + if (callback) then + button.DoClick = callback end - function PANEL:addSpacer() - local panel = self.scroll:Add("DPanel") - panel:SetTall(1) - panel:Dock(TOP) - panel:DockMargin(0, 1, 0, 0) - panel.Paint = function(this, w, h) - surface.SetDrawColor(255, 255, 255, 10) - surface.DrawRect(0, 0, w, h) - end + self.items[#self.items + 1] = button - self.items[#self.items + 1] = panel + return button +end - return panel +function PANEL:addSpacer() + local panel = self.scroll:Add("DPanel") + panel:SetTall(1) + panel:Dock(TOP) + panel:DockMargin(0, 1, 0, 0) + panel.Paint = function(this, w, h) + surface.SetDrawColor(255, 255, 255, 10) + surface.DrawRect(0, 0, w, h) end - local color_dark = Color(255, 255, 255, 5) + self.items[#self.items + 1] = panel - function PANEL:addCheck(text, callback, checked) - local x, y - local color + return panel +end - local button = self:addButton(text, function(panel) - panel.checked = !panel.checked +local color_dark = Color(255, 255, 255, 5) - if (callback) then - callback(panel, panel.checked) - end - end) - button.PaintOver = function(this, w, h) - x, y = w - 8, h * 0.5 +function PANEL:addCheck(text, callback, checked) + local x, y + local color - if (this.checked) then - color = nut.config.get("color") - else - color = color_dark - end + local button = self:addButton(text, function(panel) + panel.checked = !panel.checked - draw.SimpleText(self.icon or "F", "nutIconsSmall", x, y, color, 2, 1) + if (callback) then + callback(panel, panel.checked) + end + end) + button.PaintOver = function(this, w, h) + x, y = w - 8, h * 0.5 + + if (this.checked) then + color = nut.config.get("color") + else + color = color_dark end - button.checked = checked - return button + draw.SimpleText(self.icon or "F", "nutIconsSmall", x, y, color, 2, 1) end + button.checked = checked - function PANEL:setIcon(char) - self.icon = char - end + return button +end - function PANEL:Paint(w, h) - nut.util.drawBlur(self) +function PANEL:setIcon(char) + self.icon = char +end - surface.SetDrawColor(nut.config.get("color")) - surface.DrawRect(0, 0, w, 36) +function PANEL:Paint(w, h) + nut.util.drawBlur(self) - surface.SetDrawColor(255, 255, 255, 5) - surface.DrawRect(0, 0, w, h) - end + surface.SetDrawColor(nut.config.get("color")) + surface.DrawRect(0, 0, w, 36) + + surface.SetDrawColor(255, 255, 255, 5) + surface.DrawRect(0, 0, w, h) +end vgui.Register("nutQuick", PANEL, "EditablePanel") diff --git a/gamemode/core/derma/cl_spawnicon.lua b/gamemode/core/derma/cl_spawnicon.lua index dc94d4f2..b76889b3 100644 --- a/gamemode/core/derma/cl_spawnicon.lua +++ b/gamemode/core/derma/cl_spawnicon.lua @@ -1,95 +1,98 @@ local PANEL = {} - local MODEL_ANGLE = Angle(0, 45, 0) - function PANEL:Init() - self:setHidden(false) - for i = 0, 5 do - if (i == 1 or i == 5) then - self:SetDirectionalLight(i, Color(155, 155, 155)) - else - self:SetDirectionalLight(i, Color(255, 255, 255)) - end - end +local setSequence = function(entity) + // This code is duplicated from cl_modelpanel.lua + local sequence = entity:SelectWeightedSequence(ACT_IDLE) - self.OldSetModel = self.SetModel - self.SetModel = function(self, model, skin, hidden) - self:OldSetModel(model) + if (sequence <= 0) then + sequence = entity:LookupSequence("idle_unarmed") + end - local entity = self.Entity + entity:SetIK(false) - if (skin) then - entity:SetSkin(skin) - end + if (sequence > 0) then + entity:ResetSequence(sequence) + return + end - local sequence = entity:SelectWeightedSequence(ACT_IDLE) + for _, seqName in ipairs(entity:GetSequenceList()) do + local seqNameLower = seqName:lower() + if seqNameLower == "idlenoise" then continue end + if not (seqNameLower:find("idle") or seqNameLower:find("fly")) then continue end - if (sequence <= 0) then - sequence = entity:LookupSequence("idle_unarmed") - end + entity:ResetSequence(seqName) + return + end - if (sequence > 0) then - entity:ResetSequence(sequence) - else - local found = false + entity:ResetSequence(4) +end - for k, v in ipairs(entity:GetSequenceList()) do - if ((v:lower():find("idle") or v:lower():find("fly")) and v ~= "idlenoise") then - entity:ResetSequence(v) - found = true +function PANEL:Init() + self:setHidden(false) - break - end - end + for i = 0, 5 do + if (i == 1 or i == 5) then + self:SetDirectionalLight(i, Color(155, 155, 155)) + else + self:SetDirectionalLight(i, Color(255, 255, 255)) + end + end - if (!found) then - entity:ResetSequence(4) - end - end + self.OldSetModel = self.SetModel + self.SetModel = function(self, model, skin, hidden) + self:OldSetModel(model) - local data = PositionSpawnIcon(entity, entity:GetPos()) + local entity = self.Entity - if (data) then - self:SetFOV(data.fov) - self:SetCamPos(data.origin) - self:SetLookAng(data.angles) - end + if (skin) then + entity:SetSkin(skin) + end + + setSequence(entity) - entity:SetIK(false) - entity:SetEyeTarget(Vector(0, 0, 64)) + local data = PositionSpawnIcon(entity, entity:GetPos()) + + if (data) then + self:SetFOV(data.fov) + self:SetCamPos(data.origin) + self:SetLookAng(data.angles) end + + entity:SetEyeTarget(Vector(0, 0, 64)) end +end - function PANEL:setHidden(hidden) - if (hidden) then - self:SetAmbientLight(color_black) - self:SetColor(Color(0, 0, 0)) +function PANEL:setHidden(hidden) + if (hidden) then + self:SetAmbientLight(color_black) + self:SetColor(Color(0, 0, 0)) - for i = 0, 5 do - self:SetDirectionalLight(i, color_black) - end - else - self:SetAmbientLight(Color(20, 20, 20)) - self:SetAlpha(255) - self:SetColor(Color(255, 255, 255)) - - for i = 0, 5 do - if (i == 1 or i == 5) then - self:SetDirectionalLight(i, Color(155, 155, 155)) - else - self:SetDirectionalLight(i, Color(255, 255, 255)) - end + for i = 0, 5 do + self:SetDirectionalLight(i, color_black) + end + else + self:SetAmbientLight(Color(20, 20, 20)) + self:SetAlpha(255) + self:SetColor(Color(255, 255, 255)) + + for i = 0, 5 do + if (i == 1 or i == 5) then + self:SetDirectionalLight(i, Color(155, 155, 155)) + else + self:SetDirectionalLight(i, Color(255, 255, 255)) end end end +end - function PANEL:LayoutEntity() - self:RunAnimation() - end +function PANEL:LayoutEntity() + self:RunAnimation() +end - function PANEL:OnMousePressed() - if (self.DoClick) then - self:DoClick() - end +function PANEL:OnMousePressed() + if (self.DoClick) then + self:DoClick() end +end vgui.Register("nutSpawnIcon", PANEL, "DModelPanel") diff --git a/gamemode/core/derma/cl_tooltip.lua b/gamemode/core/derma/cl_tooltip.lua index eec9c42b..ba4d460c 100644 --- a/gamemode/core/derma/cl_tooltip.lua +++ b/gamemode/core/derma/cl_tooltip.lua @@ -64,16 +64,16 @@ end function PANEL:PerformLayout() local override = hook.Run("TooltipLayout", self) - if (not override) then - if (self.Contents) then - self:SetWide(self.Contents:GetWide() + 8) - self:SetTall(self.Contents:GetTall() + 8) - self.Contents:SetPos(4, 4) - else - local w, h = self:GetContentSize() - self:SetSize(w + 8, h + 6) - self:SetContentAlignment(5) - end + if (override) then return end + + if (self.Contents) then + self:SetWide(self.Contents:GetWide() + 8) + self:SetTall(self.Contents:GetTall() + 8) + self.Contents:SetPos(4, 4) + else + local w, h = self:GetContentSize() + self:SetSize(w + 8, h + 6) + self:SetContentAlignment(5) end end @@ -88,7 +88,7 @@ function PANEL:PositionTooltip() local x, y = input.GetCursorPos() local w, h = self:GetSize() - local lx, ly = self.TargetPanel:LocalToScreen(0, 0) + local _, ly = self.TargetPanel:LocalToScreen(0, 0) y = y - 50 @@ -103,10 +103,9 @@ function PANEL:Paint( w, h ) self:PositionTooltip() local override = hook.Run("TooltipPaint", self, w, h) + if (override) then return end - if (not override) then - derma.SkinHook("Paint", "Tooltip", self, w, h) - end + derma.SkinHook("Paint", "Tooltip", self, w, h) end function PANEL:OpenForPanel(panel) From d3d8d0901aedd9691130ee8bf79ac1b29359166e Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Tue, 5 Jul 2022 10:55:18 +0200 Subject: [PATCH 31/89] ew, whitespaces --- .../core/libs/thirdparty/sh_netstream2.lua | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/gamemode/core/libs/thirdparty/sh_netstream2.lua b/gamemode/core/libs/thirdparty/sh_netstream2.lua index 8fb6a1ff..f8558538 100644 --- a/gamemode/core/libs/thirdparty/sh_netstream2.lua +++ b/gamemode/core/libs/thirdparty/sh_netstream2.lua @@ -3,7 +3,7 @@ Alexander Grist-Hucker http://www.revotech.org - + Credits to: thelastpenguin for pON. https://github.com/thelastpenguin/gLUA-Library/tree/master/pON @@ -29,16 +29,16 @@ function netstream.Split(data) for i = 0, string.len(data) do buffer[#buffer + 1] = string.sub(data, i, i); - + if (#buffer == 32768) then result[#result + 1] = table.concat(buffer); index = index + 1; buffer = {}; end; end; - + result[#result + 1] = table.concat(buffer); - + return result; end; @@ -65,16 +65,16 @@ if (SERVER) then player = {player}; end; end; - + if (type(player) ~= "Vector") then for k, v in pairs(player) do if (type(v) == "Player") then recipients[#recipients + 1] = v; - + bShouldSend = true; elseif (type(k) == "Player") then recipients[#recipients + 1] = k; - + bShouldSend = true; end; end; @@ -97,34 +97,34 @@ if (SERVER) then end; end; end; - + net.Receive("NetStreamDS", function(length, player) local NS_DS_NAME = net.ReadString(); local NS_DS_LENGTH = net.ReadUInt(32); local NS_DS_DATA = net.ReadData(NS_DS_LENGTH); - + if (NS_DS_NAME and NS_DS_DATA and NS_DS_LENGTH) then player.nsDataStreamName = NS_DS_NAME; player.nsDataStreamData = ""; - + if (player.nsDataStreamName and player.nsDataStreamData) then player.nsDataStreamData = NS_DS_DATA; - + if (netstream.stored[player.nsDataStreamName]) then local bStatus, value = pcall(pon.decode, player.nsDataStreamData); - + if (bStatus) then netstream.stored[player.nsDataStreamName](player, unpack(value)); else ErrorNoHalt("NetStream: '"..NS_DS_NAME.."'\n"..value.."\n"); end; end; - + player.nsDataStreamName = nil; player.nsDataStreamData = nil; end; end; - + NS_DS_NAME, NS_DS_DATA, NS_DS_LENGTH = nil, nil, nil; end); else @@ -132,7 +132,7 @@ else function netstream.Start(name, ...) local dataTable = {...}; local encodedData = pon.encode(dataTable); - + if (encodedData and #encodedData > 0) then net.Start("NetStreamDS"); net.WriteString(name); @@ -141,12 +141,12 @@ else net.SendToServer(); end; end; - + net.Receive("NetStreamDS", function(length) local NS_DS_NAME = net.ReadString(); local NS_DS_LENGTH = net.ReadUInt(32); local NS_DS_DATA = net.ReadData(NS_DS_LENGTH); - + if (NS_DS_NAME and NS_DS_DATA and NS_DS_LENGTH) then if (netstream.stored[NS_DS_NAME]) then local bStatus, value = pcall(pon.decode, NS_DS_DATA); @@ -158,7 +158,7 @@ else end; end; end; - + NS_DS_NAME, NS_DS_DATA, NS_DS_LENGTH = nil, nil, nil; end); end; \ No newline at end of file From d746b3f28c18fc48984f2abea607ea5787400985 Mon Sep 17 00:00:00 2001 From: Xem0n Date: Tue, 12 Jul 2022 20:01:01 -0700 Subject: [PATCH 32/89] fix locking simfphys vehicles --- plugins/doors/entities/weapons/nut_keys.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/doors/entities/weapons/nut_keys.lua b/plugins/doors/entities/weapons/nut_keys.lua index 0062627b..c903a342 100644 --- a/plugins/doors/entities/weapons/nut_keys.lua +++ b/plugins/doors/entities/weapons/nut_keys.lua @@ -162,13 +162,13 @@ function SWEP:toggleLock(door, state) if (state) then door:Fire("lock") if (door.IsSimfphyscar) then - door.IsLocked = true + door:Lock() end self.Owner:EmitSound("doors/door_latch3.wav") else door:Fire("unlock") if (door.IsSimfphyscar) then - door.IsLocked = nil + door:UnLock() end self.Owner:EmitSound("doors/door_latch1.wav") end From c1bd870096ce680a95c9b6c2b4f9abc3d15e24a4 Mon Sep 17 00:00:00 2001 From: Xem0n <41586292+Xem0n@users.noreply.github.com> Date: Wed, 10 Aug 2022 12:45:58 -0700 Subject: [PATCH 33/89] add omitted argument (#104) --- gamemode/core/meta/sh_player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemode/core/meta/sh_player.lua b/gamemode/core/meta/sh_player.lua index c8924740..58f73a88 100644 --- a/gamemode/core/meta/sh_player.lua +++ b/gamemode/core/meta/sh_player.lua @@ -12,7 +12,7 @@ function PLAYER:addMoney(amt) end end -function PLAYER:takeMoney() +function PLAYER:takeMoney(amt) local char = self:getChar() if (char) then From b693dc018a85a107e29f70fff368dee665afe08f Mon Sep 17 00:00:00 2001 From: Dobytchick <48864677+Dobytchick@users.noreply.github.com> Date: Sun, 14 Aug 2022 18:33:56 +0600 Subject: [PATCH 34/89] Update sh_russian.lua (#108) --- gamemode/languages/sh_russian.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gamemode/languages/sh_russian.lua b/gamemode/languages/sh_russian.lua index b89e7fbc..6695d030 100644 --- a/gamemode/languages/sh_russian.lua +++ b/gamemode/languages/sh_russian.lua @@ -290,4 +290,9 @@ LANGUAGE = { cantDropBagHasEquipped = "Запрещено бросать сумку с экипированным предметом.", lookToUseAt = "Необходимо смотреть на игрока для использования '@'", mustProvideString = "Необходимо предьявить строковую для этой функции", + + --Attributes + Endurance = "Скорость бега", + Stamina = "Выносливость", + Strength = "Сила", } From c0d3cb7c91c8659befbf996267d3ee9154e23b67 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Fri, 2 Sep 2022 11:56:56 +0300 Subject: [PATCH 35/89] Entity:GetIK() is not a real function --- gamemode/core/derma/cl_modelpanel.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gamemode/core/derma/cl_modelpanel.lua b/gamemode/core/derma/cl_modelpanel.lua index 02f1c148..736bbd2b 100644 --- a/gamemode/core/derma/cl_modelpanel.lua +++ b/gamemode/core/derma/cl_modelpanel.lua @@ -52,9 +52,7 @@ function PANEL:LayoutEntity() entity:SetPoseParameter("head_pitch", yRatio*90 - 30) entity:SetPoseParameter("head_yaw", (xRatio - xRatio2)*90 - 5) entity:SetAngles(MODEL_ANGLE) - if entity:GetIK() then - entity:SetIK(false) - end + entity:SetIK(false) if (self.copyLocalSequence) then local ply = LocalPlayer() From cd3eda037460104cb771e4687c15f584b4904592 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 10 Sep 2022 15:54:37 +0300 Subject: [PATCH 36/89] Update cl_inventory.lua Stupid little extra bracket --- gamemode/core/derma/cl_inventory.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gamemode/core/derma/cl_inventory.lua b/gamemode/core/derma/cl_inventory.lua index 88c89a94..81e1f57d 100644 --- a/gamemode/core/derma/cl_inventory.lua +++ b/gamemode/core/derma/cl_inventory.lua @@ -179,7 +179,6 @@ function PANEL:openActionMenu() if (v.isMulti) then local subMenu, subMenuOption = menu:AddSubMenu(L(v.name or k), buildActionFunc(v, k, itemTable, self.invID)) - ) subMenuOption:SetImage(v.icon or "icon16/brick.png") if (not v.multiOptions) then return end @@ -295,4 +294,4 @@ hook.Add("CreateMenuButtons", "nutInventory", function(tabs) hook.Run("PostDrawInventory", mainPanel) end) end -end) \ No newline at end of file +end) From 6cf4eb9183cd795f4d2bd9e07090c4821950b26f Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 26 Oct 2022 13:52:57 +0200 Subject: [PATCH 37/89] Outfit Demos Update the outfit demo .txt's (replacing the depricated pacoutfit with outfit) and adding spacing to the examples in the base for ease of reading --- gamemode/items/base/sh_outfit.lua | 5 ++++- gamemode/items/outfit/sh_rebel_armor.txt | 9 +++++++++ gamemode/items/{pacoutfit => outfit}/sh_skullmask.txt | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 gamemode/items/outfit/sh_rebel_armor.txt rename gamemode/items/{pacoutfit => outfit}/sh_skullmask.txt (91%) diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index 6d4a2e51..29e54206 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -13,10 +13,13 @@ ITEM.pacData = {} -- This will change a player's skin after changing the model. -- Keep in mind it starts at 0. ITEM.newSkin = 1 + -- This will change a certain part of the model. ITEM.replacements = {"group01", "group02"} + -- This will change the player's model completely. ITEM.replacements = "models/manhack.mdl" + -- This will have multiple replacements. ITEM.replacements = { {"male", "female"}, @@ -77,7 +80,7 @@ function ITEM:removeOutfit(client) end end end - + character:setData("oldGroups", oldGroups) end diff --git a/gamemode/items/outfit/sh_rebel_armor.txt b/gamemode/items/outfit/sh_rebel_armor.txt new file mode 100644 index 00000000..29fd94fc --- /dev/null +++ b/gamemode/items/outfit/sh_rebel_armor.txt @@ -0,0 +1,9 @@ +ITEM.name = "Rebel Armor" +ITEM.desc = "Protects your insides from the outsides" +ITEM.model = "models/props_c17/BriefCase001a.mdl" +ITEM.width = 2 +ITEM.height = 2 +ITEM.outfitCategory = "body" + +ITEM.replacements = "models/player/combine_soldier.mdl" +ITEM.newSkin = 1 \ No newline at end of file diff --git a/gamemode/items/pacoutfit/sh_skullmask.txt b/gamemode/items/outfit/sh_skullmask.txt similarity index 91% rename from gamemode/items/pacoutfit/sh_skullmask.txt rename to gamemode/items/outfit/sh_skullmask.txt index 3316269b..2c91af27 100644 --- a/gamemode/items/pacoutfit/sh_skullmask.txt +++ b/gamemode/items/outfit/sh_skullmask.txt @@ -1,5 +1,5 @@ ITEM.name = "Skull Mask" -ITEM.desc = "It's a skull mask." +ITEM.desc = "It's a skull mask. - Demo of using PAC with items" ITEM.model = "models/Gibs/HGIBS.mdl" ITEM.width = 1 ITEM.height = 1 From 62f3cca7d9981c29c27049033624120738463460 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 26 Oct 2022 13:54:02 +0200 Subject: [PATCH 38/89] Combine, not rebel Someone is bound to complain, literally unusable --- gamemode/items/outfit/sh_rebel_armor.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemode/items/outfit/sh_rebel_armor.txt b/gamemode/items/outfit/sh_rebel_armor.txt index 29fd94fc..b3dda224 100644 --- a/gamemode/items/outfit/sh_rebel_armor.txt +++ b/gamemode/items/outfit/sh_rebel_armor.txt @@ -1,4 +1,4 @@ -ITEM.name = "Rebel Armor" +ITEM.name = "Combine Armor" ITEM.desc = "Protects your insides from the outsides" ITEM.model = "models/props_c17/BriefCase001a.mdl" ITEM.width = 2 From c6e974ba0012730762874347e2c862dc70478f6c Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 14 Dec 2022 19:36:34 +0100 Subject: [PATCH 39/89] guacamole --- gamemode/core/derma/cl_inventory.lua | 2 +- gamemode/core/hooks/cl_hooks.lua | 2 +- gamemode/items/base/sh_outfit.lua | 30 +++++++++++++++++++++++----- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/gamemode/core/derma/cl_inventory.lua b/gamemode/core/derma/cl_inventory.lua index 81e1f57d..97c2b1b9 100644 --- a/gamemode/core/derma/cl_inventory.lua +++ b/gamemode/core/derma/cl_inventory.lua @@ -171,7 +171,7 @@ function PANEL:openActionMenu() end for k, v in SortedPairs(itemTable.functions) do - if (isfunction(v.onCanRun) and not v.onCanRun(itemTable)) then + if (hook.Run("onCanRunItemAction", itemTable, k) == false or isfunction(v.onCanRun) and not v.onCanRun(itemTable)) then continue end diff --git a/gamemode/core/hooks/cl_hooks.lua b/gamemode/core/hooks/cl_hooks.lua index 3f5de1af..df74f9c3 100644 --- a/gamemode/core/hooks/cl_hooks.lua +++ b/gamemode/core/hooks/cl_hooks.lua @@ -445,7 +445,7 @@ function GM:ItemShowEntityMenu(entity) for k, v in SortedPairs(itemTable.functions) do if (k == "combine") then continue end -- yeah, noob protection - if (isfunction(v.onCanRun)) and (not v.onCanRun(itemTable)) then + if (hook.Run("onCanRunItemAction", itemTable, k) == false or isfunction(v.onCanRun)) and (not v.onCanRun(itemTable)) then continue end diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index 29e54206..e48ef415 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -6,6 +6,7 @@ ITEM.width = 1 ITEM.height = 1 ITEM.outfitCategory = "model" ITEM.pacData = {} +ITEM.isOutfit = true -- ITEM.armor = 25 -- How much armor to add/remove upon wearing/removing. @@ -50,6 +51,15 @@ if (CLIENT) then end end +--Utility for remembering all models/skins/bodygroups +if SERVER then + ITEM.visualData = { + model = {}, + skin = {}, + bodygroups = {} + } +end + function ITEM:removeOutfit(client) local character = client:getChar() @@ -57,11 +67,17 @@ function ITEM:removeOutfit(client) -- Revert the model, skin, and bodygroups. if (hook.Run("CanOutfitChangeModel", self) ~= false) then - character:setModel(character:getData("oldMdl", character:getModel())) + --[[ character:setModel(character:getData("oldMdl", character:getModel())) character:setData("oldMdl", nil) client:SetSkin(character:getData("oldSkin", character:getData("skin", 0))) - character:setData("oldSkin", nil) + character:setData("oldSkin", nil) ]] + + character:setModel(self:getData("oldMdl", character:getModel())) + self:setData("oldMdl", nil) + + client:SetSkin(self:getData("oldSkin", character:getData("skin", 0))) + self:setData("oldSkin", nil) local oldGroups = character:getData("oldGroups", {}) @@ -156,14 +172,15 @@ ITEM.functions.Equip = { item:setData("equip", true) if (hook.Run("CanOutfitChangeModel", item) ~= false) then - char:setData( + --[[ char:setData( "oldMdl", char:getData("oldMdl", item.player:GetModel()) - ) + ) ]] -- Do model substitutions. if (isfunction(item.onGetReplacement)) then char:setModel(item:onGetReplacement()) + item:setData("oldMdl", item.player:GetModel()) elseif (item.replacement or item.replacements) then if (istable(item.replacements)) then if ( @@ -182,11 +199,13 @@ ITEM.functions.Equip = { else char:setModel(tostring(item.replacement or item.replacements)) end + item:setData("oldMdl", item.player:GetModel()) end -- Then apply the new skin for the model. if (isnumber(item.newSkin)) then - char:setData("oldSkin", item.player:GetSkin()) + --char:setData("oldSkin", item.player:GetSkin()) + item:setData("oldSkin", item.player:GetSkin()) char:setData("skin", item.newSkin) item.player:SetSkin(item.newSkin) end @@ -206,6 +225,7 @@ ITEM.functions.Equip = { end char:setData("oldGroups", oldGroups) + item:setData("oldGroups", oldGroups) local newGroups = char:getData("groups", {}) for index, value in pairs(groups) do From 31268cbf3f753b83ba8c2e3b3f39c7bb77af7429 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 14 Dec 2022 19:58:15 +0100 Subject: [PATCH 40/89] Milktest: Add descs to item functions --- gamemode/core/libs/sh_item.lua | 68 ++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/gamemode/core/libs/sh_item.lua b/gamemode/core/libs/sh_item.lua index da20694d..f8c8a31e 100644 --- a/gamemode/core/libs/sh_item.lua +++ b/gamemode/core/libs/sh_item.lua @@ -9,10 +9,33 @@ nut.item.inventoryTypes = nut.item.inventoryTypes or {} nut.util.include("nutscript/gamemode/core/meta/sh_item.lua") +-- @type function nut.item.get(identifier) +-- @typeCommentStart +-- Retrieves an item table. +-- @typeCommentEnd +-- @realm shared +-- @string identifier Unique ID of the item +-- @treturn item Item table +-- @usageStart +-- print(nut.item.get("example")) +-- "item[example][0]" +-- @usageEnd function nut.item.get(identifier) return nut.item.base[identifier] or nut.item.list[identifier] end +-- @type function nut.item.load(identifier) +-- @typeCommentStart +-- Loads item from file. +-- @typeCommentEnd +-- @realm shared +-- @internal +-- @string path Path of the item file +-- @string baseID Unique ID of the item's base +-- @bool isBaseItem Whether the item is a base item +-- @usageStart +-- nut.item.load("sh_guacamole.lua", "foodstuff", false") +-- @usageEnd function nut.item.load(path, baseID, isBaseItem) local uniqueID = path:match("sh_([_%w]+)%.lua") @@ -27,10 +50,34 @@ function nut.item.load(path, baseID, isBaseItem) end end +-- @type function nut.item.isItem(object) +-- @typeCommentStart +-- Returns whether input is an item object or not. +-- @typeCommentEnd +-- @realm shared +-- @table object Object to check +-- @usageStart +-- nut.item.isItem(nut.item.instances[1]) +-- "true" +-- @usageEnd function nut.item.isItem(object) return istable(object) and object.isItem == true end +-- @type function nut.item.register(uniqueID, baseID, isBaseItem, path, luaGenerated) +-- @typeCommentStart +-- Registers an item with a given uniqueID. +-- @typeCommentEnd +-- @realm shared +-- @internal +-- @string uniqueID Unique ID of the item +-- @string baseID Unique ID of the item's base +-- @bool isBaseItem Whether the item is a base item +-- @string path Path of the item file +-- @bool luaGenerated Whether the item is generated by Lua +-- @usageStart +-- nut.item.register("example", "base_food", false, "sh_example.lua", false) +-- @usageEnd function nut.item.register(uniqueID, baseID, isBaseItem, path, luaGenerated) assert(isstring(uniqueID), "uniqueID must be a string") @@ -97,6 +144,17 @@ function nut.item.register(uniqueID, baseID, isBaseItem, path, luaGenerated) return targetTable[itemType] end + +-- @type function nut.item.loadFromDir(directory) +-- @typeCommentStart +-- Loads items from a directory. +-- @typeCommentEnd +-- @realm shared +-- @string directory Directory to load items from +-- @usageStart +-- nut.item.loadFromDir("items") +-- @usageEnd + function nut.item.loadFromDir(directory) local files, folders @@ -123,6 +181,16 @@ function nut.item.loadFromDir(directory) end end +-- @type function nut.item.new(uniqueID, id) +-- @typeCommentStart +-- Creates a new item object. +-- @typeCommentEnd +-- @realm shared +-- @string uniqueID Unique ID of the item +-- @number id ID of the item +-- @usageStart +-- local item = nut.item.new("example", 15) +-- @usageEnd function nut.item.new(uniqueID, id) id = id and tonumber(id) or id From e92bbbdaa9327bf65c78652be9eb5aeb741d91e4 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 14 Dec 2022 20:45:14 +0100 Subject: [PATCH 41/89] Update sh_item.lua --- gamemode/core/libs/sh_item.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gamemode/core/libs/sh_item.lua b/gamemode/core/libs/sh_item.lua index f8c8a31e..2ec1d568 100644 --- a/gamemode/core/libs/sh_item.lua +++ b/gamemode/core/libs/sh_item.lua @@ -1,3 +1,8 @@ +-- @module nut.item +-- @moduleCommentStart +-- Library functions for items. +-- @moduleCommentEnd + nut.item = nut.item or {} nut.item.list = nut.item.list or {} nut.item.base = nut.item.base or {} From 63f6870fa07b35460e2470d2e5fd9e178f62a547 Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Thu, 15 Dec 2022 21:31:44 +0600 Subject: [PATCH 42/89] ternarity of currency.get --- gamemode/core/libs/sh_currency.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gamemode/core/libs/sh_currency.lua b/gamemode/core/libs/sh_currency.lua index 012b99cc..4d8a28df 100644 --- a/gamemode/core/libs/sh_currency.lua +++ b/gamemode/core/libs/sh_currency.lua @@ -10,11 +10,7 @@ function nut.currency.set(symbol, singular, plural) end function nut.currency.get(amount) - if (amount == 1) then - return nut.currency.symbol.."1 "..nut.currency.singular - else - return nut.currency.symbol..amount.." "..nut.currency.plural - end + return nut.currency.symbol .. (amount == 1 and ("1 " .. nut.currency.singular) or (amount .. " " ..nut.currency.plural)) end function nut.currency.spawn(pos, amount, angle) From 9e14bec66eb006468c4c130d7ca32a56ea695551 Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Fri, 16 Dec 2022 18:15:08 +0600 Subject: [PATCH 43/89] documented character methamethods --- gamemode/core/meta/sh_character.lua | 59 +++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/gamemode/core/meta/sh_character.lua b/gamemode/core/meta/sh_character.lua index 7a79834a..d8c32f30 100644 --- a/gamemode/core/meta/sh_character.lua +++ b/gamemode/core/meta/sh_character.lua @@ -1,3 +1,8 @@ +-- @module character +-- @moduleCommentStart +-- Metamethods for character +-- @moduleCommentEnd + -- Create the character metatable. local CHAR = nut.meta.character or {} CHAR.__index = CHAR @@ -21,7 +26,12 @@ function CHAR:getID() end if (SERVER) then + -- @type function character:save(callback) + -- @typeCommentStart -- Saves the character to the database and calls the callback if provided. + -- @typeCommentEnd + -- @realm server + -- @function callback Callback when character saved on database function CHAR:save(callback) -- Do not save if the character is for a bot. if (self.isBot) then @@ -53,7 +63,12 @@ if (SERVER) then end end + -- @type function character:sync(receiver) + -- @typeCommentStart -- Sends character information to the receiver. + -- @typeCommentEnd + -- @realm server + -- @player receiver who will receive synchronization, nil - so that all players receive. function CHAR:sync(receiver) -- Broadcast the character information if receiver is not set. if (receiver == nil) then @@ -97,7 +112,12 @@ if (SERVER) then end end + -- @type function character:setup(noNetworked) + -- @typeCommentStart -- Sets up the "appearance" related information for the character. + -- @typeCommentEnd + -- @realm server + -- @bool noNetworking responsible for character synchronization function CHAR:setup(noNetworking) local client = self:getPlayer() @@ -130,7 +150,11 @@ if (SERVER) then end end + -- @type function character:kick() + -- @typeCommentStart -- Forces the player to choose a character. + -- @typeCommentEnd + -- @realm server function CHAR:kick() -- Kill the player so they are not standing anywhere. local client = self:getPlayer() @@ -151,7 +175,15 @@ if (SERVER) then end end + -- @type function character:ban(time) + -- @typeCommentStart -- Prevents the use of this character permanently or for a certain amount of time. + -- @typeCommentEnd + -- @realm server + -- @int time Сharacter ban time + -- @usageStart + -- Entity(1):getChar():ban(3600) -- will send a character owned by a player with index 1 to a ban + -- @usageEnd function CHAR:ban(time) time = tonumber(time) @@ -168,12 +200,21 @@ if (SERVER) then hook.Run("OnCharPermakilled",self,time or nil) end + -- @type function character:delete() + -- @typeCommentStart -- Deletes this character from existence along with its associated data. + -- @typeCommentEnd + -- @realm server function CHAR:delete() nut.char.delete(self:getID(), self:getPlayer()) end + -- @type function character:destroy() + -- @typeCommentStart -- Deletes this character from memory. + -- @typeCommentEnd + -- @realm server + -- @internal function CHAR:destroy() local id = self:getID() nut.char.loaded[id] = nil @@ -181,7 +222,16 @@ if (SERVER) then end end +-- @type function character:getPlayer() +-- @typeCommentStart -- Returns which player owns this character. +-- @typeCommentEnd +-- @realm shared +-- @treturn player The player who owns need character +-- @usageStart +-- local charOwner = Entity(1):getChar():getPlayer() +-- charOwner:notify('test') +-- @usageEnd function CHAR:getPlayer() -- Return the player from cache. if (IsValid(self.player)) then @@ -209,7 +259,16 @@ function CHAR:getPlayer() end end +-- @module nut.char +-- @moduleCommentStart +-- Library functions for character +-- @moduleCommentEnd + +-- @type function nut.char.registerVar() +-- @typeCommentStart -- Sets up a new character variable. +-- @typeCommentEnd +-- @realm shared function nut.char.registerVar(key, data) -- Store information for the variable. nut.char.vars[key] = data From e7f3c4d3db4666a6033462b185a63b50d7824b90 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 21 Dec 2022 14:04:36 +0100 Subject: [PATCH 44/89] Update nut.char documentation --- gamemode/core/meta/sh_character.lua | 30 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/gamemode/core/meta/sh_character.lua b/gamemode/core/meta/sh_character.lua index d8c32f30..0ddfe04e 100644 --- a/gamemode/core/meta/sh_character.lua +++ b/gamemode/core/meta/sh_character.lua @@ -1,4 +1,4 @@ --- @module character +-- @module nut.char -- @moduleCommentStart -- Metamethods for character -- @moduleCommentEnd @@ -26,7 +26,8 @@ function CHAR:getID() end if (SERVER) then - -- @type function character:save(callback) + -- @type method Character:save(callback) + -- @classmod Character -- @typeCommentStart -- Saves the character to the database and calls the callback if provided. -- @typeCommentEnd @@ -63,7 +64,8 @@ if (SERVER) then end end - -- @type function character:sync(receiver) + -- @type method Character:sync(receiver) + -- @classmod Character -- @typeCommentStart -- Sends character information to the receiver. -- @typeCommentEnd @@ -112,7 +114,8 @@ if (SERVER) then end end - -- @type function character:setup(noNetworked) + -- @type method Character:setup(noNetworked) + -- @classmod Character -- @typeCommentStart -- Sets up the "appearance" related information for the character. -- @typeCommentEnd @@ -150,7 +153,8 @@ if (SERVER) then end end - -- @type function character:kick() + -- @type method Character:kick() + -- @classmod Character -- @typeCommentStart -- Forces the player to choose a character. -- @typeCommentEnd @@ -175,7 +179,8 @@ if (SERVER) then end end - -- @type function character:ban(time) + -- @type method Character:ban(time) + -- @classmod Character -- @typeCommentStart -- Prevents the use of this character permanently or for a certain amount of time. -- @typeCommentEnd @@ -200,7 +205,8 @@ if (SERVER) then hook.Run("OnCharPermakilled",self,time or nil) end - -- @type function character:delete() + -- @type method Character:delete() + -- @classmod Character -- @typeCommentStart -- Deletes this character from existence along with its associated data. -- @typeCommentEnd @@ -209,7 +215,8 @@ if (SERVER) then nut.char.delete(self:getID(), self:getPlayer()) end - -- @type function character:destroy() + -- @type method Character:destroy() + -- @classmod Character -- @typeCommentStart -- Deletes this character from memory. -- @typeCommentEnd @@ -222,7 +229,8 @@ if (SERVER) then end end --- @type function character:getPlayer() +-- @type method Character:getPlayer() +-- @classmod Character -- @typeCommentStart -- Returns which player owns this character. -- @typeCommentEnd @@ -259,10 +267,6 @@ function CHAR:getPlayer() end end --- @module nut.char --- @moduleCommentStart --- Library functions for character --- @moduleCommentEnd -- @type function nut.char.registerVar() -- @typeCommentStart From b24a758504187d08505eb05afddf35d06b6aebf2 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Mon, 26 Dec 2022 23:44:25 +0100 Subject: [PATCH 45/89] Create syntax.lua --- gamemode/core/syntax.lua | 148 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 gamemode/core/syntax.lua diff --git a/gamemode/core/syntax.lua b/gamemode/core/syntax.lua new file mode 100644 index 00000000..49ab97f6 --- /dev/null +++ b/gamemode/core/syntax.lua @@ -0,0 +1,148 @@ +-- @module Syntax +-- @moduleCommentStart +-- Syntax for Nutscript documentation. +-- @moduleCommentEnd + +-- @type command module +-- @typeCommentStart +-- The !@module rule is used to declare the module name. This should be placed at the top of a file. +-- @typeCommentEnd +-- @string Title Required. Module title. +-- @usageStart +-- !@module Syntax +-- @usageEnd +module (string Title) + +--[[ +@type command moduleComment +@typeCommentStart +The !@moduleCommentStart and !@moduleCommentEnd commands declare the beginning and end of the module comment. +They should contain all comment material between the commands, not on the same line. This should only be used once per file. +@typeCommentEnd +@string Comment Required. Module comment. +@usageStart +!@moduleCommentStart +Syntax for Nutscript documentation. +!@moduleCommentEnd +@usageEnd +]] +moduleCommentStart +(string Comment) +moduleCommentEnd + +--[[ +@type command classmod +@typeCommentStart +The !@classmod declares a type is part of a named class. This overrides the pages !@module declaration. +Additionally, this will categorize the type into the class category, rather than the category corresponding to the !@module declaration. +@typeCommentEnd +@string Title Required. Module title. +@usageStart +!@classmod Character +@usageEnd +]] +classmod (string Title) + +--[[ +@type command type +@typeCommentStart +The !@type command declares a datatype (e.g., 'function', 'method', 'table' etc.) and a name (e.g., nut.item.get(params)). +It is critical that this is the first declaration in naming a function (i.e., all other data specific to the type should follow.). +@typeCommentEnd +@string Datatype Required. Data type: function, method, table etc. +@string Name Required. The function or method name: nut.item.get(); Character:get(). +@usageStart +!@type function nut.item.isItem(object) +@usageEnd +]] +type (string Datatype) (string Name) + +--[[ +@type command typeComment +@typeCommentStart +The !@typeCommentStart and !@typeCommentEnd commands are used to declare a type comment. This works in the same way as the moduleComment commands. +The type comment should be declared sometime after a !@type declaration. +@typeCommentEnd +@string Comment Required. Type comment. +@usageStart +!@typeCommentStart +Returns whether input is an item object or not. +!@typeCommentEnd +@usageEnd +]] +typeCommentStart +(string Comment) +typeCommentEnd + +--[[ +@type command realm +@typeCommentStart +The !@realm command is used to declare a realm type, (e.g., shared, server, or client). +@typeCommentEnd +@string Realm Required. Realm type. +@usageStart +!@realm shared +@usageEnd +]] +realm (string Realm) + +--[[ +@type command internal +@typeCommentStart +The !@internal command is used to specify an internal function, method, or table. +The command is not necessary if the item is not internal. +@typeCommentEnd +@usageStart +!@internal +@usageEnd +]] +internal + +--[[ +@type command param +@typeCommentStart +Any string which has '!@' in front of it and is not written on this page will be treated as a parameter. +Parameters can be given a default value using the [default=] command. +@typeCommentEnd +@string Param Required. Param type (e.g., string, table, int). +@string default Optional. Param default value. +@string Label Required. Param label. +@string Description Required. Param description. +@usageStart +!@string path Path of the item file. +!@table object Object to check +!@int[default=1] number Number value. +!@bool[default=false] isBaseItem Whether the item is a base item +@usageEnd +]] +Param[default=DEFAULT] (string Label) (string Description) + +--[[ +@type command treturn +@typeCommentStart +The !@treturn command is used to specify a return value. +@typeCommentEnd +@string Label Required. Return label. +@string Description Required. Return description. +@usageStart +!@treturn item Item table +@usageEnd +]] +treturn (string Label) (string Description) + +--[[ +@type command usage +@typeCommentStart +The !@usageStart and !@usageEnd commands are used to specify a block of example code. +This works in the same way as the moduleComment and typeComment commands. This is an optional command. +@typeCommentEnd +@string Example Optional. Example code. +@usageStart +!@usageStart +nut.item.register("example", "base_food", false, "sh_example.lua", false) +!@usageEnd +@usageEnd +]] +usageStart +(string Example) +usageEnd \ No newline at end of file From dddac7af1b92629d4d648b1a45aaac1d8ee8742e Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Mon, 26 Dec 2022 23:59:08 +0100 Subject: [PATCH 46/89] Update sh_character.lua --- gamemode/core/meta/sh_character.lua | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/gamemode/core/meta/sh_character.lua b/gamemode/core/meta/sh_character.lua index 0ddfe04e..b31c8f56 100644 --- a/gamemode/core/meta/sh_character.lua +++ b/gamemode/core/meta/sh_character.lua @@ -1,6 +1,6 @@ -- @module nut.char -- @moduleCommentStart --- Metamethods for character +-- Library functions for character -- @moduleCommentEnd -- Create the character metatable. @@ -27,10 +27,10 @@ end if (SERVER) then -- @type method Character:save(callback) - -- @classmod Character -- @typeCommentStart -- Saves the character to the database and calls the callback if provided. -- @typeCommentEnd + -- @classmod Character -- @realm server -- @function callback Callback when character saved on database function CHAR:save(callback) @@ -65,10 +65,10 @@ if (SERVER) then end -- @type method Character:sync(receiver) - -- @classmod Character -- @typeCommentStart -- Sends character information to the receiver. -- @typeCommentEnd + -- @classmod Character -- @realm server -- @player receiver who will receive synchronization, nil - so that all players receive. function CHAR:sync(receiver) @@ -114,11 +114,11 @@ if (SERVER) then end end - -- @type method Character:setup(noNetworked) - -- @classmod Character + -- @type method Character:setup(noNetworking) -- @typeCommentStart -- Sets up the "appearance" related information for the character. -- @typeCommentEnd + -- @classmod Character -- @realm server -- @bool noNetworking responsible for character synchronization function CHAR:setup(noNetworking) @@ -154,10 +154,10 @@ if (SERVER) then end -- @type method Character:kick() - -- @classmod Character -- @typeCommentStart -- Forces the player to choose a character. -- @typeCommentEnd + -- @classmod Character -- @realm server function CHAR:kick() -- Kill the player so they are not standing anywhere. @@ -180,10 +180,10 @@ if (SERVER) then end -- @type method Character:ban(time) - -- @classmod Character -- @typeCommentStart -- Prevents the use of this character permanently or for a certain amount of time. -- @typeCommentEnd + -- @classmod Character -- @realm server -- @int time Сharacter ban time -- @usageStart @@ -206,20 +206,20 @@ if (SERVER) then end -- @type method Character:delete() - -- @classmod Character -- @typeCommentStart -- Deletes this character from existence along with its associated data. -- @typeCommentEnd + -- @classmod Character -- @realm server function CHAR:delete() nut.char.delete(self:getID(), self:getPlayer()) end -- @type method Character:destroy() - -- @classmod Character -- @typeCommentStart -- Deletes this character from memory. -- @typeCommentEnd + -- @classmod Character -- @realm server -- @internal function CHAR:destroy() @@ -230,10 +230,10 @@ if (SERVER) then end -- @type method Character:getPlayer() --- @classmod Character -- @typeCommentStart -- Returns which player owns this character. -- @typeCommentEnd +-- @classmod Character -- @realm shared -- @treturn player The player who owns need character -- @usageStart @@ -267,7 +267,6 @@ function CHAR:getPlayer() end end - -- @type function nut.char.registerVar() -- @typeCommentStart -- Sets up a new character variable. From e8d7b11529e1ceb214aa6782fa5d608647d8aff7 Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Wed, 28 Dec 2022 16:08:18 +0600 Subject: [PATCH 47/89] fix error (#118) attempt to get length of local 'data' (a nil value) --- gamemode/core/libs/sh_character.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemode/core/libs/sh_character.lua b/gamemode/core/libs/sh_character.lua index 29dcaec4..d065da49 100644 --- a/gamemode/core/libs/sh_character.lua +++ b/gamemode/core/libs/sh_character.lua @@ -16,7 +16,7 @@ if (SERVER) then -- them into a table so they only have to be fetched once if (#nut.char.names < 1) then nut.db.query("SELECT _id, _name FROM nut_characters", function(data) - if (#data > 0) then + if (data and #data > 0) then for k, v in pairs(data) do nut.char.names[v._id] = v._name end From 17f068472c49e14bfdfea6f96a891a64f865d76a Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Tue, 3 Jan 2023 17:42:07 +0600 Subject: [PATCH 48/89] nut.playerInteract documentated (#119) --- gamemode/core/libs/cl_playerinteract.lua | 49 +++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/gamemode/core/libs/cl_playerinteract.lua b/gamemode/core/libs/cl_playerinteract.lua index 65f93264..79f34987 100644 --- a/gamemode/core/libs/cl_playerinteract.lua +++ b/gamemode/core/libs/cl_playerinteract.lua @@ -1,3 +1,8 @@ +-- @module nut.playerInteract +-- @moduleCommentStart +-- player interaction menu library +-- @moduleCommentEnd + nut.playerInteract = nut.playerInteract or {} nut.playerInteract.funcs = {} @@ -11,10 +16,39 @@ local isInteracting = false local interfaceScale = 0 local selectedFunction = nil +-- @type function nut.playerInteract.addFunc(name, data) +-- @typeCommentStart +-- adding a player interaction button +-- @typeCommentEnd +-- @realm client +-- @string name Name of interact function +-- @table data Data for interaction button callback +-- @usageStart +-- nut.playerInteract.addFunc("recognize", { +-- nameLocalized = "recognize", +-- callback = function(target) +-- netstream.Start("rgnDirect", target) +-- end, +-- canSee = function(target) +-- return true +-- end +-- }) +-- @usageEnd function nut.playerInteract.addFunc(name, data) nut.playerInteract.funcs[name] = data end +-- @type function nut.playerInteract.interact(entity, time) +-- @typeCommentStart +-- reproduce the interaction with the player +-- @typeCommentEnd +-- @realm client +-- @entity entity Entity to interact with +-- @number time The time it takes to open the menu +-- @internal +-- @usageStart +-- nut.playerInteract.interact(entity, nut.config.get("playerInteractSpeed", 1)) +-- @usageEnd function nut.playerInteract.interact(entity, time) nut.playerInteract.currentEnt = entity @@ -23,6 +57,19 @@ function nut.playerInteract.interact(entity, time) isInteracting = true end +-- @type function nut.playerInteract.clear() +-- @typeCommentStart +-- remove player interaction menu +-- @typeCommentEnd +-- @realm client +-- @internal +-- @usageStart +-- hook.Add("KeyRelease", "nut.playerInteract", function(client, key) +-- if (key == IN_USE and isInteracting) then +-- nut.playerInteract.clear() +-- end +-- end) +-- @usageEnd function nut.playerInteract.clear() isInteracting = false cachedPitch = 0 @@ -130,4 +177,4 @@ hook.Add("PlayerBindPress", "nut.playerInteract", function(_, bind) return true end -end) \ No newline at end of file +end) From 6933205b9ffdae40f7a69944aac5a9286c864800 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 4 Jan 2023 15:00:36 +0100 Subject: [PATCH 49/89] Update cl_playerinteract.lua Formatting issue in documentation site --- gamemode/core/libs/cl_playerinteract.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gamemode/core/libs/cl_playerinteract.lua b/gamemode/core/libs/cl_playerinteract.lua index 79f34987..30c450fa 100644 --- a/gamemode/core/libs/cl_playerinteract.lua +++ b/gamemode/core/libs/cl_playerinteract.lua @@ -25,14 +25,14 @@ local selectedFunction = nil -- @table data Data for interaction button callback -- @usageStart -- nut.playerInteract.addFunc("recognize", { --- nameLocalized = "recognize", --- callback = function(target) --- netstream.Start("rgnDirect", target) --- end, --- canSee = function(target) --- return true --- end --- }) +-- nameLocalized = "recognize", +-- callback = function(target) +-- netstream.Start("rgnDirect", target) +-- end, +-- canSee = function(target) +-- return true +-- end +-- }) -- @usageEnd function nut.playerInteract.addFunc(name, data) nut.playerInteract.funcs[name] = data From 458ecbc281c24f4a1209a120c233b1fa796142a3 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Fri, 6 Jan 2023 14:27:15 +0100 Subject: [PATCH 50/89] Milk's PR --- gamemode/core/libs/cl_playerinteract.lua | 41 +++++++++++++----------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/gamemode/core/libs/cl_playerinteract.lua b/gamemode/core/libs/cl_playerinteract.lua index 30c450fa..f3d44586 100644 --- a/gamemode/core/libs/cl_playerinteract.lua +++ b/gamemode/core/libs/cl_playerinteract.lua @@ -16,24 +16,27 @@ local isInteracting = false local interfaceScale = 0 local selectedFunction = nil --- @type function nut.playerInteract.addFunc(name, data) --- @typeCommentStart --- adding a player interaction button --- @typeCommentEnd --- @realm client --- @string name Name of interact function --- @table data Data for interaction button callback --- @usageStart --- nut.playerInteract.addFunc("recognize", { --- nameLocalized = "recognize", --- callback = function(target) --- netstream.Start("rgnDirect", target) --- end, --- canSee = function(target) --- return true --- end --- }) --- @usageEnd +--[[ +@type function nut.playerInteract.addFunc(name, data) +@typeCommentStart +Adding a player interaction button +@typeCommentEnd +@realm client +@string name Name of interact function +@table data Data for interaction button callback +@usageStart +nut.playerInteract.addFunc("recognize", { + nameLocalized = "recognize", + callback = function(target) + netstream.Start("rgnDirect", target) + end, + canSee = function(target) + return true + end +}) +@usageEnd +]] + function nut.playerInteract.addFunc(name, data) nut.playerInteract.funcs[name] = data end @@ -130,7 +133,7 @@ hook.Add("HUDPaint", "nut.playerInteract", function() surface.DrawOutlinedRect(loadingCentreX - (loadingMaxW / 2) + 1, loadingCentreY + 1, loadingMaxW - 2, loadingH - 2) surface.SetDrawColor(color_white) - surface.DrawRect(loadingCentreX - (curLoadingW / 2) + 2, loadingCentreY + 2, ( loadingMaxW - 4 ) * progress, loadingH - 4, 1) + surface.DrawRect(loadingCentreX - (curLoadingW / 2) + 2, loadingCentreY + 2, ( loadingMaxW - 4 ) * progress, loadingH - 4, 1) end if (interfaceScale < 0) then return end From aaa1daf7374269277bee20b432968f98b7bd06f7 Mon Sep 17 00:00:00 2001 From: dartunian Date: Fri, 6 Jan 2023 16:01:18 -0800 Subject: [PATCH 51/89] Update cl_playerinteract.lua --- gamemode/core/libs/cl_playerinteract.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/gamemode/core/libs/cl_playerinteract.lua b/gamemode/core/libs/cl_playerinteract.lua index f3d44586..53913228 100644 --- a/gamemode/core/libs/cl_playerinteract.lua +++ b/gamemode/core/libs/cl_playerinteract.lua @@ -36,7 +36,6 @@ nut.playerInteract.addFunc("recognize", { }) @usageEnd ]] - function nut.playerInteract.addFunc(name, data) nut.playerInteract.funcs[name] = data end From 1bb8de1cdf9d516acd3d9e69801d82742ecb3fcc Mon Sep 17 00:00:00 2001 From: dartunian Date: Fri, 6 Jan 2023 23:22:53 -0800 Subject: [PATCH 52/89] Update syntax.lua --- gamemode/core/syntax.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gamemode/core/syntax.lua b/gamemode/core/syntax.lua index 49ab97f6..00753b8b 100644 --- a/gamemode/core/syntax.lua +++ b/gamemode/core/syntax.lua @@ -3,14 +3,16 @@ -- Syntax for Nutscript documentation. -- @moduleCommentEnd --- @type command module --- @typeCommentStart --- The !@module rule is used to declare the module name. This should be placed at the top of a file. --- @typeCommentEnd --- @string Title Required. Module title. --- @usageStart --- !@module Syntax --- @usageEnd +--[[ +@type command module +@typeCommentStart +The !@module rule is used to declare the module name. This should be placed at the top of a file. +@typeCommentEnd +@string Title Required. Module title. +@usageStart +!@module Syntax +@usageEnd +]] module (string Title) --[[ @@ -145,4 +147,4 @@ nut.item.register("example", "base_food", false, "sh_example.lua", false) ]] usageStart (string Example) -usageEnd \ No newline at end of file +usageEnd From d3e9400559f7fc5dd18c051cb0c1ecac7f19e531 Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Thu, 12 Jan 2023 14:37:01 +0600 Subject: [PATCH 53/89] fix error (#122) [ERROR] gamemodes/nutscript/plugins/ammosave.lua:9: attempt to index global 'PLUGIN' (a nil value) 1. register - gamemodes/nutscript/plugins/ammosave.lua:9 2. unknown - lua_run:1 --- plugins/ammosave.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/ammosave.lua b/plugins/ammosave.lua index b7eae505..d5609869 100644 --- a/plugins/ammosave.lua +++ b/plugins/ammosave.lua @@ -1,3 +1,5 @@ +local PLUGIN = PLUGIN or {} + PLUGIN.name = "Ammo Saver" PLUGIN.author = "Black Tea" PLUGIN.desc = "Saves the ammo of a character." From d11b69ba064b1d4235462159717011bc757ab8db Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Thu, 12 Jan 2023 14:38:34 +0600 Subject: [PATCH 54/89] non-existent player in onUnequipWeapon (#123) --- gamemode/items/base/sh_weapons.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemode/items/base/sh_weapons.lua b/gamemode/items/base/sh_weapons.lua index deb9f53d..d8499408 100644 --- a/gamemode/items/base/sh_weapons.lua +++ b/gamemode/items/base/sh_weapons.lua @@ -67,7 +67,7 @@ ITEM.functions.EquipUn = { -- sorry, for name order. item:setData("equip", nil) if (item.onUnequipWeapon) then - item:onUnequipWeapon(client, weapon) + item:onUnequipWeapon(item.player, weapon) end return false From 46c4de8a09e3b3014157a2e0883ee75a86d89e96 Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Sun, 29 Jan 2023 04:52:51 +0600 Subject: [PATCH 55/89] removed deprecated method (#124) --- plugins/bars/libs/cl_bar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bars/libs/cl_bar.lua b/plugins/bars/libs/cl_bar.lua index 59cbfcc4..67ef1f38 100644 --- a/plugins/bars/libs/cl_bar.lua +++ b/plugins/bars/libs/cl_bar.lua @@ -124,7 +124,7 @@ function nut.bar.drawAll() return end - local w, h = surface.ScreenWidth() * 0.35, BAR_HEIGHT + local w, h = ScrW() * 0.35, BAR_HEIGHT local x, y = 4, 4 local deltas = nut.bar.delta local frameTime = FrameTime() From 086db2ef2035261af4e5e6569231a536b490a253 Mon Sep 17 00:00:00 2001 From: Leonheart <33399712+bleonheart@users.noreply.github.com> Date: Sat, 28 Jan 2023 22:54:31 +0000 Subject: [PATCH 56/89] Recommited Vendor Crash Issue to 1.2.3 --- plugins/vendor/sv_hooks.lua | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/plugins/vendor/sv_hooks.lua b/plugins/vendor/sv_hooks.lua index dfe2d766..d3fa21a8 100644 --- a/plugins/vendor/sv_hooks.lua +++ b/plugins/vendor/sv_hooks.lua @@ -146,22 +146,24 @@ function PLUGIN:VendorTradeAttempt( vendor:takeStock(itemType) local position = client:getItemDropPos() - local result = character:getInv():add(itemType) - :next(function(item) - hook.Run("OnCharTradeVendor", client, vendor, item, isSellingToVendor) - client.vendorTransaction = nil - end) - :catch(function(err) - if (IsValid(client)) then - client:notifyLocalized("itemOnGround") - end - client.vendorTransaction = nil - return nut.item.spawn(itemType, position) - end) - :catch(function(err) - client:notifyLocalized(err) - client.vendorTransaction = nil - end) + + local result = character:getInv():add(itemType):next(function(item) + hook.Run("OnCharTradeVendor", client, vendor, item, isSellingToVendor) + client.vendorTransaction = nil + end):catch(function(err) + if IsValid(client) then + client:notifyLocalized("Cannot add to inventory! Giving money back!") + end + + client.vendorTransaction = nil + + return character:giveMoney(price) + end):catch(function(err) + client:notifyLocalized(err) + client.vendorTransaction = nil + end) + + nut.log.add(client, "vendorBuy", itemType, vendor:getNetVar("name")) end From 9362ddcb2db13b6073f31099e5f0a3c42fed0822 Mon Sep 17 00:00:00 2001 From: Leonheart <33399712+bleonheart@users.noreply.github.com> Date: Sat, 28 Jan 2023 23:02:02 +0000 Subject: [PATCH 57/89] Added Stock --- plugins/vendor/sv_hooks.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/vendor/sv_hooks.lua b/plugins/vendor/sv_hooks.lua index d3fa21a8..46651438 100644 --- a/plugins/vendor/sv_hooks.lua +++ b/plugins/vendor/sv_hooks.lua @@ -154,6 +154,7 @@ function PLUGIN:VendorTradeAttempt( if IsValid(client) then client:notifyLocalized("Cannot add to inventory! Giving money back!") end + vendor:addStock(itemType) client.vendorTransaction = nil From fc83db63ea30f9731fc9d5e020a92e9ef66e26b4 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:58:22 +0100 Subject: [PATCH 58/89] Formatting --- gamemode/core/meta/item/sv_item.lua | 4 ++-- plugins/gridinv/plugins/1_1compat/libs/sh_item.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gamemode/core/meta/item/sv_item.lua b/gamemode/core/meta/item/sv_item.lua index a2ded7a5..bbf60693 100644 --- a/gamemode/core/meta/item/sv_item.lua +++ b/gamemode/core/meta/item/sv_item.lua @@ -55,7 +55,7 @@ end function ITEM:getEntity() local id = self:getID() - for k, v in ipairs(ents.FindByClass("nut_item")) do + for _, v in ipairs(ents.FindByClass("nut_item")) do if (v.nutItemID == id) then return v end @@ -102,7 +102,7 @@ function ITEM:spawn(position, angles) end function ITEM:transfer(newInventory,bBypass) - if (!bBypass and !newInventory:canAccess("transfer")) then + if (not bBypass and not newInventory:canAccess("transfer")) then return false end diff --git a/plugins/gridinv/plugins/1_1compat/libs/sh_item.lua b/plugins/gridinv/plugins/1_1compat/libs/sh_item.lua index 89768a44..41328bae 100644 --- a/plugins/gridinv/plugins/1_1compat/libs/sh_item.lua +++ b/plugins/gridinv/plugins/1_1compat/libs/sh_item.lua @@ -66,7 +66,7 @@ function nut.item.createInv(w, h, id) local instance = GridInv:new() instance.id = id instance.data = {w = w, h = h} - + nut.inventory.instances[id] = instance return instance end From bfc7c2675bf38a562d3fdd478d922725e11efc84 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:58:38 +0100 Subject: [PATCH 59/89] Add slider to quick/context config menu --- gamemode/core/derma/cl_quick.lua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gamemode/core/derma/cl_quick.lua b/gamemode/core/derma/cl_quick.lua index d418af75..846b996b 100644 --- a/gamemode/core/derma/cl_quick.lua +++ b/gamemode/core/derma/cl_quick.lua @@ -120,6 +120,38 @@ function PANEL:addSpacer() return panel end +function PANEL:addSlider(text, callback, value, min, max, decimal) + local slider = self.scroll:Add("DNumSlider") + slider:SetText(text) + slider:SetTall(36) + slider:Dock(TOP) + slider:DockMargin(0, 1, 0, 0) + slider:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + slider:SetMin(min or 0) + slider:SetMax(max or 100) + slider:SetDecimals(decimal or 0) + slider:SetValue(value or 0) + + slider.Label:SetFont("nutMediumLightFont") + slider.Label:SetTextColor(color_white) + + local textEntry = slider:GetTextArea() + textEntry:SetFont("nutMediumLightFont") + textEntry:SetTextColor(color_white) + + if (callback) then + slider.OnValueChanged = function(this, value) + value = math.Round(value, decimal) + callback(this, value) + end + end + + self.items[#self.items + 1] = slider + + return slider + +end + local color_dark = Color(255, 255, 255, 5) function PANEL:addCheck(text, callback, checked) From 980da9586c80da418d4e0e690ab043182644940b Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 22 Feb 2023 22:00:38 +0100 Subject: [PATCH 60/89] Fix recognition desc bug. If not recognized, name is desc, desc is "you dont recognize this person" If recognized, name is name, desc is desc > if sbRecog is on, name, desc AND model are overriden to prevent identity leaking --- plugins/nshud/sh_plugin.lua | 47 ++++++++++++++++++---- plugins/recognition.lua | 20 +++++++-- plugins/scoreboard/derma/cl_scoreboard.lua | 6 +-- 3 files changed, 58 insertions(+), 15 deletions(-) diff --git a/plugins/nshud/sh_plugin.lua b/plugins/nshud/sh_plugin.lua index a8a54a79..a9328e83 100644 --- a/plugins/nshud/sh_plugin.lua +++ b/plugins/nshud/sh_plugin.lua @@ -19,6 +19,15 @@ local surface = surface local hookRun = hook.Run local toScreen = FindMetaTable("Vector").ToScreen +local NUT_CVAR_NSHUD_DESCWIDTH = CreateClientConVar("nut_hud_descwidth", 0.5, true, false) + +function PLUGIN:SetupQuickMenu(menu) + menu:addSlider("HUD Desc Width Modifier", function(panel, value) + NUT_CVAR_NSHUD_DESCWIDTH:SetFloat(value) + end, NUT_CVAR_NSHUD_DESCWIDTH:GetFloat(), 0.1, 1, 2) + menu:addSpacer() +end + function PLUGIN:CanDrawAmmoHUD(weapon) return IsValid(weapon) and weapon.DrawAmmo ~= false end @@ -111,12 +120,34 @@ function PLUGIN:DrawEntityInfo(entity, alpha, position) local ty = 0 charInfo = {} - charInfo[1] = { - hookRun("GetDisplayedName", entity) or character.getName(character), - teamGetColor(entity.Team(entity)) - } - local description = hookRun("GetDisplayedDescription", entity) or character.getDesc(character) + if entity.widthCache ~= NUT_CVAR_NSHUD_DESCWIDTH:GetFloat() then + entity.widthCache = NUT_CVAR_NSHUD_DESCWIDTH:GetFloat() + entity.nutNameCache = nil + entity.nutDescCache = nil + end + + local name = hookRun("GetDisplayedName", entity, nil, "hud") or character.getName(character) + + if (name ~= entity.nutNameCache) then + entity.nutNameCache = name + + if (name:len() > 250) then + name = name:sub(1, 250).."..." + end + + entity.nutNameLines = nut.util.wrapText( + name, + ScrW() * entity.widthCache, + "nutSmallFont" + ) + end + + for i = 1, #entity.nutNameLines do + charInfo[#charInfo + 1] = {entity.nutNameLines[i], teamGetColor(entity.Team(entity))} + end + + local description = hookRun("GetDisplayedDescription", entity, "hud") or character.getDesc(character) if (description ~= entity.nutDescCache) then entity.nutDescCache = description @@ -126,7 +157,7 @@ function PLUGIN:DrawEntityInfo(entity, alpha, position) entity.nutDescLines = nut.util.wrapText( description, - ScrW() * 0.5, + ScrW() * entity.widthCache, "nutSmallFont" ) end @@ -166,7 +197,7 @@ end function PLUGIN:HUDPaintBackground() local localPlayer = LocalPlayer() - if (!localPlayer.getChar(localPlayer)) then + if (not localPlayer.getChar(localPlayer)) then return end @@ -235,7 +266,7 @@ function PLUGIN:HUDPaintBackground() if (hook.Run("CanDrawAmmoHUD", weapon) ~= false) then hook.Run("DrawAmmoHUD", weapon) end - + if ( localPlayer.getLocalVar(localPlayer, "restricted") and not localPlayer.getLocalVar(localPlayer, "restrictNoMsg") diff --git a/plugins/recognition.lua b/plugins/recognition.lua index a4077c68..f39a9f7d 100644 --- a/plugins/recognition.lua +++ b/plugins/recognition.lua @@ -71,13 +71,23 @@ if (CLIENT) then end end - function PLUGIN:ShouldAllowScoreboardOverride(client) - if (nut.config.get("sbRecog")) then - return true + local sbVars = { + ["name"] = true, + ["model"] = true, + ["desc"] = true + } + + function PLUGIN:ShouldAllowScoreboardOverride(client, var) + if (nut.config.get("sbRecog")) and sbVars[var] ~= nil and (client ~= LocalPlayer()) then + local character = client:getChar() + local ourCharacter = LocalPlayer():getChar() + if (ourCharacter and character and !ourCharacter:doesRecognize(character) and !hook.Run("IsPlayerRecognized", client)) then + return true + end end end - function PLUGIN:GetDisplayedName(client, chatType) + function PLUGIN:GetDisplayedName(client, chatType, location) if (client ~= LocalPlayer()) then local character = client:getChar() local ourCharacter = LocalPlayer():getChar() @@ -91,6 +101,8 @@ if (CLIENT) then end return "["..description.."]" + elseif location == "hud" then + return character:getDesc() elseif (!chatType) then return L"unknown" end diff --git a/plugins/scoreboard/derma/cl_scoreboard.lua b/plugins/scoreboard/derma/cl_scoreboard.lua index 938b56ff..e1b6f77a 100644 --- a/plugins/scoreboard/derma/cl_scoreboard.lua +++ b/plugins/scoreboard/derma/cl_scoreboard.lua @@ -211,16 +211,16 @@ local PANEL = {} return end - local overrideName = hook.Run("ShouldAllowScoreboardOverride", client, "name") and hook.Run("GetDisplayedName", client) + local overrideName = hook.Run("ShouldAllowScoreboardOverride", client, "name") and hook.Run("GetDisplayedName", client, nil, "sb") local name = overrideName or client:Name() name = name:gsub("#", "\226\128\139#") local model = client:GetModel() local skin = client:GetSkin() - local desc = hook.Run("ShouldAllowScoreboardOverride", client, "desc") and hook.Run("GetDisplayedDescription", client) or (client:getChar() and client:getChar():getDesc()) or "" + local desc = hook.Run("ShouldAllowScoreboardOverride", client, "desc") and hook.Run("GetDisplayedDescription", client, "sb") or (client:getChar() and client:getChar():getDesc()) or "" desc = desc:gsub("#", "\226\128\139#") - self.model:setHidden(overrideName) + self.model:setHidden(hook.Run("ShouldAllowScoreboardOverride", client, "model")) if (self.lastName ~= name) then self.name:SetText(name) From e697a01f31a8ba1f536185747b538badde2274d4 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 22 Feb 2023 22:00:54 +0100 Subject: [PATCH 61/89] temp old recog plugin. Disabled --- plugins/_disabled/recognition_alt.lua | 211 ++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 plugins/_disabled/recognition_alt.lua diff --git a/plugins/_disabled/recognition_alt.lua b/plugins/_disabled/recognition_alt.lua new file mode 100644 index 00000000..9783e1f0 --- /dev/null +++ b/plugins/_disabled/recognition_alt.lua @@ -0,0 +1,211 @@ +PLUGIN.name = "Recognition" +PLUGIN.author = "Chessnut" +PLUGIN.desc = "Adds the ability to recognize people." + +do + local character = nut.meta.character + + if (SERVER) then + function character:recognize(id) + if (type(id) ~= "number" and id.getID) then + id = id:getID() + end + + local recognized = self:getData("rgn", "") + + if (recognized ~= "" and recognized:find(","..id..",")) then + return false; + end; + + self:setData("rgn", recognized..","..id..",") + + return true + end + end + + function character:doesRecognize(id) + if (type(id) ~= "number" and id.getID) then + id = id:getID() + end + + return hook.Run("IsCharRecognized", self, id) ~= false + end + + function PLUGIN:IsCharRecognized(char, id) + local other = nut.char.loaded[id] + + if (other) then + local faction = nut.faction.indices[other:getFaction()] + + if (faction and faction.isGloballyRecognized) then + return + end + end + + local recognized = char:getData("rgn", "") + + if (recognized == "") then + return false + end + + if (!recognized:find(","..id..",")) then + return false + end + end +end + +if (CLIENT) then + CHAT_RECOGNIZED = CHAT_RECOGNIZED or {} + CHAT_RECOGNIZED["ic"] = true + CHAT_RECOGNIZED["y"] = true + CHAT_RECOGNIZED["w"] = true + CHAT_RECOGNIZED["me"] = true + + function PLUGIN:IsRecognizedChatType(chatType) + return CHAT_RECOGNIZED[chatType] + end + + function PLUGIN:GetDisplayedDescription(client, location) + if (location == "sb" and client:getChar() and client ~= LocalPlayer() and LocalPlayer():getChar() and !LocalPlayer():getChar():doesRecognize(client:getChar()) and !hook.Run("IsPlayerRecognized", client)) then + return L"noRecog" + end + end + + function PLUGIN:DrawCharInfo(client, char, info) + if (client:getChar() and client ~= LocalPlayer() and LocalPlayer():getChar() and !LocalPlayer():getChar():doesRecognize(client:getChar()) and !hook.Run("IsPlayerRecognized", client)) then + info[#info + 1] = {L"noRecog", Color(255, 183, 0)} + end + end + + function PLUGIN:ShouldAllowScoreboardOverride(client, var) + if (nut.config.get("sbRecog")) and var == "model" and (client ~= LocalPlayer()) then + local character = client:getChar() + local ourCharacter = LocalPlayer():getChar() + if (ourCharacter and character and !ourCharacter:doesRecognize(character) and !hook.Run("IsPlayerRecognized", client)) then + return true + end + end + end + + function PLUGIN:GetDisplayedName(client, chatType) + if (client ~= LocalPlayer()) then + local character = client:getChar() + local ourCharacter = LocalPlayer():getChar() + + if (ourCharacter and character and !ourCharacter:doesRecognize(character) and !hook.Run("IsPlayerRecognized", client)) then + if (chatType and hook.Run("IsRecognizedChatType", chatType)) then + local description = character:getDesc() + + if (#description > 40) then + description = description:utf8sub(1, 37).."..." + end + + return "["..description.."]" + elseif (!chatType) then + return L"unknown"--character:getDesc()--L"unknown" + end + end + end + end + + netstream.Hook("rgnMenu", function() + local menu = DermaMenu() + menu:AddOption(L"rgnLookingAt", function() + netstream.Start("rgn", 1) + end) + menu:AddOption(L"rgnWhisper", function() + netstream.Start("rgn", 2) + end) + menu:AddOption(L"rgnTalk", function() + netstream.Start("rgn", 3) + end) + menu:AddOption(L"rgnYell", function() + netstream.Start("rgn", 4) + end) + menu:Open() + menu:MakePopup() + menu:Center() + end) + + netstream.Hook("rgnDone", function() + hook.Run("OnCharRecognized", client, id) + end) + + function PLUGIN:OnCharRecognized(client, recogCharID) + surface.PlaySound("buttons/button17.wav") + end + + -- Add interaction function + nut.playerInteract.addFunc("recognize", { + nameLocalized = "recognize", + callback = function(target) + netstream.Start("rgnDirect", target) + end, + canSee = function(target) + return true + end + }) +else + function PLUGIN:ShowSpare1(client) + if client:getChar() then + netstream.Start(client, "rgnMenu") + end + end + + netstream.Hook("rgnDirect", function(client, target) + if target:GetPos():DistToSqr(client:GetPos()) > 100000 then return end + + local id = client:getChar():getID() + if target:getChar():recognize(id) then + netstream.Start(client, "rgnDone") + hook.Run("OnCharRecognized", client, id) + client:notifyLocalized("recognized") + else + client:notifyLocalized("already_recognized") + end + end) + + netstream.Hook("rgn", function(client, level) + local targets = {} + + if (level < 2) then + local entity = client:GetEyeTraceNoCursor().Entity + + if (IsValid(entity) and entity:IsPlayer() and entity:getChar() and nut.chat.classes.ic.onCanHear(client, entity)) then + targets[1] = entity + end + else + local class = "w" + + if (level == 3) then + class = "ic" + elseif (level == 4) then + class = "y" + end + + class = nut.chat.classes[class] + + for k, v in ipairs(player.GetAll()) do + if (client ~= v and v:getChar() and class.onCanHear(client, v)) then + targets[#targets + 1] = v + end + end + end + + if (#targets > 0) then + local id = client:getChar():getID() + local i = 0 + + for k, v in ipairs(targets) do + if (v:getChar():recognize(id)) then + i = i + 1 + end + end + + if (i > 0) then + netstream.Start(client, "rgnDone") + hook.Run("OnCharRecognized", client, id) + end + end + end) +end From 6148661dfa57fdee0ea882b010ce011a161b4c35 Mon Sep 17 00:00:00 2001 From: DoopieWop <62191983+DoopieWop@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:33:38 +0200 Subject: [PATCH 62/89] Documentation tests (#136) * first comment tests * added missing module declarations * removed setmodelclass from getmodelclass * removed double setmodelclass for same model --- gamemode/core/libs/cl_menu.lua | 32 +++++++++++++++- gamemode/core/libs/cl_networking.lua | 25 +++++++++++++ gamemode/core/libs/sh_anims.lua | 38 ++++++++++++++++++- gamemode/core/libs/sh_character.lua | 55 ++++++++++++++++++++++++++++ gamemode/core/libs/sh_player.lua | 5 +++ 5 files changed, 152 insertions(+), 3 deletions(-) diff --git a/gamemode/core/libs/cl_menu.lua b/gamemode/core/libs/cl_menu.lua index 93374e24..bf891154 100644 --- a/gamemode/core/libs/cl_menu.lua +++ b/gamemode/core/libs/cl_menu.lua @@ -1,7 +1,20 @@ +-- @module nut.menu +-- @moduleCommentStart +-- Library functions for nut.menu +-- @moduleCommentEnd + nut.menu = nut.menu or {} nut.menu.list = nut.menu.list or {} +-- @type function nut.menu.add(options, positions, onRemove) +-- @typeCommentStart -- Adds a new menu to the list of drawn menus. +-- @typeCommentEnd +-- @realm client +-- @table options A table of button text as keys and their callbacks as values. +-- @vector position The position of the menu or an entity to follow. +-- @function onRemove A function to call after the menu has faded out. +-- @treturn number The index of the menu in the list. function nut.menu.add(options, position, onRemove) -- Set up the width of the menu. local width = 0 @@ -43,7 +56,11 @@ end -- Gradient for subtle effects. local gradient = Material("vgui/gradient-u") +-- @type function nut.menu.drawAll() +-- @typeCommentStart -- A function to draw all of the active menus or hide them when needed. +-- @typeCommentEnd +-- @realm client function nut.menu.drawAll() local frameTime = FrameTime() * 30 local mX, mY = ScrW() * 0.5, ScrH() * 0.5 @@ -151,7 +168,13 @@ function nut.menu.drawAll() end end --- Determines which menu is being looked at +-- @type function nut.menu.getActiveMenu() +-- @typeCommentStart +-- Determines which menu is being looked at. +-- @typeCommentEnd +-- @realm client +-- @treturn table The active menu. +-- @treturn function The currently hovered option callback. function nut.menu.getActiveMenu() local mX, mY = ScrW() * 0.5, ScrH() * 0.5 local position2 = LocalPlayer():GetPos() @@ -209,7 +232,14 @@ function nut.menu.getActiveMenu() end end +-- @type function nut.menu.onButtonPressed(menu, callback) +-- @typeCommentStart -- Handles whenever a button has been pressed. +-- @typeCommentEnd +-- @realm client +-- @int menu The menu index. +-- @func callback The callback that checks whether the button can be pressed. +-- @treturn bool Whether or not the button can be pressed. function nut.menu.onButtonPressed(menu, callback) table.remove(nut.menu.list, menu) diff --git a/gamemode/core/libs/cl_networking.lua b/gamemode/core/libs/cl_networking.lua index d1a1386b..2ba058d8 100644 --- a/gamemode/core/libs/cl_networking.lua +++ b/gamemode/core/libs/cl_networking.lua @@ -1,3 +1,10 @@ +-- @module Entity +-- @moduleCommentStart +-- Entity meta functions. +-- @moduleCommentEnd + +-- there isnt an entity meta file so its just gonna be here for now + local entityMeta = FindMetaTable("Entity") local playerMeta = FindMetaTable("Player") @@ -28,6 +35,15 @@ function getNetVar(key, default) return value ~= nil and value or default end +-- @type method Entity:getNetVar(key, default) +-- @typeCommentStart +-- Returns the networked variable of the entity. +-- @typeCommentEnd +-- @realm client +-- @classmod Entity +-- @string key The key of the networked variable. +-- @string default The default value to return if the networked variable is not set. +-- @treturn any The networked variable. function entityMeta:getNetVar(key, default) local index = self:EntIndex() @@ -38,4 +54,13 @@ function entityMeta:getNetVar(key, default) return default end +-- @type method Entity:getLocalVar(key, value) +-- @typeCommentStart +-- Returns the networked variable of a player. +-- @typeCommentEnd +-- @realm client +-- @classmod Player +-- @string key The key of the networked variable. +-- @string default The default value to return if the networked variable is not set. +-- @treturn any The networked variable. playerMeta.getLocalVar = entityMeta.getNetVar \ No newline at end of file diff --git a/gamemode/core/libs/sh_anims.lua b/gamemode/core/libs/sh_anims.lua index 6eaadf89..097f42b6 100644 --- a/gamemode/core/libs/sh_anims.lua +++ b/gamemode/core/libs/sh_anims.lua @@ -1,3 +1,8 @@ +-- @module nut.anim +-- @moduleCommentStart +-- Library functions for nut.anim +-- @moduleCommentEnd + nut.anim = nut.anim or {} nut.anim.citizen_male = { @@ -330,6 +335,13 @@ nut.anim.fastZombie = { local translations = {} +-- @type function nut.anim.setModelClass(model, class) +-- @typeCommentStart +-- Sets the animation class for a specified model. +-- @typeCommentEnd +-- @realm shared +-- @string model The model for which to set the animation class. +-- @string class The animation class to set. function nut.anim.setModelClass(model, class) if (!nut.anim[class]) then error("'"..tostring(class).."' is not a valid animation class!") @@ -342,6 +354,13 @@ end local stringLower = string.lower local stringFind = string.find +-- @type function nut.anim.getModelClass(model) +-- @typeCommentStart +-- Gets the animation class for a specified model. If an animation class has not yet been set for the model, it sets a default animation class based on the model's name. +-- @typeCommentEnd +-- @realm shared +-- @string model The model for which to get the animation class. +-- @treturn string The animation class for the specified model. function nut.anim.getModelClass(model) model = stringLower(model) local class = translations[model] @@ -355,7 +374,6 @@ function nut.anim.getModelClass(model) class = "citizen_male" end - nut.anim.setModelClass(model, class) return class end @@ -367,13 +385,23 @@ nut.anim.setModelClass("models/vortigaunt.mdl", "vort") nut.anim.setModelClass("models/vortigaunt_blue.mdl", "vort") nut.anim.setModelClass("models/vortigaunt_doctor.mdl", "vort") nut.anim.setModelClass("models/vortigaunt_slave.mdl", "vort") -nut.anim.setModelClass("models/vortigaunt_slave.mdl", "vort") nut.anim.setModelClass("models/alyx.mdl", "citizen_female") nut.anim.setModelClass("models/mossman.mdl", "citizen_female") do local playerMeta = FindMetaTable("Player") + -- @type method Player:forceSequence(sequence, callback, time, noFreeze) + -- @typeCommentStart + -- Forces the player to play a specific animation sequence. + -- @typeCommentEnd + -- @realm shared + -- @classmod Player + -- @string sequence The name of the sequence to play. + -- @func callback An optional function to call when the animation sequence is finished. + -- @int[opt] number time The time in seconds to play the animation sequence. If not set, it will use the default time for the sequence. + -- @bool[opt] noFreeze Whether to freeze the player during the animation sequence. + -- @treturn number The time in seconds for the animation sequence to complete, or false if the sequence is invalid. function playerMeta:forceSequence(sequence, callback, time, noFreeze) hook.Run("OnPlayerEnterSequence", self, sequence, callback, time, noFreeze) @@ -409,6 +437,12 @@ do return false end + -- @type method Player:leaveSequence() + -- @typeCommentStart + -- Forces the player to leave the current animation sequence they are playing. + -- @typeCommentEnd + -- @realm shared + -- @classmod Player function playerMeta:leaveSequence() hook.Run("OnPlayerLeaveSequence", self) diff --git a/gamemode/core/libs/sh_character.lua b/gamemode/core/libs/sh_character.lua index d065da49..be9ce1fb 100644 --- a/gamemode/core/libs/sh_character.lua +++ b/gamemode/core/libs/sh_character.lua @@ -55,6 +55,17 @@ if (CLIENT) then end end +-- @type function nut.char.new(data, id, client, steamID) +-- @typeCommentStart +-- Creates a new character object with the given data and metadata. +-- @typeCommentEnd +-- @realm shared +-- @classmod Character +-- @table data A table containing the character data. +-- @int[default=0] id The ID of the character. +-- @Player client The player associated with the character. +-- @string[opt] steamID The SteamID of the player associated with the character. +-- @treturn table The newly created character object. function nut.char.new(data, id, client, steamID) local character = setmetatable({vars = {}}, nut.meta.character) for k, v in pairs(nut.char.vars) do @@ -419,13 +430,42 @@ end -- Additions to the player metatable here. do local playerMeta = FindMetaTable("Player") + -- @type method Player:steamName() + -- @typeCommentStart + -- Returns the players Steam name. + -- @typeCommentEnd + -- @realm shared + -- @classmod Player + -- @treturn string The player's Steam name. playerMeta.steamName = playerMeta.steamName or playerMeta.Name + + -- @type method Player:SteamName() + -- @typeCommentStart + -- Returns the players Steam name. Alias to Player:steamName(). + -- @typeCommentEnd + -- @realm shared + -- @classmod Player + -- @treturn string The player's Steam name. playerMeta.SteamName = playerMeta.steamName + -- @type method Player:getChar() + -- @typeCommentStart + -- Returns the character associated with the player. + -- @typeCommentEnd + -- @realm shared + -- @classmod Player + -- @treturn table The character object associated with the player, or nil if no character is associated. function playerMeta:getChar() return nut.char.loaded[self.getNetVar(self, "char")] end + -- @type method Player:Name() + -- @typeCommentStart + -- Returns the name of the player's character, or the player's Steam name if the character is not available. + -- @typeCommentEnd + -- @realm shared + -- @classmod Player + -- @treturn string The name of the player's character or the player's Steam name if no character is available. function playerMeta:Name() local character = self.getChar(self) @@ -434,6 +474,21 @@ do or self.steamName(self) end + -- @type method Player:Nick() + -- @typeCommentStart + -- Returns the name of the player's character, or the player's Steam name if the character is not available. Alias to Player:Name(). + -- @typeCommentEnd + -- @realm shared + -- @classmod Player + -- @treturn string The name of the player's character or the player's Steam name if no character is available. playerMeta.Nick = playerMeta.Name + + -- @type method Player:GetName() + -- @typeCommentStart + -- Returns the name of the player's character, or the player's Steam name if the character is not available. Alias to Player:Name(). + -- @typeCommentEnd + -- @realm shared + -- @classmod Player + -- @treturn string The name of the player's character or the player's Steam name if no character is available. playerMeta.GetName = playerMeta.Name end diff --git a/gamemode/core/libs/sh_player.lua b/gamemode/core/libs/sh_player.lua index 90f49505..e614a75f 100644 --- a/gamemode/core/libs/sh_player.lua +++ b/gamemode/core/libs/sh_player.lua @@ -1,3 +1,8 @@ +-- @module Player +-- @moduleCommentStart +-- Player meta functions. +-- @moduleCommentEnd + local playerMeta = FindMetaTable("Player") nut.util.include("nutscript/gamemode/core/meta/sh_player.lua") From bc62a0d5413bc9ab3afdd7e2b26819f230f72d96 Mon Sep 17 00:00:00 2001 From: zoephix Date: Thu, 13 Apr 2023 00:22:33 +0200 Subject: [PATCH 63/89] Fix formatting and localization --- plugins/vendor/sv_hooks.lua | 38 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/plugins/vendor/sv_hooks.lua b/plugins/vendor/sv_hooks.lua index 46651438..5d177994 100644 --- a/plugins/vendor/sv_hooks.lua +++ b/plugins/vendor/sv_hooks.lua @@ -146,26 +146,24 @@ function PLUGIN:VendorTradeAttempt( vendor:takeStock(itemType) local position = client:getItemDropPos() - - local result = character:getInv():add(itemType):next(function(item) - hook.Run("OnCharTradeVendor", client, vendor, item, isSellingToVendor) - client.vendorTransaction = nil - end):catch(function(err) - if IsValid(client) then - client:notifyLocalized("Cannot add to inventory! Giving money back!") - end - vendor:addStock(itemType) - - client.vendorTransaction = nil - - return character:giveMoney(price) - end):catch(function(err) - client:notifyLocalized(err) - client.vendorTransaction = nil - end) - - - + local result = character:getInv():add(itemType) + :next(function(item) + hook.Run("OnCharTradeVendor", client, vendor, item, isSellingToVendor) + client.vendorTransaction = nil + end) + :catch(function(err) + if (IsValid(client)) then + client:notifyLocalized("buyFailed") + end + vendor:addStock(itemType) + client.vendorTransaction = nil + character:giveMoney(price) + end) + :catch(function(err) + client:notifyLocalized(err) + client.vendorTransaction = nil + end) + nut.log.add(client, "vendorBuy", itemType, vendor:getNetVar("name")) end end From 2c6ef10fcfa3b4f535a7a53bcf2ead93219c3b36 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Tue, 16 May 2023 12:20:20 +0200 Subject: [PATCH 64/89] Rare bug that can happen if hands.skin is nil --- entities/weapons/nut_hands.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entities/weapons/nut_hands.lua b/entities/weapons/nut_hands.lua index e3809b48..d593aa08 100644 --- a/entities/weapons/nut_hands.lua +++ b/entities/weapons/nut_hands.lua @@ -88,7 +88,7 @@ if (CLIENT) then if (hands and hands.model) then viewModel:SetModel(hands.model) - viewModel:SetSkin(hands.skin) + viewModel:SetSkin(tonumber(hands.skin) or 0) viewModel:SetBodyGroups(hands.body) end end From 00a70f873d7225cf3120cac51db3f48d5ddcc6d0 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Tue, 16 May 2023 12:54:34 +0200 Subject: [PATCH 65/89] Give bots a desc for testing and identification --- gamemode/core/hooks/sv_hooks.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/gamemode/core/hooks/sv_hooks.lua b/gamemode/core/hooks/sv_hooks.lua index 6416ea47..402a2bee 100644 --- a/gamemode/core/hooks/sv_hooks.lua +++ b/gamemode/core/hooks/sv_hooks.lua @@ -5,6 +5,7 @@ function GM:SetupBotCharacter(client) local character = nut.char.new({ name = client:Name(), + desc = "This is a bot. BotID is "..botID..".", faction = faction and faction.uniqueID or "unknown", model = faction and table.Random(faction.models) or "models/gman.mdl" }, botID, client, client:SteamID64()) From 90d2548a2567bd357b926a3d3c0374fe4b7ae311 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 17 May 2023 17:54:50 +0200 Subject: [PATCH 66/89] Improve nut_areahelper --- .../area/entities/weapons/nut_areahelper.lua | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/area/entities/weapons/nut_areahelper.lua b/plugins/area/entities/weapons/nut_areahelper.lua index da477046..2b676a24 100644 --- a/plugins/area/entities/weapons/nut_areahelper.lua +++ b/plugins/area/entities/weapons/nut_areahelper.lua @@ -7,7 +7,7 @@ if (CLIENT) then SWEP.CLMode = 0 end -SWEP.HoldType = "fist" +SWEP.HoldType = "pistol" SWEP.Category = "Nutscript" SWEP.Spawnable = true @@ -47,8 +47,6 @@ end function SWEP:Think() end -local gridsize = 1 - if (SERVER) then function SWEP:PrimaryAttack() end @@ -87,7 +85,7 @@ else self.ohWow = false netstream.Start("areaAdd", text, areaPoint.startVector, areaPoint.endVector) end, function() - self.ohWow = false + self.ohWow = false end) end end @@ -95,7 +93,7 @@ else function SWEP:SecondaryAttack() if (IsFirstTimePredicted()) then areaPoint = {} - + if (!self.rSnd) then surface.PlaySound("buttons/button2.wav") self.rSnd = true @@ -127,9 +125,9 @@ else local cury = h/4*3 local tx, ty = draw.SimpleText("Left Click: Set Area Point", "nutMediumFont", w/2, cury, color_white, 1, 1) cury = cury + ty - local tx, ty = draw.SimpleText("Right Click: Reset Area Point", "nutMediumFont", w/2, cury, color_white, 1, 1) + tx, ty = draw.SimpleText("Right Click: Reset Area Point", "nutMediumFont", w/2, cury, color_white, 1, 1) cury = cury + ty - local tx, ty = draw.SimpleText("Reload: Register Area", "nutMediumFont", w/2, cury, color_white, 1, 1) + tx, ty = draw.SimpleText("Reload: Register Area", "nutMediumFont", w/2, cury, color_white, 1, 1) local trace = LocalPlayer():GetEyeTraceNoCursor() local pos = trace.HitPos @@ -142,9 +140,13 @@ else end end - hook.Add("PostDrawOpaqueRenderables", "helperDraw", function() + hook.Add("PostDrawOpaqueRenderables", "nutAreaHelperDraw", function() + -- do not draw if the player is not holding the area helper if (areaPoint) then - local sPos, ePos + if (IsValid(LocalPlayer()) and IsValid(LocalPlayer():GetActiveWeapon()) and LocalPlayer():GetActiveWeapon():GetClass() ~= "nut_areahelper") then + return + end + local sPos, ePos if (areaPoint.startVector and areaPoint.endVector) then sPos = areaPoint.startVector ePos = areaPoint.endVector From e04c3d3deacbe90d156d021a3ed44ca5f3b6717f Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 17 May 2023 17:55:34 +0200 Subject: [PATCH 67/89] change function names to avoid confusion --- plugins/area/derma/cl_areamanager.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/area/derma/cl_areamanager.lua b/plugins/area/derma/cl_areamanager.lua index e91db9df..7765e8fb 100644 --- a/plugins/area/derma/cl_areamanager.lua +++ b/plugins/area/derma/cl_areamanager.lua @@ -23,10 +23,10 @@ function PANEL:Init() self.list:SetPadding(5) self.list:EnableVerticalScrollbar() - self:loadBusinesses() + self:loadAreas() end -function PANEL:loadBusinesses() +function PANEL:loadAreas() for class, data in pairs(PLUGIN.areaTable) do local panel = self.list:Add("DButton") panel:SetText(data.name) @@ -77,4 +77,4 @@ vgui.Register("nutAreaManager", PANEL, "DFrame") netstream.Hook("nutAreaManager", function(areaList) PLUGIN.areaTable = areaList areaManager = vgui.Create("nutAreaManager") -end) +end) \ No newline at end of file From 3dd6611fbcfb3d715c64e2158a0440b08a1b1d82 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Wed, 17 May 2023 17:57:38 +0200 Subject: [PATCH 68/89] Change hook for pain sounds Changing from PlayerHurt to EntityTakeDamage allows the GetPlayerPainSound hook to have access to the dmg info, therefore sound can be custom based on drowning or gas, etc. --- plugins/playerinjuries/sv_hooks.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/playerinjuries/sv_hooks.lua b/plugins/playerinjuries/sv_hooks.lua index 01e6bb66..b3a37cda 100644 --- a/plugins/playerinjuries/sv_hooks.lua +++ b/plugins/playerinjuries/sv_hooks.lua @@ -52,7 +52,7 @@ function PLUGIN:GetPlayerPainSound(client) end end -function PLUGIN:PlayerHurt(client, attacker, health, damage) +--[[ function PLUGIN:PlayerHurt(client, attacker, health, damage) if ((client.nutNextPain or 0) < CurTime() and health > 0) then local painSound = hook.Run("GetPlayerPainSound", client) or PAIN_SOUNDS[math.random(#PAIN_SOUNDS)] @@ -60,6 +60,19 @@ function PLUGIN:PlayerHurt(client, attacker, health, damage) painSound = painSound:gsub("male", "female") end + client:EmitSound(painSound) + client.nutNextPain = CurTime() + 0.33 + end +end ]] + +function PLUGIN:EntityTakeDamage(client, dmg) + if ((client.nutNextPain or 0) < CurTime() and client:Health() > 0) then + local painSound = hook.Run("GetPlayerPainSound", client, dmg) + or PAIN_SOUNDS[math.random(#PAIN_SOUNDS)] + if (client:isFemale() and !painSound:find("female")) then + painSound = painSound:gsub("male", "female") + end + client:EmitSound(painSound) client.nutNextPain = CurTime() + 0.33 end From 85466c37be563c13b2c2eec5f4cbf8cd12ff5ed3 Mon Sep 17 00:00:00 2001 From: zoephix Date: Wed, 17 May 2023 19:13:29 +0200 Subject: [PATCH 69/89] Remove comment block --- plugins/playerinjuries/sv_hooks.lua | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/plugins/playerinjuries/sv_hooks.lua b/plugins/playerinjuries/sv_hooks.lua index b3a37cda..79d65fe3 100644 --- a/plugins/playerinjuries/sv_hooks.lua +++ b/plugins/playerinjuries/sv_hooks.lua @@ -52,19 +52,6 @@ function PLUGIN:GetPlayerPainSound(client) end end ---[[ function PLUGIN:PlayerHurt(client, attacker, health, damage) - if ((client.nutNextPain or 0) < CurTime() and health > 0) then - local painSound = hook.Run("GetPlayerPainSound", client) - or PAIN_SOUNDS[math.random(#PAIN_SOUNDS)] - if (client:isFemale() and !painSound:find("female")) then - painSound = painSound:gsub("male", "female") - end - - client:EmitSound(painSound) - client.nutNextPain = CurTime() + 0.33 - end -end ]] - function PLUGIN:EntityTakeDamage(client, dmg) if ((client.nutNextPain or 0) < CurTime() and client:Health() > 0) then local painSound = hook.Run("GetPlayerPainSound", client, dmg) From cc7b8a75c8fa5e320e137f0146698887f2ab8915 Mon Sep 17 00:00:00 2001 From: DoopieWop <62191983+DoopieWop@users.noreply.github.com> Date: Thu, 18 May 2023 02:08:27 +0200 Subject: [PATCH 70/89] fixed pain sound hook called by all entities --- plugins/playerinjuries/sv_hooks.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/playerinjuries/sv_hooks.lua b/plugins/playerinjuries/sv_hooks.lua index 79d65fe3..0105da91 100644 --- a/plugins/playerinjuries/sv_hooks.lua +++ b/plugins/playerinjuries/sv_hooks.lua @@ -53,7 +53,7 @@ function PLUGIN:GetPlayerPainSound(client) end function PLUGIN:EntityTakeDamage(client, dmg) - if ((client.nutNextPain or 0) < CurTime() and client:Health() > 0) then + if (client:IsPlayer() and (client.nutNextPain or 0) < CurTime() and client:Health() > 0) then local painSound = hook.Run("GetPlayerPainSound", client, dmg) or PAIN_SOUNDS[math.random(#PAIN_SOUNDS)] if (client:isFemale() and !painSound:find("female")) then From d711a32d362fddceb976834a0c6f7a4365216e35 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Fri, 19 May 2023 10:57:06 +0200 Subject: [PATCH 71/89] Storage save extra stuff Save Skin, bodygroups, colour and material --- plugins/storage/sv_storage.lua | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/plugins/storage/sv_storage.lua b/plugins/storage/sv_storage.lua index d6668912..695af277 100644 --- a/plugins/storage/sv_storage.lua +++ b/plugins/storage/sv_storage.lua @@ -58,11 +58,20 @@ function PLUGIN:saveStorage() continue end if (entity:getInv()) then + local groups = {} + for _, group in pairs(entity:GetBodyGroups()) do + groups[group.id] = entity:GetBodygroup(group.id) + end + data[#data + 1] = { entity:GetPos(), entity:GetAngles(), entity:getNetVar("id"), entity:GetModel():lower(), + entity:GetSkin() or 0, + groups, + entity:GetColor() or {r = 255, g = 255, b = 255, a = 255}, -- GetColor() doesn't return a color metatable, no need to create a colour object. + entity:GetMaterial(), entity.password } end @@ -74,12 +83,16 @@ function PLUGIN:StorageItemRemoved(entity, inventory) self:saveStorage() end +function PLUGIN:SaveData() + self:saveStorage() +end + function PLUGIN:LoadData() local data = self:getData() if (not data) then return end for _, info in ipairs(data) do - local position, angles, invID, model, password = unpack(info) + local position, angles, invID, model, skin, groups, colour, material, password = unpack(info) local storage = self.definitions[model] if (not storage) then continue end @@ -88,9 +101,15 @@ function PLUGIN:LoadData() storage:SetAngles(angles) storage:Spawn() storage:SetModel(model) + storage:SetSkin(skin) + for id, group in pairs(groups) do + storage:SetBodygroup(id, group) + end + storage:SetColor(colour) + storage:SetMaterial(material) storage:SetSolid(SOLID_VPHYSICS) storage:PhysicsInit(SOLID_VPHYSICS) - + if (password) then storage.password = password storage:setNetVar("locked", true) From 0db5f6ea22326204c8c53816ce51195d7379530f Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Fri, 19 May 2023 10:58:48 +0200 Subject: [PATCH 72/89] Vendors save extra stuff Save bodygroups, skin, colour, material --- plugins/vendor/sv_data.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/vendor/sv_data.lua b/plugins/vendor/sv_data.lua index 7a565528..38120041 100644 --- a/plugins/vendor/sv_data.lua +++ b/plugins/vendor/sv_data.lua @@ -3,12 +3,20 @@ local PLUGIN = PLUGIN function PLUGIN:saveVendors() local data = {} for k, v in ipairs(ents.FindByClass("nut_vendor")) do + local groups = {} + for _, groupData in pairs(v:GetBodyGroups()) do + groups[groupData.id] = v:GetBodygroup(groupData.id) + end data[#data + 1] = { name = v:getNetVar("name"), desc = v:getNetVar("desc"), pos = v:GetPos(), angles = v:GetAngles(), model = v:GetModel(), + skin = v:GetSkin() or 0, + groups = groups, + color = v:GetColor(), + material = v:GetMaterial(), bubble = v:getNetVar("noBubble"), items = v.items, factions = v.factions, @@ -20,6 +28,10 @@ function PLUGIN:saveVendors() self:setData(data) end +function PLUGIN:SaveData() + self:saveVendors() +end + function PLUGIN:LoadData() for k, v in ipairs(ents.FindByClass("nut_vendor")) do v.nutIsSafe = true @@ -32,6 +44,12 @@ function PLUGIN:LoadData() entity:SetAngles(v.angles) entity:Spawn() entity:SetModel(v.model) + entity:SetSkin(v.skin or 0) + for groupID, groupValue in pairs(v.groups or {}) do + entity:SetBodygroup(groupID, groupValue) + end + entity:SetColor(v.color or Color(255, 255, 255)) + entity:SetMaterial(v.material or "") entity:setNetVar("noBubble", v.bubble) entity:setNetVar("name", v.name) entity:setNetVar("desc", v.desc) From c37fb81e3563f08e312d96a01541af8243b6e2b2 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Fri, 19 May 2023 11:39:30 +0200 Subject: [PATCH 73/89] 1.2.3 (#139) * Storage save extra stuff Save Skin, bodygroups, colour and material * Vendors save extra stuff Save bodygroups, skin, colour, material --- plugins/storage/sv_storage.lua | 23 +++++++++++++++++++++-- plugins/vendor/sv_data.lua | 18 ++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/plugins/storage/sv_storage.lua b/plugins/storage/sv_storage.lua index d6668912..695af277 100644 --- a/plugins/storage/sv_storage.lua +++ b/plugins/storage/sv_storage.lua @@ -58,11 +58,20 @@ function PLUGIN:saveStorage() continue end if (entity:getInv()) then + local groups = {} + for _, group in pairs(entity:GetBodyGroups()) do + groups[group.id] = entity:GetBodygroup(group.id) + end + data[#data + 1] = { entity:GetPos(), entity:GetAngles(), entity:getNetVar("id"), entity:GetModel():lower(), + entity:GetSkin() or 0, + groups, + entity:GetColor() or {r = 255, g = 255, b = 255, a = 255}, -- GetColor() doesn't return a color metatable, no need to create a colour object. + entity:GetMaterial(), entity.password } end @@ -74,12 +83,16 @@ function PLUGIN:StorageItemRemoved(entity, inventory) self:saveStorage() end +function PLUGIN:SaveData() + self:saveStorage() +end + function PLUGIN:LoadData() local data = self:getData() if (not data) then return end for _, info in ipairs(data) do - local position, angles, invID, model, password = unpack(info) + local position, angles, invID, model, skin, groups, colour, material, password = unpack(info) local storage = self.definitions[model] if (not storage) then continue end @@ -88,9 +101,15 @@ function PLUGIN:LoadData() storage:SetAngles(angles) storage:Spawn() storage:SetModel(model) + storage:SetSkin(skin) + for id, group in pairs(groups) do + storage:SetBodygroup(id, group) + end + storage:SetColor(colour) + storage:SetMaterial(material) storage:SetSolid(SOLID_VPHYSICS) storage:PhysicsInit(SOLID_VPHYSICS) - + if (password) then storage.password = password storage:setNetVar("locked", true) diff --git a/plugins/vendor/sv_data.lua b/plugins/vendor/sv_data.lua index 7a565528..38120041 100644 --- a/plugins/vendor/sv_data.lua +++ b/plugins/vendor/sv_data.lua @@ -3,12 +3,20 @@ local PLUGIN = PLUGIN function PLUGIN:saveVendors() local data = {} for k, v in ipairs(ents.FindByClass("nut_vendor")) do + local groups = {} + for _, groupData in pairs(v:GetBodyGroups()) do + groups[groupData.id] = v:GetBodygroup(groupData.id) + end data[#data + 1] = { name = v:getNetVar("name"), desc = v:getNetVar("desc"), pos = v:GetPos(), angles = v:GetAngles(), model = v:GetModel(), + skin = v:GetSkin() or 0, + groups = groups, + color = v:GetColor(), + material = v:GetMaterial(), bubble = v:getNetVar("noBubble"), items = v.items, factions = v.factions, @@ -20,6 +28,10 @@ function PLUGIN:saveVendors() self:setData(data) end +function PLUGIN:SaveData() + self:saveVendors() +end + function PLUGIN:LoadData() for k, v in ipairs(ents.FindByClass("nut_vendor")) do v.nutIsSafe = true @@ -32,6 +44,12 @@ function PLUGIN:LoadData() entity:SetAngles(v.angles) entity:Spawn() entity:SetModel(v.model) + entity:SetSkin(v.skin or 0) + for groupID, groupValue in pairs(v.groups or {}) do + entity:SetBodygroup(groupID, groupValue) + end + entity:SetColor(v.color or Color(255, 255, 255)) + entity:SetMaterial(v.material or "") entity:setNetVar("noBubble", v.bubble) entity:setNetVar("name", v.name) entity:setNetVar("desc", v.desc) From 967ecc94366bc4da33a164c843f6f0cdf4b226eb Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Fri, 26 May 2023 13:26:10 +0200 Subject: [PATCH 74/89] Fix overriding Items that use a base but override on of the base functions override the base and all other items that use the base. I don't know why. But this change fixes this. IDK if there are any side-effects. PLEASE TEST THIS BEFORE APPROVING --- gamemode/core/libs/sh_item.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gamemode/core/libs/sh_item.lua b/gamemode/core/libs/sh_item.lua index 2ec1d568..66d9e574 100644 --- a/gamemode/core/libs/sh_item.lua +++ b/gamemode/core/libs/sh_item.lua @@ -130,8 +130,8 @@ function nut.item.register(uniqueID, baseID, isBaseItem, path, luaGenerated) ITEM.uniqueID = uniqueID ITEM.base = baseID ITEM.isBase = isBaseItem - ITEM.category = ITEM.category or "misc" - ITEM.functions = ITEM.functions or table.Copy( + ITEM.category = "misc"--ITEM.category or "misc" + ITEM.functions = table.Copy(--ITEM.functions or table.Copy( baseTable.functions or NUT_ITEM_DEFAULT_FUNCTIONS ) end From 5fdbac5c54b9c4e392774a501c66723fbda5829f Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Fri, 26 May 2023 16:57:29 +0200 Subject: [PATCH 75/89] old Model saved in the wrong place, causing faulty reverting --- gamemode/items/base/sh_outfit.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gamemode/items/base/sh_outfit.lua b/gamemode/items/base/sh_outfit.lua index e48ef415..d25d1c75 100644 --- a/gamemode/items/base/sh_outfit.lua +++ b/gamemode/items/base/sh_outfit.lua @@ -179,9 +179,10 @@ ITEM.functions.Equip = { -- Do model substitutions. if (isfunction(item.onGetReplacement)) then - char:setModel(item:onGetReplacement()) item:setData("oldMdl", item.player:GetModel()) + char:setModel(item:onGetReplacement()) elseif (item.replacement or item.replacements) then + item:setData("oldMdl", item.player:GetModel()) if (istable(item.replacements)) then if ( #item.replacements == 2 and isstring(item.replacements[1]) @@ -199,7 +200,6 @@ ITEM.functions.Equip = { else char:setModel(tostring(item.replacement or item.replacements)) end - item:setData("oldMdl", item.player:GetModel()) end -- Then apply the new skin for the model. From 5f993831550a2366365aad452c07c99cfa45c1eb Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Mon, 5 Jun 2023 16:13:47 +0200 Subject: [PATCH 76/89] Fix Charselect music > Fix volume config not working correctly > Allow online music streams to be used --- .../plugins/charselect/derma/cl_bg_music.lua | 16 ++++++++++++---- .../multichar/plugins/charselect/sh_plugin.lua | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/plugins/multichar/plugins/charselect/derma/cl_bg_music.lua b/plugins/multichar/plugins/charselect/derma/cl_bg_music.lua index 97985e77..2eecbe6c 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_bg_music.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_bg_music.lua @@ -10,9 +10,10 @@ function PANEL:Init() timer.Remove("nutMusicFader") end + VOLUME = nut.config.get("musicvolume", 0.25) + self:SetVisible(false) - nut.menuMusicIsLocal = false timer.Remove("nutMusicFader") local source = nut.config.get("music", "") @@ -30,9 +31,16 @@ function PANEL:Init() end end) else - nut.menuMusicIsLocal = true - nut.menuMusic = CreateSound(LocalPlayer(), source) - nut.menuMusic:PlayEx(VOLUME, 100) + sound.PlayFile("sound/"..source, "noplay", function(music, errorID, fault) + if (music) then + music:SetVolume(VOLUME) + nut.menuMusic = music + nut.menuMusic:Play() + else + MsgC(Color(255, 50, 50), errorID.." ") + MsgC(color_white, fault.."\n") + end + end) end end diff --git a/plugins/multichar/plugins/charselect/sh_plugin.lua b/plugins/multichar/plugins/charselect/sh_plugin.lua index 556c42f1..bec478de 100644 --- a/plugins/multichar/plugins/charselect/sh_plugin.lua +++ b/plugins/multichar/plugins/charselect/sh_plugin.lua @@ -13,7 +13,7 @@ nut.config.add( ) nut.config.add( "musicvolume", - "0.25", + 0.25, "The Volume for the music played in the character menu.", nil, { From decb049c29248adf2b6c84c04d86b05e0baf3751 Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Sun, 18 Jun 2023 15:18:07 +0600 Subject: [PATCH 77/89] getNetVar, getLocalVar -> SHARED realm (#142) --- gamemode/core/libs/cl_networking.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gamemode/core/libs/cl_networking.lua b/gamemode/core/libs/cl_networking.lua index 2ba058d8..161c65a2 100644 --- a/gamemode/core/libs/cl_networking.lua +++ b/gamemode/core/libs/cl_networking.lua @@ -39,7 +39,7 @@ end -- @typeCommentStart -- Returns the networked variable of the entity. -- @typeCommentEnd --- @realm client +-- @realm shared -- @classmod Entity -- @string key The key of the networked variable. -- @string default The default value to return if the networked variable is not set. @@ -58,9 +58,9 @@ end -- @typeCommentStart -- Returns the networked variable of a player. -- @typeCommentEnd --- @realm client +-- @realm shared -- @classmod Player -- @string key The key of the networked variable. -- @string default The default value to return if the networked variable is not set. -- @treturn any The networked variable. -playerMeta.getLocalVar = entityMeta.getNetVar \ No newline at end of file +playerMeta.getLocalVar = entityMeta.getNetVar From 8e6af5aab72735ead2ce2ea50fedd2b321fd9f3c Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Sat, 24 Jun 2023 13:12:17 +0600 Subject: [PATCH 78/89] =?UTF-8?q?=D0=97=D0=B0=D1=80=D0=B0=D0=B4=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20->=20=D0=97=D0=B0=D1=80=D1=8F=D0=B4=D0=B8=D1=82?= =?UTF-8?q?=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamemode/languages/sh_russian.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gamemode/languages/sh_russian.lua b/gamemode/languages/sh_russian.lua index b89e7fbc..fa8e973a 100644 --- a/gamemode/languages/sh_russian.lua +++ b/gamemode/languages/sh_russian.lua @@ -268,9 +268,9 @@ LANGUAGE = { toggleObserverTP = "Переключить телепортирование при наблюдении.", toggleESPAdvanced = "Переключить расширенный режим ESP", thirdpersonConfig = "Настройка третьего лица", - ammoLoadAll = "Зарадить всё", - ammoLoadAmount = "Зарадить %s", - ammoLoadCustom = "Зарадить...", + ammoLoadAll = "Зарядить всё", + ammoLoadAmount = "Зарядить %s", + ammoLoadCustom = "Зарядить...", split = "Разделить", splitHelp = "Введите сумму для разделения.", splitHalf = "Разделить 1/2", From 7f43952fc953ca40c9827f4d014a28a35151d56a Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:50:14 +0600 Subject: [PATCH 79/89] useless netstream deleted (#145) --- gamemode/core/libs/character/sv_character.lua | 2 -- gamemode/core/meta/sh_character.lua | 1 - 2 files changed, 3 deletions(-) diff --git a/gamemode/core/libs/character/sv_character.lua b/gamemode/core/libs/character/sv_character.lua index e4886ce0..56517e19 100644 --- a/gamemode/core/libs/character/sv_character.lua +++ b/gamemode/core/libs/character/sv_character.lua @@ -149,7 +149,6 @@ function nut.char.cleanUpForPlayer(client) local character = nut.char.loaded[charID] if (not character) then return end - netstream.Start(nil, "charDel", character:getID()) nut.inventory.cleanUpForCharacter(character) nut.char.loaded[charID] = nil @@ -190,7 +189,6 @@ function nut.char.delete(id, client) end nut.char.loaded[id] = nil - netstream.Start(nil, "charDel", id) nut.db.query("DELETE FROM nut_characters WHERE _id = "..id) nut.db.query( "SELECT _invID FROM nut_inventories WHERE _charID = "..id, diff --git a/gamemode/core/meta/sh_character.lua b/gamemode/core/meta/sh_character.lua index b31c8f56..a5ea410d 100644 --- a/gamemode/core/meta/sh_character.lua +++ b/gamemode/core/meta/sh_character.lua @@ -225,7 +225,6 @@ if (SERVER) then function CHAR:destroy() local id = self:getID() nut.char.loaded[id] = nil - netstream.Start(nil, "charDel", id) end end From 4fe962f27e296fd1f42e046e2788e7cce665bd94 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Sat, 1 Jul 2023 19:44:47 +0200 Subject: [PATCH 80/89] SAM Commands (#141) * Create sam_commands.lua * switch pairs to ipairs --- plugins/sam_commands.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 plugins/sam_commands.lua diff --git a/plugins/sam_commands.lua b/plugins/sam_commands.lua new file mode 100644 index 00000000..1d246bac --- /dev/null +++ b/plugins/sam_commands.lua @@ -0,0 +1,24 @@ +PLUGIN.name = "Integrated SAM Commands" +PLUGIN.desc = "Integrates SAM Commands into NutScript" +PLUGIN.author = "Tov" + +if not (sam and sam.command) then return end -- Make sure SAM is installed + +for _, commandInfo in ipairs(sam.command.get_commands()) do + local customSyntax = "" + for _, argInfo in ipairs(commandInfo.args) do + customSyntax = customSyntax == "" and "[" or customSyntax .. " [" + customSyntax = customSyntax .. (argInfo.default and tostring(type(argInfo.default)) or "string") .. " " + customSyntax = customSyntax .. argInfo.name .. "]" + end + + nut.command.add(commandInfo.name, { + adminOnly = commandInfo.default_rank == "admin", + superAdminOnly = commandInfo.default_rank == "superadmin", + syntax = customSyntax, + onRun = function(client, arguments) + --run the sam command + RunConsoleCommand("sam", commandInfo.name, unpack(arguments)) + end + }) +end \ No newline at end of file From bdb427401710186aac6096d7c041987709fa611e Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Sun, 2 Jul 2023 01:41:13 +0600 Subject: [PATCH 81/89] critical bug: removing nutSeqCallback from player object. --- gamemode/core/libs/sh_anims.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/gamemode/core/libs/sh_anims.lua b/gamemode/core/libs/sh_anims.lua index 6eaadf89..e98b9fea 100644 --- a/gamemode/core/libs/sh_anims.lua +++ b/gamemode/core/libs/sh_anims.lua @@ -419,6 +419,7 @@ do if (self.nutSeqCallback) then self:nutSeqCallback() + self.nutSeqCallback = nil end end From ae22cc51e8553229598e20e5a1ac7186b566e041 Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Mon, 10 Jul 2023 17:49:17 +0600 Subject: [PATCH 82/89] documented nut.log (#147) --- gamemode/core/libs/sh_log.lua | 77 +++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/gamemode/core/libs/sh_log.lua b/gamemode/core/libs/sh_log.lua index de0b626e..85ee1c69 100644 --- a/gamemode/core/libs/sh_log.lua +++ b/gamemode/core/libs/sh_log.lua @@ -1,3 +1,8 @@ +-- @module nut.log +-- @moduleCommentStart +-- Library functions for nutscript logs +-- @moduleCommentEnd + FLAG_NORMAL = 0 FLAG_SUCCESS = 1 FLAG_WARNING = 2 @@ -21,19 +26,61 @@ if (SERVER) then include("sv_database.lua") end + -- @type function nut.log.loadTables() + -- @typeCommentStart + -- Used to load tables into the database + -- @typeCommentEnd + -- @realm server + -- @internal function nut.log.loadTables() file.CreateDir("nutscript/logs") end + -- @type function nut.log.resetTables() + -- @typeCommentStart + -- Used to reset tables into database + -- @typeCommentEnd + -- @realm server + -- @internal function nut.log.resetTables() end + -- @type table nut.log.types() + -- @typeCommentStart + -- Stores log types and their formatting functions + -- @typeCommentEnd + -- @realm server nut.log.types = nut.log.types or {} + -- @type function nut.log.addType(logType, func) + -- @typeCommentStart + -- Used to reset tables into database + -- @typeCommentEnd + -- @realm server + -- @string logType + -- @function (client, ...) log format callback + -- @usageStart + -- nut.log.addType("playerConnected", function(client, ...) + -- local data = {...} + -- local steamID = data[2] + -- + -- return string.format("%s[%s] has connected to the server.", client:Name(), steamID or client:SteamID()) + -- end) + -- @usageEnd function nut.log.addType(logType, func) nut.log.types[logType] = func end + -- @type function nut.log.getString(client, logType, ...) + -- @typeCommentStart + -- Formats a string that is in log.type + -- @typeCommentEnd + -- @player client Default argument for format string + -- @string logType + -- @vararg ... Other arguments on log format + -- @realm server + -- @treturn string Formatted string + -- @internal function nut.log.getString(client, logType, ...) local text = nut.log.types[logType] if (isfunction(text)) then @@ -44,6 +91,14 @@ if (SERVER) then end end + -- @type function nut.log.addRaw(logString, shouldNotify, flag) + -- @typeCommentStart + -- Adds a raw that does not require formatting + -- @typeCommentEnd + -- @string logString Log string data + -- @bool sholdNotify Display log notification in the administration console + -- @int flag Log color flag + -- @realm server function nut.log.addRaw(logString, shouldNotify, flag) if (shouldNotify) then nut.log.send(nut.util.getAdmins(), logString, flag) @@ -55,6 +110,19 @@ if (SERVER) then end end + -- @type function nut.log.add(client, logType, ...) + -- @typeCommentStart + -- Displays a line of the log according to the match described in the log type + -- @typeCommentEnd + -- @player client player name on displayed log + -- @string logType type of log + -- @vararg ... other arguments for log + -- @realm server + -- @usageStart + -- function GM:PlayerAuthed(client, steamID, uniqueID) + -- nut.log.add(client, "playerConnected", client, steamID) + -- end + -- @usageEnd function nut.log.add(client, logType, ...) local logString = nut.log.getString(client, logType, ...) if (not isstring(logString)) then return end @@ -71,6 +139,15 @@ if (SERVER) then netstream.Hook(client, "nutLogView", logData) end + -- @type function nut.log.add(client, logString, flag) + -- @typeCommentStart + -- Display log raw on client console + -- @typeCommentEnd + -- @player client player name on displayed log + -- @string logString log string + -- @int flag Color flag on log string + -- @realm server + -- @internal function nut.log.send(client, logString, flag) netstream.Start(client, "nutLogStream", logString, flag) end From 5350d7c0a1652de03b536452538af168b1e2bf35 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Thu, 13 Jul 2023 14:22:09 +0200 Subject: [PATCH 83/89] formatting --- gamemode/core/derma/cl_quick.lua | 1 - gamemode/core/libs/sh_chatbox.lua | 2 +- gamemode/core/meta/inventory/sv_base_inventory.lua | 4 ++-- gamemode/core/sh_config.lua | 5 ++--- gamemode/shared.lua | 2 +- plugins/nshud/sh_plugin.lua | 3 +++ plugins/vendor/sv_hooks.lua | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/gamemode/core/derma/cl_quick.lua b/gamemode/core/derma/cl_quick.lua index 846b996b..0a8f5cfc 100644 --- a/gamemode/core/derma/cl_quick.lua +++ b/gamemode/core/derma/cl_quick.lua @@ -149,7 +149,6 @@ function PANEL:addSlider(text, callback, value, min, max, decimal) self.items[#self.items + 1] = slider return slider - end local color_dark = Color(255, 255, 255, 5) diff --git a/gamemode/core/libs/sh_chatbox.lua b/gamemode/core/libs/sh_chatbox.lua index 4ddb183e..f777a217 100644 --- a/gamemode/core/libs/sh_chatbox.lua +++ b/gamemode/core/libs/sh_chatbox.lua @@ -408,4 +408,4 @@ nut.chat.register("event", { }) -- Why does ULX even have a /me command? -hook.Remove("PlayerSay", "ULXMeCheck") +hook.Remove("PlayerSay", "ULXMeCheck") \ No newline at end of file diff --git a/gamemode/core/meta/inventory/sv_base_inventory.lua b/gamemode/core/meta/inventory/sv_base_inventory.lua index 1e7edc50..4f16d363 100644 --- a/gamemode/core/meta/inventory/sv_base_inventory.lua +++ b/gamemode/core/meta/inventory/sv_base_inventory.lua @@ -286,7 +286,7 @@ function Inventory:sync(recipients) net.WriteString(self.typeID) net.WriteTable(self.data) local items = {} - + local function writeItem(item) items[#items + 1] = { i = item:getID(), @@ -306,7 +306,7 @@ function Inventory:sync(recipients) --local currentBytes, currentBits = net.BytesWritten() --print("Current net message size: " .. currentBytes .. " bytes (" .. currentBits .. " bits)") - + local res = net.Send(recipients or self:getRecipients()) for _, item in pairs(self.items) do diff --git a/gamemode/core/sh_config.lua b/gamemode/core/sh_config.lua index d0407163..93271763 100644 --- a/gamemode/core/sh_config.lua +++ b/gamemode/core/sh_config.lua @@ -127,7 +127,7 @@ if (SERVER) then if (client:IsSuperAdmin() and type(nut.config.stored[key].default) == type(value) and hook.Run("CanPlayerModifyConfig", client, key) ~= false) then nut.config.set(key, value) - if (type(value) == "table") then + if (istable(value)) then local value2 = "[" local count = table.Count(value) local i = 1 @@ -248,7 +248,7 @@ if (CLIENT) then end -- VectorColor currently only exists for DProperties. - if (form == "Generic" and type(value) == "table" and value.r and value.g and value.b) then + if (form == "Generic" and istable(value) and value.r and value.g and value.b) then -- Convert the color to a vector. value = Vector(value.r / 255, value.g / 255, value.b / 255) form = "VectorColor" @@ -284,7 +284,6 @@ if (CLIENT) then elseif (form == "Boolean") then newValue = tobool(newValue) end - netstream.Start("cfgSet", k, newValue) end) end diff --git a/gamemode/shared.lua b/gamemode/shared.lua index ea1a940c..4e5583b3 100644 --- a/gamemode/shared.lua +++ b/gamemode/shared.lua @@ -3,7 +3,7 @@ GM.Name = "NutScript 1.2" GM.Author = "Chessnut, Black Tea and the NutScript team" GM.Website = "http://nutscript.net/" -nut.version = "1.2.2" +nut.version = "1.2.3" -- Fix for client:SteamID64() returning nil when in single-player. do diff --git a/plugins/nshud/sh_plugin.lua b/plugins/nshud/sh_plugin.lua index a9328e83..9dbe3004 100644 --- a/plugins/nshud/sh_plugin.lua +++ b/plugins/nshud/sh_plugin.lua @@ -127,6 +127,9 @@ function PLUGIN:DrawEntityInfo(entity, alpha, position) entity.nutDescCache = nil end + entity.nutNameCache = nil + entity.nutDescCache = nil + local name = hookRun("GetDisplayedName", entity, nil, "hud") or character.getName(character) if (name ~= entity.nutNameCache) then diff --git a/plugins/vendor/sv_hooks.lua b/plugins/vendor/sv_hooks.lua index 5d177994..52359a13 100644 --- a/plugins/vendor/sv_hooks.lua +++ b/plugins/vendor/sv_hooks.lua @@ -163,7 +163,7 @@ function PLUGIN:VendorTradeAttempt( client:notifyLocalized(err) client.vendorTransaction = nil end) - + nut.log.add(client, "vendorBuy", itemType, vendor:getNetVar("name")) end end From a8138053c051636a983aa6e6f23d3d0aa56916c2 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Fri, 21 Jul 2023 10:30:17 +0200 Subject: [PATCH 84/89] Fix error with credits screen --- plugins/nscredits.lua | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/plugins/nscredits.lua b/plugins/nscredits.lua index 3e080ce6..db91ae6a 100644 --- a/plugins/nscredits.lua +++ b/plugins/nscredits.lua @@ -21,15 +21,26 @@ surface.CreateFont("nutBigCredits", { weight = 600 }) +local colorCreator, colorLDev, colorDev = Color(255, 0, 0), Color(138,43,226), Color(34,139,34) + local authorCredits = { - {desc = "Creator", steamid = "76561198030127257", color = Color(255, 0, 0)}, -- Chessnut - {desc = "Co-Creator", steamid = "76561197999893894", color = Color(255, 0, 0)}, -- Black Tea - {desc = "Lead Developer", steamid = "76561198060659964", color = Color(138,43,226)}, -- Zoephix - {desc = "Lead Developer", steamid = "76561198070441753", color = Color(138,43,226)}, -- TovarischPootis - {desc = "Developer", steamid = "76561198036551982", color = Color(34,139,34)}, -- Seamus - {desc = "Developer", steamid = "76561198031437460", color = Color(34,139,34)}, -- Milk + {desc = "Creator", steamid = "76561198030127257", color = colorCreator}, -- Chessnut + {desc = "Co-Creator", steamid = "76561197999893894", color = colorCreator}, -- Black Tea + {desc = "Lead Developer", steamid = "76561198060659964", color = colorLDev}, -- Zoephix + {desc = "Lead Developer", steamid = "76561198070441753", color = colorLDev}, -- TovarischPootis + {desc = "Developer", steamid = "76561198036551982", color = colorDev}, -- Seamus + {desc = "Developer", steamid = "76561198251000796", color = colorDev}, -- Dobytchick + {desc = "Developer", steamid = "76561198031437460", color = colorDev}, -- Milk } +do + for _, v in ipairs(authorCredits) do + steamworks.RequestPlayerInfo(v.steamid, function(steamName) + v.name = steamName or "Loading..." + end) + end +end + local contributors = {desc = "View All Contributors", url = "https://github.com/NutScript/NutScript/graphs/contributors"} local discord = {desc = "Join the NutScript Community Discord", url = "https://discord.gg/ySZY8TY"} @@ -62,15 +73,9 @@ function PANEL:setAvatarImage(id) end end -function PANEL:setName(name, isID, color) +function PANEL:setName(name, color) if not IsValid(self.name) then return end - if isID then - steamworks.RequestPlayerInfo(name, function(steamName) - self.name:SetText(steamName or "Loading...") - end) - else - self.name:SetText(name) - end + self.name:SetText(name) if color then self.name:SetTextColor(color) end @@ -133,7 +138,7 @@ function PANEL:setPerson(data, left) local id = left and "creditleft" or "creditright" self[id] = self:Add("CreditsNamePanel") self[id]:setAvatarImage(data.steamid) - self[id]:setName(data.steamid, true, data.color) + self[id]:setName(data.name, data.color) self[id]:setDesc(data.desc) self[id]:Dock(left and LEFT or RIGHT) self[id]:InvalidateLayout(true) From c7264be31b60829ed0f201b7182ff1b0bb2fd12c Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:33:23 +0200 Subject: [PATCH 85/89] Color Optimization --- entities/entities/nut_item.lua | 2 +- entities/weapons/nut_hands.lua | 2 +- gamemode/core/derma/cl_dev_icon.lua | 6 +- gamemode/core/derma/cl_quick.lua | 82 ++++++++++++++++++----- gamemode/core/derma/cl_spawnicon.lua | 17 +++-- gamemode/core/libs/cl_playerinteract.lua | 6 +- gamemode/core/libs/sh_chatbox.lua | 15 +++-- gamemode/core/libs/sv_database.lua | 35 ++++++---- gamemode/init.lua | 11 +-- plugins/attributes/derma/cl_attribute.lua | 4 +- plugins/business/derma/cl_shipment.lua | 5 +- plugins/doors/derma/cl_door.lua | 8 ++- plugins/f1menu/derma/cl_classes.lua | 21 +++--- plugins/f1menu/derma/cl_information.lua | 21 +++--- 14 files changed, 156 insertions(+), 79 deletions(-) diff --git a/entities/entities/nut_item.lua b/entities/entities/nut_item.lua index 6e81c9c3..9728565c 100644 --- a/entities/entities/nut_item.lua +++ b/entities/entities/nut_item.lua @@ -57,7 +57,7 @@ if (SERVER) then self:SetModel(model) self:SetSkin(itemTable.skin or 0) self:SetMaterial(itemTable.material or "") - self:SetColor(itemTable.color or Color(255,255,255)) + self:SetColor(itemTable.color or color_white) self:PhysicsInit(SOLID_VPHYSICS) self:SetSolid(SOLID_VPHYSICS) self:setNetVar("id", itemTable.uniqueID) diff --git a/entities/weapons/nut_hands.lua b/entities/weapons/nut_hands.lua index d593aa08..7bee9891 100644 --- a/entities/weapons/nut_hands.lua +++ b/entities/weapons/nut_hands.lua @@ -538,7 +538,7 @@ function SWEP:pickup(entity, trace) self.carryHack:SetModel("models/weapons/w_bugbait.mdl") - self.carryHack:SetColor(Color(50, 250, 50, 240)) + --self.carryHack:SetColor(Color(50, 250, 50, 240)) self.carryHack:SetNoDraw(true) self.carryHack:DrawShadow(false) diff --git a/gamemode/core/derma/cl_dev_icon.lua b/gamemode/core/derma/cl_dev_icon.lua index 70ad2d82..46e072fa 100644 --- a/gamemode/core/derma/cl_dev_icon.lua +++ b/gamemode/core/derma/cl_dev_icon.lua @@ -9,7 +9,7 @@ ICON_INFO.h = ICON_INFO.h or 1 ICON_INFO.modelAng = ICON_INFO.modelAng or Angle() ICON_INFO.modelName = ICON_INFO.modelName or "models/Items/grenadeAmmo.mdl" ICON_INFO.outline = ICON_INFO.outline or false -ICON_INFO.outlineColor = ICON_INFO.outlineColor or Color(255, 255, 255) +ICON_INFO.outlineColor = ICON_INFO.outlineColor or color_white local vTxt = "xyz" local aTxt = "pyr" @@ -87,7 +87,7 @@ function PANEL:Init() local exIcon = ikon:getIcon("iconEditor") if (exIcon) then surface.SetMaterial(exIcon) - surface.SetDrawColor(color_white) + surface.SetDrawColor(255, 255, 255) surface.DrawTexturedRect(0, 0, x, y) end end @@ -500,7 +500,7 @@ end function PANEL:AddText(str) local label = self.list:Add("DLabel") label:SetFont("ChatFont") - label:SetTextColor(color_white) + label:SetTextColor(nut.config.get("colorText", color_white)) label:Dock(TOP) label:DockMargin(5, 5, 5, 0) label:SetContentAlignment(5) diff --git a/gamemode/core/derma/cl_quick.lua b/gamemode/core/derma/cl_quick.lua index 0a8f5cfc..30782cb7 100644 --- a/gamemode/core/derma/cl_quick.lua +++ b/gamemode/core/derma/cl_quick.lua @@ -1,4 +1,12 @@ local PANEL = {} +local color_offWhite = Color(250, 250, 250) +local color_blackTransparent = Color(0,0,0,175) +local color_blackTransparent2 = Color(0,0,0,150) + +local gradientD = nut.util.getMaterial("vgui/gradient-d") +local gradientR = nut.util.getMaterial("vgui/gradient-r") +local gradientL = nut.util.getMaterial("vgui/gradient-l") + function PANEL:Init() if (IsValid(nut.gui.quick)) then nut.gui.quick:Remove() @@ -19,8 +27,8 @@ function PANEL:Init() self.title:SetText(L"quickSettings") self.title:SetContentAlignment(4) self.title:SetTextInset(44, 0) - self.title:SetTextColor(Color(250, 250, 250)) - self.title:SetExpensiveShadow(1, Color(0, 0, 0, 175)) + self.title:SetTextColor(nut.config.get("colorText", color_white)) + self.title:SetExpensiveShadow(1, color_blackTransparent) self.title.Paint = function(this, w, h) surface.SetDrawColor(nut.config.get("color")) surface.DrawRect(0, 0, w, h) @@ -31,8 +39,8 @@ function PANEL:Init() self.expand:SetText("`") self.expand:SetFont("nutIconsMedium") self.expand:SetPaintBackground(false) - self.expand:SetTextColor(color_white) - self.expand:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + self.expand:SetTextColor(nut.config.get("colorText", color_white)) + self.expand:SetExpensiveShadow(1, color_blackTransparent2) self.expand:SetSize(36, 36) self.expand.DoClick = function(this) if (self.expanded) then @@ -71,16 +79,54 @@ function PANEL:Init() end local function paintButton(button, w, h) - local alpha = 0 + local r, g, b = nut.config.get("color"):Unpack() + local alpha = 100 if (button.Depressed or button.m_bSelected) then - alpha = 5 + alpha = 255 elseif (button.Hovered) then - alpha = 2 + alpha = 200 end - surface.SetDrawColor(255, 255, 255, alpha) - surface.DrawRect(0, 0, w, h) +--[[ surface.SetDrawColor(255, 255, 255, alpha) + surface.DrawRect(0, 0, w, h) ]] + surface.SetDrawColor(r, g, b, alpha) + + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, 0, w/2, h) + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(w/2, 0, w/2, h) +end + +local categoryDoClick = function(this) + this.expanded = not this.expanded + local items = nut.gui.quick.items + local index = table.KeyFromValue(items, this) + for i = index + 1, #items do + if items[i].categoryLabel then + break + end + if not items[i].h then + items[i].w, items[i].h = items[i]:GetSize() + end + + items[i]:SizeTo(items[i].w, this.expanded and (items[i].h or 36) or 0, 0.15) + end +end + +function PANEL:addCategory(text) + local label = self:addButton(text, categoryDoClick) + label.categoryLabel = true + label.expanded = true + label:SetText(text) + label:SetTall(36) + label:Dock(TOP) + label:DockMargin(0, 1, 0, 0) + label:SetFont("nutMediumFont") + label:SetTextColor(nut.config.get("colorText", color_white)) + label:SetExpensiveShadow(1, color_blackTransparent2) + label:SetContentAlignment(5) + label.Paint = function() end end function PANEL:addButton(text, callback) @@ -90,10 +136,10 @@ function PANEL:addButton(text, callback) button:Dock(TOP) button:DockMargin(0, 1, 0, 0) button:SetFont("nutMediumLightFont") - button:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + button:SetExpensiveShadow(1, color_blackTransparent2) button:SetContentAlignment(4) button:SetTextInset(8, 0) - button:SetTextColor(color_white) + button:SetTextColor(nut.config.get("colorText", color_white)) button.Paint = paintButton if (callback) then @@ -133,11 +179,11 @@ function PANEL:addSlider(text, callback, value, min, max, decimal) slider:SetValue(value or 0) slider.Label:SetFont("nutMediumLightFont") - slider.Label:SetTextColor(color_white) + slider.Label:SetTextColor(nut.config.get("colorText", color_white)) local textEntry = slider:GetTextArea() textEntry:SetFont("nutMediumLightFont") - textEntry:SetTextColor(color_white) + textEntry:SetTextColor(nut.config.get("colorText", color_white)) if (callback) then slider.OnValueChanged = function(this, value) @@ -148,6 +194,8 @@ function PANEL:addSlider(text, callback, value, min, max, decimal) self.items[#self.items + 1] = slider + slider.Paint = paintButton + return slider end @@ -185,12 +233,14 @@ function PANEL:setIcon(char) end function PANEL:Paint(w, h) + surface.SetDrawColor(0, 0, 0, 200) + surface.DrawRect(0, 0, w, h) nut.util.drawBlur(self) surface.SetDrawColor(nut.config.get("color")) surface.DrawRect(0, 0, w, 36) - surface.SetDrawColor(255, 255, 255, 5) - surface.DrawRect(0, 0, w, h) + --[[ surface.SetDrawColor(255, 255, 255, 5) + surface.DrawRect(0, 0, w, h) ]] end -vgui.Register("nutQuick", PANEL, "EditablePanel") +vgui.Register("nutQuick", PANEL, "EditablePanel") \ No newline at end of file diff --git a/gamemode/core/derma/cl_spawnicon.lua b/gamemode/core/derma/cl_spawnicon.lua index b76889b3..d8487c10 100644 --- a/gamemode/core/derma/cl_spawnicon.lua +++ b/gamemode/core/derma/cl_spawnicon.lua @@ -28,14 +28,17 @@ local setSequence = function(entity) entity:ResetSequence(4) end +local color_grey = Color(155, 155 ,155) +local color_darkgrey = Color(20, 20, 20) + function PANEL:Init() self:setHidden(false) for i = 0, 5 do if (i == 1 or i == 5) then - self:SetDirectionalLight(i, Color(155, 155, 155)) + self:SetDirectionalLight(i, color_grey) else - self:SetDirectionalLight(i, Color(255, 255, 255)) + self:SetDirectionalLight(i, color_white) end end @@ -66,21 +69,21 @@ end function PANEL:setHidden(hidden) if (hidden) then self:SetAmbientLight(color_black) - self:SetColor(Color(0, 0, 0)) + self:SetColor(color_black) for i = 0, 5 do self:SetDirectionalLight(i, color_black) end else - self:SetAmbientLight(Color(20, 20, 20)) + self:SetAmbientLight(color_darkgrey) self:SetAlpha(255) - self:SetColor(Color(255, 255, 255)) + self:SetColor(color_white) for i = 0, 5 do if (i == 1 or i == 5) then - self:SetDirectionalLight(i, Color(155, 155, 155)) + self:SetDirectionalLight(i, color_grey) else - self:SetDirectionalLight(i, Color(255, 255, 255)) + self:SetDirectionalLight(i, color_white) end end end diff --git a/gamemode/core/libs/cl_playerinteract.lua b/gamemode/core/libs/cl_playerinteract.lua index 53913228..2360136f 100644 --- a/gamemode/core/libs/cl_playerinteract.lua +++ b/gamemode/core/libs/cl_playerinteract.lua @@ -99,6 +99,8 @@ end local scrW = ScrW() local scrH = ScrH() +local color_blackTransparent = Color(0,0,0, 150) +local color_whiteTransparent = Color(255, 255, 255 ,120) hook.Add("HUDPaint", "nut.playerInteract", function() if (!isInteracting and interfaceScale < 0) then return end @@ -125,10 +127,10 @@ hook.Add("HUDPaint", "nut.playerInteract", function() nut.util.drawBlurAt(loadingCentreX - (loadingMaxW / 2), loadingCentreY, loadingMaxW, loadingH) - surface.SetDrawColor(Color(0, 0, 0, 150)) + surface.SetDrawColor(color_blackTransparent) surface.DrawRect(loadingCentreX - (loadingMaxW / 2), loadingCentreY, loadingMaxW, loadingH, 1) - surface.SetDrawColor(255, 255, 255, 120) + surface.SetDrawColor(color_whiteTransparent) surface.DrawOutlinedRect(loadingCentreX - (loadingMaxW / 2) + 1, loadingCentreY + 1, loadingMaxW - 2, loadingH - 2) surface.SetDrawColor(color_white) diff --git a/gamemode/core/libs/sh_chatbox.lua b/gamemode/core/libs/sh_chatbox.lua index f777a217..73872d06 100644 --- a/gamemode/core/libs/sh_chatbox.lua +++ b/gamemode/core/libs/sh_chatbox.lua @@ -12,6 +12,8 @@ function nut.chat.timestamp(ooc) return nut.config.get("chatShowTime") and (ooc and " " or "") .. "(" .. nut.date.getFormatted("%H:%M") .. ")" .. (ooc and "" or " ") or "" end +local color_yellow = Color(242, 230, 160) + -- Registers a new chat type with the information provided. function nut.chat.register(chatType, data) if (not data.onCanHear) then @@ -63,7 +65,7 @@ function nut.chat.register(chatType, data) end -- Chat text color. - data.color = data.color or Color(242, 230, 160) + data.color = data.color or color_yellow if (not data.onChatAdd) then data.format = data.format or "%s: \"%s\"" @@ -180,7 +182,6 @@ if (SERVER) then return end end - netstream.Start(receivers, "cMsg", speaker, chatType, hook.Run("PlayerMessageSend", speaker, chatType, text, anonymous, receivers) or text, anonymous) end end @@ -281,6 +282,8 @@ do prefix = {"/y", "/yell"} }) + local color_offRed = Color(255, 50, 50) + -- Out of character. nut.chat.register("ooc", { onCanSay = function(speaker, text) @@ -335,7 +338,7 @@ do end icon = Material(hook.Run("GetPlayerIcon", speaker) or icon) - chat.AddText(icon, nut.chat.timestamp(true), Color(255, 50, 50), " [OOC] ", speaker, color_white, ": " .. text) + chat.AddText(icon, nut.chat.timestamp(true), color_offRed, " [OOC] ", speaker, color_white, ": " .. text) end, prefix = {"//", "/ooc"}, noSpaceAfter = true, @@ -366,7 +369,7 @@ do if (nut.config.get("oocLimit", 0) ~= 0) and (#text > nut.config.get("oocLimit", 0)) then text = string.sub(text, 1, nut.config.get("oocLimit", 0)) .. "..." end - chat.AddText(nut.chat.timestamp(false), Color(255, 50, 50), "[LOOC] ", nut.config.get("chatColor"), speaker:Name() .. ": " .. text) + chat.AddText(nut.chat.timestamp(false), color_offRed, "[LOOC] ", nut.config.get("chatColor"), speaker:Name() .. ": " .. text) end, radius = function() return nut.config.get("chatRange", 280) @@ -396,13 +399,15 @@ nut.chat.register("pm", { deadCanChat = true }) +local color_orange = Color(255, 150, 0) + -- Global events. nut.chat.register("event", { onCanSay = function(speaker, text) return speaker:IsAdmin() end, onChatAdd = function(speaker, text) - chat.AddText(nut.chat.timestamp(false), Color(255, 150, 0), text) + chat.AddText(nut.chat.timestamp(false), color_orange, text) end, prefix = {"/event"} }) diff --git a/gamemode/core/libs/sv_database.lua b/gamemode/core/libs/sv_database.lua index 1e374b42..3b912059 100644 --- a/gamemode/core/libs/sv_database.lua +++ b/gamemode/core/libs/sv_database.lua @@ -1,14 +1,16 @@ nut.db = nut.db or {} nut.db.queryQueue = nut.db.queue or {} +local color_red = Color(255, 0, 0) + local function ThrowQueryFault(query, fault) - MsgC(Color(255, 0, 0), "* "..query.."\n") - MsgC(Color(255, 0, 0), fault.."\n") + MsgC(color_red, "* "..query.."\n") + MsgC(color_red, fault.."\n") end local function ThrowConnectionFault(fault) - MsgC(Color(255, 0, 0), "NutScript has failed to connect to the database.\n") - MsgC(Color(255, 0, 0), fault.."\n") + MsgC(color_red, "NutScript has failed to connect to the database.\n") + MsgC(color_red, fault.."\n") setNetVar("dbError", fault) end @@ -202,10 +204,9 @@ modules.mysqloo = { if (not pcall(require, "mysqloo")) then return setNetVar("dbError", system.IsWindows() and "Server is missing VC++ redistributables! " or "Server is missing binaries for mysqloo! ") end - if (mysqloo.VERSION ~= "9" or not mysqloo.MINOR_VERSION or tonumber(mysqloo.MINOR_VERSION) < 1) then - MsgC(Color(255, 0, 0), "You are using an outdated mysqloo version\n") - MsgC(Color(255, 0, 0), "Download the latest mysqloo9 from here\n") + MsgC(color_red, "You are using an outdated mysqloo version\n") + MsgC(color_red, "Download the latest mysqloo9 from here\n") MsgC(Color(86, 156, 214), "https://github.com/syl0r/MySQLOO/releases") return end @@ -303,7 +304,7 @@ modules.mysqloo = { prepObj:start() else - MsgC(Color(255, 0, 0), "INVALID PREPARED STATEMENT : " .. key .. "\n") + MsgC(color_red, "INVALID PREPARED STATEMENT : " .. key .. "\n") end end } @@ -335,7 +336,15 @@ function nut.db.connect(callback, reconnect) nut.db.escape = dbModule.escape nut.db.query = dbModule.query else - ErrorNoHalt("[NutScript] '"..(nut.db.module or "nil").."' is not a valid data storage method! \n") + local errMessage = "[NutScript] '"..(nut.db.module or "nil").."' is not a valid data storage method!\nValid modules are:" + + --loop through all the modules and add them to the error message, separated by a comma + for k in pairs(modules) do + errMessage = errMessage .. " '" .. k .. "'," + end + + --print the error message + ErrorNoHalt(string.sub(errMessage, 1, -2) .. "\n") end end @@ -460,7 +469,7 @@ function nut.db.wipeTables(callback) local function realCallback() nut.db.query("SET FOREIGN_KEY_CHECKS = 1;", function() MsgC( - Color(255, 0, 0), + color_red, "[Nutscript] ALL NUTSCRIPT DATA HAS BEEN WIPED\n" ) if (isfunction(callback)) then @@ -501,11 +510,11 @@ concommand.Add("nut_recreatedb", function(client) if (resetCalled < RealTime()) then resetCalled = RealTime() + 3 - MsgC(Color(255, 0, 0), "[Nutscript] TO CONFIRM DATABASE RESET, RUN 'nut_recreatedb' AGAIN in 3 SECONDS.\n") + MsgC(color_red, "[Nutscript] TO CONFIRM DATABASE RESET, RUN 'nut_recreatedb' AGAIN in 3 SECONDS.\n") else resetCalled = 0 - MsgC(Color(255, 0, 0), "[Nutscript] DATABASE WIPE IN PROGRESS.\n") + MsgC(color_red, "[Nutscript] DATABASE WIPE IN PROGRESS.\n") hook.Run("OnWipeTables") nut.db.wipeTables(nut.db.loadTables) @@ -704,7 +713,7 @@ function GM:SetupDatabase() end if (not nut.db.config) then - MsgC(Color(255, 0, 0), "Database not configured.\n") + MsgC(color_red, "Database not configured.\n") for k, v in pairs(defaultConfig) do nut.db[k] = v diff --git a/gamemode/init.lua b/gamemode/init.lua index 6ad8bc1e..33ec461c 100644 --- a/gamemode/init.lua +++ b/gamemode/init.lua @@ -16,6 +16,9 @@ include("core/sh_util.lua") include("core/sv_data.lua") include("shared.lua") +local color_green = Color(0, 255, 0) +local color_red = Color(255, 0, 0) + -- Connect to the database using SQLite, mysqloo, or tmysql4. timer.Simple(0, function() hook.Run("SetupDatabase") @@ -25,8 +28,8 @@ timer.Simple(0, function() nut.db.loadTables() nut.log.loadTables() - MsgC(Color(0, 255, 0), "NutScript has connected to the database.\n") - MsgC(Color(0, 255, 0), "Database Type: "..nut.db.module..".\n") + MsgC(color_green, "NutScript has connected to the database.\n") + MsgC(color_green, "Database Type: "..nut.db.module..".\n") hook.Run("DatabaseConnected") end) @@ -34,8 +37,8 @@ end) concommand.Add("nut_setowner", function(client, command, arguments) if (!IsValid(client)) then - MsgC(Color(255, 0, 0), "** 'nut_setowner' has been deprecated in NutScript 1.1\n") - MsgC(Color(255, 0, 0), "** Instead, please install an admin mod and use that instead.\n") + MsgC(color_red, "** 'nut_setowner' has been deprecated in NutScript 1.1\n") + MsgC(color_red, "** Instead, please install an admin mod and use that instead.\n") end end) diff --git a/plugins/attributes/derma/cl_attribute.lua b/plugins/attributes/derma/cl_attribute.lua index 26c338d2..33cb03fd 100644 --- a/plugins/attributes/derma/cl_attribute.lua +++ b/plugins/attributes/derma/cl_attribute.lua @@ -1,7 +1,7 @@ local PANEL = {} local gradient = nut.util.getMaterial("vgui/gradient-u") local gradient2 = nut.util.getMaterial("vgui/gradient-d") - + local color_blackTransparent = Color(0,0,0,60) function PANEL:Init() self:SetTall(20) @@ -83,7 +83,7 @@ local PANEL = {} self.label = self.bar:Add("DLabel") self.label:Dock(FILL) - self.label:SetExpensiveShadow(1, Color(0, 0, 60)) + self.label:SetExpensiveShadow(1, color_blackTransparent) self.label:SetContentAlignment(5) end diff --git a/plugins/business/derma/cl_shipment.lua b/plugins/business/derma/cl_shipment.lua index 84fbbec0..06727f6a 100644 --- a/plugins/business/derma/cl_shipment.lua +++ b/plugins/business/derma/cl_shipment.lua @@ -12,6 +12,7 @@ local PANEL = {} self.list:Dock(FILL) end + local color_blackTransparent = Color(0,0,0,150) function PANEL:setItems(entity, items) self.entity = entity @@ -38,7 +39,7 @@ local PANEL = {} item.quantity:SetTextInset(0, 0) item.quantity:SetText(v) item.quantity:SetFont("DermaDefaultBold") - item.quantity:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + item.quantity:SetExpensiveShadow(1, color_blackTransparent) item.name = item:Add("DLabel") item.name:SetPos(38, 0) @@ -46,7 +47,7 @@ local PANEL = {} item.name:SetFont("nutSmallFont") item.name:SetText(L(itemTable.name)) item.name:SetContentAlignment(4) - item.name:SetTextColor(color_white) + item.name:SetTextColor(nut.config.get("colorText", color_white)) item.take = item:Add("DButton") item.take:Dock(RIGHT) diff --git a/plugins/doors/derma/cl_door.lua b/plugins/doors/derma/cl_door.lua index 0dbb8242..64481f3e 100644 --- a/plugins/doors/derma/cl_door.lua +++ b/plugins/doors/derma/cl_door.lua @@ -1,4 +1,6 @@ local PANEL = {} +local color_darkGrey = Color(25, 25, 25) + function PANEL:Init() self:SetSize(280, 240) self:SetTitle(L"doorSettings") @@ -7,8 +9,8 @@ local PANEL = {} self.access = self:Add("DListView") self.access:Dock(FILL) - self.access:AddColumn(L"name").Header:SetTextColor(Color(25, 25, 25)) - self.access:AddColumn(L"access").Header:SetTextColor(Color(25, 25, 25)) + self.access:AddColumn(L"name").Header:SetTextColor(color_darkGrey) + self.access:AddColumn(L"access").Header:SetTextColor(color_darkGrey) self.access.OnClickLine = function(this, line, selected) if (IsValid(line.player)) then local menu = DermaMenu() @@ -51,7 +53,7 @@ local PANEL = {} self.sell = self:Add("DButton") self.sell:Dock(BOTTOM) self.sell:SetText(L"sell") - self.sell:SetTextColor(color_white) + self.sell:SetTextColor(nut.config.get("colorText", color_white)) self.sell:DockMargin(0, 5, 0, 0) self.sell.DoClick = function(this) self:Remove() diff --git a/plugins/f1menu/derma/cl_classes.lua b/plugins/f1menu/derma/cl_classes.lua index 8d514691..b81bf0a1 100644 --- a/plugins/f1menu/derma/cl_classes.lua +++ b/plugins/f1menu/derma/cl_classes.lua @@ -1,9 +1,10 @@ local PANEL = {} +local color_darkBlue = Color(0,0,60) function PANEL:Init() self:SetTall(64) - - local function assignClick(panel) + + local function assignClick(panel) panel.OnMousePressed = function() self.pressing = -1 self:onClick() @@ -40,26 +41,26 @@ local PANEL = {} end */ end - assignClick(self.icon) + assignClick(self.icon) self.limit = self:Add("DLabel") self.limit:Dock(RIGHT) self.limit:SetMouseInputEnabled(true) self.limit:SetCursor("hand") - self.limit:SetExpensiveShadow(1, Color(0, 0, 60)) + self.limit:SetExpensiveShadow(1, color_darkBlue) self.limit:SetContentAlignment(5) self.limit:SetFont("nutMediumFont") self.limit:SetWide(64) - assignClick(self.limit) + assignClick(self.limit) self.label = self:Add("DLabel") self.label:Dock(FILL) self.label:SetMouseInputEnabled(true) self.label:SetCursor("hand") - self.label:SetExpensiveShadow(1, Color(0, 0, 60)) + self.label:SetExpensiveShadow(1, color_darkBlue) self.label:SetContentAlignment(5) self.label:SetFont("nutMediumFont") - assignClick(self.label) + assignClick(self.label) end function PANEL:onClick() @@ -95,8 +96,8 @@ local PANEL = {} self.icon:SetModel(model) end - self.label:SetText(L(data.name)) - self.data = data + self.label:SetText(L(data.name)) + self.data = data self.class = data.index self:setNumber(#nut.class.getPlayers(data.index)) @@ -121,7 +122,7 @@ PANEL = {} function PANEL:loadClasses() self.list:Clear() - + for k, v in ipairs(nut.class.list) do local no, why = nut.class.canBe(LocalPlayer(), k) local itsFull = ("class is full" == why) diff --git a/plugins/f1menu/derma/cl_information.lua b/plugins/f1menu/derma/cl_information.lua index 7b4b8c12..e33a2b0f 100644 --- a/plugins/f1menu/derma/cl_information.lua +++ b/plugins/f1menu/derma/cl_information.lua @@ -1,4 +1,5 @@ local PANEL = {} +local color_blackTransparent = Color(0,0,0,150) function PANEL:Init() if (IsValid(nut.gui.info)) then nut.gui.info:Remove() @@ -34,8 +35,8 @@ local PANEL = {} self.name:SetFont("nutHugeFont") self.name:SetTall(60) self.name:Dock(TOP) - self.name:SetTextColor(color_white) - self.name:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + self.name:SetTextColor(nut.config.get("colorText", color_white)) + self.name:SetExpensiveShadow(1, color_blackTransparent) end if (!suppress or !suppress.desc) then @@ -50,16 +51,16 @@ local PANEL = {} self.time:SetFont("nutMediumFont") self.time:SetTall(28) self.time:Dock(TOP) - self.time:SetTextColor(color_white) - self.time:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + self.time:SetTextColor(nut.config.get("colorText", color_white)) + self.time:SetExpensiveShadow(1, color_blackTransparent) end if (!suppress or !suppress.money) then self.money = self.info:Add("DLabel") self.money:Dock(TOP) self.money:SetFont("nutMediumFont") - self.money:SetTextColor(color_white) - self.money:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + self.money:SetTextColor(nut.config.get("colorText", color_white)) + self.money:SetExpensiveShadow(1, color_blackTransparent) self.money:DockMargin(0, 10, 0, 0) end @@ -67,8 +68,8 @@ local PANEL = {} self.faction = self.info:Add("DLabel") self.faction:Dock(TOP) self.faction:SetFont("nutMediumFont") - self.faction:SetTextColor(color_white) - self.faction:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + self.faction:SetTextColor(nut.config.get("colorText", color_white)) + self.faction:SetExpensiveShadow(1, color_blackTransparent) self.faction:DockMargin(0, 10, 0, 0) end @@ -79,8 +80,8 @@ local PANEL = {} self.class = self.info:Add("DLabel") self.class:Dock(TOP) self.class:SetFont("nutMediumFont") - self.class:SetTextColor(color_white) - self.class:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + self.class:SetTextColor(nut.config.get("colorText", color_white)) + self.class:SetExpensiveShadow(1, color_blackTransparent) self.class:DockMargin(0, 10, 0, 0) end end From 3e8cb0a002f9991b38316928b4cc2cd0d6404dba Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:35:06 +0200 Subject: [PATCH 86/89] Localization I used ai here, i dont speak these languages. Someone please verify the accuracy of the translations, because the person who checked dutch originally stated it wasn't the best --- gamemode/languages/sh_dutch.lua | 419 ++++++++++++-------- gamemode/languages/sh_english.lua | 10 +- gamemode/languages/sh_french.lua | 326 ++++++++-------- gamemode/languages/sh_german.lua | 266 +++++++++++++ gamemode/languages/sh_korean.lua | 517 +++++++++++++------------ gamemode/languages/sh_norwegian.lua | 493 +++++++++++++----------- gamemode/languages/sh_polish.lua | 471 +++++++++++++---------- gamemode/languages/sh_portuguese.lua | 394 +++++++++---------- gamemode/languages/sh_russian.lua | 549 +++++++++++++-------------- gamemode/languages/sh_spanish.lua | 528 +++++++++++++------------- 10 files changed, 2221 insertions(+), 1752 deletions(-) create mode 100644 gamemode/languages/sh_german.lua diff --git a/gamemode/languages/sh_dutch.lua b/gamemode/languages/sh_dutch.lua index 78a3485c..05682f66 100644 --- a/gamemode/languages/sh_dutch.lua +++ b/gamemode/languages/sh_dutch.lua @@ -2,159 +2,266 @@ NAME = "Nederlands" LANGUAGE = { - loading = "Laden", - dbError = "Database verbinding gefaald", - unknown = "Onbekend", - noDesc = "Geen beschrijving beschikbaar", - create = "Creëer", - createTip = "Maak een nieuw karakter aan om mee te spelen.", - load = "Laad", - loadTip = "Kies een eerder gemaakte karakter om mee te spelen.", - leave = "Verlaat", - leaveTip = "Verlaat de huidige server.", - ["return"] = "Terug", - returnTip = "Ga terug naar het vorige menu.", - name = "Naam", - desc = "Beschrijving", - model = "Model", - attribs = "Attributen", - charCreateTip = "Vul de velden hieronder in en druk op 'Voltooi' om je karakter te maken.", - invalid = "Je hebt een ongeldige %s voorzien", - descMinLen = "Je beschrijving moet ten minste %d tekens zijn.", - model = "Model", - player = "Speler", - finish = "Voltooi", - finishTip = "Voltooi het maken van jouw karakter.", - needModel = "Je moet een geldig 'Model' kiezen.", - creating = "Je karakter wordt gemaakt...", - unknownError = "Er is een onbekende fout opgetreden", - delConfirm = "Weet je zeker dat je %s wilt verwijderen?", - no = "Nee", - yes = "Ja", - itemInfo = "Naam: %s\nBeschrijving: %s", - cloud_no_repo = "Deze opslaagplaats is niet geldig.", - cloud_no_plugin = "Deze plugin is niet geldig.", - inv = "Inventaris", - plugins = "Plugins", - author = "Auteur", - version = "Versie", - characters = "Karakters", - business = "Bedrijf", - settings = "Instellingen", - config = "Config", - chat = "Chat", - appearance = "Uiterlijk", - misc = "Gemengd", - oocDelay = "Je moet %s seconde(n) wachten voordat je weer in OOC kan praten.", - loocDelay = "Je moet %s seconde(n) wachten voordat je weer in LOOC kan praten.", - usingChar = "Je bent dit karakter al aan het gebruiken.", - notAllowed = "Sorry, Je mag dat niet doen.", - itemNoExist = "Sorry, het item dat je hebt opgevraagd bestaat niet.", - cmdNoExist = "Sorry, dat commando bestaat niet.", - plyNoExist = "Sorry, Er is geen speler gevonden met die naam.", - cfgSet = "%s heeft \"%s\" gezet tot %s.", - drop = "Vallen", - dropTip = "Dit laat deze item(s) vallen uit je inventaris.", - take = "Nemen", - takeTip = "Dit laat deze item(s) oppakken en het in je inventaris doen.", - dTitle = "Unowned Door", - dTitleOwned = "Purchased Door", - dIsNotOwnable = "Deze deur kan niet gekocht worden.", - dIsOwnable = "Je kan deze deur kopen door op 'F2' te drukken.", - dMadeUnownable = "Je hebt deze deur niet verkoopbaar gemaakt.", - dMadeOwnable = "Je hebt deze deur verkoopbaar gemaakt.", - dNotAllowedToOwn = "Je mag deze deur niet bezitten.", - dSetDisabled = "Je hebt deze deur uitgeschakeld.", - dSetNotDisabled = "Je hebt deze deur ingeschakeld.", - dSetParentDoor = "Je hebt deze deur als je 'Parent' deur gezet. ", - dCanNotSetAsChild = "Je kan deze 'Parent' deur niet als een 'Child' deur zetten.", - dAddChildDoor = "Je hebt deze deur als een 'Child' toegevoegd.", - dRemoveChildren = "Je hebt alle 'Childs' van deze deur verwijderd.", - dRemoveChildDoor = "Je hebt de 'Child' status van deze deur verwijderd.", - dNoParentDoor = "Je hebt nog geen 'Parent' deur ingeschakeld.", - dOwnedBy = "%s is de eigenaar van deze deur.", - dConfigName = "Deuren", - dSetFaction = "Deze deur behoort nu toe aan de %s 'faction'.", - dRemoveFaction = "Deze deur behoort niet meer toe aan een 'faction'.", - dNotValid = "Je kijkt niet naar een geldige deur.", - canNotAfford = "Je kunt het je niet veroorloven om dit te kopen.", - dPurchased = "Je hebt deze deur gekocht voor %s.", - dSold = "Je hebt deze deur verkocht voor %s.", - notOwner = "Je bent niet de eigenaar van dit.", - invalidArg = "Je hebt een ongeldige waarde voor argument #%s.", - invalidFaction = "De 'faction' die u zoekt kan niet worden gevonden.", - flagGive = "%s heeft %s '%s' flags gegeven.", - flagTake = "%s heeft '%s' flags van %s genomen.", - flagNoMatch = "Je moet (de) \"%s\" Flag(s) hebben om dit te doen", - textAdded = "Je hebt een tekst toegevoegd.", - textRemoved = "Je hebt de %s tekst(en) verwijderd.", - moneyTaken = "Je hebt %s gevonden.", - businessPurchase = "Je hebt %s gekocht voor %s.", - businessSell = "Je verkocht %s voor %s.", - cChangeModel = "%s veranderde %s's model naar %s.", - cChangeName = "%s veranderde %s's naam naar %s.", - playerCharBelonging = "Dit object behoort aan je andere karakter toe.", - business = "Bedrijf", - invalidFaction = "Je hebt een ongeldige 'faction' voorzien", - spawnAdd = "Je hebt een spawn toegevoegd voor de %s 'faction'.", - spawnDeleted = "Je hebt (een) %s spawn punt(en) verwijderd.", - someone = "Iemand", - rgnLookingAt = "Toestaan dat de persoon waar je naar kijkt je herkent.", - rgnWhisper = "Toestaan dat degene(n) in het fluister gebied je herkent.", - rgnTalk = "Toestaan dat de personen in het praat gebied je herkennen.", - rgnYell = "Toestaan dat de personen in het schreeuw gebied je herkennen.", - icFormat = "%s zegt \"%s\"", - rollFormat = "%s heeft %s uitgerold.", - wFormat = "%s fluistert \"%s\"", - yFormat = "%s schreeuwt \"%s\"", - sbOptions = "Klik om opties over %s te zien.", - spawnAdded = "Je hebt een spawn toegevoegd voor %s.", - whitelist = "%s heeft %s gewhitelist voor de %s 'faction'.", - unwhitelist = "%s heeft %s geblacklist van de %s 'faction'.", - gettingUp = "Je staat nu op...", - wakingUp = "Je krijgt je bewustzijn terug...", - Weapons = "Wapens", - checkout = "Ga naar checkout (%s)", - purchase = "Koop", - purchasing = "Aan het kopen...", - success = "Succes", - buyFailed = "De koop is gefaald!", - buyGood = "Succesvol gekocht!", - shipment = "Lading", - shipmentDesc = "Deze lading behoort toe aan %s.", - class = "Class", - classes = "Classes", - illegalAccess = "Illegale toegang", - becomeClassFail = "Het is niet gelukt om %s te worden.", - becomeClass = "Je bent %s geworden.", - attribSet = "You set %s's %s to %s.", - attribUpdate = "You added %s's %s by %s.", - noFit = "Deze item(s) passen niet in je inventaris", - help = "Hulp", - commands = "Commando's", - helpDefault = "Selecteer een categorie", - doorSettings = "Deur Instellingen", - sell = "Verkoop", - access = "Toegang", - locking = "Bezig deze 'Entity' opslot te zetten ...", - unlocking = "Bezig deze 'Entity' van het slot te zetten ...", - modelNoSeq = "Je model ondersteunt deze 'Act' niet.", - notNow = "Je kan dat nu niet doen.", - faceWall = "Je moet de muur aankijken om dit te doen.", - faceWallBack = "Je moet met je rug tegen de muur staan om dit te doen", - descChanged = "Je hebt je karakter's beschrijving veranderd.", - charMoney = "Je hebt momenteel %s.", - charFaction = "Je bent een lid van de %s 'faction'.", - charClass = "Je bent %s van de 'faction'.", - noSpace = "Inventaris is vol.", - noOwner = "De eigenaar is niet geldig.", - notAllowed = "Dit is niet toegestaan.", - invalidIndex = "De Item Index is Ongeldig.", - invalidItem = "De Item Object is Ongeldig.", - invalidInventory = "Het inventaris object is ongeldig.", - home = "Home", - charKick = "%s kickde karakter %s.", - charBan = "%s heeft karakter %s verbannen.", - charBanned = "Deze karakter is verbannen.", - setMoney = "Je hebt %s's geld tot %s gezet." -} \ No newline at end of file + loading = "Laden", + dbError = "Database verbinding mislukt", + unknown = "Onbekend", + noDesc = "Geen beschrijving beschikbaar", + create = "Aanmaken", + createTip = "Maak een nieuw personage om mee te spelen.", + load = "Laden", + loadTip = "Kies een eerder aangemaakt personage om mee te spelen.", + leave = "Verlaten", + leaveTip = "Verlaat de huidige server.", + ["return"] = "Terug", + returnTip = "Ga terug naar het vorige menu.", + name = "Naam", + desc = "Beschrijving", + model = "Model", + attribs = "Attributen", + charCreateTip = "Vul de velden hieronder in en klik op 'Voltooien' om je personage aan te maken.", + invalid = "Je hebt een ongeldige %s opgegeven", + descMinLen = "Je beschrijving moet minimaal %d karakter(s) bevatten.", + player = "Speler", + finish = "Voltooien", + finishTip = "Voltooi het aanmaken van het personage.", + needModel = "Je moet een geldig model kiezen", + creating = "Je personage wordt aangemaakt...", + unknownError = "Er is een onbekende fout opgetreden", + delConfirm = "Weet je zeker dat je %s PERMANENT wilt verwijderen?", + no = "Nee", + yes = "Ja", + itemInfo = "Naam: %s\nBeschrijving: %s", + itemCreated = "Item succesvol aangemaakt.", + cloud_no_repo = "Het opgegeven repository is niet geldig.", + cloud_no_plugin = "Het opgegeven plugin is niet geldig.", + inv = "Inventaris", + plugins = "Plugins", + togglePlugins = "Schakel plugins in/uit", + author = "Auteur", + version = "Versie", + characters = "Personages", + settings = "Instellingen", + config = "Configuratie", + chat = "Chat", + appearance = "Uiterlijk", + misc = "Diversen", + oocDelay = "Je moet nog %s seconde(n) wachten voordat je weer OOC kunt gebruiken.", + loocDelay = "Je moet nog %s seconde(n) wachten voordat je weer LOOC kunt gebruiken.", + usingChar = "Dit Personage is al in gebruik.", + itemNoExist = "Sorry, het gevraagde item bestaat niet.", + cmdNoExist = "Sorry, die opdracht bestaat niet.", + plyNoExist = "Sorry, er kon geen overeenkomende speler worden gevonden.", + cfgSet = "%s heeft \"%s\" ingesteld op %s.", + drop = "Neerzetten", + dropTip = "Zet dit item uit je inventaris.", + take = "Oppakken", + takeTip = "Pak dit item op en plaats het in je inventaris.", + dTitle = "Niet toegeëigende Deur", + dTitleOwned = "Gekochte Deur", + dIsNotOwnable = "Deze deur is niet te bezitten.", + dIsOwnable = "Je kunt deze deur kopen door op F2 te drukken.", + dMadeUnownable = "Je hebt deze deur niet toekenbaar gemaakt.", + dMadeOwnable = "Je hebt deze deur toekenbaar gemaakt", + dNotAllowedToOwn = "Je mag deze deur niet bezitten.", + dSetDisabled = "Je hebt deze deur uitgeschakeld.", + dSetNotDisabled = "Je hebt deze deur Ingeschakeld.", + dSetHidden = "Je hebt deze deur verborgen.", + dSetNotHidden = "Je hebt deze deur niet langer verborgen.", + dSetParentDoor = "Je hebt deze deur als hoofd deur ingesteld.", + dCanNotSetAsChild = "Je kunt de hoofd deur niet als secundair instellen.", + dAddChildDoor = "Je hebt deze deur als kind toegevoegd.", + dRemoveChildren = "Je hebt alle secundaire van deze deur verwijderd.", + dRemoveChildDoor = "Je hebt deze deur verwijderd als secundaire.", + dNoParentDoor = "Je hebt geen ouderdeur ingesteld.", + dOwnedBy = "Deze deur is eigendom van %s.", + dConfigName = "Deuren", + dSetFaction = "Deze deur behoort nu tot de factie %s.", + dRemoveFaction = "Deze deur behoort niet langer tot een factie.", + dNotValid = "Je kijkt niet naar een geldige deur.", + canNotAfford = "Je kunt je dit niet veroorloven om te kopen.", + dPurchased = "Je hebt deze deur gekocht voor %s.", + dSold = "Je hebt deze deur verkocht voor %s.", + notOwner = "Je bent hier niet de eigenaar van.", + invalidArg = "Je hebt een ongeldige waarde opgegeven voor argument #%s.", + flagGive = "%s heeft %s de vlaggen '%s' gegeven.", + flagGiveTitle = "Vlaggen Geven", + flagGiveDesc = "Geef de volgende vlaggen aan de speler.", + flagTake = "%s heeft de vlaggen '%s' van %s afgenomen.", + flagTakeTitle = "Vlaggen Afnemen", + flagTakeDesc = "Verwijder de volgende vlaggen van de speler.", + flagNoMatch = "Je moet \"%s\" vlag(gen) hebben om deze actie uit te voeren.", + textAdded = "Je hebt een tekst toegevoegd.", + textRemoved = "Je hebt %s tekst(en) verwijderd.", + moneyTaken = "Je hebt %s gevonden.", + businessPurchase = "Je hebt %s gekocht voor %s.", + businessSell = "Je hebt %s verkocht voor %s.", + cChangeModel = "%s heeft het model van %s veranderd naar %s.", + cChangeName = "%s heeft de naam van %s veranderd naar %s.", + cChangeSkin = "%s heeft de skin van %s veranderd naar %s.", + cChangeGroups = "%s heeft de \"%s\" lichaamsstijl van %s veranderd naar %s.", + cChangeFaction = "%s heeft %s overgezet naar de factie %s.", + playerCharBelonging = "Dit object behoort toe aan je andere personage.", + business = "Zakelijk", + invalidFaction = "Je hebt een ongeldige factie opgegeven.", + limitFaction = "Deze factie is vol. Probeer het later opnieuw.", + spawnAdd = "Je hebt een spawnpunt toegevoegd voor %s.", + spawnDeleted = "Je hebt %s spawnpunt(en) verwijderd.", + someone = "Iemand", + rgnLookingAt = "Laat de persoon naar wie je kijkt je herkennen.", + rgnWhisper = "Laat degenen in fluisterafstand je herkennen.", + rgnTalk = "Laat degenen in praatafstand je herkennen.", + rgnYell = "Laat degenen in schreeuwafstand je herkennen.", + icFormat = "%s zegt \"%s\"", + rollFormat = "%s heeft %s gegooid.", + wFormat = "%s fluistert \"%s\"", + yFormat = "%s schreeuwt \"%s\"", + sbOptions = "Klik om opties te bekijken voor %s.", + spawnAdded = "Je hebt een spawnpunt toegevoegd voor %s.", + whitelist = "%s heeft %s op de whitelist gezet voor de factie %s.", + unwhitelist = "%s heeft %s van de whitelist van de factie %s verwijderd.", + gettingUp = "Je staat op...", + wakingUp = "Je komt langzaam weer bij bewustzijn...", + Weapons = "Wapens", + checkout = "Ga naar de Kassa (%s)", + purchase = "Kopen", + purchasing = "Aan het kopen...", + success = "Succes", + buyFailed = "Aankoop mislukt.", + buyGood = "Aankoop succesvol!", + shipment = "Zending", + shipmentDesc = "Deze zending behoort toe aan %s.", + class = "Klasse", + classes = "Klassen", + illegalAccess = "Illegale toegang.", + becomeClassFail = "Niet gelukt om %s te worden.", + becomeClass = "Je bent nu %s.", + attribSet = "Je hebt %s's %s ingesteld op %s.", + attribUpdate = "Je hebt %s's %s met %s verhoogd.", + noFit = "Dit item past niet in je inventaris.", + help = "Help", + commands = "Commando's", + helpDefault = "Selecteer een categorie", + doorSettings = "Deurinstellingen", + sell = "Verkopen", + access = "Toegang", + locking = "Dit object wordt vergrendeld...", + unlocking = "Dit object wordt ontgrendeld...", + modelNoSeq = "Je model ondersteunt deze handeling niet.", + notNow = "Je mag dit nu niet doen.", + faceWall = "Je moet naar de muur kijken om dit te doen.", + faceWallBack = "Je rug moet naar de muur gericht zijn om dit te doen.", + descChanged = "Je hebt de beschrijving van je personage veranderd.", + charMoney = "Je hebt momenteel %s.", + charFaction = "Je bent lid van de factie %s.", + charClass = "Je bent %s van de factie.", + noSpace = "Inventaris is vol.", + noOwner = "De eigenaar is ongeldig.", + notAllowed = "Deze actie is niet toegestaan.", + invalidIndex = "Het itemnummer is ongeldig.", + invalidItem = "Het itemobject is ongeldig.", + invalidInventory = "Het inventarisobject is ongeldig.", + home = "Thuis", + charKick = "%s heeft karakter %s gekickt.", + charBan = "%s heeft het personage %s verbannen.", + charBanned = "Dit personage is verbannen.", + setMoney = "Je hebt het geld van %s op %s gezet.", + itemPriceInfo = "Je kunt dit item kopen voor %s.\nJe kunt dit item verkopen voor %s", + free = "Gratis", + vendorNoSellItems = "Er zijn geen items te koop.", + vendorNoBuyItems = "Er zijn geen items te koop.", + vendorSettings = "Verkopersinstellingen", + vendorUseMoney = "Moet de verkoper geld gebruiken?", + vendorNoBubble = "Verberg de verkopers spraakbel?", + mode = "Modus", + price = "Prijs", + stock = "Voorraad", + none = "Geen", + vendorBoth = "Kopen en verkopen", + vendorBuy = "Alleen kopen", + vendorSell = "Alleen verkopen", + maxStock = "Maximale voorraad", + vendorFaction = "Factie-editor", + buy = "Kopen", + vendorWelcome = "Welkom in mijn winkel, wat kan ik voor je doen?", + vendorBye = "Kom snel weer terug!", + charSearching = "Je bent al op zoek naar een ander personage, wacht even.", + charUnBan = "%s heeft het personage %s geunbanned.", + charNotBanned = "Dit personage is niet verbannen.", + storPass = "Je hebt het wachtwoord van deze opslagruimte ingesteld op %s.", + storPassRmv = "Je hebt het wachtwoord van deze opslagruimte verwijderd.", + storPassWrite = "Voer het wachtwoord in.", + wrongPassword = "Je hebt het verkeerde wachtwoord ingevoerd.", + cheapBlur = "Vervaging uitschakelen? (Verhoogt FPS)", + quickSettings = "Snelle instellingen", + vmSet = "Je hebt je voicemail ingesteld.", + vmRem = "Je hebt je voicemail verwijderd.", + altLower = "Handen verbergen wanneer deze omlaag zijn?", + noPerm = "Je hebt geen toestemming om dit te doen.", + youreDead = "Je bent dood", + injMajor = "Lijkt ernstig gewond te zijn.", + injLittle = "Lijkt gewond te zijn", + toggleObserverTP = "Schakel observer-teleportatie in/uit", + toggleESP = "Schakel Admin ESP in/uit", + toggleESPAdvanced = "ESP Geavanceerde modus", + chgName = "Naam wijzigen", + chgNameDesc = "Voer hieronder de nieuwe naam van het personage in.", + thirdpersonToggle = "Schakel Derdepersoonsmodus in/uit", + thirdpersonClassic = "Gebruik Klassieke Derdepersoonsmodus", + thirdpersonConfig = "Derdepersoonsconfiguratie", + equippedBag = "Uitgeruste items kunnen niet tussen inventarissen worden verplaatst.", + useTip = "Gebruikt het item.", + equipTip = "Rust het item uit.", + unequipTip = "Leg het item weg.", + consumables = "Verbruiksartikelen", + plyNotValid = "Je kijkt niet naar een geldige speler.", + restricted = "Je functies zijn beperkt.", + viewProfile = "Bekijk Steam-profiel", + salary = "Je hebt %s van je salaris ontvangen.", + noRecog = "Je herkent dit persoon niet.", + curTime = "De huidige tijd is %s.", + vendorEditor = "Verkoper Editor", + edit = "Bewerken", + disable = "Uitschakelen", + vendorPriceReq = "Voer de nieuwe prijs voor dit item in.", + vendorEditCurStock = "Huidige voorraad bewerken", + you = "Jij", + vendorSellScale = "Verkoopprijs schaal", + vendorNoTrade = "Je kunt niet handelen met deze verkoper.", + vendorNoMoney = "Deze verkoper kan dat item niet betalen.", + vendorNoStock = "Deze verkoper heeft dat item niet op voorraad.", + contentTitle = "NutScript Inhoud Ontbreekt", + contentWarning = "Je hebt de NutScript-inhoud niet geïnstalleerd. Hierdoor kunnen bepaalde functies ontbreken.\nHet adres van de Nutscript-inhoud is gewijzigd naar dat van rebel1324.\nWil je de Workshop-pagina voor de NutScript-inhoud openen?", + flags = "Vlaggen", + chooseTip = "Kies dit personage om mee te spelen.", + deleteTip = "Verwijder dit personage.", + moneyLeft = "Jouw geld: ", + currentMoney = "Resterend geld: ", + -- 2018 patch + ammoLoadAll = "Alles laden", + ammoLoadAmount = "%s laden", + ammoLoadCustom = "Laden...", + split = "Delen", + splitHelp = "Voer een getal in om te splitsen.", + splitHalf = "Helft splitsen", + splitQuarter = "Kwart splitsen", + recognize = "Laat dit personage je herkennen.", + recognized = "Je hebt dit personage je identiteit gegeven.", + already_recognized = "Dit personage kent je al.", + isTied = "Deze persoon is vastgebonden.", + tying = "Vastbinden", + untying = "Los maken", + beingUntied = "Je wordt los gemaakt.", + beingTied = "Je wordt vastgebonden.", + sameOutfitCategory = "Je draagt al dit soort outfit.", + noBusiness = "Je mag op dit moment niets kopen.", + panelRemoved = "Je hebt %s 3D-panelen verwijderd.", + panelAdded = "Je hebt een 3D-paneel toegevoegd.", + itemOnGround = "Je item is op de grond geplaatst.", + forbiddenActionStorage = "Je kunt deze actie niet uitvoeren met een opgeslagen item.", + cantDropBagHasEquipped = "Je kunt de tas niet laten vallen zolang er een uitgerust item in zit.", + -- 2021 patch + lookToUseAt = "Je moet naar iemand kijken om '@' te gebruiken.", + mustProvideString = "Je moet een tekenreeks voor de variabele opgeven", + -- 2023 patch + togglePluginsDesc = "Geselecteerde plugins worden uitgeschakeld.\nDe kaart moet worden herstart na het maken van wijzigingen!", +} diff --git a/gamemode/languages/sh_english.lua b/gamemode/languages/sh_english.lua index 26f10444..32c16ee5 100644 --- a/gamemode/languages/sh_english.lua +++ b/gamemode/languages/sh_english.lua @@ -1,4 +1,3 @@ - NAME = "English" LANGUAGE = { @@ -36,6 +35,7 @@ LANGUAGE = { cloud_no_plugin = "The plugin provided is not valid.", inv = "Inventory", plugins = "Plugins", + togglePlugins = "Toggle plugins", author = "Author", version = "Version", characters = "Characters", @@ -258,10 +258,14 @@ LANGUAGE = { panelRemoved = "You have removed %s 3D panels.", panelAdded = "You have added a 3D panel.", itemOnGround = "Your item has been placed on the ground.", - forbiddenActionStorage = "You can't do this action with storaged item.", - cantDropBagHasEquipped = "You can't drop bag that has equipped item.", + forbiddenActionStorage = "You can't do this action with a storaged item.", + cantDropBagHasEquipped = "You can't drop a bag that has equipped item.", -- 2021 patch lookToUseAt = "You need to be looking at someone to use '@'", mustProvideString = "You must provide a string for the variable", + + -- 2023 patch + + togglePluginsDesc = "Selected Plugins will be disabled.\nThe map must be restarted after making changes!", } diff --git a/gamemode/languages/sh_french.lua b/gamemode/languages/sh_french.lua index 6e70ad9e..4c57ea1f 100644 --- a/gamemode/languages/sh_french.lua +++ b/gamemode/languages/sh_french.lua @@ -3,265 +3,265 @@ NAME = "Français" LANGUAGE = { loading = "Chargement", - dbError = "Connexion avec la base de données échouée", + dbError = "Échec de la connexion à la base de données", unknown = "Inconnu", noDesc = "Aucune description disponible", - create = "CrÉer", - createTip = "Créer un nouveau personnage pour jouer avec.", + create = "Créer", + createTip = "Créez un nouveau personnage pour jouer.", load = "Charger", - loadTip = "Charger un personnage crée auparavant pour jouer avec.", + loadTip = "Choisissez un personnage déjà créé pour jouer.", leave = "Quitter", - leaveTip = "Quitter le serveur actuel.", + leaveTip = "Quittez le serveur actuel.", ["return"] = "Retour", - returnTip = "Retourner au menu précédent.", + returnTip = "Revenir au menu précédent.", name = "Nom", desc = "Description", model = "Modèle", attribs = "Attributs", charCreateTip = "Remplissez les champs ci-dessous et appuyez sur 'Terminer' pour créer votre personnage.", invalid = "Vous avez fourni un %s invalide", - descMinLen = "Votre description doit comporter au moins %d caractère(s).", + descMinLen = "Votre description doit contenir au moins %d caractère(s).", player = "Joueur", finish = "Terminer", - finishTip = "Terminer la création du personnage.", + finishTip = "Terminez la création du personnage.", needModel = "Vous devez choisir un modèle valide", creating = "Votre personnage est en cours de création...", - unknownError = "Une erreur inconnue est survenue", - delConfirm = "Êtes-vous sûr de vouloir supprimer définitivement %s?", + unknownError = "Une erreur inconnue s'est produite", + delConfirm = "Êtes-vous sûr de vouloir SUPPRIMER %s de façon PERMANENTE ?", no = "Non", yes = "Oui", - itemInfo = "Nom: %s\nDescription: %s", - itemCreated = "L'objet à été créé avec succès.", - cloud_no_repo = "Les référentiels fournies ne sont pas valides.", - cloud_no_plugin = "Les plugins fournies ne sont pas valides.", + itemInfo = "Nom : %s\nDescription : %s", + itemCreated = "Objet créé avec succès.", + cloud_no_repo = "Le référentiel fourni n'est pas valide.", + cloud_no_plugin = "Le plugin fourni n'est pas valide.", inv = "Inventaire", plugins = "Plugins", + togglePlugins = "Activer/désactiver les plugins", author = "Auteur", version = "Version", characters = "Personnages", settings = "Paramètres", config = "Configuration", - chat = "Chat", + chat = "Discussion", appearance = "Apparence", misc = "Divers", - oocDelay = "Vous devez attendre %s seconde(s) avant de pouvoir utiliser de nouveau le OOC.", - loocDelay = "Vous devez attendre %s seconde(s) avant de pouvoir utiliser de nouveau le LOOC.", + oocDelay = "Vous devez attendre encore %s seconde(s) avant de pouvoir utiliser OOC à nouveau.", + loocDelay = "Vous devez attendre encore %s seconde(s) avant de pouvoir utiliser LOOC à nouveau.", usingChar = "Vous utilisez déjà ce personnage.", - itemNoExist = "Désolé, l'objet que vous avez demandé n'a pas été trouvé ou n'existe pas.", - cmdNoExist = "Désolé, cette commande n'a pas été trouvé ou n'existe pas.", - plyNoExist = "Désolé, le joueur n'a pas été trouvé ou n'existe pas.", - cfgSet = "%s a mis \"%s\" à %s.", + itemNoExist = "Désolé, l'objet que vous avez demandé n'existe pas.", + cmdNoExist = "Désolé, cette commande n'existe pas.", + plyNoExist = "Désolé, aucun joueur correspondant n'a pu être trouvé.", + cfgSet = "%s a défini \"%s\" sur %s.", drop = "Lâcher", - dropTip = "Lâcher cet objet de votre inventaire.", + dropTip = "Lâchez cet objet de votre inventaire.", take = "Prendre", - takeTip = "Prendre cet objet et le placer dans votre inventaire.", - dTitle = "Porte en vente", + takeTip = "Prenez cet objet et placez-le dans votre inventaire.", + dTitle = "Porte non possédée", dTitleOwned = "Porte achetée", - dIsNotOwnable = "Cette porte est inachetable.", + dIsNotOwnable = "Cette porte n'est pas achetable.", dIsOwnable = "Vous pouvez acheter cette porte en appuyant sur F2.", - dMadeUnownable = "Vous avez rendu cette porte inachetable.", + dMadeUnownable = "Vous avez rendu cette porte non achetable.", dMadeOwnable = "Vous avez rendu cette porte achetable.", dNotAllowedToOwn = "Vous n'êtes pas autorisé à posséder cette porte.", dSetDisabled = "Vous avez désactivé cette porte.", - dSetNotDisabled = "Vous avez activé cette porte.", - dSetHidden = "Vous avez cachée cette porte.", - dSetNotHidden = "Vous avez rendu visible cette porte.", - dSetParentDoor = "Vous avez fait de cette porte, la porte principale.", - dCanNotSetAsChild = "Vous avez fait de cette porte, la porte secondaire.", - dAddChildDoor = "Vous avez ajouté une porte secondaire.", - dRemoveChildren = "Vous avez supprimé toutes les portes secondaires, pour ne laisser que celle-ci.", - dRemoveChildDoor = "Vous avez supprimé cette porte secondaire.", - dNoParentDoor = "Vous ne disposez pas d'une porte principale.", + dSetNotDisabled = "Vous avez réactivé cette porte.", + dSetHidden = "Vous avez rendu cette porte invisible.", + dSetNotHidden = "Vous avez rendu cette porte visible.", + dSetParentDoor = "Vous avez défini cette porte comme votre porte parente.", + dCanNotSetAsChild = "Vous ne pouvez pas définir la porte parente comme enfant.", + dAddChildDoor = "Vous avez ajouté cette porte comme enfant.", + dRemoveChildren = "Vous avez retiré tous les enfants de cette porte.", + dRemoveChildDoor = "Vous avez retiré cette porte en tant qu'enfant.", + dNoParentDoor = "Vous n'avez pas de porte parente définie.", dOwnedBy = "Cette porte appartient à %s.", dConfigName = "Portes", - dSetFaction = "Cette porte appartient maintenant à la faction %s.", + dSetFaction = "Cette porte appartient désormais à la faction %s.", dRemoveFaction = "Cette porte n'appartient plus à aucune faction.", dNotValid = "Vous ne regardez pas une porte valide.", - canNotAfford = "Vous ne pouvez pas vous permettre d'acheter ceci.", + canNotAfford = "Vous ne pouvez pas vous permettre d'acheter cela.", dPurchased = "Vous avez acheté cette porte pour %s.", dSold = "Vous avez vendu cette porte pour %s.", notOwner = "Vous n'êtes pas le propriétaire de ceci.", - invalidArg = "Vous avez fourni une valeur non valide pour l'argument #%s.", - flagGive = "%s a donné à %s les drapeaux \"%s\".", - flagGiveTitle = "Donner drapeaux", - flagGiveDesc = "Donner les drapeaux suivants à un joueur.", - flagTake = "%s a retiré les drapeaux \"%s\" à %s.", - flagTakeTitle = "Retirer drapeaux", - flagTakeDesc = "Retirer les drapeaux suivants à un joueur.", - flagNoMatch = "Vous devez avoir le ou les drapeaux \"%s\" pour réaliser cette action.", + invalidArg = "Vous avez fourni une valeur invalide pour l'argument #%s.", + flagGive = "%s a donné les drapeaux '%s' à %s.", + flagGiveTitle = "Donner des drapeaux", + flagGiveDesc = "Donnez les drapeaux suivants au joueur.", + flagTake = "%s a retiré les drapeaux '%s' de %s.", + flagTakeTitle = "Retirer les drapeaux", + flagTakeDesc = "Retirez les drapeaux suivants du joueur.", + flagNoMatch = "Vous devez avoir les drapeaux \"%s\" pour effectuer cette action.", textAdded = "Vous avez ajouté un texte.", textRemoved = "Vous avez supprimé %s texte(s).", moneyTaken = "Vous avez trouvé %s.", businessPurchase = "Vous avez acheté %s pour %s.", businessSell = "Vous avez vendu %s pour %s.", - cChangeModel = "%s a modifié le modèle de %s par \"%s\".", - cChangeName = "%s a modifié le nom roleplay de %s par \"%s\".", - cChangeSkin = "%s a modifié la peau (skin) de %s par \"%s\".", - cChangeGroups = "%s a modifié le bodygroup de %s avec (nom: %s, index: %s).", - cChangeFaction = "%s a modifié la faction de %s par \"%s\".", - playerCharBelonging = "Cet objet appartient à un autre de vos personnages.", - business = "Marché", - invalidFaction = "La faction que vous avez fourni n'a pu être trouvée.", + cChangeModel = "%s a changé le modèle de %s en %s.", + cChangeName = "%s a changé le nom de %s en %s.", + cChangeSkin = "%s a changé la peau de %s en %s.", + cChangeGroups = "%s a changé le groupe corporel \"%s\" de %s en %s.", + cChangeFaction = "%s a transféré %s vers la faction %s.", + playerCharBelonging = "Cet objet appartient à un autre personnage.", + business = "Commerce", + invalidFaction = "Vous avez fourni une faction invalide.", limitFaction = "Cette faction est complète. Réessayez plus tard.", spawnAdd = "Vous avez ajouté un point d'apparition pour %s.", spawnDeleted = "Vous avez supprimé %s point(s) d'apparition.", someone = "Quelqu'un", - rgnLookingAt = "Permettre à la personne que vous regardez de vous reconnaître.", - rgnWhisper = "Permettre à ceux qui vous entendent chuchoter de vous reconnaître.", - rgnTalk = "Permettre à ceux qui vous entendent parler de vous reconnaître.", - rgnYell = "Permettre à ceux qui vous entendent crier de vous reconnaître.", + rgnLookingAt = "Permet à la personne que vous regardez de vous reconnaître.", + rgnWhisper = "Permet à ceux qui chuchotent de vous reconnaître.", + rgnTalk = "Permet à ceux qui parlent de vous reconnaître.", + rgnYell = "Permet à ceux qui crient de vous reconnaître.", icFormat = "%s dit \"%s\"", - rollFormat = "%s a jeté les dés, %s.", + rollFormat = "%s a fait un jet de %s.", wFormat = "%s chuchote \"%s\"", yFormat = "%s crie \"%s\"", - sbOptions = "Cliquez pour voir les options de %s.", + sbOptions = "Cliquez pour voir les options pour %s.", spawnAdded = "Vous avez ajouté un point d'apparition pour %s.", - whitelist = "%s a ajouté à la liste blanche %s pour la faction %s.", - unwhitelist = "%s a retiré de la liste blanche %s pour la faction %s.", - gettingUp = "Vous êtes maintenant debout...", - wakingUp = "Vous avez repris conscience...", + whitelist = "%s a mis %s sur la liste blanche pour la faction %s.", + unwhitelist = "%s a retiré %s de la liste blanche de la faction %s.", + gettingUp = "Vous vous levez maintenant...", + wakingUp = "Vous reprenez conscience...", Weapons = "Armes", - checkout = "Panier (%s)", + checkout = "Aller à la caisse (%s)", purchase = "Acheter", - purchasing = "Achat...", + purchasing = "Achat en cours...", success = "Succès", - buyFailed = "Achat échoué.", - buyGood = "Achat réussi.", - shipment = "Cargaison", - shipmentDesc = "Cette cargaison appartient à %s.", + buyFailed = "L'achat a échoué.", + buyGood = "Achat réussi !", + shipment = "Expédition", + shipmentDesc = "Cette expédition appartient à %s.", class = "Classe", - classes = "Métiers", + classes = "Classes", illegalAccess = "Accès illégal.", - becomeClassFail = "Impossible de devenir %s.", - becomeClass = "Vous êtes devenu %s.", - attribSet = "Vous avez mis à %s de %s à %s.", - attribUpdate = "Vous avez ajouté à %s de %s, %s pour être précis.", - noFit = "Cet objet ne peut pas rentrer dans votre inventaire.", + becomeClassFail = "Échec pour devenir %s.", + becomeClass = "Vous êtes maintenant %s.", + attribSet = "Vous avez défini les %s de %s sur %s.", + attribUpdate = "Vous avez augmenté les %s de %s de %s.", + noFit = "Cet objet ne peut pas être rangé dans votre inventaire.", help = "Aide", commands = "Commandes", - helpDefault = "Choisir une fichier d'aide", - doorSettings = "Modifications", + helpDefault = "Sélectionnez une catégorie", + doorSettings = "Paramètres de la porte", sell = "Vendre", access = "Accès", - locking = "VERROUILLAGE DE L'ENTITÉ...", - unlocking = "DÉVERROUILLAGE DE L'ENTITÉ...", - modelNoSeq = "Votre modèle ne prend pas en charge cet acte.", - notNow = "Vous n'êtes pas autorisé à faire ceci maintenant.", - faceWall = "Vous devez être face au mur.", - faceWallBack = "Votre dos doit être orientée vers le mur.", - descChanged = "Vous avez changé la description de votre personnage.", + locking = "Verrouillage de cette entité...", + unlocking = "Déverrouillage de cette entité...", + modelNoSeq = "Votre modèle ne prend pas en charge cette action.", + notNow = "Vous n'êtes pas autorisé à faire cela pour le moment.", + faceWall = "Vous devez faire face au mur pour faire cela.", + faceWallBack = "Votre dos doit être tourné vers le mur pour faire cela.", + descChanged = "Vous avez modifié la description de votre personnage.", charMoney = "Vous avez actuellement %s.", - charFaction = "Vous êtes un membre de la faction %s.", - charClass = "Vous êtes %s dans votre faction.", - noSpace = "L'inventaire est complet.", - noOwner = "Le propriétaire est invalide.", - notAllowed = "Cette action n'est pas autorisé.", - invalidIndex = "L'objet de l'index est invalide.", + charFaction = "Vous êtes membre de la faction %s.", + charClass = "Vous êtes %s de la faction.", + noSpace = "L'inventaire est plein.", + noOwner = "Le propriétaire n'est pas valide.", + notAllowed = "Cette action n'est pas autorisée.", + invalidIndex = "L'index de l'objet est invalide.", invalidItem = "L'objet est invalide.", - invalidInventory = "L'object de l'inventaire est invalide.", + invalidInventory = "L'inventaire est invalide.", home = "Accueil", - charKick = "%s a kick le personnage %s.", + charKick = "%s a expulsé le personnage %s.", charBan = "%s a banni le personnage %s.", charBanned = "Ce personnage est banni.", - setMoney = "Vous avez défini l'argent de %s à %s.", - itemPriceInfo = "Vous pouvez acheter cet objet pour %s.\nVous pouvez vendre cet objet pour %s.", + setMoney = "Vous avez défini l'argent de %s sur %s.", + itemPriceInfo = "Vous pouvez acheter cet objet pour %s.\nVous pouvez vendre cet objet pour %s", free = "Gratuit", - vendorNoSellItems = "Il n'y a pas d'objet à vendre.", - vendorNoBuyItems = "Il n'y a pas d'objet à acheter.", - vendorSettings = "Modifications", - vendorUseMoney = "Le PNJ peut utiliser de l'argent?", - vendorNoBubble = "Cacher la bulle du PNJ ?", + vendorNoSellItems = "Il n'y a aucun objet à vendre.", + vendorNoBuyItems = "Il n'y a aucun objet à acheter.", + vendorSettings = "Paramètres du vendeur", + vendorUseMoney = "Le vendeur devrait-il utiliser de l'argent ?", + vendorNoBubble = "Masquer la bulle du vendeur ?", mode = "Mode", price = "Prix", stock = "Stock", none = "Aucun", - vendorBoth = "Achat et vente", - vendorBuy = "Achat seulement", - vendorSell = "Vente seulement", - maxStock = "Max stock", - vendorFaction = "Modification faction", - buy = "Achat", - vendorWelcome = "Bienvenue dans mon magasin, tout ce que je peux vous obtenir se trouve ici !", - vendorBye = "À bientôt !", - charSearching = "Vous êtes déjà à la recherche d'un autre personnage, veuillez attendre.", + vendorBoth = "Acheter et Vendre", + vendorBuy = "Acheter Uniquement", + vendorSell = "Vendre Uniquement", + maxStock = "Stock Max", + vendorFaction = "Éditeur de Faction", + buy = "Acheter", + vendorWelcome = "Bienvenue dans mon magasin, que puis-je vous offrir aujourd'hui ?", + vendorBye = "Revenez bientôt !", + charSearching = "Vous recherchez déjà un autre personnage, veuillez patienter.", charUnBan = "%s a débanni le personnage %s.", - charNotBanned = "Ce personnage n'est pas interdit.", - storPass = "Le mot de passe de ce stockage est %s.", + charNotBanned = "Ce personnage n'est pas banni.", + storPass = "Vous avez défini le mot de passe de ce stockage sur %s.", storPassRmv = "Vous avez supprimé le mot de passe de ce stockage.", storPassWrite = "Entrez le mot de passe.", wrongPassword = "Vous avez entré un mauvais mot de passe.", - cheapBlur = "Désactiver le flou ? (Gain FPS)", - quickSettings = "Paramètres rapides", - vmSet = "Vous avez défini votre messagerie vocale.", - vmRem = "Vous avez supprimé votre messagerie vocale.", - altLower = "Cacher les mains quand elles sont baissées ?", - noPerm = "Vous n'êtes pas autorisé à faire ceci.", + cheapBlur = "Désactiver le flou ? (Augmente les FPS)", + quickSettings = "Paramètres Rapides", + vmSet = "Vous avez défini votre boîte vocale.", + vmRem = "Vous avez supprimé votre boîte vocale.", + altLower = "Masquer les mains lorsqu'elles sont baissées ?", + noPerm = "Vous n'êtes pas autorisé à faire cela.", youreDead = "Vous êtes mort", - injMajor = "Il semble grièvement blessé.", - injLittle = "Il semble blessé.", - toggleObserverTP = "Activer l'observation des téléportations", - toggleESP = "Activer l'ESP admin", - toggleESPAdvanced = "Mode avancé de l'ESP", - chgName = "Changer de nom", + injMajor = "Semble gravement blessé.", + injLittle = "Semble blessé", + toggleObserverTP = "Activer/désactiver la téléportation de l'observateur", + toggleESP = "Activer/désactiver l'ESP Admin", + toggleESPAdvanced = "Mode ESP Avancé", + chgName = "Changer le Nom", chgNameDesc = "Entrez le nouveau nom du personnage ci-dessous.", - thirdpersonToggle = "Activer la troisième personne", - thirdpersonClassic = "Utiliser troisième personne classique", - thirdpersonConfig = "Configuration troisième personne", + thirdpersonToggle = "Activer/désactiver la Troisième Personne", + thirdpersonClassic = "Utiliser la Troisième Personne Classique", + thirdpersonConfig = "Configuration de la Troisième Personne", equippedBag = "Les objets équipés ne peuvent pas être déplacés entre les inventaires.", - useTip = "Utiliser l'objet.", - equipTip = "Équiper l'objet.", - unequipTip = "Déséquiper l'objet.", + useTip = "Utilisez l'objet.", + equipTip = "Équipez l'objet.", + unequipTip = "Déséquipez l'objet.", consumables = "Consommables", plyNotValid = "Vous ne regardez pas un joueur valide.", - restricted = "Vous avez été attaché", + restricted = "Vous êtes restreint.", viewProfile = "Voir le profil Steam", - salary = "Vous avez reçu votre salaire, %s.", - noRecog = "Vous ne connaissez pas cette personne.", - curTime = "L'heure et la date actuelle, %s.", - vendorEditor = "Édition du vendeur", - edit = "Éditer", + salary = "Vous avez reçu %s de salaire.", + noRecog = "Vous ne reconnaissez pas cette personne.", + curTime = "Il est actuellement %s.", + vendorEditor = "Éditeur de Vendeur", + edit = "Modifier", disable = "Désactiver", - vendorPriceReq = "Entrez le nouveau prix pour cet objet.", - vendorEditCurStock = "Modifier le stock actuel", + vendorPriceReq = "Entrez le nouveau prix de cet objet.", + vendorEditCurStock = "Modifier le Stock Actuel", you = "Vous", - vendorSellScale = "Échelle de prix de vente", - vendorNoTrade = "Vous ne pouvez pas faire de commerce avec ce vendeur.", - vendorNoMoney = "Ce vendeur ne peut pas se payer cet article.", - vendorNoStock = "Ce vendeur n'a pas cet article en stock.", - contentTitle = "Contenu NutScript manquant", - contentWarning = "Vous n'avez pas monté le contenu NutScript. Cela peut entraîner l'absence de certaines fonctionnalités. L'adresse du contenu NutScript a été remplacée par celle de rebel1324.\nVoulez-vous ouvrir la page de l'atelier pour le contenu NutScript ?", + vendorSellScale = "Échelle de Prix de Vente", + vendorNoTrade = "Vous ne pouvez pas commercer avec ce vendeur.", + vendorNoMoney = "Ce vendeur ne peut pas se permettre cet objet.", + vendorNoStock = "Ce vendeur n'a pas cet objet en stock.", + contentTitle = "Contenu de NutScript Manquant", + contentWarning = "Vous n'avez pas le contenu de NutScript installé. Cela peut entraîner l'absence de certaines fonctionnalités.\nL'adresse du contenu Nutscript a été modifiée pour celle de rebel1324.\nSouhaitez-vous ouvrir la page Workshop pour le contenu NutScript ?", flags = "Drapeaux", - chooseTip = "Choisissez ce personnage pour jouer avec lui.", + chooseTip = "Choisissez ce personnage pour jouer.", deleteTip = "Supprimez ce personnage.", - moneyLeft = "Votre argent : ", - currentMoney = "Argent restant : ", - + moneyLeft = "Votre Argent : ", + currentMoney = "Argent Restant : ", -- 2018 patch - - ammoLoadAll = "Tout charger", + ammoLoadAll = "Tout Charger", ammoLoadAmount = "Charger %s", - ammoLoadCustom = "Chargement...", + ammoLoadCustom = "Charger...", split = "Diviser", - splitHelp = "Saisissez un nombre pour diviser.", - splitHalf = "Diviser 1/2", - splitQuarter = "Diviser 1/4", + splitHelp = "Entrez un nombre pour diviser.", + splitHalf = "Diviser par 2", + splitQuarter = "Diviser par 4", recognize = "Permettez à ce personnage de vous reconnaître.", - recognized = "Tu as donné ton identité à ce personnage.", + recognized = "Vous avez donné votre identité à ce personnage.", already_recognized = "Ce personnage vous connaît déjà.", - isTied = "Cette personne a été attachée.", + isTied = "Cette personne est attachée.", tying = "Attachement", untying = "Détachement", - beingUntied = "Tu as été détaché.", - beingTied = "Tu as été attaché.", + beingUntied = "Vous êtes en train d'être détaché.", + beingTied = "Vous êtes en train d'être attaché.", sameOutfitCategory = "Vous portez déjà ce type de tenue.", noBusiness = "Vous n'êtes pas autorisé à acheter quoi que ce soit pour le moment.", - panelRemoved = "Vous avez supprimé %s interfaces 3D.", - panelAdded = "Vous avez ajouté une interface 3D.", - itemOnGround = "Votre article a été placé sur le sol.", - forbiddenActionStorage = "Vous ne pouvez pas faire cette action avec un objet stocké.", - cantDropBagHasEquipped = "Vous ne pouvez pas déposer un sac qui a un objet équipé.", - + panelRemoved = "Vous avez supprimé %s panneau(x) 3D.", + panelAdded = "Vous avez ajouté un panneau 3D.", + itemOnGround = "Votre objet a été placé sur le sol.", + forbiddenActionStorage = "Vous ne pouvez pas effectuer cette action avec un objet stocké.", + cantDropBagHasEquipped = "Vous ne pouvez pas lâcher un sac contenant un objet équipé.", -- 2021 patch - lookToUseAt = "Vous devez regarder quelqu'un pour utiliser '@'.", + lookToUseAt = "Vous devez regarder quelqu'un pour utiliser '@'", mustProvideString = "Vous devez fournir une chaîne de caractères pour la variable", + -- 2023 patch + togglePluginsDesc = "Les plugins sélectionnés seront désactivés.\nLa carte doit être redémarrée après avoir apporté des modifications !", } diff --git a/gamemode/languages/sh_german.lua b/gamemode/languages/sh_german.lua new file mode 100644 index 00000000..d7c7e832 --- /dev/null +++ b/gamemode/languages/sh_german.lua @@ -0,0 +1,266 @@ +NAME = "Deutsch" + +LANGUAGE = { + loading = "Lade", + dbError = "Datenbankverbindung fehlgeschlagen", + unknown = "Unbekannt", + noDesc = "Keine Beschreibung verfügbar", + create = "Erstellen", + createTip = "Erstelle einen neuen Charakter, um zu spielen.", + load = "Laden", + loadTip = "Wähle einen zuvor erstellten Charakter zum Spielen aus.", + leave = "Verlassen", + leaveTip = "Verlasse den aktuellen Server.", + ["return"] = "Zurück", + returnTip = "Zurück zum vorherigen Menü.", + name = "Name", + desc = "Beschreibung", + model = "Modell", + attribs = "Attribute", + charCreateTip = "Fülle die unten stehenden Felder aus und klicke auf 'Fertig', um deinen Charakter zu erstellen.", + invalid = "Du hast eine ungültige %s angegeben", + descMinLen = "Deine Beschreibung muss mindestens %d Zeichen lang sein.", + player = "Spieler", + finish = "Fertigstellen", + finishTip = "Beende die Charaktererstellung.", + needModel = "Du musst ein gültiges Modell auswählen", + creating = "Dein Charakter wird erstellt...", + unknownError = "Ein unbekannter Fehler ist aufgetreten", + delConfirm = "Bist du sicher, dass du %s dauerhaft löschen möchtest?", + no = "Nein", + yes = "Ja", + itemInfo = "Name: %s\nBeschreibung: %s", + itemCreated = "Gegenstand erfolgreich erstellt.", + cloud_no_repo = "Das angegebene Repository ist ungültig.", + cloud_no_plugin = "Das angegebene Plugin ist ungültig.", + inv = "Inventar", + plugins = "Plugins", + togglePlugins = "Plugins umschalten", + author = "Autor", + version = "Version", + characters = "Charaktere", + settings = "Einstellungen", + config = "Konfiguration", + chat = "Chat", + appearance = "Erscheinung", + misc = "Verschiedenes", + oocDelay = "Du musst noch %s Sekunde(n) warten, bevor du OOC erneut verwenden kannst.", + loocDelay = "Du musst noch %s Sekunde(n) warten, bevor du LOOC erneut verwenden kannst.", + usingChar = "Du verwendest bereits diesen Charakter.", + itemNoExist = "Entschuldigung, der angeforderte Gegenstand existiert nicht.", + cmdNoExist = "Entschuldigung, dieser Befehl existiert nicht.", + plyNoExist = "Entschuldigung, es konnte kein passender Spieler gefunden werden.", + cfgSet = "%s hat \"%s\" auf %s gesetzt.", + drop = "Ablegen", + dropTip = "Diesen Gegenstand aus deinem Inventar ablegen.", + take = "Nehmen", + takeTip = "Diesen Gegenstand nehmen und in dein Inventar legen.", + dTitle = "Unbesitzte Tür", + dTitleOwned = "Gekaufte Tür", + dIsNotOwnable = "Diese Tür kann nicht besessen werden.", + dIsOwnable = "Du kannst diese Tür durch Drücken von F2 kaufen.", + dMadeUnownable = "Du hast diese Tür unbesitzbar gemacht.", + dMadeOwnable = "Du hast diese Tür besitzbar gemacht.", + dNotAllowedToOwn = "Du darfst diese Tür nicht besitzen.", + dSetDisabled = "Du hast diese Tür deaktiviert.", + dSetNotDisabled = "Du hast diese Tür nicht mehr deaktiviert.", + dSetHidden = "Du hast diese Tür versteckt.", + dSetNotHidden = "Du hast diese Tür nicht mehr versteckt.", + dSetParentDoor = "Du hast diese Tür als Elterntür festgelegt.", + dCanNotSetAsChild = "Du kannst die Elterntür nicht als Kind festlegen.", + dAddChildDoor = "Du hast diese Tür als Kind hinzugefügt.", + dRemoveChildren = "Du hast alle Kinder für diese Tür entfernt.", + dRemoveChildDoor = "Du hast diese Tür als Kind entfernt.", + dNoParentDoor = "Du hast keine Elterntür festgelegt.", + dOwnedBy = "Diese Tür gehört %s.", + dConfigName = "Türen", + dSetFaction = "Diese Tür gehört jetzt zur Fraktion %s.", + dRemoveFaction = "Diese Tür gehört jetzt keiner Fraktion mehr.", + dNotValid = "Du schaust keine gültige Tür an.", + canNotAfford = "Du kannst dir den Kauf dieses Gegenstands nicht leisten.", + dPurchased = "Du hast diese Tür für %s gekauft.", + dSold = "Du hast diese Tür für %s verkauft.", + notOwner = "Du bist nicht der Besitzer davon.", + invalidArg = "Du hast einen ungültigen Wert für das Argument #%s angegeben.", + flagGive = "%s hat %s '%s' Flags gegeben.", + flagGiveTitle = "Flags geben", + flagGiveDesc = "Gib dem Spieler die folgenden Flags.", + flagTake = "%s hat '%s' Flags von %s genommen.", + flagTakeTitle = "Flags entfernen", + flagTakeDesc = "Nimm dem Spieler die folgenden Flags weg.", + flagNoMatch = "Du musst \"%s\" Flag(s) haben, um diese Aktion auszuführen.", + textAdded = "Du hast einen Text hinzugefügt.", + textRemoved = "Du hast %s Text(e) entfernt.", + moneyTaken = "Du hast %s gefunden.", + businessPurchase = "Du hast %s für %s gekauft.", + businessSell = "Du hast %s für %s verkauft.", + cChangeModel = "%s hat %s Modell zu %s geändert.", + cChangeName = "%s hat %s Namen zu %s geändert.", + cChangeSkin = "%s hat %s Skin zu %s geändert.", + cChangeGroups = "%s hat %s \"%s\" Bodygroup zu %s geändert.", + cChangeFaction = "%s hat %s zur Fraktion %s transferiert.", + playerCharBelonging = "Dieses Objekt gehört deinem anderen Charakter.", + business = "Geschäft", + invalidFaction = "Du hast eine ungültige Fraktion angegeben.", + limitFaction = "Diese Fraktion ist voll. Versuche es später erneut.", + spawnAdd = "Du hast einen Spawnpunkt für %s hinzugefügt.", + spawnDeleted = "Du hast %s Spawnpunkt(e) entfernt.", + someone = "Jemand", + rgnLookingAt = "Erlaube der Person, die du ansiehst, dich zu erkennen.", + rgnWhisper = "Erlaube denen in Flüsternähe, dich zu erkennen.", + rgnTalk = "Erlaube denen in Sprechnähe, dich zu erkennen.", + rgnYell = "Erlaube denen in Schreiweite, dich zu erkennen.", + icFormat = "%s sagt \"%s\"", + rollFormat = "%s hat %s geworfen.", + wFormat = "%s flüstert \"%s\"", + yFormat = "%s schreit \"%s\"", + sbOptions = "Klicke, um Optionen für %s zu sehen.", + spawnAdded = "Du hast einen Spawnpunkt für %s hinzugefügt.", + whitelist = "%s hat %s für die Fraktion %s auf die Whitelist gesetzt.", + unwhitelist = "%s hat %s von der Whitelist der Fraktion %s entfernt.", + gettingUp = "Du stehst jetzt auf...", + wakingUp = "Du kommst langsam wieder zu Bewusstsein...", + Weapons = "Waffen", + checkout = "Zur Kasse gehen (%s)", + purchase = "Kaufen", + purchasing = "Kaufe...", + success = "Erfolg", + buyFailed = "Kauf fehlgeschlagen.", + buyGood = "Kauf erfolgreich!", + shipment = "Lieferung", + shipmentDesc = "Diese Lieferung gehört zu %s.", + class = "Klasse", + classes = "Klassen", + illegalAccess = "Illegale Zugriffe.", + becomeClassFail = "Fehler beim Wechsel zu %s.", + becomeClass = "Du bist jetzt %s.", + attribSet = "Du hast %s's %s auf %s gesetzt.", + attribUpdate = "Du hast %s's %s um %s erhöht.", + noFit = "Dieser Gegenstand passt nicht in dein Inventar.", + help = "Hilfe", + commands = "Befehle", + helpDefault = "Wähle eine Kategorie", + doorSettings = "Tür-Einstellungen", + sell = "Verkaufen", + access = "Zugriff", + locking = "Sperre dieses Objekt...", + unlocking = "Entsperre dieses Objekt...", + modelNoSeq = "Dein Modell unterstützt diese Aktion nicht.", + notNow = "Du darfst das gerade nicht tun.", + faceWall = "Du musst zur Wand schauen, um dies zu tun.", + faceWallBack = "Dein Rücken muss zur Wand zeigen, um dies zu tun.", + descChanged = "Du hast die Beschreibung deines Charakters geändert.", + charMoney = "Du hast derzeit %s.", + charFaction = "Du bist Mitglied der Fraktion %s.", + charClass = "Du bist %s der Fraktion.", + noSpace = "Inventar ist voll.", + noOwner = "Der Besitzer ist ungültig.", + notAllowed = "Diese Aktion ist nicht erlaubt.", + invalidIndex = "Der Gegenstandsindex ist ungültig.", + invalidItem = "Das Gegenstandsobjekt ist ungültig.", + invalidInventory = "Das Inventarobjekt ist ungültig.", + home = "Zuhause", + charKick = "%s hat Charakter %s gekickt.", + charBan = "%s hat den Charakter %s gebannt.", + charBanned = "Dieser Charakter ist gebannt.", + setMoney = "Du hast %s's Geld auf %s gesetzt.", + itemPriceInfo = "Du kannst diesen Gegenstand für %s kaufen.\nDu kannst diesen Gegenstand für %s verkaufen", + free = "Kostenlos", + vendorNoSellItems = "Es gibt keine Gegenstände zum Verkauf.", + vendorNoBuyItems = "Es gibt keine Gegenstände zum Kauf.", + vendorSettings = "Verkäufer-Einstellungen", + vendorUseMoney = "Soll der Verkäufer Geld verwenden?", + vendorNoBubble = "Verkäufer-Bubble ausblenden?", + mode = "Modus", + price = "Preis", + stock = "Lagerbestand", + none = "Keine", + vendorBoth = "Kaufen und Verkaufen", + vendorBuy = "Nur Kaufen", + vendorSell = "Nur Verkaufen", + maxStock = "Maximaler Lagerbestand", + vendorFaction = "Fraktions-Editor", + buy = "Kaufen", + vendorWelcome = "Willkommen in meinem Geschäft, was kann ich für dich tun?", + vendorBye = "Komm bald wieder!", + charSearching = "Du suchst bereits nach einem anderen Charakter, bitte warte.", + charUnBan = "%s hat den Charakter %s entbannt.", + charNotBanned = "Dieser Charakter ist nicht gebannt.", + storPass = "Du hast das Passwort für diesen Speicher auf %s gesetzt.", + storPassRmv = "Du hast das Passwort für diesen Speicher entfernt.", + storPassWrite = "Gib das Passwort ein.", + wrongPassword = "Du hast ein falsches Passwort eingegeben.", + cheapBlur = "Unschärfe deaktivieren? (Erhöht FPS)", + quickSettings = "Schnelleinstellungen", + vmSet = "Du hast deine Voicemail festgelegt.", + vmRem = "Du hast deine Voicemail entfernt.", + altLower = "Hände verstecken, wenn sie gesenkt sind?", + noPerm = "Du darfst das nicht tun.", + youreDead = "Du bist tot", + injMajor = "Scheint schwer verletzt zu sein.", + injLittle = "Scheint verletzt zu sein", + toggleObserverTP = "Beobachter-Teleport umschalten", + toggleESP = "Admin ESP umschalten", + toggleESPAdvanced = "ESP Erweiterter Modus", + chgName = "Namen ändern", + chgNameDesc = "Gib den neuen Namen des Charakters unten ein.", + thirdpersonToggle = "Dritte Person umschalten", + thirdpersonClassic = "Klassische dritte Person verwenden", + thirdpersonConfig = "Dritte Person Konfiguration", + equippedBag = "Ausgerüstete Gegenstände können nicht zwischen Inventaren verschoben werden.", + useTip = "Verwendet den Gegenstand.", + equipTip = "Rüstet den Gegenstand aus.", + unequipTip = "Rüstet den Gegenstand ab.", + consumables = "Verbrauchsgüter", + plyNotValid = "Du schaust keinen gültigen Spieler an.", + restricted = "Du wurdest eingeschränkt.", + viewProfile = "Steam-Profil anzeigen", + salary = "Du hast %s von deinem Gehalt erhalten.", + noRecog = "Du erkennst diese Person nicht.", + curTime = "Die aktuelle Zeit ist %s.", + vendorEditor = "Verkäufer-Editor", + edit = "Bearbeiten", + disable = "Deaktivieren", + vendorPriceReq = "Gib den neuen Preis für diesen Gegenstand ein.", + vendorEditCurStock = "Aktuellen Lagerbestand bearbeiten", + you = "Du", + vendorSellScale = "Verkaufspreisskala", + vendorNoTrade = "Du kannst nicht mit diesem Verkäufer handeln.", + vendorNoMoney = "Dieser Verkäufer kann sich diesen Gegenstand nicht leisten.", + vendorNoStock = "Dieser Verkäufer hat diesen Gegenstand nicht auf Lager.", + contentTitle = "NutScript Inhalt fehlt", + contentWarning = "Du hast den NutScript Inhalt nicht installiert. Dies kann dazu führen, dass bestimmte Funktionen fehlen.\nDie Adresse des Nutscript-Inhalts wurde zu rebel1324 geändert.\nMöchtest du die Workshop-Seite für den NutScript-Inhalt öffnen?", + flags = "Flags", + chooseTip = "Wähle diesen Charakter zum Spielen.", + deleteTip = "Lösche diesen Charakter.", + moneyLeft = "Dein Geld: ", + currentMoney = "Verbleibendes Geld: ", + -- 2018 patch + ammoLoadAll = "Alle laden", + ammoLoadAmount = "%s laden", + ammoLoadCustom = "Laden...", + split = "Teilen", + splitHelp = "Gib eine Zahl zum Teilen ein.", + splitHalf = "Hälfte teilen", + splitQuarter = "Viertel teilen", + recognize = "Erlaube diesem Charakter, dich zu erkennen.", + recognized = "Du hast diesem Charakter deine Identität gegeben.", + already_recognized = "Dieser Charakter kennt dich bereits.", + isTied = "Diese Person wurde gefesselt.", + tying = "Binden", + untying = "Entfesseln", + beingUntied = "Du wirst entfesselt.", + beingTied = "Du wirst gefesselt.", + sameOutfitCategory = "Du trägst bereits diese Art von Kleidung.", + noBusiness = "Du darfst gerade nichts kaufen.", + panelRemoved = "Du hast %s 3D-Panels entfernt.", + panelAdded = "Du hast ein 3D-Panel hinzugefügt.", + itemOnGround = "Dein Gegenstand wurde auf den Boden gelegt.", + forbiddenActionStorage = "Du kannst diese Aktion nicht mit gelagertem Gegenstand durchführen.", + cantDropBagHasEquipped = "Du kannst die Tasche nicht ablegen, solange ein ausgerüsteter Gegenstand darin ist.", + -- 2021 patch + lookToUseAt = "Du musst jemanden anschauen, um '@' zu verwenden.", + mustProvideString = "Du musst eine Zeichenfolge für die Variable angeben", + -- 2023 patch + togglePluginsDesc = "Ausgewählte Plugins werden deaktiviert.\nDie Karte muss nach den Änderungen neu gestartet werden!", +} diff --git a/gamemode/languages/sh_korean.lua b/gamemode/languages/sh_korean.lua index 0174f454..f3a10035 100644 --- a/gamemode/languages/sh_korean.lua +++ b/gamemode/languages/sh_korean.lua @@ -1,256 +1,273 @@ NAME = "한국어" LANGUAGE = { - loading = "불러오는 중", - dbError = "DB 서버 연결 실패", - unknown = "알 수 없음", - noDesc = "정보가 존재하지 않습니다.", - create = "생성", - createTip = "새로운 캐릭터를 생성합니다.", - load = "계속", - loadTip = "플레이할 캐릭터를 불러옵니다.", - leave = "종료", - leaveTip = "서버에서 퇴장합니다.", - ["return"] = "뒤로", - returnTip = "이전 메뉴로 돌아갑니다.", - name = "이름", - desc = "정보", - model = "외관", - attribs = "능력", - charCreateTip = "빈칸들을 채우고 아래 '완료' 버튼을 눌러 캐릭터를 생성하십시오.", - invalid = "다음 정보가 존재하지 않습니다: %s", - descMinLen = "정보는 적어도 %d 자 이상이어야 합니다.", - model = "외관", - player = "플레이어", - finish = "완료", - finishTip = "캐릭터 생성을 완료합니다.", - needModel = "올바른 외관을 선택하여야 합니다.", - creating = "캐릭터를 생성중입니다...", - unknownError = "오류가 발생하였습니다.", - delConfirm = "%s 영구히 완전히 삭제합니까?", - no = "아니오", - yes = "예", - itemInfo = "이름: %s\n정보: %s", - cloud_no_repo = "클라우드 경로가 존재하지 않습니다.", - cloud_no_plugin = "클라우드 추가 기능이 존재하지 않습니다.", - inv = "인벤토리", - plugins = "추가 기능", - author = "제작자", - version = "버전", - characters = "캐릭터", - business = "사업", - settings = "설정", - config = "설정", - chat = "대화", - appearance = "외관", - misc = "기타", - oocDelay = "%s 초를 더 기다려야 OOC 대화가 가능합니다.", - loocDelay = "%s 초를 더 기다려야 LOOC 대화가 가능합니다.", - usingChar = "이미 이 캐릭터로 서버에서 플레이하고 있습니다.", - notAllowed = "당신은 이것을 할 권한이 없습니다.", - itemNoExist = "당신이 요청한 아이템은 존재하지 않습니다.", - cmdNoExist = "당신이 요청한 명령은 존재하지 않습니다.", - plyNoExist = "그 이름을 가진 플레이어를 검색할 수 없습니다.", - cfgSet = "%s 님이 \"%s\" 를 %s 으로 설정하였습니다.", - drop = "버리기", - dropTip = "아이템을 소지품에서 제외시킵니다.", - take = "가지기", - takeTip = "아이템을 소지품에 추가시킵니다.", - dTitle = "소유되지 않은 문", - dTitleOwned = "소유된 문", - dIsNotOwnable = "이 문은 소유할 수 없습니다.", - dIsOwnable = "F2를 눌러서 이 문을 소유할 수 있습니다.", - dMadeUnownable = "당신은 이 문을 소유할 수 없도록 설정했습니다.", - dMadeOwnable = "당신은 이 문을을 소유할 수 있도록 설정했습니다.", - dNotAllowedToOwn = "이 문을 소유하도록 허가되지 않았습니다.", - dSetDisabled = "당신은 이 문의 기능을 껐습니다.", - dSetNotDisabled = "당신은 이 문의 기능을 다시 켰습니다.", - dSetHidden = "당신은 이 문을 숨겼습니다.", - dSetNotHidden = "당신은 이 문을 숨김 해제했습니다.", - dSetParentDoor = "당신은 이 문을 상위 개체로 설정하였습니다.", - dCanNotSetAsChild = "당신은 이 문을 하위 개체로 설정할 수 없습니다.", - dAddChildDoor = "당신은 이 문을 하위 개체로 설정하였습니다.", - dRemoveChildren = "당신은 이 문에 할당된 모든 하위 개체를 삭제했습니다.", - dRemoveChildDoor = "당신은 이 문을 하위 개체에서 삭제했습니다.", - dNoParentDoor = "상위 개체인 문이 없습니다.", - dOwnedBy = "이 문은 %s 님의 소유입니다.", - dConfigName = "문", - dSetFaction = "이 문은 이제 %s 단체에 속하게 됩니다.", - dRemoveFaction = "이 문은 이제 어느 단체에도 속하지 않습니다.", - dNotValid = "유효한 문을 바라보고 있어야 합니다.", - canNotAfford = "이 문을 구매할 충분한 자금을 가지고 있지 않습니다.", - dPurchased = "이 문을 %s으로 구매했습니다.", - dSold = "당신은 이 문을 %s으로 판매했습니다.", - notOwner = "당신은 이 문을 소유하고 있지 않습니다.", - invalidArg = "#%s 번째 명령 변수에 올바른 값을 입력해야 합니다.", - invalidFaction = "제시된 이름으로 된 단체를 찾을 수 없습니다.", - flagGive = "%s 님이 %s 님에게 '%s' 권한을 주었습니다.", - flagGiveTitle = "권한 주기", - flagGiveDesc = "이 권한들을 플레이어에게 줍니다.", - flagTake = "%s 님이 '%s' 권한을 %s 님으로 부터 받았습니다.", - flagTakeTitle = "플래그 가지기.", - flagTakeDesc = "이 권한들을 플레이어에게서 뺏습니다.", - flagNoMatch = "이 행동은 \"%s\" 권한을 필요로 합니다.", - textAdded = "텍스트를 추가하였습니다.", - textRemoved = "%s개의 택스트를 삭제하였습니다.", - moneyTaken = "%s 발견.", - businessPurchase = "당신은 %s 을/를 %s에 구매하였습니다.", - businessSell = "당신은 %s 을/를 %s에 판매했습니다.", - cChangeModel = "%s님이 %s님의 외관을 교체했습니다: %s.", - cChangeName = "%s님이 %s님의 이름을 교체했습니다: %s.", - cChangeSkin = "%s 가 %s's 의 스킨을 %s 로 바꾸었습니다.", - cChangeGroups = "%s 가 %s 의 \"%s\" 바디그룹을 %s 로 바꾸었습니다.", - cChangeFaction = "%s 는 %s 를 %s 팩션으로 이동시켰습니다.", - playerCharBelonging = "이 물건은 당신의 다른 캐릭터의 물건입니다.", - business = "사업", - invalidFaction = "당신은 잘못된 단체를 참조했습니다.", - spawnAdd = "%s 개의 시작지점을 추가하였습니다.", - spawnDeleted = "%s개의 시작지점을 삭제하였습니다.", - someone = "누군가", - rgnLookingAt = "당신이 보고 있는 사람이 당신을 인식하도록 선언.", - rgnWhisper = "귓속말 거리에 있는 사람을 당신을 인식하도록 선언", - rgnTalk = "일반 대화 거리에 있는 사람을 당신을 인식하도록 선언", - rgnYell = "외침 대화 거리에 있는 사람을 당신을 인식하도록 선언", - icFormat = "%s: \"%s\"", - rollFormat = "%s님이 주사위를 굴렸습니다: %s.", - wFormat = "%s(귓속말): \"%s\"", - yFormat = "%s(외침): \"%s\"", - sbOptions = "%s님에 대한 선택지를 보려면 클릭하십시오.", - spawnAdded = "%s 단체를 위한 시작 지점이 추가되었습니다.", - whitelist = "%s님이 %s님을 %s 단체에 들어가도록 허가했습니다.", - unwhitelist = "%s님이 %s님을 %s 단체에 들어가는 것을 금지했습니다.", - gettingUp = "몸을 일으키는 중입니다...", - wakingUp = "정신을 차리는 중입니다...", - Weapons = "무기", - checkout = "물건 결제 (%s)", - purchase = "구매", - purchasing = "결제 진행중...", - success = "성공", - buyFailed = "결제 실패.", - buyGood = "결제가 완료되었습니다!", - shipment = "소유물", - shipmentDesc = "이 소유물은 %s님의 명의로 되어있습니다.", - class = "직업", - classes = "직업", - illegalAccess = "잘못된 접근입니다.", - becomeClassFail = "%s이/가 되는 것에 실패했습니다.", - becomeClass = "%s이/가 되었습니다.", - attribSet = "당신은 %s님의 %s을/를 %s로 설정하였습니다.", - attribUpdate = "당신은 %s님의 %s을/를 %s만큼 추가하였습니다.", - noFit = "소지품 공간이 부족합니다.", - help = "도움말", - commands = "명령어", - helpDefault = "목차 선택", - doorSettings = "문 설정", - sell = "판매", - access = "접근", - locking = "이 물건을 잠그는 중입니다...", - unlocking = "이 물건을 여는 중입니다...", - modelNoSeq = "당신의 외관은 이 행동을 지원하지 않습니다.", - notNow = "당신은 아직 이 행동을 할 수 없습니다.", - faceWall = "이 행동을 위해선 벽을 바라보고 있어야 합니다.", - faceWallBack = "이 행동을 위해선 벽을 등지고 있어야 합니다.", - descChanged = "당신의 캐릭터의 정보를 변경했습니다.", - charMoney = "당신의 소지금은 %s 입니다.", - charFaction = "당신은 %s 단체에 소속되어 있습니다.", - charClass = "당신은 이 단체의 %s 입니다.", - noSpace = "소지품이 가득 찼습니다.", - noOwner = "소유자가 존재하지 않습니다.", - notAllowed = "이 행동을 허가되지 않았습니다.", - invalidIndex = "아이템의 구분 번호가 올바르지 않습니다.", - invalidItem = "아이템 객체 참조가 잘못되었습니다.", - invalidInventory = "소지품 객체 참조가 잘못되었습니다.", - home = "초기", - charKick = "%s님이 %s님의 캐릭터를 추방하였습니다.", - charBan = "%s님이 %s님의 캐릭터를 영구히 추방하였습니다.", - charBanned = "이 캐릭터는 사용이 금지되었습니다.", - setMoney = "당신은 %s님의 돈을 %s으로 설정하였습니다.", - itemPriceInfo = "이 아이템을 %s에 구매가 가능합니다.\n이 아이템을 %s에 판매가 가능합니다", - free = "무료", - vendorNoSellItems = "판매할 아이템이 없습니다.", - vendorNoBuyItems = "구매할 아이템이 없습니다.", - vendorSettings = "상인 설정", - vendorUseMoney = "상인에 제한된 돈", - vendorNoBubble = "말풍선 보이기", - mode = "상태", - price = "가격", - stock = "재고", - none = "없음", - vendorBoth = "판매와 구매", - vendorBuy = "구매 전용", - vendorSell = "판매 전용", - maxStock = "최대 재고", - vendorFaction = "팩션 에디터", - buy = "구매", - vendorWelcome = "어서오세요. 무엇을 찾으십니까?", - vendorBye = "다음에 또 오세요!", - charSearching = "이미 캐릭터를 수색하고 있습니다.", - charUnBan = "%s 님이 다음 캐릭터를 금지 해제했습니다: %s.", - charNotBanned = "이 캐릭터는 금지되지 않았습니다.", - storPass = "이 보관함의 암호를 %s 으로 설정하였습니다.", - storPassRmv = "이 보관함의 암호를 삭제했습니다.", - storPassWrite = "암호를 입력해 주십시오.", - wrongPassword = "암호가 다릅니다.", - cheapBlur = "블러 효과 사용 (FPS 향상)", - quickSettings = "빠른 설정", - vmSet = "개인 귓속말을 설정했습니다.", - vmRem = "개인 귓속말을 삭제했습니다.", - altLower = "주먹 미사용시 숨김", - noPerm = "이 행위를 할 권한이 없습니다.", - youreDead = "당신은 죽었습니다", - injMajor = "중상을 입음.", - injLittle = "부상을 입음.", - toggleESP = "어드민 월핵 사용", - chgName = "이름 변경", - chgNameDesc = "아래에 캐릭터의 새로운 이름을 입력하세요.", - thirdpersonToggle = "3인칭 사용", - thirdpersonClassic = "클래식 3인칭 사용", - equippedBag = "가방 내부에 사용중인 아이템이 있습니다.", - useTip = "이 아이템을 사용합니다.", - equipTip = "이 아이템을 착용합니다.", - unequipTip = "이 아이템을 착용해제합니다.", - consumables = "소모품", - plyNotValid = "당신은 잘못된 플레이어를 보고 있습니다.", - restricted = "당신은 저지되었습니다.", - viewProfile = "스팀 프로필 보기", - salary = "당신은 &s 만큼의 돈을 봉급으로 받았습니다.", - noRecog = "당신은 이 사람을 인식하지 않았습니다.", - curTime = "지금 시각은 %s.", - vendorEditor = "상인 수정", - edit = "수정", - disable = "해제", - vendorPriceReq = "이 물품의 새로운 가격을 적으십시오.", - vendorEditCurStock = "현재 재고 수정", - you = "당신", - vendorSellScale = "판매 가격 규모", - vendorNoTrade = "당신은 이 상인과 거래할 수 없습니다.", - vendorNoMoney = "이 상인은 해당 물품을 사들일 수 없습니다.", - vendorNoStock = "이 상인은 해당 물품의 재고가 없습니다.", - contentTitle = "NutScript 콘텐츠 없음.", - contentWarning = "당신은 NutScript 콘텐츠가 적용되어있지 않습니다. 특정 기능이 누락될 수 있습니다.\nNutscipt 콘텐츠를 적용해야 합니다.", - flags = "플래그", + LANGUAGE = { + loading = "로딩 중", + dbError = "데이터베이스 연결 실패", + unknown = "알 수 없음", + noDesc = "설명 없음", + create = "생성", + createTip = "새로운 캐릭터를 생성합니다.", + load = "불러오기", + loadTip = "이전에 생성한 캐릭터를 선택하여 플레이합니다.", + leave = "나가기", + leaveTip = "현재 서버에서 나갑니다.", + ["return"] = "돌아가기", + returnTip = "이전 메뉴로 돌아갑니다.", + name = "이름", + desc = "설명", + model = "모델", + attribs = "속성", + charCreateTip = "아래 필드를 작성하고 '완료'를 눌러 캐릭터를 생성합니다.", + invalid = "%s를 잘못 입력하셨습니다.", + descMinLen = "설명은 최소 %d자 이상이어야 합니다.", + player = "플레이어", + finish = "완료", + finishTip = "캐릭터 생성을 완료합니다.", + needModel = "올바른 모델을 선택해야 합니다.", + creating = "캐릭터 생성 중...", + unknownError = "알 수 없는 오류가 발생했습니다.", + delConfirm = "%s을(를) 영구적으로 삭제하시겠습니까?", + no = "아니오", + yes = "예", + itemInfo = "이름: %s\n설명: %s", + itemCreated = "아이템을 성공적으로 생성했습니다.", + cloud_no_repo = "제공된 저장소가 유효하지 않습니다.", + cloud_no_plugin = "제공된 플러그인이 유효하지 않습니다.", + inv = "인벤토리", + plugins = "플러그인", + togglePlugins = "플러그인 활성화/비활성화", + author = "작성자", + version = "버전", + characters = "캐릭터", + settings = "설정", + config = "구성", + chat = "채팅", + appearance = "외모", + misc = "기타", + oocDelay = "OOC를 다시 사용하려면 %s 초를 더 기다려야 합니다.", + loocDelay = "LOOC를 다시 사용하려면 %s 초를 더 기다려야 합니다.", + usingChar = "이미 이 캐릭터를 사용하고 있습니다.", + itemNoExist = "죄송합니다, 요청한 아이템이 존재하지 않습니다.", + cmdNoExist = "죄송합니다, 해당 명령어가 존재하지 않습니다.", + plyNoExist = "죄송합니다, 일치하는 플레이어를 찾을 수 없습니다.", + cfgSet = "%s님이 \"%s\"를 %s(으)로 설정하였습니다.", + drop = "버리기", + dropTip = "인벤토리에서 이 아이템을 버립니다.", + take = "가져가기", + takeTip = "이 아이템을 가져와서 인벤토리에 넣습니다.", + dTitle = "소유되지 않은 문", + dTitleOwned = "구매된 문", + dIsNotOwnable = "이 문은 소유할 수 없습니다.", + dIsOwnable = "F2를 눌러 이 문을 구매할 수 있습니다.", + dMadeUnownable = "이 문을 소유할 수 없게 만들었습니다.", + dMadeOwnable = "이 문을 소유할 수 있게 만들었습니다.", + dNotAllowedToOwn = "이 문을 소유할 권한이 없습니다.", + dSetDisabled = "이 문을 비활성화했습니다.", + dSetNotDisabled = "이 문을 더 이상 비활성화하지 않았습니다.", + dSetHidden = "이 문을 숨김 처리했습니다.", + dSetNotHidden = "이 문을 더 이상 숨김 처리하지 않았습니다.", + dSetParentDoor = "이 문을 상위 문으로 설정했습니다.", + dCanNotSetAsChild = "상위 문을 하위로 설정할 수 없습니다.", + dAddChildDoor = "이 문을 하위로 추가했습니다.", + dRemoveChildren = "이 문의 모든 하위 문을 제거했습니다.", + dRemoveChildDoor = "이 문을 하위 문에서 제거했습니다.", + dNoParentDoor = "상위 문이 설정되지 않았습니다.", + dOwnedBy = "이 문은 %s 소유입니다.", + dConfigName = "문", + dSetFaction = "이 문은 이제 %s 팩션에 속합니다.", + dRemoveFaction = "이 문은 더 이상 어떤 팩션에도 속하지 않습니다.", + dNotValid = "유효한 문을 보고 있지 않습니다.", + canNotAfford = "이것을 구매할 돈이 부족합니다.", + dPurchased = "이 문을 %s에게 구매했습니다.", + dSold = "이 문을 %s에게 판매했습니다.", + notOwner = "이것의 소유자가 아닙니다.", + invalidArg = "인수 #%s에 대한 잘못된 값이 제공되었습니다.", + flagGive = "%s님이 %s에게 '%s' 플래그를 부여하였습니다.", + flagGiveTitle = "플래그 부여", + flagGiveDesc = "다음의 플래그를 플레이어에게 부여합니다.", + flagTake = "%s님이 %s로부터 '%s' 플래그를 제거하였습니다.", + flagTakeTitle = "플래그 제거", + flagTakeDesc = "플레이어로부터 다음의 플래그를 제거합니다.", + flagNoMatch = "이 작업을 수행하려면 \"%s\" 플래그가 필요합니다.", + textAdded = "텍스트를 추가했습니다.", + textRemoved = "%s개의 텍스트를 제거했습니다.", + moneyTaken = "%s를 찾았습니다.", + businessPurchase = "%s을(를) %s에게 구매했습니다.", + businessSell = "%s을(를) %s에게 판매했습니다.", + cChangeModel = "%s님이 %s의 모델을 %s(으)로 변경하였습니다.", + cChangeName = "%s님이 %s의 이름을 %s(으)로 변경하였습니다.", + cChangeSkin = "%s님이 %s의 스킨을 %s(으)로 변경하였습니다.", + cChangeGroups = "%s님이 %s의 \"%s\" 바디그룹을 %s(으)로 변경하였습니다.", + cChangeFaction = "%s님이 %s을(를) %s 팩션으로 이전하였습니다.", + playerCharBelonging = "이 물건은 다른 캐릭터의 소유물입니다.", + business = "상업", + invalidFaction = "유효하지 않은 팩션을 제공하였습니다.", + limitFaction = "이 팩션은 가득 찼습니다. 나중에 다시 시도하세요.", + spawnAdd = "%s 스폰 지점을 추가하였습니다.", + spawnDeleted = "%s 스폰 지점을 삭제하였습니다.", + someone = "누군가", + rgnLookingAt = "당신을 보고 있는 사람에게 인식되도록 허용합니다.", + rgnWhisper = "속삭임 범위의 사람에게 인식되도록 허용합니다.", + rgnTalk = "말 범위의 사람에게 인식되도록 허용합니다.", + rgnYell = "외침 범위의 사람에게 인식되도록 허용합니다.", + icFormat = "%s님이 \"%s\"(을)를 말하였습니다.", + rollFormat = "%s님이 %s(을)를 굴렸습니다.", + wFormat = "%s님이 속삭임: \"%s\"", + yFormat = "%s님이 외침: \"%s\"", + sbOptions = "%s의 옵션을 보려면 클릭하세요.", + spawnAdded = "%s 스폰 지점을 추가하였습니다.", + whitelist = "%s님이 %s을(를) %s 팩션의 화이트리스트에 추가하였습니다.", + unwhitelist = "%s님이 %s을(를) %s 팩션의 화이트리스트에서 제거하였습니다.", + gettingUp = "이제 일어나는 중입니다...", + wakingUp = "의식을 회복 중입니다...", + Weapons = "무기", + checkout = "체크아웃으로 이동 (%s)", + purchase = "구매", + purchasing = "구매 중...", + success = "성공", + buyFailed = "구매 실패", + buyGood = "구매 성공!", + shipment = "출하", + shipmentDesc = "이 출하물은 %s 소유입니다.", + class = "클래스", + classes = "클래스", + illegalAccess = "불법 접근.", + becomeClassFail = "%s이(가) 되는 데 실패하였습니다.", + becomeClass = "이제 %s입니다.", + attribSet = "%s님이 %s의 %s을(를) %s으로 설정하였습니다.", + attribUpdate = "%s님이 %s의 %s을(를) %s만큼 증가하였습니다.", + noFit = "이 아이템은 인벤토리에 들어가지 않습니다.", + help = "도움말", + commands = "명령어", + helpDefault = "카테고리를 선택하세요.", + doorSettings = "문 설정", + sell = "판매", + access = "접근", + locking = "이 엔터티를 잠그는 중...", + unlocking = "이 엔터티를 열어는 중...", + modelNoSeq = "모델이 이 동작을 지원하지 않습니다.", + notNow = "현재 이 작업을 수행할 수 없습니다.", + faceWall = "이 벽을 바라보아야 합니다.", + faceWallBack = "이 벽의 뒷면을 바라보아야 합니다.", + descChanged = "캐릭터 설명을 변경하였습니다.", + charMoney = "현재 보유 금액: %s", + charFaction = "%s 팩션의 일원입니다.", + charClass = "당신은 %s 팩션의 %s입니다.", + noSpace = "인벤토리가 가득 찼습니다.", + noOwner = "소유자가 유효하지 않습니다.", + notAllowed = "이 작업은 허용되지 않습니다.", + invalidIndex = "아이템 인덱스가 유효하지 않습니다.", + invalidItem = "아이템 객체가 유효하지 않습니다.", + invalidInventory = "인벤토리 객체가 유효하지 않습니다.", + home = "홈", + charKick = "%s님이 캐릭터 %s을(를) 킥하였습니다.", + charBan = "%s님이 캐릭터 %s을(를) 밴하였습니다.", + charBanned = "이 캐릭터는 밴되었습니다.", + setMoney = "%s님이 %s의 돈을 %s으로 설정하였습니다.", + itemPriceInfo = "이 아이템을 %s에 구매하거나 %s에 판매할 수 있습니다.", + free = "무료", + vendorNoSellItems = "판매할 아이템이 없습니다.", + vendorNoBuyItems = "구매할 아이템이 없습니다.", + vendorSettings = "판매자 설정", + vendorUseMoney = "판매자가 돈을 사용해야 하나요?", + vendorNoBubble = "판매자 말풍선 숨기기?", + mode = "모드", + price = "가격", + stock = "재고", + none = "없음", + vendorBoth = "구매 및 판매", + vendorBuy = "구매 전용", + vendorSell = "판매 전용", + maxStock = "최대 재고", + vendorFaction = "팩션 에디터", + buy = "구매", + vendorWelcome = "내 가게에 오신 것을 환영합니다. 오늘 어떤 것을 드릴까요?", + vendorBye = "다음에 또 오세요!", + charSearching = "이미 다른 캐릭터를 검색 중입니다. 잠시 기다려주세요.", + charUnBan = "%s님이 캐릭터 %s의 밴을 해제하였습니다.", + charNotBanned = "이 캐릭터는 밴되지 않았습니다.", + storPass = "이 저장소의 비밀번호를 %s(으)로 설정하였습니다.", + storPassRmv = "이 저장소의 비밀번호를 제거하였습니다.", + storPassWrite = "비밀번호를 입력하세요.", + wrongPassword = "잘못된 비밀번호를 입력하였습니다.", + cheapBlur = "흐림 효과 비활성화? (FPS 상승)", + quickSettings = "빠른 설정", + vmSet = "음성 메시지를 설정하였습니다.", + vmRem = "음성 메시지를 제거하였습니다.", + altLower = "손을 숨길까요?", + noPerm = "이 작업을 수행할 권한이 없습니다.", + youreDead = "당신은 죽었습니다", + injMajor = "치명적인 상처가 있는 것 같습니다.", + injLittle = "상처를 입은 것 같습니다", + toggleObserverTP = "관전자 텔레포트 토글", + toggleESP = "관리자 ESP 토글", + toggleESPAdvanced = "ESP 고급 모드", + chgName = "이름 변경", + chgNameDesc = "아래에 캐릭터의 새 이름을 입력하세요.", + thirdpersonToggle = "서드퍼슨 토글", + thirdpersonClassic = "클래식 서드퍼슨 사용", + thirdpersonConfig = "서드퍼슨 설정", + equippedBag = "장비를 장착한 아이템은 인벤토리 간 이동이 불가능합니다.", + useTip = "아이템 사용", + equipTip = "아이템 장착", + unequipTip = "아이템 해제", + consumables = "소비품", + plyNotValid = "유효한 플레이어를 보고 있지 않습니다.", + restricted = "제한됨", + viewProfile = "스팀 프로필 보기", + salary = "당신은 월급으로 %s을(를) 받았습니다.", + noRecog = "당신은 이 사람을 인식하지 못합니다.", + curTime = "현재 시간은 %s 입니다.", + vendorEditor = "판매자 에디터", + edit = "편집", + disable = "비활성화", + vendorPriceReq = "이 아이템의 새 가격을 입력하세요.", + vendorEditCurStock = "현재 재고 편집", + you = "당신", + vendorSellScale = "판매 가격 스케일", + vendorNoTrade = "이 판매자와 거래할 수 없습니다.", + vendorNoMoney = "이 판매자는 그 아이템을 구매할 수 없습니다.", + vendorNoStock = "이 판매자는 그 아이템을 재고에 가지고 있지 않습니다.", + contentTitle = "NutScript 콘텐츠 없음", + contentWarning = "NutScript 콘텐츠를 마운트하지 않았습니다. 이로 인해 일부 기능이 누락될 수 있습니다.\nNutscript 콘텐츠의 주소가 rebel1324의 것으로 변경되었습니다.\nNutScript 콘텐츠의 워크샵 페이지를 열어보시겠습니까?", + flags = "플래그", + chooseTip = "이 캐릭터를 선택하여 플레이하세요.", + deleteTip = "이 캐릭터를 삭제하세요.", + moneyLeft = "보유 금액: ", + currentMoney = "남은 돈: ", - -- 2018 patch + -- 2018 패치 + + ammoLoadAll = "전체 장전", + ammoLoadAmount = "%s 장전", + ammoLoadCustom = "사용자 정의로 장전...", + split = "나누기", + splitHelp = "나눌 숫자를 입력하세요.", + splitHalf = "1/2 나누기", + splitQuarter = "1/4 나누기", + recognize = "이 캐릭터에게 당신을 인식하게 허용합니다.", + recognized = "이 캐릭터에게 당신의 신원을 알렸습니다.", + already_recognized = "이 캐릭터는 이미 당신을 알고 있습니다.", + isTied = "이 사람은 묶여 있습니다.", + tying = "묶는 중", + untying = "묶기 해제 중", + beingUntied = "당신은 지금 묶기가 해제되고 있습니다.", + beingTied = "당신은 지금 묶기가 되고 있습니다.", + sameOutfitCategory = "이 유형의 의상을 이미 입고 있습니다.", + noBusiness = "현재 아무것도 구매할 권한이 없습니다.", + panelRemoved = "%s 개의 3D 패널을 제거하였습니다.", + panelAdded = "3D 패널을 추가하였습니다.", + itemOnGround = "아이템이 땅에 놓였습니다.", + forbiddenActionStorage = "저장된 아이템으로는 이 작업을 수행할 수 없습니다.", + cantDropBagHasEquipped = "장비가 장착된 가방은 버릴 수 없습니다.", + + -- 2021 패치 + lookToUseAt = "사용하려면 누군가를 바라봐야 합니다.", + mustProvideString = "변수에 문자열을 제공해야 합니다.", + + -- 2023 패치 + togglePluginsDesc = "선택한 플러그인이 비활성화됩니다.\n변경 사항을 적용하려면 맵을 다시 시작해야 합니다!", + } - ammoLoadAll = "모두 사용", - ammoLoadAmount = "%s개 사용", - ammoLoadCustom = "수량 입력", - split = "나누기", - splitHelp = "나눌 수량을 입력하세요.", - splitHalf = "1/2로 나누기", - splitQuarter = "1/4로 나누기", - recognize = "이 캐릭터가 당신을 인식하도록 허용합니다.", - recognized = "이 캐릭터에게 당신을 인식하게 했습니다.", - already_recognized = "이 캐릭터는 이미 당신을 인식했습니다.", - isTied = "이 사람은 손이 묶여 있습니다.", - tying = "묶는 중", - untying = "풀어주는 중", - beingUntied = "당신은 손이 풀리고 있습니다.", - beingTied = "당신은 손이 묶이고 있습니다.", - sameOutfitCategory = "당신은 이미 해당 유형의 의상을 착용하고 있습니다.", - noBusiness = "당신은 지금 아무것도 구매하실 수 없습니다.", - panelRemoved = "당신은 %s개의 3D 패널을 지웠습니다.", - panelAdded = "당신은 3D 패널을 추가했습니다.", - forbiddenActionStorage = "해당 행동은 보관된 아이템에게 할 수 없습니다.", - cantDropBagHasEquipped = "장착된 아이템이 있는 가방은 버릴 수 없습니다." } diff --git a/gamemode/languages/sh_norwegian.lua b/gamemode/languages/sh_norwegian.lua index 1dc74f52..be529945 100644 --- a/gamemode/languages/sh_norwegian.lua +++ b/gamemode/languages/sh_norwegian.lua @@ -1,232 +1,269 @@ NAME = "Norwegian" LANGUAGE = { - loading = "Laster", - dbError = "Database tilkobling feilet", - unknown = "Ukjent", - noDesc = "Ingen beskrivelse tilgjengelig", - create = "Lag", - createTip = "Lag en ny karakter til å spille med.", - load = "Last", - loadTip = "Velg en tidligere brukt karakter til å spille med.", - leave = "Forlat", - leaveTip = "Forlat den nåværende serveren.", - ["return"] = "Tilbake", - returnTip = "Tilbake til den forrige menyen.", - name = "Navn", - desc = "Beskrivelse", - model = "Modell", - attribs = "Attributter", - charCreateTip = "Fyll inn feltene nedenfor og trykk på 'Fullfør' for å skape din karakter.", - invalid = "Du har gitt et ugyldig %s", - descMinLen = "Din beskrivelse må være minst %d bokstav(er).", - model = "Modell", - player = "Spiller", - finish = "Fullfør", - finishTip = "Fullfør med å lage karakteren.", - needModel = "Du må velge en gyldig modell", - creating = "Din karakter blir skapt...", - unknownError = "Det har oppstått en ukjent feil", - delConfirm = "Er du sikker på at du vil PERMANENT slette %s?", - no = "Nei", - yes = "Ja", - itemInfo = "Navn: %s\nDescription: %s", - cloud_no_repo = "The repository provided is not valid.", - cloud_no_plugin = "The plugin provided is not valid.", - inv = "Inventar", - plugins = "Tillegg", - author = "Forfatter", - version = "Versjon", - characters = "Karakterer", - business = "Handel", - settings = "Innstillinger", - config = "Konfigurasjon", - chat = "Chat", - appearance = "Utseende", - misc = "Diverse", - oocDelay = "Du må vente %s sekund(er) med å bruke OOC igjen.", - loocDelay = "Du må vente %s sekund(er) med å bruke LOOC igjen.", - usingChar = "Du bruker allerede denne karakteren.", - notAllowed = "Beklager, du har ikke lov til å gjøre dette.", - itemNoExist = "Beklager, det elementet du forespurte finnes ikke.", - cmdNoExist = "Beklager, den kommandoen ekisterer ikke.", - plyNoExist = "Beklager, en matchende spiller ble ikke funnet.", - cfgSet = "%s har satt \"%s\" til %s.", - drop = "Frigjør", - dropTip = "Frigjør dette elementet fra ditt inventar.", - take = "Ta", - takeTip = "Ta dette elementet og putt det i inventaret ditt.", - dTitle = "Ueid Dør", - dTitleOwned = "Kjøpt Dør", - dIsNotOwnable = "Denne døren er ikke mulig å kjøpe.", - dIsOwnable = "Du kan kjøpe denne døren med å trykke på F2.", - dMadeUnownable = "Du har gjordt denne døren umulig å kjøpe.", - dMadeOwnable = "Du har gjordt denne døren mulig å kjøpe.", - dNotAllowedToOwn = "Du er ikke tillatt å eie denne døra.", - dSetDisabled = "Du har deaktivert denne døren.", - dSetNotDisabled = "Du har gjordt denne døren ikke lenger deaktivert.", - dSetHidden = "Du har gjordt denne døren gjemt.", - dSetNotHidden = "Du har gjordt at døren ikke er gjemt lenger.", - dSetParentDoor = "Du har gjort denne døren, hoveddøren.", - dCanNotSetAsChild = "Du kan ikke sette hoveddøren som sekundær døren.", - dAddChildDoor = "Du har lagt til en sekundær dør.", - dRemoveChildren = "Du har fjernet alle sekundære dører fra denne døren.", - dRemoveChildDoor = "Du har fjernet denne døren fra å være en sekundær dør.", - dNoParentDoor = "Du har ikke en hoveddør satt.", - dOwnedBy = "Denne døren er eid av %s.", - dConfigName = "Dører", - dSetFaction = "Denne døren tilhører %s gruppen.", - dRemoveFaction = "Denne døren tilhører ikke en gruppe lenger.", - dNotValid = "Du ser ikke på en gyldig dør.", - canNotAfford = "Du har ikke råd til å kjøpe dette.", - dPurchased = "Du har kjøpt denne døren for %s.", - dSold = "Du har solgt denne døren for %s.", - notOwner = "Du er ikke eieren av dette.", - invalidArg = "Du har gitt en ugyldig verdi for argumentet #%s.", - invalidFaction = "Gruppen du hadde gitt ekisterer ikke.", - flagGive = "%s har gitt %s '%s' flaggene.", - flagGiveTitle = "Gi Flagg", - flagGiveDesc = "Gi de følgene flaggene til en spiller.", - flagTake = "%s har tatt '%s' flaggene fra %s.", - flagTakeTitle = "Ta Flagg", - flagTakeDesc = "Fjern de følgene flaggene til en spiller.", - flagNoMatch = "Du må ha \"%s\" Flagg for å gjøre denne handlingen.", - textAdded = "Du har lagt til en tekst.", - textRemoved = "Du har fjernet %s tekst(er).", - moneyTaken = "Du har funnet %s.", - businessPurchase = "Du har kjøpt %s for %s.", - businessSell = "Du har solgt %s for %s.", - cChangeModel = "%s endret %s's modell til %s.", - cChangeName = "%s endret %s's navn til %s.", - cChangeSkin = "%s endret %s's skin til %s.", - cChangeGroups = "%s endret %s's \"%s\" kroppsgruppe to %s.", - cChangeFaction = "%s har overført %s til %s gruppen.", - playerCharBelonging = "Dette objektet tilhører en av dine andre karakterer.", - business = "Handel", - invalidFaction = "Du har gitt en ugyldig gruppe.", - spawnAdd = "Du har lagt til spawnen for %s.", - spawnDeleted = "Du har fjernet %s spawn punkt(er).", - someone = "Noen", - rgnLookingAt = "Tillat personen du ser på å gjenkjenne deg.", - rgnWhisper = "Tillat de innen hviske radius å gjenkjenne deg.", - rgnTalk = "Tillat de innen prate radius å gjenkjenne deg.", - rgnYell = "Tillat de innen rope radius å gjenkjenne deg.", - icFormat = "%s sier \"%s\"", - rollFormat = "%s har rullet %s.", - wFormat = "%s hvisker \"%s\"", - yFormat = "%s roper \"%s\"", - sbOptions = "Klikk for å se instillingene for %s.", - spawnAdded = "Du har lagt til spawnen for %s.", - whitelist = "%s har hvitelistet %s for %s gruppen.", - unwhitelist = "%s har fjernet %s fra hvitelisten til %s gruppen.", - gettingUp = "Du reiser deg opp...", - wakingUp = "Du er kommer til bevissthet...", - Weapons = "Våpen", - checkout = "Gå til kassen (%s)", - purchase = "Kjøp", - purchasing = "Kjøp = er...", - success = "Suksess", - buyFailed = "Kjøpet mislyktes.", - buyGood = "Kjøp vellykket!", - shipment = "Forsendelsen", - shipmentDesc = "Denne forsendelsen tilhører %s.", - class = "Klasse", - classes = "Klasser", - illegalAccess = "Ulovlig Tilgang.", - becomeClassFail = "Klarte ikke å bli %s.", - becomeClass = "Du har bltt %s.", - attribSet = "Du har satt %s's %s til %s.", - attribUpdate = "Du har lagt til %s's %s av %s.", - noFit = "Dette elementet kan ikke passe i inventaret ditt.", - help = "Hjelp", - commands = "Kommandoer", - helpDefault = "Velg et katagori", - doorSettings = "Dør innstillinger", - sell = "Selg", - access = "Tilgang", - locking = "Låser denne enheten...", - unlocking = "Låser opp denne enheten...", - modelNoSeq = "Din modell støtter ikke denne handlingen.", - notNow = "Du er ikke tillatt.", - faceWall = "Du må stå mot veggen for å gjøre dette.", - faceWallBack = "Din rygg må stå mot veggen for å gjøre dette.", - descChanged = "Du har endret din karakters beskrivelse.", - charMoney = "Du har akkurat nå %s.", - charFaction = "Du er et medlem av denne %s gruppen.", - charClass = "Du er %s i gruppen.", - noSpace = "Inventaret er fult.", - noOwner = "Eieren er ugyldig.", - notAllowed = "Denne handlingen er ikke tillatt.", - invalidIndex = "Elementet's Index er ugyldig.", - invalidItem = "Element Objektet er ugyldig.", - invalidInventory = "Inventar objektet er ugyldig.", - home = "Hjem", - charKick = "%s sparket karakteren %s.", - charBan = "%s utestengte karakteren %s.", - charBanned = "Denne karakteren er utestengt.", - setMoney = "Du har satt %s's penger til %s.", - itemPriceInfo = "Du kan kjøpe dette elementet for %s.\nDu kan kjøpe dette elementet for %s", - free = "Gratis", - vendorNoSellItems = "Det er ingen elementer for å selle.", - vendorNoBuyItems = "Det er ingen elementer til å kjøpe.", - vendorSettings = "Leverandør Innstillinger", - vendorUseMoney = "Leverandør skal bruke penger?", - vendorNoBubble = "Gjem leverandør bobblen?", - mode = "Modus", - price = "Pris", - stock = "På lager", - none = "Ingen", - vendorBoth = "Kjøp og selg", - vendorBuy = "Kun Kjøp", - vendorSell = "Kun Selg", - maxStock = "Maks på lager", - vendorFaction = "Gruppe endrer", - buy = "Kjøp", - vendorWelcome = "Velkommen til butikken min, hva kan jeg gi deg i dag?", - vendorBye = "Kom tilbake snart!", - charSearching = "Du søker allerede etter en annen karakter, vennligst vent.", - charUnBan = "%s har fjernet %s fra karakter utestengt listen.", - charNotBanned = "Denne karakteren er ikke utestengt.", - storPass = "Du har satt dette lagerets passord til %s.", - storPassRmv = "Du har fjernet dette lagerets passord.", - storPassWrite = "Skriv inn passordet.", - wrongPassword = "Du har skrivd inn feil passord.", - cheapBlur = "Deaktiver uklarhet? (Bedre FPS)", - quickSettings = "Hurtiginnstillinger", - vmSet = "Du har satt ditt mobilsvar.", - vmRem = "Du har fjernet ditt mobilsvar.", - altLower = "Gjemme hendene når senket?", - noPerm = "Du er ikke tillatt til å gjøre dette.", - youreDead = "Du er død.", - injMajor = "Ser kritisk skadd ut.", - injLittle = "Ser skadd ut.", - toggleESP = "Veksle Admin ESP", - chgName = "Endre navn", - chgNameDesc = "Skriv in karakterens nye navn under.", - thirdpersonToggle = "Veksle Tredje-Person", - thirdpersonClassic = "Bruk klassisk Tredje-Person", - equippedBag = "Posen at du flyttet har utstyrt element.", - useTip = "Bruk dette elementet.", - equipTip = "Ta på dette elementet.", - unequipTip = "Ta av dette elementet.", - consumables = "Forbruksvarer", - plyNotValid = "Du ser ikke på en gyldig spiller.", - restricted = "Du har blitt tilbakeholdne.", - viewProfile = "Se Steam Profil", - salary = "Du har motatt %s fra lønnen din.", - noRecog = "Du kjenner ikke denne personen.", - curTime = "Tiden er %s.", - vendorEditor = "Leverandør Redigering", - edit = "Rediger", - disable = "Deaktiver", - vendorPriceReq = "Skriv in den nye prisen for dette elementet.", - vendorEditCurStock = "Rediger nåværende lager", - you = "Du", - vendorSellScale = "Utsalgspris skala", - vendorNoTrade = "Du er ikke i stand til å handle med denne leverandøren.", - vendorNoMoney = "Denne leverandøren ikke har råd til dette elementet.", - vendorNoStock = "Denne leverandøren har ikke at varen på lager.", - contentTitle = "NutScript Innhold Mangler", - contentWarning = "Du har ikke NutScript innhold montert. Dette kan føre til enkelte funksjoner mangler. \nVil du åpne Workshop side for NutScript innhold?", - flags = "Flagg" + loading = "Laster", + dbError = "Database-tilkobling mislyktes", + unknown = "Ukjent", + noDesc = "Ingen beskrivelse tilgjengelig", + create = "Opprett", + createTip = "Opprett en ny karakter å spille som.", + load = "Last", + loadTip = "Velg en tidligere opprettet karakter å spille som.", + leave = "Forlat", + leaveTip = "Forlat den gjeldende serveren.", + ["return"] = "Tilbake", + returnTip = "Gå tilbake til forrige meny.", + name = "Navn", + desc = "Beskrivelse", + model = "Modell", + attribs = "Egenskaper", + charCreateTip = "Fyll ut feltene nedenfor og trykk 'Fullfør' for å opprette karakteren din.", + invalid = "Du har oppgitt en ugyldig %s", + descMinLen = "Beskrivelsen din må være minst %d tegn(lang).", + player = "Spiller", + finish = "Fullfør", + finishTip = "Fullfør opprettelsen av karakteren.", + needModel = "Du må velge en gyldig modell", + creating = "Karakteren din opprettes...", + unknownError = "En ukjent feil har oppstått", + delConfirm = "Er du sikker på at du vil SLETTE %s PERMANENT?", + no = "Nei", + yes = "Ja", + itemInfo = "Navn: %s\nBeskrivelse: %s", + itemCreated = "Gjenstanden ble opprettet vellykket.", + cloud_no_repo = "Den git-repositoryen er ikke gyldig.", + cloud_no_plugin = "Den git-plugins er ikke gyldig.", + inv = "Inventar", + plugins = "Plugins", + togglePlugins = "Bytt plugins", + author = "Forfatter", + version = "Versjon", + characters = "Karakterer", + settings = "Innstillinger", + config = "Konfigurasjon", + chat = "Chat", + appearance = "Utseende", + misc = "Diverse", + oocDelay = "Du må vente %s sekund(er) til før du kan bruke OOC igjen.", + loocDelay = "Du må vente %s sekund(er) til før du kan bruke LOOC igjen.", + usingChar = "Du bruker allerede denne karakteren.", + itemNoExist = "Beklager, gjenstanden du spurte etter eksisterer ikke.", + cmdNoExist = "Beklager, den kommandoen eksisterer ikke.", + plyNoExist = "Beklager, ingen passende spiller ble funnet.", + cfgSet = "%s har satt \"%s\" til %s.", + drop = "Slipp", + dropTip = "Slipp denne gjenstanden fra inventaret ditt.", + take = "Ta", + takeTip = "Ta denne gjenstanden og legg den i inventaret ditt.", + dTitle = "Ueiet dør", + dTitleOwned = "Kjøpt dør", + dIsNotOwnable = "Denne døren kan ikke eies.", + dIsOwnable = "Du kan kjøpe denne døren ved å trykke F2.", + dMadeUnownable = "Du har gjort denne døren ueiet.", + dMadeOwnable = "Du har gjort denne døren eiet.", + dNotAllowedToOwn = "Du har ikke lov til å eie denne døren.", + dSetDisabled = "Du har gjort denne døren deaktivert.", + dSetNotDisabled = "Du har gjort denne døren ikke lenger deaktivert.", + dSetHidden = "Du har gjort denne døren skjult.", + dSetNotHidden = "Du har gjort denne døren ikke lenger skjult.", + dSetParentDoor = "Du har satt denne døren som din overordnede dør.", + dCanNotSetAsChild = "Du kan ikke sette overordnede dør som en underordnet.", + dAddChildDoor = "Du har lagt til denne døren som en underordnet.", + dRemoveChildren = "Du har fjernet alle underordnede for denne døren.", + dRemoveChildDoor = "Du har fjernet denne døren som en underordnet.", + dNoParentDoor = "Du har ikke en overordnet dør satt.", + dOwnedBy = "Denne døren eies av %s.", + dConfigName = "Dører", + dSetFaction = "Denne døren tilhører nå %s fraksjonen.", + dRemoveFaction = "Denne døren tilhører ikke lenger noen fraksjon.", + dNotValid = "Du ser ikke på en gyldig dør.", + canNotAfford = "Du har ikke råd til å kjøpe dette.", + dPurchased = "Du har kjøpt denne døren for %s.", + dSold = "Du har solgt denne døren for %s.", + notOwner = "Du er ikke eieren av dette.", + invalidArg = "Du har oppgitt en ugyldig verdi for argument #%s.", + flagGive = "%s har gitt %s '%s' flagg.", + flagGiveTitle = "Gi flagg", + flagGiveDesc = "Gi følgende flagg til spilleren.", + flagTake = "%s har tatt '%s' flagg fra %s.", + flagTakeTitle = "Ta flagg", + flagTakeDesc = "Fjern følgende flagg fra spilleren.", + flagNoMatch = "Du må ha \"%s\" Flag(g) for å utføre denne handlingen.", + textAdded = "Du har lagt til en tekst.", + textRemoved = "Du har fjernet %s tekster.", + moneyTaken = "Du fant %s.", + businessPurchase = "Du har kjøpt %s for %s.", + businessSell = "Du har solgt %s for %s.", + cChangeModel = "%s har endret %s sin modell til %s.", + cChangeName = "%s har endret %s sin navn til %s.", + cChangeSkin = "%s har endret %s sin hud til %s.", + cChangeGroups = "%s har endret %s sin \"%s\" kroppstype til %s.", + cChangeFaction = "%s har overført %s til %s fraksjonen.", + playerCharBelonging = "Dette objektet tilhører en annen karakter.", + business = "Forretning", + invalidFaction = "Du har oppgitt en ugyldig fraksjon.", + limitFaction = "Denne fraksjonen er full. Prøv igjen senere.", + spawnAdd = "Du har lagt til en spawn for %s.", + spawnDeleted = "Du har fjernet %s spawn punkt(er).", + someone = "Noen", + rgnLookingAt = "Tillat personen du ser på å gjenkjenne deg.", + rgnWhisper = "Tillat de som er i en hviskende avstand å gjenkjenne deg.", + rgnTalk = "Tillat de som er i en samtaleavstand å gjenkjenne deg.", + rgnYell = "Tillat de som er i en roper avstand å gjenkjenne deg.", + icFormat = "%s sier \"%s\"", + rollFormat = "%s har rullet %s.", + wFormat = "%s hvisker \"%s\"", + yFormat = "%s roper \"%s\"", + sbOptions = "Klikk for å se alternativer for %s.", + spawnAdded = "Du la til spawn for %s.", + whitelist = "%s har satt %s på hvitelisten for %s fraksjonen.", + unwhitelist = "%s har fjernet %s fra hvitelisten for %s fraksjonen.", + gettingUp = "Du står nå opp...", + wakingUp = "Du er i ferd med å våkne...", + Weapons = "Våpen", + checkout = "Gå til kassen (%s)", + purchase = "Kjøp", + purchasing = "Kjøper...", + success = "Suksess", + buyFailed = "Kjøp mislyktes.", + buyGood = "Kjøp vellykket!", + shipment = "Sending", + shipmentDesc = "Denne forsendelsen tilhører %s.", + class = "Klasse", + classes = "Klasser", + illegalAccess = "Ulovlig tilgang.", + becomeClassFail = "Klasseendring til %s mislyktes.", + becomeClass = "Du har blitt %s.", + attribSet = "Du har satt %s sin %s til %s.", + attribUpdate = "Du har lagt til %s sin %s med %s.", + noFit = "Denne gjenstanden passer ikke i inventaret ditt.", + help = "Hjelp", + commands = "Kommandoer", + helpDefault = "Velg en kategori", + doorSettings = "Dørinnstillinger", + sell = "Selg", + access = "Tilgang", + locking = "Låser dette objektet...", + unlocking = "Låser opp dette objektet...", + modelNoSeq = "Modellen din støtter ikke denne handlingen.", + notNow = "Du har ikke lov til å gjøre dette akkurat nå.", + faceWall = "Du må stå vendt mot veggen for å gjøre dette.", + faceWallBack = "Du må ha ryggen mot veggen for å gjøre dette.", + descChanged = "Du har endret karakterens beskrivelse.", + charMoney = "Du har for øyeblikket %s.", + charFaction = "Du er medlem av %s fraksjonen.", + charClass = "Du er %s i fraksjonen.", + noSpace = "Inventaret er fullt.", + noOwner = "Eieren er ugyldig.", + notAllowed = "Denne handlingen er ikke tillatt.", + invalidIndex = "Elementindeksen er ugyldig.", + invalidItem = "Gjenstanden er ugyldig.", + invalidInventory = "Inventaret er ugyldig.", + home = "Hjem", + charKick = "%s sparket karakteren %s.", + charBan = "%s har forbudt karakteren %s.", + charBanned = "Denne karakteren er forbudt.", + setMoney = "Du har satt %s sin penger til %s.", + itemPriceInfo = "Du kan kjøpe denne gjenstanden for %s.\nDu kan selge denne gjenstanden for %s.", + free = "Gratis", + vendorNoSellItems = "Det er ingen gjenstander å selge.", + vendorNoBuyItems = "Det er ingen gjenstander å kjøpe.", + vendorSettings = "Selgerinnstillinger", + vendorUseMoney = "Skal selgeren bruke penger?", + vendorNoBubble = "Skjul selgerboble?", + mode = "Modus", + price = "Pris", + stock = "Lager", + none = "Ingen", + vendorBoth = "Kjøp og Selg", + vendorBuy = "Kjøp Bare", + vendorSell = "Selg Bare", + maxStock = "Maks Lager", + vendorFaction = "Fraksjonsredigerer", + buy = "Kjøp", + vendorWelcome = "Velkommen til butikken min, hva kan jeg hjelpe deg med i dag?", + vendorBye = "Kom igjen snart!", + charSearching = "Du søker allerede etter en annen karakter, vennligst vent.", + charUnBan = "%s har opphevet forbudet mot karakteren %s.", + charNotBanned = "Denne karakteren er ikke forbudt.", + storPass = "Du har satt passordet for denne lagringen til %s.", + storPassRmv = "Du har fjernet passordet for denne lagringen.", + storPassWrite = "Skriv inn passordet.", + wrongPassword = "Du har oppgitt feil passord.", + cheapBlur = "Deaktiver uskarphet? (Øker FPS)", + quickSettings = "Rask innstilling", + vmSet = "Du har satt din telefonsvarer.", + vmRem = "Du har fjernet din telefonsvarer.", + altLower = "Skjul hender når de er nede?", + noPerm = "Du har ikke lov til å gjøre dette.", + youreDead = "Du er død", + injMajor = "Ser kritisk skadet ut.", + injLittle = "Ser skadet ut", + toggleObserverTP = "Veksle observatør teleportering", + toggleESP = "Veksle Admin ESP", + toggleESPAdvanced = "ESP Avansert modus", + chgName = "Endre navn", + chgNameDesc = "Skriv inn den nye karakterens navn nedenfor.", + thirdpersonToggle = "Veksle Tredjeperson", + thirdpersonClassic = "Bruk Klassisk Tredjeperson", + thirdpersonConfig = "Tredjeperson Konfigurasjon", + equippedBag = "Utstyrte gjenstander kan ikke flyttes mellom inventar.", + useTip = "Bruker gjenstanden.", + equipTip = "Utstyr gjenstanden.", + unequipTip = "Fjern utstyr gjenstanden.", + consumables = "Forbruksvarer", + plyNotValid = "Du ser ikke på en gyldig spiller.", + restricted = "Du har blitt begrenset.", + viewProfile = "Se Steam-profil", + salary = "Du har mottatt %s fra lønnen din.", + noRecog = "Du gjenkjenner ikke denne personen.", + curTime = "Nåværende tid er %s.", + vendorEditor = "Selgerredigerer", + edit = "Rediger", + disable = "Deaktiver", + vendorPriceReq = "Skriv inn den nye prisen for denne gjenstanden.", + vendorEditCurStock = "Rediger nåværende lager", + you = "Du", + vendorSellScale = "Salgsprisskala for selger", + vendorNoTrade = "Du kan ikke handle med denne selgeren.", + vendorNoMoney = "Denne selgeren har ikke råd til den gjenstanden.", + vendorNoStock = "Denne selgeren har ikke den gjenstanden på lager.", + contentTitle = "NutScript Innhold Mangler", + contentWarning = "Du har ikke NutScript-innholdet montert. Dette kan føre til at visse funksjoner mangler.\nVil du åpne Workshopen for NutScript-innholdet?", + flags = "Flagg", + chooseTip = "Velg denne karakteren å spille med.", + deleteTip = "Slett denne karakteren.", + moneyLeft = "Dine penger: ", + currentMoney = "Gjenværende penger: ", + + -- 2018-patch + ammoLoadAll = "Last alle", + ammoLoadAmount = "Last %s", + ammoLoadCustom = "Last tilpasset...", + split = "Del", + splitHelp = "Skriv inn et tall for å dele.", + splitHalf = "Del 1/2", + splitQuarter = "Del 1/4", + recognize = "Tillat denne karakteren å gjenkjenne deg.", + recognized = "Du ga denne karakteren identiteten din.", + already_recognized = "Denne karakteren vet allerede hvem du er.", + isTied = "Denne personen er bundet.", + tying = "Binder", + untying = "Løser opp", + beingUntied = "Du blir løst opp.", + beingTied = "Du blir bundet.", + sameOutfitCategory = "Du har allerede på deg denne typen antrekk.", + noBusiness = "Du har ikke lov til å kjøpe noe akkurat nå.", + panelRemoved = "Du har fjernet %s 3D-paneler.", + panelAdded = "Du har lagt til et 3D-panel.", + itemOnGround = "Gjenstanden din er plassert på bakken.", + forbiddenActionStorage = "Du kan ikke utføre denne handlingen med lagret gjenstand.", + cantDropBagHasEquipped = "Du kan ikke droppe en bag som har utstyrte gjenstander.", + + -- 2021-patch + lookToUseAt = "Du må se på noen for å bruke '@'", + mustProvideString = "Du må oppgi en streng for variabelen", + + -- 2023-patch + togglePluginsDesc = "Valgte plugins vil bli deaktivert.\nKartet må startes på nytt etter å ha gjort endringer!", } diff --git a/gamemode/languages/sh_polish.lua b/gamemode/languages/sh_polish.lua index 45b4c72a..32b81c22 100644 --- a/gamemode/languages/sh_polish.lua +++ b/gamemode/languages/sh_polish.lua @@ -4,211 +4,266 @@ NAME = "Polski" LANGUAGE = { - loading = "Ładowanie", - dbError = "Połączenie z bazą danych nie powiodło się", - unknown = "Nieznane", - noDesc = "Rysopis niedostępny", - create = "Stwórz", - createTip = "Stwórz nową postać aby nią zagrać.", - load = "Załaduj", - loadTip = "Załaduj uprzednio stworzoną postać aby nią zagrać.", - leave = "Wyjdź", - leaveTip = "Opuść serwer.", - ["return"] = "Powrót", - returnTip = "Powrót do poprzedniego menu.", - name = "Imię i nazwisko", - desc = "Opis", - model = "Model", - attribs = "Atrybuty", - charCreateTip = "Wypełnij pola poniżej i klinij 'Zakończ' aby stworzyć swoją postać.", - invalid = "Podałeś niewłaściwe(ą) %s", - descMinLen = "Opis musi zawierać minimum %d znak(ów).", - model = "Model", - player = "Gracz", - finish = "Zakończ", - finishTip = "Zakończ tworzenie postaci.", - needModel = "Musisz wybrać prawidłowy model", - creating = "Twoja postać jest aktualnie tworzona...", - unknownError = "Wystąpił nieznany błąd", - delConfirm = "Czy jesteś pewien, że chcesz PERMANENTNIE skasować %s?", - no = "Nie", - yes = "Tak", - itemInfo = "Imię i nazwisko %s\nRysopis: %s", - cloud_no_repo = "Repozytorium, które zostało podane nie jest prawidłowe.", - cloud_no_plugin = "Podany plugin nie jest prawidłowy.", - inv = "Ekwipunek", - plugins = "Pluginy", - author = "Autor", - version = "Wersja", - characters = "Postacie", - business = "Biznes", - settings = "Ustawienia", - config = "Konfiguracja", - chat = "Czat", - appearance = "Wygląd", - misc = "Różne", - oocDelay = "Musisz poczekać %s sekund przed ponownym użyciem OOC.", - loocDelay = "Musisz poczekać %s sekund przed ponownym użyciem LOOC.", - usingChar = "Aktualnie już używasz tej postaci.", - notAllowed = "Przepraszamy, nie masz uprawnień do zrobienia tego.", - itemNoExist = "Przepraszamy, przedmiot o który prosiłeś nie istnieje.", - cmdNoExist = "Przepraszamy, ta komenda nie istnieje.", - plyNoExist = "Przepraszamy, nie znaleziono pasującego gracza.", - cfgSet = "%s ustawił \"%s\" na %s.", - drop = "Upuść", - dropTip = "Upuszcza ten przedmiot z Twojego ekwipunku.", - take = "Weź", - takeTip = "Weź ten przedmiot i umieść go w swoim ekwipunku.", - dTitle = "Drzwi możliwe do wykupienia", - dTitleOwned = "Wykupione Drzwi", - dIsNotOwnable = "Tych drzwi nie można kupić.", - dIsOwnable = "Możesz kupić te drzwi naciskając F2.", - dMadeUnownable = "Uczyniłeś te drzwi niemożliwymi do kupienia.", - dMadeOwnable = "Uczyniłeś te drzwi możliwymi do kupienia.", - dNotAllowedToOwn = "Nie możesz kupić tych drzwi.", - dSetDisabled = "Wyłączyłeś te drzwi z użytku.", - dSetNotDisabled = "Ponownie można używać tych drzwi.", - dSetParentDoor = "Uczyniłeś te drzwi swoimi drzwiami nadrzędnymi.", - dCanNotSetAsChild = "Nie możesz ustawi aby drzwi nadrzędne były drzwiami podrzędnymi.", - dAddChildDoor = "Dodałeś te drzwi jako drzwi podrzędne.", - dRemoveChildren = "Usunąłeś wszystkie drzwi podrzędne należące do tych drzwi.", - dRemoveChildDoor = "Te drzwi już nie są drzwiami podrzędnymi.", - dNoParentDoor = "Nie masz ustawionych drzwi nadrzędnych.", - dOwnedBy = "Te drzwi należą do %s.", - dConfigName = "Drzwi", - dSetFaction = "Te drzwi należą teraz do frakcji %s.", - dRemoveFaction = "Te drzwi już nie należą do żadnej frakcji.", - dNotValid = "Patrzysz na nie prawidłowe drzwi.", - canNotAfford = "Nie stać Cię na kupienie tego.", - dPurchased = "Kupiłeś te drzwi za %s.", - dSold = "Sprzedałeś te drzwi za %s.", - notOwner = "Nie jesteś właścicielem tego.", - invalidArg = "Podałeś niepoprawną wartość dla argumentu #%s.", - invalidFaction = "Frakcja, którą podałeś nie mogła zostać znaleziona.", - flagGive = "%s dał %s następujące flagi: '%s'.", - flagGiveTitle = "Daj Flagi", - flagGiveDesc = "Daj następujące flagi graczowi.", - flagTake = "%s zabrał od %s następujące flagi: '%s'.", - flagTakeTitle = "Zabierz Flagi", - flagTakeDesc = "Zabierz następujące flagi od gracza.", - flagNoMatch = "Musisz posiadać flagę(i) \"%s\" aby wykonać tą czynność.", - textAdded = "Dodałeś tekst.", - textRemoved = "Usunąłeś %s tekst(y).", - moneyTaken = "Znalazłeś %s.", - businessPurchase = "Kupiłeś %s za %s.", - businessSell = "Sprzedałeś %s za %s.", - cChangeModel = "%s zmienił model gracza %s na %s.", - cChangeName = "%s zmienił imię gracza %s na %s.", - playerCharBelonging = "Ten przedmiot należy do innej postaci należącej do Ciebie.", - business = "Biznes", - invalidFaction = "Wprowadziłeś niewłaściwą frakcję.", - spawnAdd = "Dodaj punkt odradzania się (Spawn) dla %s.", - spawnDeleted = "Usunąłeś %s punktów odradzania się (spawn'u).", - someone = "Ktoś", - rgnLookingAt = "Pozwól osobie na którą patrzysz aby Cię rozpoznawała.", - rgnWhisper = "Pozwól tym, którzy są w zasięgu Twoich szeptów aby Cię rozpoznawali.", - rgnTalk = "Pozwól tym, którzy są w zasięgu normalnych rozmów aby Cię rozpoznawali.", - rgnYell = "Pozwól tym, którzy są w zasięgu Twoich krzyków aby Cię rozpoznawali.", - icFormat = "%s mówi: \"%s\"", - rollFormat = "%s wylosował %s rzucając kośćmi.", - wFormat = "%s szepcze: \"%s\"", - yFormat = "%s krzyczy: \"%s\"", - sbOptions = "Kliknij aby zobaczyć opcje dla %s.", - spawnAdded = "Dodałeś punkt odradzania się (Spawn) dla %s.", - whitelist = "%s dodał %s na białą listę frakcji %s.", - unwhitelist = "%s usunął %s z białej listy frakcji %s.", - gettingUp = "Podnosisz się...", - wakingUp = "Wraca Ci świadomość...", - Weapons = "Broń", - checkout = "Idź do kasy (%s)", - purchase = "Kup", - purchasing = "Kupuję...", - success = "Sukces", - buyFailed = "Zakupy nie powiodły się.", - buyGood = "Zakupy udane!", - shipment = "Dostawa", - shipmentDesc = "Ta dostawa należy do %s.", - class = "Klasa", - classes = "Klasy", - illegalAccess = "Nielegalny Dostęp.", - becomeClassFail = "Nie udało Ci się zostać %s.", - becomeClass = "Zostałeś %s.", - attribSet = "Postać %s ma teraz %s ustawioną na %s.", - attribUpdate = "Postać %s ma teraz %s podwyższoną o %s.", - noFit = "Ten przedmiot nie mieści się w Twoim ekwipunku.", - help = "Pomoc", - commands = "Komendy", - helpDefault = "Wybierz kateogrię", - doorSettings = "Ustawienia drzwi", - sell = "Sprzedaj", - access = "Dostęp", - locking = "Zamykanie przedmiotu...", - unlocking = "Otwieranie przedmiotu...", - modelNoSeq = "Twój model nie obsługuje tej animacji.", - notNow = "Nie możesz tego aktualnie zrobić.", - faceWall = "Musisz patrzeć na ścianę aby to wykonać.", - faceWallBack = "Musisz stać tyłem do ściany aby to wykonać.", - descChanged = "Zmieniłeś rysopis swojej postaci.", - charMoney = "Aktualnie posiadasz %s.", - charFaction = "Jesteś członkiem frakcji %s.", - charClass = "Piastujesz stanowisko %s we frakcji.", - noSpace = "Ekwipunek jest pełny.", - noOwner = "Nieprawidłowy właściciel.", - notAllowed = "Ta akcja jest niedozowolna.", - invalidIndex = "Index przedmiotu jest nieprawidłowy.", - invalidItem = "Obiekt przedmiotu jest nieprawidłowy.", - invalidInventory = "Obiekt ekwipunku jest nieprawidłowy.", - home = "Strona główna", - charKick = "%s wyrzucił %s.", - charBan = "%s zbanował postać %s.", - charBanned = "Ta postać jest niedostępna.", - setMoney = "Ustawiłem ilość pieniędzy %s na %s.", - itemPriceInfo = "Możesz kupić ten przedmiot za %s.\nMożesz sprzedać ten przedmiot za %s", - free = "Darmowe", - vendorNoSellItems = "Nie ma przedmiotów do sprzedania.", - vendorNoBuyItems = "Nie ma przedmiotów do kupienia.", - vendorSettings = "Ustawienia sprzedawców", - vendorUseMoney = "Czy sprzedawcy powinni używać pieniędzy?", - vendorNoBubble = "Ukryć dymek sprzedawcy?", - mode = "Tryb", - price = "Cena", - stock = "Zasób", - none = "Nic", - vendorBoth = "Kupowanie i Sprzedawanie", - vendorBuy = "Tylko kupowanie", - vendorSell = "Tylko sprzedawanie", - maxStock = "Maksymalny zasób", - vendorFaction = "Edytor frakcji", - buy = "Kup", - vendorWelcome = "Witaj w moim sklepie, czy mogę Ci coś podać?", - vendorBye = "Przyjdź niedługo z powrotem!", - charSearching = "Aktualnie szukasz już innej postaci, proszę poczekać.", - charUnBan = "%s odbanował postać %s.", - charNotBanned = "Ta postać nie jest zbanowana.", - storPass = "Ustawiłeś hasło tego pojemnika na %s.", - storPassRmv = "Usunąłeś hasło z tego pojemnika.", - storPassWrite = "Wprowadź hasło.", - wrongPassword = "Wprowadziłeś złe hasło.", - cheapBlur = "Wyłączyć rozmazywanie? (Podnosi FPSy)", - quickSettings = "Szybkie Ustawienia", - vmSet = "Ustawiłeś swoją automatyczną sekretarkę.", - vmRem = "Usunąłeś swoją automatyczną sekretarkę.", - altLower = "Ukryć dłonie kiedy są opuszczone?", - noPerm = "Nie wolno Ci tego zrobić.", - youreDead = "Jesteś martwy.", - injMajor = "Widoczne krytyczne obrażenia.", - injLittle = "Widoczne obrażenia.", - toggleESP = "Włącz/Wyłącz Admiński wallhack.", - chgName = "Zmień imię i nazwisko.", - chgNameDesc = "Wprowadź nowę imię i nazwisko postaci poniżej.", - thirdpersonToggle = "Przełącz widok z trzeciej osoby", - thirdpersonClassic = "Używaj klasycznego widoku z trzeciej osoby", - equippedBag = "Torba którą przesunąłeś posiada przedmiot(y).", - useTip = "Używa przedmiotu.", - equipTip = "Zakłada przedmiot.", - unequipTip = "Zdejmuje przedmiot.", - consumables = "Towary konsumpcyjne.", - plyNotValid = "Nie patrzysz na prawidłowego gracza.", - restricted = "Zostałeś związany.", - viewProfile = "Obejrzyj profil Steam." -} + loading = "Ładowanie", + dbError = "Błąd połączenia z bazą danych", + unknown = "Nieznane", + noDesc = "Brak dostępnych opisów", + create = "Stwórz", + createTip = "Stwórz nową postać do gry.", + load = "Wczytaj", + loadTip = "Wybierz wcześniej stworzoną postać do gry.", + leave = "Opuszcz", + leaveTip = "Opuszcz obecny serwer.", + ["return"] = "Powrót", + returnTip = "Powróć do poprzedniego menu.", + name = "Imię", + desc = "Opis", + model = "Model", + attribs = "Atrybuty", + charCreateTip = "Wypełnij pola poniżej i naciśnij 'Zakończ', aby stworzyć swoją postać.", + invalid = "Podano nieprawidłowy %s", + descMinLen = "Twój opis musi mieć co najmniej %d znak(ów).", + player = "Gracz", + finish = "Zakończ", + finishTip = "Zakończ tworzenie postaci.", + needModel = "Musisz wybrać prawidłowy model postaci", + creating = "Twoja postać jest tworzona...", + unknownError = "Wystąpił nieznany błąd", + delConfirm = "Czy na pewno chcesz TRWALE usunąć %s?", + no = "Nie", + yes = "Tak", + itemInfo = "Nazwa: %s\nOpis: %s", + itemCreated = "Przedmiot pomyślnie stworzony.", + cloud_no_repo = "Podane repozytorium jest nieprawidłowe.", + cloud_no_plugin = "Podana wtyczka jest nieprawidłowa.", + inv = "Inwentarz", + plugins = "Wtyczki", + togglePlugins = "Przełącz wtyczki", + author = "Autor", + version = "Wersja", + characters = "Postacie", + settings = "Ustawienia", + config = "Konfiguracja", + chat = "Czat", + appearance = "Wygląd", + misc = "Różne", + oocDelay = "Musisz poczekać jeszcze %s sekund(y), zanim będziesz mógł ponownie używać czatu OOC.", + loocDelay = "Musisz poczekać jeszcze %s sekund(y), zanim będziesz mógł ponownie używać czatu LOOC.", + usingChar = "Już używasz tej postaci.", + itemNoExist = "Przepraszam, ale przedmiot, który chciałeś, nie istnieje.", + cmdNoExist = "Przepraszam, ale ta komenda nie istnieje.", + plyNoExist = "Przepraszam, ale nie znaleziono pasującego gracza.", + cfgSet = "%s ustawił \"%s\" na %s.", + drop = "Upuść", + dropTip = "Upuść ten przedmiot z twojego inwentarza.", + take = "Weź", + takeTip = "Weź ten przedmiot i umieść go w swoim inwentarzu.", + dTitle = "Drzwi niezakupione", + dTitleOwned = "Zakupione drzwi", + dIsNotOwnable = "Te drzwi nie mogą być zakupione.", + dIsOwnable = "Możesz zakupić te drzwi, naciskając F2.", + dMadeUnownable = "Zrobiłeś te drzwi niezakupionymi.", + dMadeOwnable = "Zrobiłeś te drzwi zakupionymi.", + dNotAllowedToOwn = "Nie masz uprawnień do zakupu tych drzwi.", + dSetDisabled = "Zrobiłeś te drzwi wyłączonymi.", + dSetNotDisabled = "Zrobiłeś te drzwi nie wyłączonymi.", + dSetHidden = "Zrobiłeś te drzwi ukrytymi.", + dSetNotHidden = "Zrobiłeś te drzwi nie ukrytymi.", + dSetParentDoor = "Ustawiłeś te drzwi jako drzwi nadrzędne.", + dCanNotSetAsChild = "Nie możesz ustawić drzwi nadrzędnych jako drzwi podrzędnych.", + dAddChildDoor = "Dodałeś te drzwi jako drzwi podrzędne.", + dRemoveChildren = "Usunąłeś wszystkie podrzędne drzwi dla tych drzwi.", + dRemoveChildDoor = "Usunąłeś te drzwi jako drzwi podrzędne.", + dNoParentDoor = "Nie masz ustawionego drzwi nadrzędnego.", + dOwnedBy = "Te drzwi są własnością %s.", + dConfigName = "Drzwi", + dSetFaction = "Te drzwi teraz należą do frakcji %s.", + dRemoveFaction = "Te drzwi już nie należą do żadnej frakcji.", + dNotValid = "Nie patrzysz na prawidłowe drzwi.", + canNotAfford = "Nie stać cię na zakup tego przedmiotu.", + dPurchased = "Zakupiłeś te drzwi za %s.", + dSold = "Sprzedałeś te drzwi za %s.", + notOwner = "Nie jesteś właścicielem tego.", + invalidArg = "Podano nieprawidłową wartość dla argumentu #%s.", + flagGive = "%s nadał %s flagę '%s'.", + flagGiveTitle = "Nadaj Flagi", + flagGiveDesc = "Nadaj następujące flagi graczowi.", + flagTake = "%s odebrał flagę '%s' od %s.", + flagTakeTitle = "Usuń Flagi", + flagTakeDesc = "Usuń następujące flagi graczowi.", + flagNoMatch = "Musisz mieć Flagi \"%s\" aby wykonać tę akcję.", + textAdded = "Dodałeś tekst.", + textRemoved = "Usunąłeś %s tekst(y).", + moneyTaken = "Znalazłeś %s.", + businessPurchase = "Zakupiłeś %s za %s.", + businessSell = "Sprzedałeś %s za %s.", + cChangeModel = "%s zmienił model %s na %s.", + cChangeName = "%s zmienił imię %s na %s.", + cChangeSkin = "%s zmienił skórkę %s na %s.", + cChangeGroups = "%s zmienił grupę ciała \"%s\" na %s.", + cChangeFaction = "%s przetransferował %s do frakcji %s.", + playerCharBelonging = "Ten przedmiot należy do innej postaci.", + business = "Biznes", + invalidFaction = "Podano nieprawidłową frakcję.", + limitFaction = "Ta frakcja jest pełna. Spróbuj ponownie później.", + spawnAdd = "Dodałeś punkt spawnu dla %s.", + spawnDeleted = "Usunąłeś %s punkt(y) spawnu.", + someone = "Ktoś", + rgnLookingAt = "Pozwól osobie, na którą patrzysz, cię rozpoznać.", + rgnWhisper = "Pozwól tym, którzy są w zasięgu szeptu, cię rozpoznać.", + rgnTalk = "Pozwól tym, którzy są w zasięgu rozmowy, cię rozpoznać.", + rgnYell = "Pozwól tym, którzy są w zasięgu krzyku, cię rozpoznać.", + icFormat = "%s mówi \"%s\"", + rollFormat = "%s rzucił %s.", + wFormat = "%s szepce \"%s\"", + yFormat = "%s krzyczy \"%s\"", + sbOptions = "Kliknij, aby zobaczyć opcje dla %s.", + spawnAdded = "Dodałeś punkt spawnu dla %s.", + whitelist = "%s dodał %s do białej listy frakcji %s.", + unwhitelist = "%s usunął %s z białej listy frakcji %s.", + gettingUp = "Teraz wstajesz...", + wakingUp = "Zdajesz sobie sprawę...", + Weapons = "Bronie", + checkout = "Idź do Kasy (%s)", + purchase = "Zakup", + purchasing = "Zakupy...", + success = "Sukces", + buyFailed = "Zakup nieudany.", + buyGood = "Zakup udany!", + shipment = "Dostawa", + shipmentDesc = "Ta dostawa należy do %s.", + class = "Klasa", + classes = "Klasy", + illegalAccess = "Nielegalny dostęp.", + becomeClassFail = "Nie udało się zostać %s.", + becomeClass = "Stałeś się %s.", + attribSet = "Ustawiłeś %s atrybut %s na %s.", + attribUpdate = "Dodałeś %s atrybut %s o %s.", + noFit = "Ten przedmiot nie mieści się w twoim inwentarzu.", + help = "Pomoc", + commands = "Komendy", + helpDefault = "Wybierz kategorię", + doorSettings = "Ustawienia drzwi", + sell = "Sprzedaj", + access = "Dostęp", + locking = "Zamykanie tego obiektu...", + unlocking = "Otwieranie tego obiektu...", + modelNoSeq = "Twój model nie obsługuje tej animacji.", + notNow = "Nie możesz teraz tego zrobić.", + faceWall = "Musisz stać twarzą do ściany, żeby to zrobić.", + faceWallBack = "Musisz stać plecami do ściany, żeby to zrobić.", + descChanged = "Zmieniłeś opis swojej postaci.", + charMoney = "Aktualnie masz %s.", + charFaction = "Jesteś członkiem frakcji %s.", + charClass = "Jesteś %s w frakcji.", + noSpace = "Inwentarz jest pełny.", + noOwner = "Właściciel jest nieprawidłowy.", + notAllowed = "Ta akcja jest niedozwolona.", + invalidIndex = "Indeks przedmiotu jest nieprawidłowy.", + invalidItem = "Obiekt przedmiotu jest nieprawidłowy.", + invalidInventory = "Obiekt inwentarza jest nieprawidłowy.", + home = "Dom", + charKick = "%s wykickował postać %s.", + charBan = "%s zbanował postać %s.", + charBanned = "Ta postać jest zbanowana.", + setMoney = "Ustawiłeś pieniądze %s na %s.", + itemPriceInfo = "Możesz zakupić ten przedmiot za %s.\nMożesz sprzedać ten przedmiot za %s", + free = "Darmowe", + vendorNoSellItems = "Nie ma przedmiotów do sprzedaży.", + vendorNoBuyItems = "Nie ma przedmiotów do zakupu.", + vendorSettings = "Ustawienia sprzedawcy", + vendorUseMoney = "Czy sprzedawca powinien używać pieniędzy?", + vendorNoBubble = "Ukryj dymek sprzedawcy?", + mode = "Tryb", + price = "Cena", + stock = "Zapas", + none = "Brak", + vendorBoth = "Kup i Sprzedaj", + vendorBuy = "Tylko Kup", + vendorSell = "Tylko Sprzedaj", + maxStock = "Maksymalny Zapas", + vendorFaction = "Edytor Frakcji", + buy = "Zakup", + vendorWelcome = "Witaj w moim sklepie, czym mogę służyć?", + vendorBye = "Do zobaczenia następnym razem!", + charSearching = "Już wyszukujesz inną postać, proszę czekać.", + charUnBan = "%s odbanował postać %s.", + charNotBanned = "Ta postać nie jest zbanowana.", + storPass = "Ustawiłeś hasło do tego schowka na %s.", + storPassRmv = "Usunąłeś hasło tego schowka.", + storPassWrite = "Podaj hasło.", + wrongPassword = "Podano złe hasło.", + cheapBlur = "Wyłączyć rozmycie? (Zwiększa FPS)", + quickSettings = "Szybkie ustawienia", + vmSet = "Ustawiłeś pocztę głosową.", + vmRem = "Usunąłeś pocztę głosową.", + altLower = "Ukryć ręce podczas opuszczenia?", + noPerm = "Nie masz uprawnień do tego.", + youreDead = "Jesteś martwy", + injMajor = "Wydajesz się być ciężko ranny.", + injLittle = "Wydajesz się być ranny", + toggleObserverTP = "Przełącz teleportację obserwatora", + toggleESP = "Przełącz ESP administratora", + toggleESPAdvanced = "Zaawansowany tryb ESP", + chgName = "Zmień imię", + chgNameDesc = "Wprowadź nowe imię postaci poniżej.", + thirdpersonToggle = "Przełącz tryb widoku z trzeciej osoby", + thirdpersonClassic = "Użyj klasycznego widoku z trzeciej osoby", + thirdpersonConfig = "Konfiguracja widoku z trzeciej osoby", + equippedBag = "Przedmioty wyposażone nie mogą być przenoszone między inwentarzami.", + useTip = "Używa przedmiot.", + equipTip = "Wyposaża przedmiot.", + unequipTip = "Usuwa wyposażenie przedmiot.", + consumables = "Środki spożywcze", + plyNotValid = "Nie patrzysz na prawidłowego gracza.", + restricted = "Jesteś ograniczony.", + viewProfile = "Zobacz profil Steam", + salary = "Otrzymałeś %s z twojej pensji.", + noRecog = "Nie rozpoznajesz tej osoby.", + curTime = "Obecny czas to %s.", + vendorEditor = "Edytor sprzedawcy", + edit = "Edytuj", + disable = "Wyłącz", + vendorPriceReq = "Podaj nową cenę tego przedmiotu.", + vendorEditCurStock = "Edytuj bieżący zapas", + you = "Ty", + vendorSellScale = "Skala ceny sprzedaży", + vendorNoTrade = "Nie możesz handlować z tym sprzedawcą.", + vendorNoMoney = "Ten sprzedawca nie stać na ten przedmiot.", + vendorNoStock = "Ten sprzedawca nie ma tego przedmiotu w zapasach.", + contentTitle = "Brakująca zawartość NutScript", + contentWarning = "Nie masz zamontowanej zawartości NutScript. Może to skutkować brakiem pewnych funkcji.\nCzy chcesz otworzyć stronę Warsztatu z zawartością NutScript?", + flags = "Flagi", + chooseTip = "Wybierz tę postać, aby grać.", + deleteTip = "Usuń tę postać.", + moneyLeft = "Twoje pieniądze: ", + currentMoney = "Pozostałe pieniądze: ", + -- 2018-patch + ammoLoadAll = "Załaduj wszystko", + ammoLoadAmount = "Załaduj %s", + ammoLoadCustom = "Załaduj...", + split = "Podziel", + splitHelp = "Wprowadź liczbę, aby podzielić.", + splitHalf = "Podziel 1/2", + splitQuarter = "Podziel 1/4", + recognize = "Pozwól tej postaci cię rozpoznać.", + recognized = "Podarowałeś tej postaci swoją tożsamość.", + already_recognized = "Ta postać już cię zna.", + isTied = "Ta osoba jest związana.", + tying = "Wiązanie", + untying = "Rozwiązywanie", + beingUntied = "Jesteś rozwiązywany.", + beingTied = "Jesteś wiązany.", + sameOutfitCategory = "Jesteś już ubrany w ten typ ubioru.", + noBusiness = "Obecnie nie masz dostępu do zakupów.", + panelRemoved = "Usunąłeś %s panele 3D.", + panelAdded = "Dodałeś panel 3D.", + itemOnGround = "Twój przedmiot został umieszczony na ziemi.", + forbiddenActionStorage = "Nie możesz wykonywać tej akcji z przechowywanym przedmiotem.", + cantDropBagHasEquipped = "Nie możesz upuścić torby, która ma założony przedmiot.", + -- 2021-patch + lookToUseAt = "Musisz patrzeć na kogoś, żeby użyć '@'", + mustProvideString = "Musisz podać ciąg znaków dla zmiennej", + -- 2023-patch + togglePluginsDesc = "Wybrane wtyczki zostaną wyłączone.\nMapa musi zostać ponownie uruchomiona po wprowadzeniu zmian!", +} \ No newline at end of file diff --git a/gamemode/languages/sh_portuguese.lua b/gamemode/languages/sh_portuguese.lua index 25c570c5..e54ee74b 100644 --- a/gamemode/languages/sh_portuguese.lua +++ b/gamemode/languages/sh_portuguese.lua @@ -1,267 +1,267 @@ -NAME = "Portuguese" ---//Contact Barata#2411 if you have any translation change suggestion\\---- - +NAME = "Portuguese" LANGUAGE = { - loading = "A carregar", - dbError = "Erro ao conectar à database", + loading = "Carregando", + dbError = "Falha na conexão com o banco de dados", unknown = "Desconhecido", noDesc = "Nenhuma descrição disponível", create = "Criar", - createTip = "Criar um novo personagem para jogar como.", + createTip = "Criar um novo personagem para jogar.", load = "Carregar", - loadTip = "Escolhe um personagem que já tenhas criado.", + loadTip = "Escolher um personagem previamente criado para jogar.", leave = "Sair", leaveTip = "Sair do servidor atual.", ["return"] = "Retornar", - returnTip = "Retornar ao menu anterior.", + returnTip = "Voltar ao menu anterior.", name = "Nome", desc = "Descrição", - attribs = "Atributos", - charCreateTip = "Preenche os campos abaixo e pressiona 'Acabar' para criar o teu personagem.", - invalid = "Deste uma %s inválida", - descMinLen = "A tua descrição têm de ter pelo menos %d caracteres.", model = "Modelo", + attribs = "Atributos", + charCreateTip = "Preencha os campos abaixo e pressione 'Concluir' para criar seu personagem.", + invalid = "Você forneceu um(a) %s inválido(a)", + descMinLen = "Sua descrição deve ter pelo menos %d caractere(s).", player = "Jogador", - finish = "Acabar", - finishTip = "Acabar de criar o teu personagem.", - needModel = "Escolhe um modelo válido", - creating = "O teu personagem está a ser criado...", - unknownError = "Ocorreu um erro desconhecido.", - delConfirm = "Tens a certeza que queres apagar %s PERMANENTEMENTE?", + finish = "Concluir", + finishTip = "Concluir a criação do personagem.", + needModel = "Você precisa escolher um modelo válido", + creating = "Seu personagem está sendo criado...", + unknownError = "Um erro desconhecido ocorreu", + delConfirm = "Você tem certeza de que deseja EXCLUIR PERMANENTEMENTE %s?", no = "Não", yes = "Sim", itemInfo = "Nome: %s\nDescrição: %s", - itemCreated = "Objecto criado com sucesso.", - cloud_no_repo = "O repositório providenciado não é valido.", - cloud_no_plugin = "O plugin providenciado não é válido.", + itemCreated = "Item criado com sucesso.", + cloud_no_repo = "O repositório fornecido não é válido.", + cloud_no_plugin = "O plugin fornecido não é válido.", inv = "Inventário", plugins = "Plugins", + togglePlugins = "Ativar/desativar plugins", author = "Autor", version = "Versão", characters = "Personagens", - settings = "Definições", - config = "Configuração", + settings = "Configurações", + config = "Config", chat = "Chat", - appearance = "Aparencia", + appearance = "Aparência", misc = "Diversos", - oocDelay = "Deves esperar %s mais segundos antes de usares o OOC de novo.", - loocDelay = "Deves esperar %s mais segundos antes de usares o LOOC de novo.", - usingChar = "Já estás a usar este personagem.", - notAllowed = "Desculpa, não podes fazer isto.", - itemNoExist = "Desculpa, o item que pediste não existe.", - cmdNoExist = "Desculpa, o comando não existe.", - plyNoExist = "Desculpa, um jogador que procuras não foi encontrado.", - cfgSet = "%s mudou \"%s\" para %s.", + oocDelay = "Você deve esperar mais %s segundo(s) antes de usar o OOC novamente.", + loocDelay = "Você deve esperar mais %s segundo(s) antes de usar o LOOC novamente.", + usingChar = "Você já está usando este personagem.", + itemNoExist = "Desculpe, o item que você solicitou não existe.", + cmdNoExist = "Desculpe, esse comando não existe.", + plyNoExist = "Desculpe, nenhum jogador correspondente foi encontrado.", + cfgSet = "%s definiu \"%s\" para %s.", drop = "Largar", - dropTip = "Solta este objecto do teu inventário.", - take = "Levar", - takeTip = "Leva este item e põe no teu inventário.", - dTitle = "Porta sem dono", + dropTip = "Larga este item do seu inventário.", + take = "Pegar", + takeTip = "Pegar este item e colocá-lo em seu inventário.", + dTitle = "Porta não pertencente", dTitleOwned = "Porta Comprada", - dIsNotOwnable = "Esta porta não pode ser comprada.", - dIsOwnable = "Podes comprar esta porta ao clicar F2.", - dMadeUnownable = "Fizeste esta porta não ser comprável.", - dMadeOwnable = "Fizeste esta porta ser compravel.", - dNotAllowedToOwn = "Não podes comprar esta porta.", - dSetDisabled = "Desativaste esta porta.", - dSetNotDisabled = "Esta porta já não está desativada.", - dSetHidden = "Escondeste a porta.", - dSetNotHidden = "Esta porta já não está escondida.", - dSetParentDoor = "Tornaste esta porta numa porta parente.", - dCanNotSetAsChild = "Não pode tornar esta porta parente numa porta criança.", - dAddChildDoor = "Adicionaste esta porta como porta criança.", - dRemoveChildren = "Removeste todos os filhos de esta porta.", - dRemoveChildDoor = "Removeste esta porta de ser filho.", - dNoParentDoor = "Não tens uma porta parente definida.", - dOwnedBy = "Este porta é propriedade de %s.", + dIsNotOwnable = "Esta porta não pode ser possuída.", + dIsOwnable = "Você pode comprar esta porta pressionando F2.", + dMadeUnownable = "Você tornou esta porta não-possuível.", + dMadeOwnable = "Você tornou esta porta possuível.", + dNotAllowedToOwn = "Você não está autorizado a possuir esta porta.", + dSetDisabled = "Você tornou esta porta desativada.", + dSetNotDisabled = "Você tornou esta porta não mais desativada.", + dSetHidden = "Você tornou esta porta oculta.", + dSetNotHidden = "Você tornou esta porta não mais oculta.", + dSetParentDoor = "Você definiu esta porta como sua porta principal.", + dCanNotSetAsChild = "Você não pode definir a porta principal como uma porta secundária.", + dAddChildDoor = "Você adicionou esta porta como uma porta secundária.", + dRemoveChildren = "Você removeu todas as portas secundárias para esta porta.", + dRemoveChildDoor = "Você removeu esta porta como uma porta secundária.", + dNoParentDoor = "Você não tem uma porta principal definida.", + dOwnedBy = "Esta porta pertence a %s.", dConfigName = "Portas", - dSetFaction = "Esta porta pertence à facção %s.", - dRemoveFaction = "Esta porta já não pertence a uma facção.", - dNotValid = "Não estás a olhar para uma porta válida.", - canNotAfford = "Não tens dinheiro suficiente para comprar isto.", - dPurchased = "Compraste esta porta por %s.", - dSold = "Vendeste esta porta por %s.", - notOwner = "Não és o dono disto.", - invalidArg = "Deste um valor invalido para o argumento #%s.", - flagGive = "%s deu %s '%s' flags.", - flagGiveTitle = "Dar Flags", - flagGiveDesc = "Dar as flags seguintes ao jogador.", - flagTake = "%s tirou '%s' flags de %s.", - flagTakeTitle = "Tirar Flags", - flagTakeDesc = "Remover Flags do jogador.", - flagNoMatch = "Tu deves ter a Flag \"%s\" para fazeres isto.", - textAdded = "Adicionaste texto.", - textRemoved = "Removeste %s textos.", - moneyTaken = "Encontraste %s.", - businessPurchase = "Compraste %s por %s.", - businessSell = "Vendeste %s por %s.", + dSetFaction = "Esta porta agora pertence à facção %s.", + dRemoveFaction = "Esta porta não pertence mais a nenhuma facção.", + dNotValid = "Você não está olhando para uma porta válida.", + canNotAfford = "Você não pode pagar por esta compra.", + dPurchased = "Você comprou esta porta por %s.", + dSold = "Você vendeu esta porta por %s.", + notOwner = "Você não é o proprietário disso.", + invalidArg = "Você forneceu um valor inválido para o argumento #%s.", + flagGive = "%s deu a %s a(s) bandeira(s) '%s'.", + flagGiveTitle = "Dar Bandeiras", + flagGiveDesc = "Dê as seguintes bandeiras ao jogador.", + flagTake = "%s retirou a(s) bandeira(s) '%s' de %s.", + flagTakeTitle = "Retirar Bandeiras", + flagTakeDesc = "Remova as seguintes bandeiras do jogador.", + flagNoMatch = "Você precisa ter bandeira(s) \"%s\" para executar esta ação.", + textAdded = "Você adicionou um texto.", + textRemoved = "Você removeu %s texto(s).", + moneyTaken = "Você encontrou %s.", + businessPurchase = "Você comprou %s por %s.", + businessSell = "Você vendeu %s por %s.", cChangeModel = "%s mudou o modelo de %s para %s.", cChangeName = "%s mudou o nome de %s para %s.", cChangeSkin = "%s mudou a skin de %s para %s.", - cChangeGroups = "%s mudou o bodygroup de %s \"%s\" para %s.", + cChangeGroups = "%s mudou o grupo de corpo \"%s\" de %s para %s.", cChangeFaction = "%s transferiu %s para a facção %s.", - playerCharBelonging = "Isto pertence a outro personagem.", + playerCharBelonging = "Este objeto pertence a outro personagem seu.", business = "Negócios", - invalidFaction = "Deste uma facção inválida.", - limitFaction = "Esta facção está cheia. Tenta mais tarde.", - spawnAdd = "Adicionaste um spawn para a %s.", - spawnDeleted = "Removeste %s spawn point(s).", + invalidFaction = "Você forneceu uma facção inválida.", + limitFaction = "Esta facção está cheia. Tente novamente mais tarde.", + spawnAdd = "Você adicionou um ponto de spawn para %s.", + spawnDeleted = "Você removeu %s ponto(s) de spawn.", someone = "Alguém", - rgnLookingAt = "Permite que a pessoa te reconheça.", - rgnWhisper = "Permite que a(s) pessoa(s) na area de sussuro te reconheçam.", - rgnTalk = "Permite que a(s) pessoa(s) na area de fala te reconheçam.", - rgnYell = "Permite que a(s) pessoa(s) na area de gritar te reconheçam.", + rgnLookingAt = "Permitir que a pessoa que você está olhando o reconheça.", + rgnWhisper = "Permitir que aqueles em um sussurro reconheçam você.", + rgnTalk = "Permitir que aqueles em uma conversa reconheçam você.", + rgnYell = "Permitir que aqueles em um grito reconheçam você.", icFormat = "%s diz \"%s\"", - rollFormat = "%s deu roll a %s.", + rollFormat = "%s rolou %s.", wFormat = "%s sussurra \"%s\"", yFormat = "%s grita \"%s\"", - sbOptions = "Clica para veres as opções para %s.", - spawnAdded = "Adicionaste um spawn para %s.", - whitelist = "%s deu uma whitelist a %s para a facção %s.", - unwhitelist = "%s tirou uma whitelist a %s para a facção %s.", - gettingUp = "Estás a levantar-te...", - wakingUp = "Estás a ganhar consciência...", + sbOptions = "Clique para ver opções para %s.", + spawnAdded = "Você adicionou um spawn para %s.", + whitelist = "%s incluiu %s na whitelist da facção %s.", + unwhitelist = "%s excluiu %s da whitelist da facção %s.", + gettingUp = "Você está se levantando agora...", + wakingUp = "Você está recuperando a consciência...", Weapons = "Armas", - checkout = "Vai para o pagamento (%s)", + checkout = "Ir para o Checkout (%s)", purchase = "Comprar", purchasing = "Comprando...", success = "Sucesso", - buyFailed = "Compra Falhada.", - buyGood = "Compra bem sucedida!", + buyFailed = "Compra falhou.", + buyGood = "Compra bem-sucedida!", shipment = "Remessa", shipmentDesc = "Esta remessa pertence a %s.", - class = "Class", + class = "Classe", classes = "Classes", - illegalAccess = "Acesso Ilegal.", - becomeClassFail = "Falhaste a tornar-te %s.", - becomeClass = "Tornaste-te %s.", - attribSet = "Definiste %s %s para %s.", - attribUpdate = "Adicionaste %s %s para %s.", - noFit = "Este item não cabe no teu inventário.", + illegalAccess = "Acesso ilegal.", + becomeClassFail = "Falha ao se tornar %s.", + becomeClass = "Você se tornou %s.", + attribSet = "Você definiu %s's %s como %s.", + attribUpdate = "Você adicionou %s's %s por %s.", + noFit = "Este item não cabe em seu inventário.", help = "Ajuda", commands = "Comandos", - helpDefault = "Selecionar Categoria", - doorSettings = "Definições da porta", + helpDefault = "Selecione uma categoria", + doorSettings = "Configurações da Porta", sell = "Vender", access = "Acesso", locking = "Trancando esta entidade...", - unlocking = "Desbloqueando esta entidade...", - modelNoSeq = "O teu modelo não suporta este ato.", - notNow = "Não és permitido a fazer isto agora.", - faceWall = "Deves estar a olhar para uma parede para fazer isto.", - faceWallBack = "Deves estar de costas para uma parede para fazer isto.", - descChanged = "Mudaste a aparência do teu personagem.", - charMoney = "Tens %s.", - charFaction = "És membro da facção %s.", - charClass = "Tu %s da facção.", + unlocking = "Destrancando esta entidade...", + modelNoSeq = "Seu modelo não suporta essa ação.", + notNow = "Você não tem permissão para fazer isso agora.", + faceWall = "Você precisa estar de frente para a parede para fazer isso.", + faceWallBack = "Sua parte de trás deve estar voltada para a parede para fazer isso.", + descChanged = "Você alterou a descrição do seu personagem.", + charMoney = "Você tem atualmente %s.", + charFaction = "Você é um membro da facção %s.", + charClass = "Você é %s da facção.", noSpace = "Inventário está cheio.", - noOwner = "O dono é invalido.", - invalidIndex = "O índice deste item Index é invalido.", - invalidItem = "O objeto deste item Index é invalido.", - invalidInventory = "O objecto do inventário é invaldio.", - home = "Home", - charKick = "%s deu kick ao personagem %s.", + noOwner = "O proprietário é inválido.", + notAllowed = "Esta ação não é permitida.", + invalidIndex = "O Índice do Item é Inválido.", + invalidItem = "O Objeto do Item é Inválido.", + invalidInventory = "O Objeto de Inventário é Inválido.", + home = "Início", + charKick = "%s chutou o personagem %s.", charBan = "%s baniu o personagem %s.", charBanned = "Este personagem está banido.", - setMoney = "Definiste o dinheiro de %s para %s.", - itemPriceInfo = "Podes comprar este item por %s.\nPodes vender este item por %s", - free = "De Graça", - vendorNoSellItems = "Não existem items para vender.", - vendorNoBuyItems = "Não existem items para comprar.", - vendorSettings = "Definições do vendedor", - vendorUseMoney = "O vendedor deve usar dinheiro?", - vendorNoBubble = "Esconder a bolha do vendedor?", + setMoney = "Você definiu o dinheiro de %s como %s.", + itemPriceInfo = "Você pode comprar este item por %s.\nVocê pode vender este item por %s", + free = "Grátis", + vendorNoSellItems = "Não há itens para vender.", + vendorNoBuyItems = "Não há itens para comprar.", + vendorSettings = "Configurações do Vendedor", + vendorUseMoney = "Vendedor deve usar dinheiro?", + vendorNoBubble = "Esconder balão do vendedor?", mode = "Modo", price = "Preço", - stock = "Stock", + stock = "Estoque", none = "Nenhum", vendorBoth = "Comprar e Vender", vendorBuy = "Apenas Comprar", vendorSell = "Apenas Vender", - maxStock = "Stock Máximo", - vendorFaction = "Editor de Facções", + maxStock = "Estoque Máximo", + vendorFaction = "Editor de Facção", buy = "Comprar", - vendorWelcome = "Bem vindo à minha loja, o que é que te posso arranjar hoje?", - vendorBye = "Volta brevemente!", - charSearching = "Já estás a procurar um personagem, espera por favor.", + vendorWelcome = "Bem-vindo à minha loja, o que posso pegar para você hoje?", + vendorBye = "Volte sempre!", + charSearching = "Você já está procurando por outro personagem, por favor, espere.", charUnBan = "%s desbaniu o personagem %s.", charNotBanned = "Este personagem não está banido.", - storPass = "Definiste a password deste armazém para %s.", - storPassRmv = "Removeste a password deste armazém.", - storPassWrite = "Mete a password.", - wrongPassword = "Meteste a password errada.", - cheapBlur = "Desativar obscurecimento? (Aumenta os FPS)", - quickSettings = "Definições rápidas", - vmSet = "Definiste voicemail.", - vmRem = "Removeste o teu voicemail.", + storPass = "Você definiu a senha deste armazenamento como %s.", + storPassRmv = "Você removeu a senha deste armazenamento.", + storPassWrite = "Digite a senha.", + wrongPassword = "Você digitou a senha errada.", + cheapBlur = "Desativar o desfoque? (Aumenta o FPS)", + quickSettings = "Configurações Rápidas", + vmSet = "Você definiu sua caixa postal.", + vmRem = "Você removeu sua caixa postal.", altLower = "Esconder mãos quando abaixadas?", - noPerm = "Não estás permitido a fazer isto.", - youreDead = "Tu estás morto", - injMajor = "Parece estar criticamente ferido.", - injLittle = "Parece magoado", - toggleObserverTP = "Alternar teleportador do Observer", - toggleESP = "Alternar ESP de Admin", - toggleESPAdvanced = "Modo avançado do ESP", - chgName = "Mudar nome", - chgNameDesc = "Põe o novo nome do personagem abaixo.", - thirdpersonToggle = "Alternar Terceira Pessoa", - thirdpersonClassic = "Usar Terceira Pessoa clássica", - thirdpersonConfig = "Configuração da Terceira Pessoa", - equippedBag = "items equipados não podem ser movidos por inventarios.", - useTip = "Usa o item", - equipTip = "Equipa o item.", - unequipTip = "Desequipa o item.", + noPerm = "Você não tem permissão para fazer isso.", + youreDead = "Você está morto", + injMajor = "Parece gravemente ferido.", + injLittle = "Parece ferido", + toggleObserverTP = "Alternar teletransporte de observador", + toggleESP = "Alternar ESP de Administrador", + toggleESPAdvanced = "Modo Avançado de ESP", + chgName = "Mudar Nome", + chgNameDesc = "Digite o novo nome do personagem abaixo.", + thirdpersonToggle = "Alternar Visão de Terceira Pessoa", + thirdpersonClassic = "Usar Visão de Terceira Pessoa Clássica", + thirdpersonConfig = "Configuração de Terceira Pessoa", + equippedBag = "Itens equipados não podem ser movidos entre inventários.", + useTip = "Usa o item.", + equipTip = "Equipar o item.", + unequipTip = "Desquipar o item.", consumables = "Consumíveis", - plyNotValid = "Não estás a olhar para um jogador valido.", - restricted = "Foste contido.", - viewProfile = "Ver perfil Steam", - salary = "Recebeste %s do teu salário.", - noRecog = "Não reconheces esta pessoa.", - curTime = "São %s.", - vendorEditor = "Editar Vendedor", + plyNotValid = "Você não está olhando para um jogador válido.", + restricted = "Você está restrito.", + viewProfile = "Ver Perfil Steam", + salary = "Você recebeu %s do seu salário.", + noRecog = "Você não reconhece esta pessoa.", + curTime = "O horário atual é %s.", + vendorEditor = "Editor de Vendedor", edit = "Editar", - disable = "Desabilitar", - vendorPriceReq = "Põe o novo preço para este item.", - vendorEditCurStock = "Edit Current Stock", - you = "Tu", - vendorSellScale = "Escala do Preço de Venda", - vendorNoTrade = "Tu não podes trocar com este vendedor.", - vendorNoMoney = "Este vendedor não têm dinheiro suficiente para esse item.", - vendorNoStock = "Este vendedor não têm esse item em stock.", - contentTitle = "Conteúdo NutScript não encontrado", - contentWarning = "Não tens o conteúdo do NutScript montado. Isto pode resultar em alguns recursos não funcionarem .\nO conteúdo do Nutscript foi mudado para o do rebel1324.\nQueres abrir a pagina da loja para o conteúdo do NutScript?", - flags = "Flags", - chooseTip = "Escolhe este personagem para jogares.", - deleteTip = "Apagar este personagem.", - moneyLeft = "O teu dinheiro: ", + disable = "Desativar", + vendorPriceReq = "Digite o novo preço para este item.", + vendorEditCurStock = "Editar Estoque Atual", + you = "Você", + vendorSellScale = "Escala de preço de venda", + vendorNoTrade = "Você não pode negociar com este vendedor.", + vendorNoMoney = "Este vendedor não pode pagar por esse item.", + vendorNoStock = "Este vendedor não tem esse item em estoque.", + contentTitle = "Conteúdo do NutScript Ausente", + contentWarning = "Você não tem o conteúdo do NutScript montado. Isso pode resultar em algumas funcionalidades ausentes.\nO endereço do conteúdo do Nutscript foi alterado para o de rebel1324.\nGostaria de abrir a página da Oficina para o conteúdo do NutScript?", + flags = "Bandeiras", + chooseTip = "Escolha este personagem para jogar com.", + deleteTip = "Excluir este personagem.", + moneyLeft = "Seu Dinheiro: ", currentMoney = "Dinheiro Restante: ", - - -- 2018 patch - - ammoLoadAll = "Carregar tudo", + -- 2018-patch + ammoLoadAll = "Carregar Tudo", ammoLoadAmount = "Carregar %s", ammoLoadCustom = "Carregar...", split = "Dividir", - splitHelp = "Mete um número para dividir.", + splitHelp = "Digite um número para dividir.", splitHalf = "Dividir 1/2", splitQuarter = "Dividir 1/4", - recognize = "Permite que este personagem te reconheça.", - recognized = "Deste a tua identidade a este personagem.", + recognize = "Permitir que este personagem o reconheça.", + recognized = "Você deu sua identidade a este personagem.", already_recognized = "Este personagem já te conhece.", - isTied = "Esta personagem já está atada.", - tying = "Atando", - untying = "Desatando", - beingUntied = "Estás a ser desatado.", - beingTied = "Estás a ser atado.", - sameOutfitCategory = "Já estás a vestir uma roupa deste tipo.", - noBusiness = "Não podes comprar nada.", - panelRemoved = "Removeste %s 3D panels.", - panelAdded = "Adicionaste 1 3D panel.", - itemOnGround = "O teu item foi colocado no chão.", - forbiddenActionStorage = "Não podes fazer isto com itens armazenados.", - cantDropBagHasEquipped = "Não podes largar uma mala equipada.", - - -- 2021 patch - lookToUseAt = "Precisas de estar a olhar para alguém para usar '@'", - mustProvideString = "Deves dar uma string para a variável", + isTied = "Esta pessoa está amarrada.", + tying = "Amarrando", + untying = "Desamarrando", + beingUntied = "Você está sendo desamarrado.", + beingTied = "Você está sendo amarrado.", + sameOutfitCategory = "Você já está usando esse tipo de roupa.", + noBusiness = "Você não está autorizado a comprar nada no momento.", + panelRemoved = "Você removeu %s painel(ns) 3D.", + panelAdded = "Você adicionou um painel 3D.", + itemOnGround = "Seu item foi colocado no chão.", + forbiddenActionStorage = "Você não pode fazer essa ação com um item guardado.", + cantDropBagHasEquipped = "Você não pode soltar a bolsa que possui um item equipado.", + -- 2021-patch + lookToUseAt = "Olhe para alguém para usar '@'", + mustProvideString = "Você deve fornecer uma string para a variável", + -- 2023-patch + togglePluginsDesc = "Os Plugins selecionados serão desativados.\nO mapa deve ser reiniciado após fazer as alterações!", } + diff --git a/gamemode/languages/sh_russian.lua b/gamemode/languages/sh_russian.lua index 0aceb1ac..4b746b04 100644 --- a/gamemode/languages/sh_russian.lua +++ b/gamemode/languages/sh_russian.lua @@ -1,6 +1,6 @@  --[[ -Russian translation by: +Russian translation by: Shadow Nova (http://steamcommunity.com/profiles/76561197989134302), Schwarz Kruppzo (http://steamcommunity.com/id/schwarzkruppzo), Neon (http://steamcommunity.com/id/ru_neon), @@ -11,288 +11,269 @@ Tov (https://steamcommunity.com/id/TOVARISCHPOOTIS) NAME = "Русский" LANGUAGE = { - loading = "Загружается", - dbError = "Подключение к базе данных провалилось", - unknown = "Неизвестно", - noDesc = "Описание отсутствует", - create = "Создать", - createTip = "Создать нового персонажа, за которого вы будете играть.", - load = "Загрузить", - loadTip = "Выберите ранее созданного вами персонажа.", - leave = "Выйти", - leaveTip = "Покинуть текущий сервер.", - ["return"] = "Вернуться", - returnTip = "Вернуться к предыдущему меню.", - name = "Имя", - desc = "Описание", - model = "Модель", - attribs = "Атрибуты", - charCreateTip = "Заполните строчки ниже и нажмите 'Завершить', чтобы создать вашего персонажа.", - invalid = "Вы предъявили недействительный %s", - descMinLen = "Ваше описание должно хотя бы иметь %d количество букв.", - player = "Игрок", - finish = "Завершить", - finishTip = "Завершить создание персонажа.", - needModel = "Вы должны выбрать действительную модель", - creating = "Ваш персонаж создаётся...", - unknownError = "Обнаружена неизвестная ошибка", - delConfirm = "Вы уверены, что хотите НАВСЕГДА удалить %s?", - no = "Нет", - yes = "Да", - choose = "Выбрать", - delete = "Удалить", - chooseTip = "Выбрать этого персонажа.", - deleteTip = "Удалить этого персонажа.", - itemInfo = "Название: %s\nОписание: %s", - cloud_no_repo = "Выбранное хранилише недействительное.", - cloud_no_plugin = "Выбранный плагин недействителен.", - inv = "Инвентарь", - plugins = "Плагин", - author = "Автор", - version = "Версия", - characters = "Персонажи", - business = "Бизнес", - settings = "Настройки", - config = "Конфиг", - chat = "Чат", - appearance = "Внешний вид", - misc = "Остальное", - oocDelay = "Вы должны дождаться %s секунд, чтобы воспользоватся OOC чатом снова.", - loocDelay = "Вы должны дождаться %s секунд чтобы воспользоватся LOOC чатом снова.", - usingChar = "Вы уже используете этого персонажа.", - notAllowed = "Извините, но вы не можете этого сделать.", - itemNoExist = "Извините, но предмет, который вы просите не существует.", - cmdNoExist = "Извините, но эта команда не существует.", - plyNoExist = "Извините, игрок с таким именем не найден.", - cfgSet = "%s изменил \"%s\" на %s.", - drop = "Выбросить", - dropTip = "Выбросить этот предмет из инвентаря.", - take = "Взять", - takeTip = "Взять предмет и положить его в инвентарь.", - dTitle = "Бесхозная дверь", - dTitleOwned = "Арендованная дверь", - dIsNotOwnable = "Эту дверь невозможно арендовать.", - dIsOwnable = "Вы можете арендовать эту дверь, нажимая кнопку F2.", - dMadeUnownable = "Вы сделали эту дверь не подлежащей к аренде.", - dMadeOwnable = "Вы сделали эту дверь подлежащей к аренде.", - dNotAllowedToOwn = "Вам не позволено арендовать эту дверь.", - dSetDisabled = "Вы сделали эту дверь нерабочей.", - dSetNotDisabled = "Вы сделали эту дверь вновь рабочей.", - dSetHidden = "Вы сделали эту дверь невидимой.", - dSetNotHidden = "Вы сделали эту дверь вновь видимой.", - dSetParentDoor = "Вы сделали эту дверь главной.", - dCanNotSetAsChild = "Вы не можете сделать главную дверь второстепенной.", - dAddChildDoor = "Вы добавили эту дверь как второстепенную.", - dRemoveChildren = "Вы убрали все второстепенные двери из перечня главной.", - dRemoveChildDoor = "Вы убрали второстепенную дверь из перечня главной.", - dNoParentDoor = "У вас не установленна главная дверь.", - dOwnedBy = "Эта дверь принадлежит %s.", - dConfigName = "Дверь", - dSetFaction = "Сейчас эта дверь принадлежит %s фракций.", - dRemoveFaction = "Эта дверь не принадлежит никакой фракции.", - dNotValid = "Вы смотрите не на подлинную дверь.", - canNotAfford = "У вас недостаточно средств, чтобы купить это.", - dPurchased = "Вы арендовали эту дверь за %s.", - dSold = "Вы продали эту дверь за %s.", - notOwner = "Вы не владелец этого.", - invalidArg = "Вы предоставили недопустимое значение аргумента #%s.", - tellAdmin = "Ошибка: %s. Сообщите администратору!", - flagGive = "%s выдал %s '%s' флаги.", - flagTake = "%s отнял '%s' флаги у %s.", - flagNoMatch = "У вас должны быть \"%s\" флаги, чтобы выполнить это действие.", - textAdded = "Вы добавили текст.", - textRemoved = "Вы удалили %s текст(ов).", - moneyTaken = "Вы нашли %s.", - businessPurchase = "Вы купили %s за %s.", - businessSell = "Вы продали %s за %s.", - cChangeModel = "%s поменял модель %s на %s.", - cChangeName = "%s поменял имя %s на %s.", - cChangeSkin = "%s поменял скин %s на %s.", - cChangeGroups = "%s поменял %s \"%s\" бодигруппу на %s.", - cChangeFaction = "%s переместил %s в фракцию %s.", - playerCharBelonging = "Этот объект принадлежит другому вашему персонажу.", - invalidFaction = "Вы предъявили недействительную фракцию.", - spawnAdd = "Вы создали точку возрождения для %s.", - spawnDeleted = "Вы удалили %s точку (точки) возрождения.", - someone = "Кто-то", - rgnLookingAt = "Позволить человеку, на которого вы смотрите вас распознать.", - rgnWhisper = "Позволить людям в радиусе слышимости шепота вас распознать.", - rgnTalk = "Позволить людям в радиусе слышимости речи вас распознать.", - rgnYell = "Позволить людям в радиусе слышимости крика вас распознать.", - icFormat = "%s говорит \"%s\"", - rollFormat = "%s выпало число %s.", - wFormat = "%s шепчет \"%s\"", - yFormat = "%s кричит \"%s\"", - sbOptions = "Нажмите, чтобы увидеть опции для %s.", - spawnAdded = "Вы создали точку возрождения для %s.", - whitelist = "%s добавил %s в перечень фракции %s.", - unwhitelist = "%s исключил %s из перечня фракции %s.", - gettingUp = "Вы поднимаетесь...", - wakingUp = "Вы приходите в чувство...", - Weapons = "Оружие", - checkout = "Перейти к оформлению заказа (%s)", - purchase = "Покупка", - purchasing = "Покупаем...", - success = "Успех", - buyFailed = "Покупка провалилась.", - buyGood = "Покупка успешна!", - shipment = "Груз", - shipmentDesc = "Этот груз принадлежит %s.", - class = "Класс", - classes = "Классы", - illegalAccess = "Запрещённый доступ.", - becomeClassFail = "Не получилось стать %s.", - becomeClass = "Вы стали %s.", - attribSet = "Вы поменяли игроку %s %s на %s.", - attribUpdate = "Вы добавили игроку %s %s by %s.", - noFit = "Этот предмет не помещается в инвентаре.", - help = "Помощь", - commands = "Команды", - helpDefault = "Выберите категорию", - doorSettings = "Настройки дверей", - sell = "Продать", - access = "Доступ", - locking = "Запираем этот объект...", - unlocking = "Открываем этот объект...", - modelNoSeq = "Эта модель не поддерживает эту анимацию.", - notNow = "Вы не можете это сделать сейчас.", - faceWall = "Вы должны стоять лицом к стене, чтобы сделать это.", - faceWallBack = "Ваша спина должна быть прижата к стене, чтобы сделать это.", - descChanged = "Вы поменяли описание вашего персонажа.", - livesLeft = "Жизней осталось: %s", - charIsDead = "Ваш персонаж умер", - charMoney = "У вас сейчас %s.", - charFaction = "Вы являетесь членом фракции %s.", - charClass = "Вы %s фракций.", - noSpace = "Ваш инвентарь полон.", - noOwner = "Владелец недействителен.", - invalidIndex = "Индекс предмета недействителен.", - invalidItem = "Объект предмета недействителен.", - invalidInventory = "Объект инвентаря недействителен.", - home = "Дом", - charKick = "%s кикнул персонажа %s.", - charBan = "%s забанил персонажа %s.", - charBanned = "Этот персонаж забанен.", - setMoney = "Вы установили %s's количество денег на %s.", - itemPriceInfo = "Вы можете купить этот предмет за %s.\nВы можете продать этот предмет за %s", - free = "Бесплатно", - vendorNoSellItems = "Здесь нету предметов для продажи.", - vendorNoBuyItems = "Здесь нету предметов для покупки.", - vendorSettings = "Настроики раздатчика", - vendorUseMoney = "Будет ли раздатчик брать деньги?", - vendorNoBubble = "Спрятать облачко раздатчика?", - mode = "Мод", - price = "Цена", - stock = "Запас", - none = "Ничего", - vendorBoth = "Купить и продать", - vendorBuy = "Только купить", - vendorSell = "Только продать", - maxStock = "Максимальный запас", - vendorFaction = "Настройки фракций", - buy = "Купить", - vendorWelcome = "Приветствую вас в моем магазине, что пожелаете?", - vendorBye = "Приходите еще!", - charSearching = "Вы уже ищите другого персонажа, пожалуйста, подождите.", - charUnBan = "%s разбанил персонажа %s.", - charNotBanned = "Этот персонаж не забанен.", - storPass = "Вы установили пароль контейнера на %s.", - storPassRmv = "Вы убрали пароль контейнера.", - storPassWrite = "Введите пароль.", - wrongPassword = "Вы ввели неправильный пароль.", - cheapBlur = "Выключить размытие? (Повышает FPS)", - quickSettings = "Быстрые настройки", - vmSet = "Вы установили ваш автоответчик.", - vmRem = "Вы избавились от автоответчика.", - altLower = "Спрятать руки, пока они опущены?", - noPerm = "Вам не позволено сделать это.", - youreDead = "Вы мертвы", - injMajor = "Похоже, что он очень сильно ранен.", - injLittle = "Похоже, что он ранен", - toggleESP = "Включить Admin ESP", - chgName = "Поменять имя", - chgNameDesc = "Впишите новое имя для персонажа.", - thirdpersonToggle = "Включить вид от третьего лица", - thirdpersonClassic = "Использовать классический вид от третьего лица", - equippedBag = "Сумка, которую вы сдвинули имеет одетую вами вещь.", - useTip = "Использовать предмет.", - equipTip = "Одеть предмет.", - unequipTip = "Снять предмет.", - consumables = "Потребности", - plyNotValid = "Вы смотрите не на подлинного игрока.", - restricted = "Вы были связаны.", - viewProfile = "Показать профиль Steam", - salary = "Вы получили %s из вашей зарплаты.", - noRecog = "Вы не узнаёте этого человека.", - curTime = "Текущее время: %s.", - vendorEditor = "Редактор торговца", - edit = "Изменить", - disable = "Отключить", - vendorPriceReq = "Введите новую цену предмета.", - vendorEditCurStock = "Изменить количество", - radioFreq = "Изменить частоту радиоприёма", - radioSubmit = "Сохранить", - you = "Вы", - isTied = "Связан", - tying = "Связывание...", - unTying = "Развязывание...", - On = "Включен", - Off = "Выключен", - vendorSellScale = "Множитель цен продажи", - vendorNoTrade = "Вы не можете взаимодействовать с этим торговцем.", - vendorNoMoney = "Торговец не может купить у вас предмет.", - vendorNoStock = "У этого торговца нет в наличии этого предмета.", - contentTitle = "Отсутствует контент NutScript", - contentWarning = "У вас не установлен контент NutScript. Некоторые функции могут не работать.\nВы желаете перейти на страницу скачивания контента?", - Assign = "Присвоить", - Freq = "Частота", - Toggle = "Переключить", - Use = "Использовать", - UseForward = "Использовать на игроке", - Equip = "Экипировать", - Unequip = "Снять", - Load = "Распаковать", - View = "Открыть", - flags = "Флаги", - moneyLeft = "Ваши деньги: ", - currentMoney = "Осталось денег: ", - moneyGiven = "Вы дали %s", + loading = "Загрузка", + dbError = "Ошибка подключения к базе данных", + unknown = "Неизвестно", + noDesc = "Описание отсутствует", + create = "Создать", + createTip = "Создать нового персонажа для игры.", + load = "Загрузить", + loadTip = "Выбрать ранее созданного персонажа для игры.", + leave = "Выйти", + leaveTip = "Покинуть текущий сервер.", + ["return"] = "Вернуться", + returnTip = "Вернуться в предыдущее меню.", + name = "Имя", + desc = "Описание", + model = "Модель", + attribs = "Атрибуты", + charCreateTip = "Заполните поля ниже и нажмите 'Завершить', чтобы создать своего персонажа.", + invalid = "Вы указали недопустимый %s", + descMinLen = "Ваше описание должно содержать как минимум %d символ(ов).", + player = "Игрок", + finish = "Завершить", + finishTip = "Завершить создание персонажа.", + needModel = "Вам нужно выбрать подходящую модель", + creating = "Ваш персонаж создается...", + unknownError = "Произошла неизвестная ошибка", + delConfirm = "Вы уверены, что хотите ПЕРМАНЕНТНО удалить %s?", + no = "Нет", + yes = "Да", + itemInfo = "Название: %s\nОписание: %s", + itemCreated = "Предмет успешно создан.", + cloud_no_repo = "Указанный репозиторий недействителен.", + cloud_no_plugin = "Указанный плагин недействителен.", + inv = "Инвентарь", + plugins = "Плагины", + togglePlugins = "Включить/выключить плагины", + author = "Автор", + version = "Версия", + characters = "Персонажи", + settings = "Настройки", + config = "Конфигурация", + chat = "Чат", + appearance = "Внешность", + misc = "Разное", + oocDelay = "Вы должны подождать еще %s секунд(ы) перед повторным использованием OOC.", + loocDelay = "Вы должны подождать еще %s секунд(ы) перед повторным использованием LOOC.", + usingChar = "Вы уже используете этого персонажа.", + itemNoExist = "Извините, запрошенный вами предмет не существует.", + cmdNoExist = "Извините, этой команды не существует.", + plyNoExist = "Извините, игрок с таким именем не найден.", + cfgSet = "%s установил \"%s\" на %s.", + drop = "Убрать", + dropTip = "Убрать этот предмет из вашего инвентаря.", + take = "Взять", + takeTip = "Взять этот предмет и поместить его в ваш инвентарь.", + dTitle = "Безхозная дверь", + dTitleOwned = "Приобретенная дверь", + dIsNotOwnable = "Эта дверь не может быть взята во владение.", + dIsOwnable = "Вы можете приобрести эту дверь, нажав F2.", + dMadeUnownable = "Вы сделали эту дверь невладеемой.", + dMadeOwnable = "Вы сделали эту дверь владеемой.", + dNotAllowedToOwn = "Вам запрещено владеть этой дверью.", + dSetDisabled = "Вы сделали эту дверь недоступной.", + dSetNotDisabled = "Вы сделали эту дверь снова доступной.", + dSetHidden = "Вы скрыли эту дверь.", + dSetNotHidden = "Вы сделали эту дверь видимой.", + dSetParentDoor = "Вы установили эту дверь как родительскую.", + dCanNotSetAsChild = "Вы не можете установить родительскую дверь как дочернюю.", + dAddChildDoor = "Вы добавили эту дверь в качестве дочерней.", + dRemoveChildren = "Вы удалили все дочерние двери для этой двери.", + dRemoveChildDoor = "Вы удалили эту дверь как дочернюю.", + dNoParentDoor = "У вас не установлена родительская дверь.", + dOwnedBy = "Эта дверь принадлежит %s.", + dConfigName = "Двери", + dSetFaction = "Эта дверь теперь принадлежит фракции %s.", + dRemoveFaction = "Эта дверь больше не принадлежит никакой фракции.", + dNotValid = "Вы не смотрите на действительную дверь.", + canNotAfford = "У вас нет денег, чтобы купить это.", + dPurchased = "Вы приобрели эту дверь за %s.", + dSold = "Вы продали эту дверь за %s.", + notOwner = "Вы не являетесь владельцем этого.", + invalidArg = "Вы предоставили недопустимое значение для аргумента #%s.", + flagGive = "%s дал %s флаги '%s'.", + flagGiveTitle = "Выдать флаги", + flagGiveDesc = "Выдайте следующие флаги игроку.", + flagTake = "%s взял флаги '%s' у %s.", + flagTakeTitle = "Забрать флаги", + flagTakeDesc = "Уберите следующие флаги у игрока.", + flagNoMatch = "Для выполнения этого действия вам нужно иметь флаг(и) \"%s\".", + textAdded = "Вы добавили текст.", + textRemoved = "Вы удалили %s текст(ов).", + moneyTaken = "Вы нашли %s.", + businessPurchase = "Вы приобрели %s за %s.", + businessSell = "Вы продали %s за %s.", + cChangeModel = "%s сменил модель %s на %s.", + cChangeName = "%s сменил имя %s на %s.", + cChangeSkin = "%s сменил скин %s на %s.", + cChangeGroups = "%s сменил бодигруппу \"%s\" у %s на %s.", + cChangeFaction = "%s перевел %s в фракцию %s.", + playerCharBelonging = "Этот объект является имуществом другого вашего персонажа.", + business = "Бизнес", + invalidFaction = "Вы указали недействительную фракцию.", + limitFaction = "Эта фракция полна. Попробуйте позже.", + spawnAdd = "Вы добавили точку появления для %s.", + spawnDeleted = "Вы удалили %s точек появления.", + someone = "Кто-то", + rgnLookingAt = "Разрешить человеку, на которого вы смотрите, узнать вас.", + rgnWhisper = "Разрешить тем, кто находится в радиусе шепота, узнать вас.", + rgnTalk = "Разрешить тем, кто находится в радиусе разговора, узнать вас.", + rgnYell = "Разрешить тем, кто находится в радиусе крика, узнать вас.", + icFormat = "%s говорит \"%s\"", + rollFormat = "%s бросил %s.", + wFormat = "%s шепчет \"%s\"", + yFormat = "%s кричит \"%s\"", + sbOptions = "Нажмите, чтобы увидеть опции для %s.", + spawnAdded = "Вы добавили точку появления для %s.", + whitelist = "%s добавил в белый список %s для фракции %s.", + unwhitelist = "%s убрал из белого списка %s из фракции %s.", + gettingUp = "Вы встаете...", + wakingUp = "Вы приходите в сознание...", + Weapons = "Оружие", + checkout = "Перейти к оформлению (%s)", + purchase = "Покупка", + purchasing = "Покупка...", + success = "Успех", + buyFailed = "Покупка не удалась.", + buyGood = "Покупка успешно завершена!", + shipment = "Партия", + shipmentDesc = "Эта партия принадлежит %s.", + class = "Класс", + classes = "Классы", + illegalAccess = "Незаконный доступ.", + becomeClassFail = "Не удалось стать %s.", + becomeClass = "Вы стали %s.", + attribSet = "Вы установили %s %s на %s.", + attribUpdate = "Вы увеличили %s %s на %s.", + noFit = "Этот предмет не помещается в ваш инвентарь.", + help = "Помощь", + commands = "Команды", + helpDefault = "Выберите категорию", + doorSettings = "Настройки дверей", + sell = "Продать", + access = "Доступ", + locking = "Закрываю этот объект...", + unlocking = "Открываю этот объект...", + modelNoSeq = "Ваша модель не поддерживает это действие.", + notNow = "Вам сейчас нельзя это делать.", + faceWall = "Вы должны смотреть на стену, чтобы сделать это.", + faceWallBack = "Ваша спина должна быть обращена к стене, чтобы сделать это.", + descChanged = "Вы изменили описание своего персонажа.", + charMoney = "У вас сейчас %s.", + charFaction = "Вы являетесь членом фракции %s.", + charClass = "Вы %s фракции.", + noSpace = "Инвентарь полон.", + noOwner = "Владелец недействителен.", + notAllowed = "Это действие не разрешено.", + invalidIndex = "Индекс предмета недействителен.", + invalidItem = "Объект предмета недействителен.", + invalidInventory = "Объект инвентаря недействителен.", + home = "Домой", + charKick = "%s выгнал персонажа %s.", + charBan = "%s забанил персонажа %s.", + charBanned = "Этот персонаж забанен.", + setMoney = "Вы установили деньги %s на %s.", + itemPriceInfo = "Вы можете приобрести этот предмет за %s.\nВы можете продать этот предмет за %s", + free = "Бесплатно", + vendorNoSellItems = "Нет предметов для продажи.", + vendorNoBuyItems = "Нет предметов для покупки.", + vendorSettings = "Настройки продавца", + vendorUseMoney = "Продавец должен использовать деньги?", + vendorNoBubble = "Скрыть облачко продавца?", + mode = "Режим", + price = "Цена", + stock = "Склад", + none = "Нет", + vendorBoth = "Купить и продать", + vendorBuy = "Только покупка", + vendorSell = "Только продажа", + maxStock = "Максимальный запас", + vendorFaction = "Редактор фракции", + buy = "Купить", + vendorWelcome = "Добро пожаловать в мой магазин, что я могу для вас сделать?", + vendorBye = "Приходите еще!", + charSearching = "Вы уже ищете другого персонажа, пожалуйста, подождите.", + charUnBan = "%s разбанил персонажа %s.", + charNotBanned = "Этот персонаж не забанен.", + storPass = "Вы установили пароль для этого хранилища: %s.", + storPassRmv = "Вы удалили пароль для этого хранилища.", + storPassWrite = "Введите пароль.", + wrongPassword = "Вы ввели неверный пароль.", + cheapBlur = "Отключить размытие? (Повышает FPS)", + quickSettings = "Быстрые настройки", + vmSet = "Вы установили свою голосовую почту.", + vmRem = "Вы удалили свою голосовую почту.", + altLower = "Скрывать руки, когда они опущены?", + noPerm = "Вам запрещено это делать.", + youreDead = "Вы мертвы", + injMajor = "Выглядит критически раненым/ой.", + injLittle = "Выглядит раненым/ой.", + toggleObserverTP = "Переключить телепортацию наблюдателя", + toggleESP = "Переключить режим администратора ESP", + toggleESPAdvanced = "Расширенный режим ESP", + chgName = "Изменить имя", + chgNameDesc = "Введите новое имя персонажа.", + thirdpersonToggle = "Переключить вид от третьего лица", + thirdpersonClassic = "Использовать классический вид от третьего лица", + thirdpersonConfig = "Настройка вида от третьего лица", + equippedBag = "Экипированные предметы нельзя перемещать между инвентарями.", + useTip = "Использует предмет.", + equipTip = "Экипирует предмет.", + unequipTip = "Снимает предмет.", + consumables = "Расходуемые", + plyNotValid = "Вы не смотрите на действительного игрока.", + restricted = "Вы были задержаны.", + viewProfile = "Просмотреть профиль Steam", + salary = "Вы получили %s от своей зарплаты.", + noRecog = "Вы не узнаете этого человека.", + curTime = "Текущее время: %s.", + vendorEditor = "Редактор продавца", + edit = "Редактировать", + disable = "Отключить", + vendorPriceReq = "Введите новую цену для этого предмета.", + vendorEditCurStock = "Редактировать текущий склад", + you = "Вы", + vendorSellScale = "Масштаб цены продажи", + vendorNoTrade = "Вы не можете торговать с этим продавцом.", + vendorNoMoney = "У этого продавца нет денег на этот предмет.", + vendorNoStock = "У этого продавца нет этого предмета в наличии.", + contentTitle = "Отсутствует контент NutScript", + contentWarning = "У вас не установлен контент NutScript. Это может привести к недоступности некоторых функций.\nАдрес контента NutScript был изменен на адрес rebel1324.\nХотите открыть страницу мастерской для контента NutScript?", + flags = "Флаги", + chooseTip = "Выберите этого персонажа для игры.", + deleteTip = "Удалить этого персонажа.", + moneyLeft = "Ваши деньги: ", + currentMoney = "Остаток денег: ", - -- 2021 patch - itemCreated = "Предмет успешно создан.", - flagGiveTitle = "Дать флаги", - flagGiveDesc = "Выдать следующие флаги игроку.", - flagTakeTitle = "Отнять флаги", - flagTakeDesc = "Отнять следующие флаги от игрока.", - limitFaction = "Данная фракция полна. Попробуйте попозже.", - toggleObserverTP = "Переключить телепортирование при наблюдении.", - toggleESPAdvanced = "Переключить расширенный режим ESP", - thirdpersonConfig = "Настройка третьего лица", - ammoLoadAll = "Зарядить всё", - ammoLoadAmount = "Зарядить %s", - ammoLoadCustom = "Зарядить...", - split = "Разделить", - splitHelp = "Введите сумму для разделения.", - splitHalf = "Разделить 1/2", - splitQuarter = "Разделить 1/4", - recognize = "Позволить этому персонажу узнать вашу личность.", - recognized = "Данный персонаж узнал вашу личность.", - already_recognized = "Данный персонаж уже знает вашу личность.", - untying = "Развязывание...", - beingUntied = "Вас развязывают...", - beingTied = "Вас связывают...", - sameOutfitCategory = "Такой вид экипировки на вас уже надет.", - noBusiness = "В данный момент вы не можете ничего купить.", - panelRemoved = "Вы удалили %s 3D панелей.", - panelAdded = "Вы добавили 3D панель.", - itemOnGround = "Вас предмет был положет на землю.", - forbiddenActionStorage = "Действие с хранимым предметом запрещено.", - cantDropBagHasEquipped = "Запрещено бросать сумку с экипированным предметом.", - lookToUseAt = "Необходимо смотреть на игрока для использования '@'", - mustProvideString = "Необходимо предьявить строковую для этой функции", - - --Attributes - Endurance = "Скорость бега", - Stamina = "Выносливость", - Strength = "Сила", + -- Патч 2018 года + ammoLoadAll = "Загрузить всё", + ammoLoadAmount = "Загрузить %s", + ammoLoadCustom = "Загрузить...", + split = "Разделить", + splitHelp = "Введите число для разделения.", + splitHalf = "Разделить на 1/2", + splitQuarter = "Разделить на 1/4", + recognize = "Разрешить этому персонажу вас узнавать.", + recognized = "Вы предоставили этому персонажу свою личность.", + already_recognized = "Этот персонаж уже вас знает.", + isTied = "Этого человека связали.", + tying = "Связывание", + untying = "Развязывание", + beingUntied = "Вас развязывают.", + beingTied = "Вас связывают.", + sameOutfitCategory = "Вы уже носите этот тип наряда.", + noBusiness = "Вам сейчас не разрешается ничего покупать.", + panelRemoved = "Вы удалили %s 3D-панелей.", + panelAdded = "Вы добавили 3D-панель.", + itemOnGround = "Ваш предмет был помещен на землю.", + forbiddenActionStorage = "Вы не можете выполнять это действие с помощью предмета в хранилище.", + cantDropBagHasEquipped = "Вы не можете выбросить сумку, в которой есть экипированный предмет.", + + -- Патч 2021 года + lookToUseAt = "Вы должны смотреть на кого-то, чтобы использовать '@'", + mustProvideString = "Вы должны предоставить строку для переменной", + + -- Патч 2023 года + togglePluginsDesc = "Выбранные плагины будут отключены.\nКарта должна быть перезапущена после внесения изменений!", } diff --git a/gamemode/languages/sh_spanish.lua b/gamemode/languages/sh_spanish.lua index dec2466e..4ffb66da 100644 --- a/gamemode/languages/sh_spanish.lua +++ b/gamemode/languages/sh_spanish.lua @@ -1,264 +1,266 @@ ----//Translation made by Barata#2411 & CVAROG#7222\\---- ----//Contact DasBarata#2411 if you have any translation change suggestion\\---- -NAME = "Español" -LANGUAGE = { - loading = "Cargando", - dbError = "Fallo de conexión con la Base de Datos", - unknown = "Desconocido", - noDesc = "Descripción no disponible", - create = "Crear", - createTip = "Crea un nuevo personaje con el que jugar.", - load = "Cargar", - loadTip = "Escoge un personaje previamente creado con el que jugar.", - leave = "Abandonar", - leaveTip = "Abandonar el servidor.", - ["return"] = "Volver", - returnTip = "Vuelve al menú anterior.", - name = "Nombre", - desc = "Descripción", - model = "Modelo", - attribs = "Atributos", - charCreateTip = "Completa todos los campos obligatorios y haz clic en 'Finalizar' para crear a tu personaje.", - invalid = "Has provisto un %s inválido.", - descMinLen = "Tu descripción debe ser de al menos %d caracteres.", - player = "Jugador", - finish = "Finalizar", - finishTip = "Finaliza la creación de personaje.", - needModel = "Necesitas escoger un modelo válido.", - creating = "Tu personaje está siendo creado...", - unknownError = "Ha ocurrido un error desconocido", - delConfirm = "¿Estás seguro que quieres borrar PERMANENTEMENTE a %s?", - no = "No", - yes = "Sí", - itemInfo = "Nombre: %s\nDescripción: %s", - cloud_no_repo = "El repositorio provisto no es válido.", - cloud_no_plugin = "El plugin provisto no es válido.", - inv = "Inventario", - plugins = "Plugins", - author = "Autor", - version = "Versión", - characters = "Personajes", - business = "Negocios", - settings = "Opciones", - config = "Configuración", - chat = "Chat", - appearance = "Apariencia", - misc = "Misceláneo", - oocDelay = "Espera %s segundo(s) antes de usar el chat OOC de nuevo.", - loocDelay = "Espera %s segundo(s) antes de usar el chat LOOC de nuevo.", - usingChar = "Ya estás usando éste personaje.", - notAllowed = "Lo siento, no tienes permitido hacer eso.", - itemNoExist = "Lo siento, el objeto que solicitaste no existe.", - cmdNoExist = "Lo siento, éste comando no existe.", - plyNoExist = "Lo siento, el jugador correspondiente no ha podido ser encontrado.", - cfgSet = "%s ha establecido \"%s\" a %s.", - drop = "Tirar", - dropTip = "Tira el objeto desde tu inventario.", - take = "Coger", - takeTip = "Coge éste objeto y colocarlo en tu inventario.", - dTitle = "Puerta sin propietario", - dTitleOwned = "Puerta comprada", - dIsNotOwnable = "Está puerta no se puede poseer.", - dIsOwnable = "Puedes comprar ésta puerta pulsando F2.", - dMadeUnownable = "Has hecho ésta puerta 'No poseíble'.", - dMadeOwnable = "Has hecho ésta puerta 'Poseíble'.", - dNotAllowedToOwn = "No tienes permiso a poseer ésta puerta.", - dSetDisabled = "Has hecho que ésta puerta este 'Dehabilitada'.", - dSetNotDisabled = "Has hecho que ésta puerta este 'Habilitada'.", - dSetHidden = "Has hecho que ésta puerta esté oculta.", - dSetNotHidden = "Has hecho que ésta puerta no esté oculta.", - dSetParentDoor = "Has establecido ésta puerta como tu puerta principal.", - dCanNotSetAsChild = "No puedes establecer la puerta principal como puerta secundaria.", - dAddChildDoor = "Has añadido ésta puerta como puerta secundaria.", - dRemoveChildren = "Has eliminado todas las puertas secundarias de ésta puerta.", - dRemoveChildDoor = "Has eliminado ésta puerta como puerta secundaria.", - dNoParentDoor = "No tienes una puerta principal establecida.", - dOwnedBy = "Ésta puerta está poseída por %s.", - dConfigName = "Puertas", - dSetFaction = "Ésta puerta ahora pertenece a la facción %s.", - dRemoveFaction = "Ésta puerta ya no pertenece a ninguna facción.", - dNotValid = "No estás mirando a una puerta válida.", - canNotAfford = "No puedes permitirte el gasto para comprar ésto.", - dPurchased = "Has comprado ésta puerta por %s.", - dSold = "Has vendido ésta puerta por %s.", - notOwner = "No eres el propietario de ésto.", - invalidArg = "Has provisto un valor inválido para el argumento #%s.", - invalidFaction = "No se ha encontrado la facción que has provisto.", - flagGive = "%s ha dado a %s las flags '%s'.", - flagGiveTitle = "Dar Flags", - flagGiveDesc = "Da las siguientes flags al jugador.", - flagTake = "%s ha quitado las flags '%s' de %s.", - flagTakeTitle = "Quitar Flags", - flagTakeDesc = "Quita las siguientes flags del jugador.", - flagNoMatch = "Debes tener la(s) flag(s) \"%s\" para hacer ésta acción.", - textAdded = "Has añadido un texto.", - textRemoved = "Has borrado %s texto(s).", - moneyTaken = "Has encontrado %s.", - businessPurchase = "Has comprado %s por %s.", - businessSell = "Has vendido %s por %s.", - cChangeModel = "%s ha cambiado el modelo de %s a %s.", - cChangeName = "%s ha cambiado el nombre de %s a %s.", - cChangeSkin = "%s ha cambiado el skin de %s a %s.", - cChangeGroups = "%s ha cambiado el bodygroup \"%s\" de %s a %s.", - cChangeFaction = "%s ha transferido a %s a la facción %s.", - playerCharBelonging = "Éste objeto ya pertenece a otro de tus personajes.", - spawnAdd = "Has añadido un spawn para %s.", - spawnDeleted = "Has eliminado el spawn de %s.", - someone = "Alguien", - rgnLookingAt = "Permite que te reconozca a quien estás mirando.", - rgnWhisper = "Permite que te reconozcan aquellos que te escuchen susurrar.", - rgnTalk = "Permite que te reconozcan aquellos que te escuchen hablar.", - rgnYell = "Permite que te reconozcan aquellos que te escuchen gritar.", - icFormat = "%s dice \"%s\"", - rollFormat = "%s ha tirado los dados y ha sacado un %s.", - wFormat = "%s susurra \"%s\"", - yFormat = "%s gritar \"%s\"", - sbOptions = "Haz clic para ver las opciones de %s.", - spawnAdded = "Has añadido punto de aparición de %s.", - whitelist = "%s ha metido a %s en la 'whitelist' de la facción %s.", - unwhitelist = "%s ha sacado a %s de la 'whitelist' de la facción %s.", - gettingUp = "Te estás levantando...", - wakingUp = "Estás recuperando la consciencia...", - Weapons = "Armas", - checkout = "Ir a la cesta (%s)", - purchase = "Comprar", - purchasing = "Comprando...", - success = "Éxito.", - buyFailed = "Compra fallida.", - buyGood = "Compra exitosa!", - shipment = "Envío", - shipmentDesc = "Éste envío pertenece a %s.", - class = "Clase", - classes = "Clases", - illegalAccess = "Acceso ilegal.", - becomeClassFail = "Fallo en convertirse en %s.", - becomeClass = "Te has convertido en %s.", - attribSet = "Has establecido el nivel de %s de %s a %s puntos.", - attribUpdate = "Has añadido al nivel de %s de %s %s puntos.", - noFit = "Éste objeto no cabe en tu inventario.", - help = "Ayuda", - commands = "Comandos", - helpDefault = "Selecciona una categoría", - doorSettings = "Configuración de puertas", - sell = "Vender", - access = "Acceso", - locking = "Bloqueando ésta entidad...", - unlocking = "Desbloqueando ésta entidad...", - modelNoSeq = "Tu modelo no es compatible con éste acto.", - notNow = "No tienes permiso para hacer ésto ahora.", - faceWall = "Debes estar mirando una pared para hacer ésto.", - faceWallBack = "Tu espalda tiene que estar mirando una pared para hacer ésto.", - descChanged = "Has cambiado la descripción de tu personaje.", - charMoney = "Actualmente tienes %s.", - charFaction = "Eres un miembro de %s.", - charClass = "Eres %s de la facción.", - noSpace = "El inventario está lleno.", - noOwner = "El propietario no es válido.", - invalidIndex = "El índice no es válido.", - invalidItem = "El objeto no es válido.", - invalidInventory = "El inventario no es válido.", - home = "Inicio", - charKick = "%s ha echado a %s.", - charBan = "%s ha expulsado a %s.", - charBanned = "Éste personaje está expulsado.", - setMoney = "Has establecido el dinero de %s a %s.", - itemPriceInfo = "Puedes comprar éste objeto por %s.\nPuedes vender éste objeto por %s", - free = "Gratis", - vendorNoSellItems = "No hay objetos para vender.", - vendorNoBuyItems = "No hay objetos para comprar.", - vendorSettings = "Configuración del Vendedor", - vendorUseMoney = "¿El vendedor debe usar dinero?", - vendorNoBubble = "¿Esconder burbuja del vendedor?", - mode = "Modo", - price = "Precio", - stock = "Stock", - none = "Nada", - vendorBoth = "Comprar y vender", - vendorBuy = "Sólo comprar", - vendorSell = "Sólo vender", - maxStock = "Stock máximo", - vendorFaction = "Editor de facción", - buy = "Comprar", - vendorWelcome = "Bienvenid@ a mi tienda, ¿qué puedo hacer por usted?", - vendorBye = "¡Vuelva pronto!", - charSearching = "Ya está buscando a otro personaje, por favor espere.", - charUnBan = "%s ha perdonado la expulsión a %s.", - charNotBanned = "Éste personaje no está expulsado.", - storPass = "Has establecido la contraseña de éste depósito como %s.", - storPassRmv = "Has eliminado la contraseña de éste depósito.", - storPassWrite = "Introduce la contraseña.", - wrongPassword = "Has introducido una constraseña errónea.", - cheapBlur = "¿Deshabilitar difuminación?", - quickSettings = "Configuración rápida", - vmSet = "Has establecido tu buzón de voz.", - vmRem = "Has eliminado tu buzón de voz.", - altLower = "¿Ocultar las manos cuando se bajen?", - noPerm = "No tienes permiso para hacer ésto.", - youreDead = "Estás muerto.", - injMajor = "Parece que está gravemente herido.", - injLittle = "Parece que está herido.", - toggleESP = "Activar/Desactivar Admin ESP", - chgName = "Cambiar nombre", - chgNameDesc = "Introduce abajo el nuevo nombre del personaje.", - thirdpersonToggle = "Activar/Desactivar Tercera Persona", - thirdpersonClassic = "Usar el sistema de Tercera Persona clásico", - equippedBag = "La bolsa que has movido tiene un objeto que te has equipado.", - useTip = "Usa el objeto.", - equipTip = "Equipa el objeto.", - unequipTip = "Desequipa el objeto.", - consumables = "Consumibles", - plyNotValid = "No estás mirando a un jugador válido.", - restricted = "Has sido atado.", - viewProfile = "Ver el perfil de Steam.", - salary = "Has recibido %s de tu salario.", - noRecog = "No reconoces a ésta persona.", - curTime = "La hora actual es %s.", - vendorEditor = "Editor de vendedor", - edit = "Editar", - disable = "Deshabilitar", - vendorPriceReq = "Introduce el nuevo precio del objeto.", - vendorEditCurStock = "Editar Stock actual", - you = "Tú", - model = "Modelo", - business = "Negocios", - invalidFaction = "Has provisto una facción inválida.", - notAllowed = "Ésta acción no está permitida.", - -- 2021 patch +NAME = "Español" - thirdpersonConfig = "Configuración de cámara en tercera persona", - vendorSellScale = "Escala de precios de venta", - vendorNoTrade = "No puedes comprar a este vendedor.", - vendorNoMoney = "Este vendedor no puede pagar este artículo.", - vendorNoStock = "Este vendedor no tiene este artículo en stock.", - contentTitle = "Content del NutScript Ausent", - contentWarning = "No tienes el contenido de NutScript montado. Esto puede probocar ciertas fallas en las funciones.\nUtilice el contenido de Nutscript de Rebel1324.\n¿Le gustaría abrir la página del Workshop para el contenido de NutScript?", - flags = "Flags", - chooseTip = "Elige este personaje para jugar.", - deleteTip = "Eliminar este personaje.", - moneyLeft = "Tu Dinero: ", - currentMoney = "Dinero Sobrante: ", - ammoLoadAll = "Cargar todo", - ammoLoadAmount = "Cargar %s", - ammoLoadCustom = "Cargar...", - split = "Dividr", - splitHelp = "Ingrese un número para dividir.", - splitHalf = "Dividir 1/2", - splitQuarter = "Dividir 1/4", - recognize = "Deja que este personaje te reconozca.", - recognized = "Le diste a este personaje tu identidad.", - already_recognized = "Este personaje ya te conoce.", - isTied = "Esta persona ha sido atada.", - tying = "Atando", - untying = "Desatando", - beingUntied = "Estas siendo desatado.", - beingTied = "Estas siendo atado.", - sameOutfitCategory = "Ya llevas este tipo de atuendo.", - noBusiness = "No se le permite comprar nada en este momento.", - panelRemoved = "Te has quitado %s 3D panels.", - panelAdded = "Has agregado a 3D panel.", - itemOnGround = "Tu artículo ha sido colocado en el suelo.", - forbiddenActionStorage = "No puedes realizar esta acción con un artículo almacenado.", - cantDropBagHasEquipped = "No puedes soltar la bolsa que tiene un artículo equipado.", - lookToUseAt = "Necesitas estar buscando a alguien para usar '@'", - mustProvideString = "Debes proporcionar una string para la variable.", -} +LANGUAGE = { + loading = "Cargando", + dbError = "Error de conexión a la base de datos", + unknown = "Desconocido", + noDesc = "Descripción no disponible", + create = "Crear", + createTip = "Crear un nuevo personaje para jugar.", + load = "Cargar", + loadTip = "Seleccionar un personaje previamente creado para jugar.", + leave = "Salir", + leaveTip = "Abandonar el servidor actual.", + ["return"] = "Volver", + returnTip = "Volver al menú anterior.", + name = "Nombre", + desc = "Descripción", + model = "Modelo", + attribs = "Atributos", + charCreateTip = "Rellena los campos a continuación y pulsa 'Finalizar' para crear tu personaje.", + invalid = "Has proporcionado un(a) %s inválido(a)", + descMinLen = "Tu descripción debe tener al menos %d caracteres.", + player = "Jugador", + finish = "Finalizar", + finishTip = "Terminar la creación del personaje.", + needModel = "Debes elegir un modelo válido", + creating = "Tu personaje se está creando...", + unknownError = "Ha ocurrido un error desconocido", + delConfirm = "¿Estás seguro de que quieres BORRAR PERMANENTEMENTE a %s?", + no = "No", + yes = "Sí", + itemInfo = "Nombre: %s\nDescripción: %s", + itemCreated = "Objeto creado exitosamente.", + cloud_no_repo = "El repositorio proporcionado no es válido.", + cloud_no_plugin = "El complemento proporcionado no es válido.", + inv = "Inventario", + plugins = "Complementos", + togglePlugins = "Activar/Desactivar complementos", + author = "Autor", + version = "Versión", + characters = "Personajes", + settings = "Configuración", + config = "Config", + chat = "Chat", + appearance = "Apariencia", + misc = "Misceláneo", + oocDelay = "Debes esperar %s segundo(s) más antes de usar OOC nuevamente.", + loocDelay = "Debes esperar %s segundo(s) más antes de usar LOOC nuevamente.", + usingChar = "Ya estás usando este personaje.", + itemNoExist = "Lo siento, el objeto que has solicitado no existe.", + cmdNoExist = "Lo siento, ese comando no existe.", + plyNoExist = "Lo siento, no se ha encontrado ningún jugador coincidente.", + cfgSet = "%s ha configurado \"%s\" como %s.", + drop = "Soltar", + dropTip = "Soltar este objeto de tu inventario.", + take = "Recoger", + takeTip = "Recoger este objeto y colocarlo en tu inventario.", + dTitle = "Puerta sin propietario", + dTitleOwned = "Puerta Comprada", + dIsNotOwnable = "Esta puerta no puede ser poseída.", + dIsOwnable = "Puedes comprar esta puerta presionando F2.", + dMadeUnownable = "Has hecho que esta puerta no sea poseíble.", + dMadeOwnable = "Has hecho que esta puerta sea poseíble.", + dNotAllowedToOwn = "No tienes permitido ser el propietario de esta puerta.", + dSetDisabled = "Has desactivado esta puerta.", + dSetNotDisabled = "Has reactivado esta puerta.", + dSetHidden = "Has ocultado esta puerta.", + dSetNotHidden = "Has revelado esta puerta.", + dSetParentDoor = "Has establecido esta puerta como tu puerta principal.", + dCanNotSetAsChild = "No puedes establecer la puerta principal como una puerta secundaria.", + dAddChildDoor = "Has añadido esta puerta como una puerta secundaria.", + dRemoveChildren = "Has eliminado todas las puertas secundarias de esta puerta.", + dRemoveChildDoor = "Has eliminado esta puerta como una puerta secundaria.", + dNoParentDoor = "No tienes una puerta principal establecida.", + dOwnedBy = "Esta puerta es propiedad de %s.", + dConfigName = "Puertas", + dSetFaction = "Esta puerta ahora pertenece a la facción %s.", + dRemoveFaction = "Esta puerta ya no pertenece a ninguna facción.", + dNotValid = "No estás mirando a una puerta válida.", + canNotAfford = "No puedes permitirte comprar esto.", + dPurchased = "Has comprado esta puerta por %s.", + dSold = "Has vendido esta puerta por %s.", + notOwner = "No eres el propietario de esto.", + invalidArg = "Has proporcionado un valor inválido para el argumento #%s.", + flagGive = "%s ha dado a %s las banderas '%s'.", + flagGiveTitle = "Dar Banderas", + flagGiveDesc = "Dar las siguientes banderas al jugador.", + flagTake = "%s ha quitado las banderas '%s' de %s.", + flagTakeTitle = "Quitar Banderas", + flagTakeDesc = "Quitar las siguientes banderas del jugador.", + flagNoMatch = "Necesitas tener banderas \"%s\" para realizar esta acción.", + textAdded = "Has añadido un texto.", + textRemoved = "Has eliminado %s texto(s).", + moneyTaken = "Encontraste %s.", + businessPurchase = "Has comprado %s por %s.", + businessSell = "Has vendido %s por %s.", + cChangeModel = "%s ha cambiado el modelo de %s a %s.", + cChangeName = "%s ha cambiado el nombre de %s a %s.", + cChangeSkin = "%s ha cambiado la apariencia de %s a %s.", + cChangeGroups = "%s ha cambiado el bodygroup \"%s\" de %s a %s.", + cChangeFaction = "%s ha transferido a %s a la facción %s.", + playerCharBelonging = "Este objeto pertenece a tu otro personaje.", + business = "Negocio", + invalidFaction = "Has proporcionado una facción inválida.", + limitFaction = "Esta facción está llena. Inténtalo de nuevo más tarde.", + spawnAdd = "Has añadido un punto de spawn para %s.", + spawnDeleted = "Has eliminado %s punto(s) de spawn.", + someone = "Alguien", + rgnLookingAt = "Permite a la persona a la que estás mirando reconocerte.", + rgnWhisper = "Permite a los que están susurrando reconocerte.", + rgnTalk = "Permite a los que están hablando reconocerte.", + rgnYell = "Permite a los que están gritando reconocerte.", + icFormat = "%s dice \"%s\"", + rollFormat = "%s ha sacado %s.", + wFormat = "%s susurra \"%s\"", + yFormat = "%s grita \"%s\"", + sbOptions = "Haz clic para ver las opciones de %s.", + spawnAdded = "Has añadido un punto de spawn para %s.", + whitelist = "%s ha añadido a %s a la lista blanca de la facción %s.", + unwhitelist = "%s ha eliminado a %s de la lista blanca de la facción %s.", + gettingUp = "Te estás levantando...", + wakingUp = "Estás recobrando la conciencia...", + Weapons = "Armas", + checkout = "Ir al Pago (%s)", + purchase = "Comprar", + purchasing = "Comprando...", + success = "Éxito", + buyFailed = "Compra fallida.", + buyGood = "Compra exitosa.", + shipment = "Envío", + shipmentDesc = "Este envío pertenece a %s.", + class = "Clase", + classes = "Clases", + illegalAccess = "Acceso ilegal.", + becomeClassFail = "Fallo al convertirse en %s.", + becomeClass = "Te has convertido en %s.", + attribSet = "Has establecido %s's %s como %s.", + attribUpdate = "Has aumentado %s's %s por %s.", + noFit = "Este objeto no cabe en tu inventario.", + help = "Ayuda", + commands = "Comandos", + helpDefault = "Selecciona una categoría", + doorSettings = "Configuración de Puertas", + sell = "Vender", + access = "Acceso", + locking = "Bloqueando esta entidad...", + unlocking = "Desbloqueando esta entidad...", + modelNoSeq = "Tu modelo no admite esta acción.", + notNow = "No tienes permitido hacer esto en este momento.", + faceWall = "Debes estar mirando a la pared para hacer esto.", + faceWallBack = "Debes tener la espalda hacia la pared para hacer esto.", + descChanged = "Has cambiado la descripción de tu personaje.", + charMoney = "Actualmente tienes %s.", + charFaction = "Eres miembro de la facción %s.", + charClass = "Eres %s de la facción.", + noSpace = "Inventario lleno.", + noOwner = "El propietario no es válido.", + notAllowed = "Esta acción no está permitida.", + invalidIndex = "El índice del objeto no es válido.", + invalidItem = "El objeto no es válido.", + invalidInventory = "El inventario no es válido.", + home = "Inicio", + charKick = "%s expulsó al personaje %s.", + charBan = "%s ha baneado al personaje %s.", + charBanned = "Este personaje está baneado.", + setMoney = "Has establecido el dinero de %s como %s.", + itemPriceInfo = "Puedes comprar este objeto por %s.\nPuedes vender este objeto por %s", + free = "Gratis", + vendorNoSellItems = "No hay objetos para vender.", + vendorNoBuyItems = "No hay objetos para comprar.", + vendorSettings = "Configuración de Vendedor", + vendorUseMoney = "¿El vendedor debe usar dinero?", + vendorNoBubble = "¿Ocultar burbuja del vendedor?", + mode = "Modo", + price = "Precio", + stock = "Existencias", + none = "Ninguno", + vendorBoth = "Comprar y Vender", + vendorBuy = "Solo Comprar", + vendorSell = "Solo Vender", + maxStock = "Existencias Máximas", + vendorFaction = "Editor de Facciones", + buy = "Comprar", + vendorWelcome = "Bienvenido a mi tienda, ¿qué puedo conseguirte hoy?", + vendorBye = "¡Vuelve pronto!", + charSearching = "Ya estás buscando otro personaje, por favor espera.", + charUnBan = "%s ha desbaneado al personaje %s.", + charNotBanned = "Este personaje no está baneado.", + storPass = "Has establecido la contraseña de este almacenamiento como %s.", + storPassRmv = "Has eliminado la contraseña de este almacenamiento.", + storPassWrite = "Ingresa la contraseña.", + wrongPassword = "Has ingresado una contraseña incorrecta.", + cheapBlur = "¿Desactivar el desenfoque? (Aumenta FPS)", + quickSettings = "Configuración Rápida", + vmSet = "Has establecido tu correo de voz.", + vmRem = "Has eliminado tu correo de voz.", + altLower = "¿Ocultar las manos cuando están bajas?", + noPerm = "No tienes permiso para hacer esto.", + youreDead = "Estás muerto", + injMajor = "Pareces gravemente herido.", + injLittle = "Pareces herido", + toggleObserverTP = "Alternar teletransporte de observador", + toggleESP = "Alternar ESP de Administrador", + toggleESPAdvanced = "Modo Avanzado de ESP", + chgName = "Cambiar Nombre", + chgNameDesc = "Ingresa el nuevo nombre del personaje a continuación.", + thirdpersonToggle = "Alternar Tercera Persona", + thirdpersonClassic = "Usar Tercera Persona Clásica", + thirdpersonConfig = "Configuración de Tercera Persona", + equippedBag = "Los objetos equipados no se pueden mover entre inventarios.", + useTip = "Usa el objeto.", + equipTip = "Equipar el objeto.", + unequipTip = "Desequipar el objeto.", + consumables = "Consumibles", + plyNotValid = "No estás mirando a un jugador válido.", + restricted = "Has sido restringido.", + viewProfile = "Ver Perfil de Steam", + salary = "Has recibido %s de tu salario.", + noRecog = "No reconoces a esta persona.", + curTime = "La hora actual es %s.", + vendorEditor = "Editor de Vendedor", + edit = "Editar", + disable = "Desactivar", + vendorPriceReq = "Ingresa el nuevo precio para este objeto.", + vendorEditCurStock = "Editar Existencias Actuales", + you = "Tú", + vendorSellScale = "Escala de precio de venta", + vendorNoTrade = "No puedes comerciar con este vendedor.", + vendorNoMoney = "Este vendedor no puede permitirse ese objeto.", + vendorNoStock = "Este vendedor no tiene ese objeto en stock.", + contentTitle = "Contenido Faltante de NutScript", + contentWarning = "No tienes montado el contenido de NutScript. Esto puede resultar en la falta de ciertas características.\nLa dirección del contenido de Nutscript ha sido cambiada a la de rebel1324.\n¿Deseas abrir la página del Workshop para el contenido de NutScript?", + flags = "Banderas", + chooseTip = "Elige este personaje para jugar con él.", + deleteTip = "Eliminar este personaje.", + moneyLeft = "Tu Dinero: ", + currentMoney = "Dinero Restante: ", + -- Parche de 2018 + ammoLoadAll = "Cargar Todo", + ammoLoadAmount = "Cargar %s", + ammoLoadCustom = "Cargar...", + split = "Dividir", + splitHelp = "Ingresa un número para dividir.", + splitHalf = "Dividir 1/2", + splitQuarter = "Dividir 1/4", + recognize = "Permitir que este personaje te reconozca.", + recognized = "Le diste tu identidad a este personaje.", + already_recognized = "Este personaje ya te conoce.", + isTied = "Esta persona está atada.", + tying = "Atando", + untying = "Desatando", + beingUntied = "Te están desatando.", + beingTied = "Te están atando.", + sameOutfitCategory = "Ya estás usando este tipo de atuendo.", + noBusiness = "No tienes permitido comprar nada en este momento.", + panelRemoved = "Has eliminado %s paneles 3D.", + panelAdded = "Has agregado un panel 3D.", + itemOnGround = "Tu objeto ha sido colocado en el suelo.", + forbiddenActionStorage = "No puedes hacer esta acción con un objeto almacenado.", + cantDropBagHasEquipped = "No puedes soltar la bolsa que tiene un objeto equipado.", + -- Parche de 2021 + lookToUseAt = "Debes mirar a alguien para usar '@'", + mustProvideString = "Debes proporcionar una cadena para la variable.", + -- Parche de 2023 + togglePluginsDesc = "Los complementos seleccionados se desactivarán.\nEl mapa debe reiniciarse después de realizar cambios.", +} \ No newline at end of file From f104d5514583ddc452c1e900bbd825d53c2c9666 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Tue, 24 Oct 2023 10:14:41 +0200 Subject: [PATCH 87/89] UI update --- gamemode/config/sh_config.lua | 37 +- gamemode/core/derma/cl_config.lua | 588 ++++++++++++++++++ gamemode/core/derma/cl_inventory.lua | 242 ++++++- gamemode/core/derma/cl_tooltip.lua | 14 +- gamemode/core/hooks/cl_hooks.lua | 47 +- gamemode/core/hooks/sv_hooks.lua | 1 - gamemode/core/libs/cl_easyicons.lua | 32 + gamemode/core/sh_config.lua | 204 +++--- gamemode/core/sh_util.lua | 14 +- gamemode/shared.lua | 4 +- plugins/area/derma/cl_areamanager.lua | 4 +- plugins/area/sh_plugin.lua | 7 +- .../attributes/derma/cl_attributes_step.lua | 4 +- plugins/attributes/sh_plugin.lua | 5 +- plugins/business/derma/cl_business.lua | 44 +- plugins/chatbox/derma/cl_chatbox.lua | 6 +- plugins/f1menu/derma/cl_menu.lua | 67 +- plugins/f1menu/derma/cl_menubutton.lua | 96 ++- .../plugins/charselect/derma/cl_button.lua | 6 +- .../plugins/charselect/derma/cl_character.lua | 91 ++- .../charselect/derma/cl_character_slot.lua | 16 +- .../charselect/derma/cl_confirmation.lua | 17 +- .../plugins/charselect/derma/cl_creation.lua | 2 +- .../plugins/charselect/derma/cl_selection.lua | 12 + .../charselect/derma/cl_tab_button.lua | 29 +- .../charselect/derma/steps/cl_faction.lua | 2 +- .../plugins/charselect/sh_plugin.lua | 12 + plugins/newvoice.lua | 4 +- plugins/notices/derma/cl_notice.lua | 2 +- plugins/nshud/sh_plugin.lua | 6 +- plugins/nsintro/derma/cl_intro.lua | 4 +- plugins/nstheme/derma/cl_skin.lua | 361 ++++++++++- plugins/nstheme/derma/cl_skin_alt.lua | 90 +++ plugins/nstheme/derma/cl_skin_old.lua | 87 +++ plugins/nstheme/sh_plugin.lua | 21 +- plugins/observer.lua | 2 + plugins/pluginconfig.lua | 18 +- plugins/raiseweapons/cl_hooks.lua | 2 +- plugins/scoreboard/derma/cl_scoreboard.lua | 10 +- plugins/thirdperson.lua | 1 + 40 files changed, 1920 insertions(+), 291 deletions(-) create mode 100644 gamemode/core/derma/cl_config.lua create mode 100644 gamemode/core/libs/cl_easyicons.lua create mode 100644 plugins/nstheme/derma/cl_skin_alt.lua create mode 100644 plugins/nstheme/derma/cl_skin_old.lua diff --git a/gamemode/config/sh_config.lua b/gamemode/config/sh_config.lua index 91a6b232..336ed323 100644 --- a/gamemode/config/sh_config.lua +++ b/gamemode/config/sh_config.lua @@ -16,23 +16,52 @@ nut.config.add("maxChars", 5, "The maximum number of characters a player can hav category = "characters" }) -nut.config.add("color", Color(75, 119, 190), "The main color theme for the framework.", nil, {category = "appearance"}) +nut.config.add("color", Color(75, 119, 190), "The main color theme for the framework.", function() + if CLIENT then hook.Run("nutUpdateColors") end +end, {category = "appearance"}) + +nut.config.add("colorAutoTheme", "dark", "Whether secondary and background colours generated from the main color should be dark or light themed.\nGenerated colors will be estimates and not guaranteed to look good.\nDisable to enable manual tuning", function() + if CLIENT then hook.Run("nutUpdateColors") end +end, { + form = "Combo", + category = "appearance", + options = {"dark", "light", "disabled"} + } +) + +nut.config.add("colorSecondary", Color(55, 87, 140), "The secondary color for the framework, used for accents.", function() + if CLIENT then hook.Run("nutUpdateColors") end +end, {category = "appearance"}) + +nut.config.add("colorBackground", Color(25, 40, 64), "The background color for the framework, used in derma backgrounds", function() + if CLIENT then hook.Run("nutUpdateColors") end +end, {category = "appearance"}) + +nut.config.add("colorText", color_white, "The main text color for the framework.", function() + if CLIENT then hook.Run("nutUpdateColors") end +end, {category = "appearance"}) nut.config.add("font", "Arial", "The font used to display titles.", function(oldValue, newValue) if (CLIENT) then - hook.Run("LoadNutFonts", newValue, nut.config.get("genericFont")) + hook.Run("LoadNutFonts", newValue, nut.config.get("genericFont"), nut.config.get("configFont")) end end, {category = "appearance"}) nut.config.add("genericFont", "Segoe UI", "The font used to display generic texts.", function(oldValue, newValue) if (CLIENT) then - hook.Run("LoadNutFonts", nut.config.get("font"), newValue) + hook.Run("LoadNutFonts", nut.config.get("font"), newValue, nut.config.get("configFont")) + end +end, {category = "appearance"}) + +nut.config.add("configFont", "Segoe UI", "The font used to display config and admin menu texts.", function(oldValue, newValue) + if (CLIENT) then + hook.Run("LoadNutFonts", nut.config.get("font"), nut.config.get("genericFont"), newValue) end end, {category = "appearance"}) nut.config.add("fontScale", 1.0, "The scale for the font.", function(oldValue, newValue) if (CLIENT) then - hook.Run("LoadNutFonts", nut.config.get("font"), nut.config.get("genericFont")) + hook.Run("LoadNutFonts", nut.config.get("font"), nut.config.get("genericFont"), nut.config.get("configFont")) end end, { form = "Float", diff --git a/gamemode/core/derma/cl_config.lua b/gamemode/core/derma/cl_config.lua new file mode 100644 index 00000000..722a0a36 --- /dev/null +++ b/gamemode/core/derma/cl_config.lua @@ -0,0 +1,588 @@ +local gradientD = nut.util.getMaterial("vgui/gradient-d") +local gradientR = nut.util.getMaterial("vgui/gradient-r") +local gradientL = nut.util.getMaterial("vgui/gradient-l") + +-- Originally, the plan was to allow both serverside configs and clientside quick settings to be editable here. However, I've decided to keep them separate for now. +-- I do not wish to break the quick menu, nor use ugly hacks. +-- if you wish to change it, then complete populateConfig.client, and at the bottom, uncomment self.selectPanel = self:Add("NutConfigSelectPanel") to show the server/client buttons +-- Tov + +local populateConfig = { + server = function(panel) + local buffer = {} + + for k, v in pairs(nut.config.stored) do + -- Get the category name. + local index = v.data and v.data.category or "misc" + + -- Insert the config into the category list. + buffer[index] = buffer[index] or {} + buffer[index][k] = v + end + + panel.data = buffer + end, + client = function(panel) + end, +} + +local serverIcon, clientIcon, check, uncheck +-- wait until icons are loaded, then load icons +hook.Add("EasyIconsLoaded", "nutConfigIcons", function() + serverIcon = getIcon("icon-equalizer") + clientIcon = getIcon("icon-child") + check = getIcon("icon-ok-squared") + uncheck = getIcon("icon-check-empty") +end) + +local PANEL = {} + +function PANEL:Init() + self:SetSize(100, 0) + self:DockMargin(0, 0, 0, 0) + self:Dock(LEFT) + self:InvalidateLayout(true) + + local parent = self:GetParent() + + print(parent, nut.gui.config, nut.gui.config == parent) + print(parent.populateConfigs) + + self:createConfigButton(serverIcon, "Server", function() + local config = parent.configListPanel + populateConfig.server(config) + config:InvalidateChildren(true) + config:populateConfigs() + end) + + self:createConfigButton(clientIcon, "Client", function() + local config = parent.configListPanel + populateConfig.client(config) + config:InvalidateChildren(true) + config:populateConfigs() + end) +end + +function PANEL:createConfigButton(icon, name, func) + local button = self:Add("DButton") + button:Dock(TOP) + button:DockMargin(0, 0, 0, 0) + button:SetSize(self:GetWide(), 30) + button:SetText("") + + local icon_label = button:Add("DLabel") + icon_label:Dock(LEFT) + icon_label:DockMargin(0, 0, 0, 0) + icon_label:SetSize(30, 30) + icon_label:SetText("") + icon_label.Paint = function(_, w, h) + nut.util.drawText(icon, w * 0.5, h * 0.5, color_white, 1, 1, "nutIconsSmallNew") + end + + local text_label = button:Add("DLabel") + text_label:SetText(name) + text_label:SetContentAlignment(5) + text_label:SetFont("nutMediumConfigFont") + text_label:Dock(FILL) + text_label:DockMargin(0, 0, 0, 0) + + button.DoClick = function() + self:GetParent():ClearConfigs() + func() + end + + return button +end + +function PANEL:Paint() end + +vgui.Register("NutConfigSelectPanel", PANEL, "DPanel") + +-- the center panel, listing all the configs +PANEL = {} + +function PANEL:Init() + self:Dock(FILL) + self:InvalidateParent(true) + + hook.Run("CreateConfigPanel", self) + + -- a dTextEntry that will filter the list of configs + self.filter = self:Add("DTextEntry") + self.filter:Dock(TOP) + self.filter:DockMargin(0, 0, 0, 0) + self.filter:SetSize(self:GetWide(), 30) + self.filter:SetPlaceholderText("Filter configs") + self.filter:SetUpdateOnType(true) + self.filter.OnChange = function() + self:filterConfigs(self.filter:GetValue()) + end + + -- a dScrollPanel that will contain the list of configs + self.scroll = self:Add("DScrollPanel") + self.scroll:Dock(FILL) + self.scroll.Paint = function() end + + populateConfig.server(self) + + self:InvalidateChildren(true) + + self:populateConfigs() +end + +local paintFunc = function(panel, w, h) + local r, g, b = nut.config.get("color"):Unpack() + surface.SetDrawColor(r, g, b, 255) + + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, 0, w/2, h) + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(w/2, 0, w/2, h) + +end + +local mathRound, mathFloor = math.Round, math.floor +local labelSpacing = 0.25 + +local configElement = { + Int = function(name, config, parent) + local panel = vgui.Create("DNumSlider") + panel:SetSize(parent:GetWide(), 30) + panel:InvalidateChildren(true) + + panel:SetMin(config.data.data and config.data.data.min or 0) + panel:SetMax(config.data.data and config.data.data.max or 1) + panel:SetDecimals(0) + panel:SetValue(config.value) + panel:SetText(name) + panel.TextArea:SetFont("nutConfigFont") + panel.Label:SetFont("nutConfigFont") + panel.Label:SetTextInset(10, 0) + panel.OnValueChanged = function(_, newValue) + timer.Create("nutConfigChange"..name, 1, 1, function() netstream.Start("cfgSet", name, mathFloor(newValue)) end) + end + + panel.Paint = function(this, w, h) + paintFunc(this, w, h) + end + + panel.PerformLayout = function(this) + this.Label:SetWide( parent:GetWide() * labelSpacing ) + end + + -- prevent right click from triggering default behaviour when we want to reset + local oldMousePressed = panel.Scratch.OnMousePressed + panel.Scratch.OnMousePressed = function(this, code) + if code ~= MOUSE_RIGHT then + oldMousePressed(this, code) + end + end + + return panel + end, + Float = function(name, config, parent) + local panel = vgui.Create("DNumSlider") + panel:SetSize(parent:GetWide(), 30) + panel:InvalidateChildren(true) + + panel:SetMin(config.data.data and config.data.data.min or 0) + panel:SetMax(config.data.data and config.data.data.max or 1) + panel:SetDecimals(2) + panel:SetValue(config.value) + panel:SetText(name) + panel.TextArea:SetFont("nutConfigFont") + panel.Label:SetFont("nutConfigFont") + panel.Label:SetTextInset(10, 0) + panel.OnValueChanged = function(_, newValue) + timer.Create("nutConfigChange"..name, 1, 1, function() netstream.Start("cfgSet", name, mathRound(newValue, 2)) end) + end + + panel.Paint = function(this, w, h) + paintFunc(this, w, h) + end + + panel.PerformLayout = function(this) + this.Label:SetWide( parent:GetWide() * labelSpacing ) + end + + -- prevent right click from triggering default behaviour when we want to reset + local oldMousePressed = panel.Scratch.OnMousePressed + panel.Scratch.OnMousePressed = function(this, code) + if code ~= MOUSE_RIGHT then + oldMousePressed(this, code) + end + end + + return panel + end, + Generic = function(name, config, parent) + local panel = vgui.Create("DPanel") + panel:SetSize(parent:GetWide(), 30) + panel:SetTall(30) + + -- draw the label over the entry, docked to the left + local label = panel:Add("DLabel") + label:Dock(LEFT) + label:DockMargin(0, 0, 0, 0) + label:SetWide(panel:GetWide() * labelSpacing) + label:SetText(name) + label:SetFont("nutConfigFont") + label:SetContentAlignment(4) + label:SetTextInset(10, 0) + + local entry = panel:Add("DTextEntry") + entry:Dock(FILL) + entry:DockMargin(0, 0, 0, 0) + entry:SetText(tostring(config.value)) + entry.OnValueChange = function(_, newValue) + netstream.Start("cfgSet", name, newValue) + end + entry.OnLoseFocus = function(this) + timer.Simple(0, function() this:SetText(tostring(config.value)) end) + end + + panel.SetValue = function(this, value) -- for compatibility + entry:SetText(tostring(value)) + end + + panel.Paint = function(this, w, h) + paintFunc(this, w, h) + end + + return panel + end, + Boolean = function(name, config, parent) + local panel = vgui.Create("DPanel") + panel:SetSize(parent:GetWide(), 30) + panel:SetTall(30) + + local button = panel:Add("DButton") + button:Dock(FILL) + button:DockMargin(0, 0, 0, 0) + button:SetText("") + button.Paint = function(_, w, h) + nut.util.drawText(config.value and check or uncheck, w * 0.5, h * 0.5, color_white, 1, 1, "nutIconsSmallNew") + end + button.DoClick = function() + netstream.Start("cfgSet", name, not config.value) + end + + local label = button:Add("DLabel") + label:Dock(LEFT) + label:DockMargin(0, 0, 0, 0) + label:SetWide(parent:GetWide()) + label:SetText(name) + label:SetFont("nutConfigFont") + label:SetContentAlignment(4) + label:SetTextInset(10, 0) + + panel.Paint = function(this, w, h) + paintFunc(this, w, h) + end + + return panel + + end, + Color = function(name, config, parent) + local panel = vgui.Create("DPanel") + panel:SetSize(parent:GetWide(), 30) + panel:SetTall(30) + + local button = panel:Add("DButton") + button:Dock(FILL) + button:DockMargin(0, 0, 0, 0) + button:SetText("") + button.Paint = function(_, w, h) + draw.RoundedBox(4, w/2 - 9, h/2 - 9, 18, 18, config.value) + nut.util.drawText(config.value.r .. " " .. config.value.g .. " " .. config.value.b, w/2 + 18, h/2, nut.config.get("colorText"), 0, 1, "nutConfigFont") + end + button.DoClick = function(this) + + local pickerFrame = this:Add("DFrame") + + pickerFrame:SetSize(ScrW()*0.15, ScrH()*0.2) -- Good size for example + pickerFrame:SetPos(gui.MouseX(), gui.MouseY()) + pickerFrame:MakePopup() + + if IsValid(button.picker) then button.picker:Remove() end + button.picker = pickerFrame + + local Mixer = pickerFrame:Add( "DColorMixer") + Mixer:Dock(FILL) -- Make Mixer fill place of Frame + Mixer:SetPalette(true) -- Show/hide the palette DEF:true + Mixer:SetAlphaBar(true) -- Show/hide the alpha bar DEF:true + Mixer:SetWangs(true) -- Show/hide the R G B A indicators DEF:true + Mixer:SetColor(config.value) -- Set the default color + pickerFrame.curColor = config.value + + local confirm = pickerFrame:Add("DButton") + confirm:Dock(BOTTOM) + confirm:DockMargin(0, 0, 0, 0) + confirm:SetText("Apply") + confirm:SetTextColor(pickerFrame.curColor) + confirm.DoClick = function() + netstream.Start("cfgSet", name, pickerFrame.curColor) + pickerFrame:Remove() + end + + Mixer.ValueChanged = function(_, value) + pickerFrame.curColor = value + confirm:SetTextColor(value) + end + end + + local label = button:Add("DLabel") + label:Dock(LEFT) + label:SetWide(parent:GetWide()) + label:SetText(name) + label:SetFont("nutConfigFont") + label:SetContentAlignment(4) + label:SetTextInset(10, 0) + + panel.Paint = function(this, w, h) + paintFunc(this, w, h) + end + + return panel + end, + Combo = function(name, config, parent) + -- a DTextEntry with a label on the left + local panel = vgui.Create("DPanel") + panel:SetSize(parent:GetWide(), 30) + panel:SetTall(30) + + -- draw the label over the entry, docked to the left + local label = panel:Add("DLabel") + label:Dock(LEFT) + label:DockMargin(0, 0, 0, 0) + label:SetWide(panel:GetWide() * labelSpacing) + label:SetText(name) + label:SetFont("nutConfigFont") + label:SetContentAlignment(4) + label:SetTextInset(10, 0) + + local combo = panel:Add("DComboBox") + combo:Dock(FILL) + combo:DockMargin(0, 0, 0, 0) + combo:SetSortItems(false) + combo:SetValue(tostring(config.value)) + combo.OnSelect = function(_, index, value) + netstream.Start("cfgSet", name, value) + end + + for _, v in ipairs(config.data.options) do + combo:AddChoice(v) + end + + panel.Paint = function(this, w, h) + paintFunc(this, w, h) + end + + panel.SetValue = function(this, value) -- for compatibility + combo:SetValue(tostring(value)) + end + + return panel + + end, +} + +local function typeConvert(value) + local t = type(value) + if t == "boolean" then + return "Boolean" + elseif t == "number" then + if math.floor(value) == value then + return "Int" + else + return "Float" + end + elseif t == "table" and value.r and value.g and value.b then + return "Color" + end + return "Generic" +end + +function PANEL:populateConfigs() + local sorted = {} + self.entries = {} + self.categories = {} + + if not self.data then return end + + for k in pairs(self.data) do + table.insert(sorted, k) + end + + -- sort alphabetically, case insensitive + table.sort(sorted, function(a, b) + return a:lower() < b:lower() + end) + + self:InvalidateLayout(true) + + + for _, category in ipairs(sorted) do + local panel = self.scroll:Add("DPanel") + panel:Dock(TOP) + panel:DockMargin(0,1,0,4) + panel:DockPadding(0,0,0,10) + panel:SetSize(self:GetWide(), 30) + panel:SetPaintBackground(false) + panel.category = category + + local label = panel:Add("DLabel") + label:Dock(TOP) + label:DockMargin(1, 1, 1, 4) + label:SetSize(self:GetWide(), 30) + label:SetFont("nutMediumConfigFont") + label:SetContentAlignment(5) + label:SetText(category:gsub("^%l", string.upper)) + + for name, config in SortedPairs(self.data[category]) do + local form = config.data and config.data.form + local value = config.default + if not form then form = typeConvert(value) end + local entry = panel:Add(configElement[form or "Generic"](name, config, panel)) + entry:Dock(TOP) + entry:DockMargin(0, 1, 5, 2) + entry:SetTooltip(config.desc) + entry.shown = true + entry.name = name + entry.config = config + + table.insert(self.entries, entry) + end + panel:SizeToChildren(false, true) + + table.insert(self.categories, panel) + end +end + +local function requestReset(panel) + if panel.name and panel.config then + -- a query to reset config to default + Derma_Query("Reset " .. panel.name .. " to default? ("..tostring(panel.config.default)..")", "Reset Config", "Yes", function() + netstream.Start("cfgSet", panel.name, panel.config.default or nil) + if panel.SetValue then panel:SetValue(panel.config.default) end + end, "No") + end + if panel:GetParent() then + requestReset(panel:GetParent()) + end +end + +hook.Add("VGUIMousePressed", "nutConfigReset", function(panel, code) + -- if the panel or any children, recursively, have .name and .config, reset it to default + if code == MOUSE_RIGHT then requestReset(panel) end +end) + +local animTime = 0.3 + +function PANEL:filterConfigs(filter) + filter = filter:lower() + for _, entry in ipairs(self.entries) do + if not (entry.wide and entry.tall) then + entry.wide, entry.tall = entry:GetSize() + end + local text = entry.name:lower() + local category = entry.config.data.category:lower() + local description = entry.config.desc:lower() + + if filter == "" or string.find(text, filter) or string.find(category, filter) or string.find(description, filter) then + if not entry.shown then + entry:SetVisible(true) + entry.shown = true + entry:SizeTo(entry.wide, entry.tall, animTime, 0, -1, function() + + end) + end + else + if entry.shown then + entry:SizeTo(entry.wide, 0, animTime, 0, -1, function() + entry:SetVisible(false) + entry.shown = false + end) + end + end + end +end + +function PANEL:Think() + for _, category in ipairs(self.categories) do + local shown = false + + for _, entry in ipairs(self.entries) do + if entry.shown and entry.config.data.category:lower() == category.category:lower() then + shown = true + break + end + end + + if shown then + category:SetVisible(true) + category:SizeToChildren(false, true) + else + category:SetVisible(false) + category:SetTall(0) + end + end + self.scroll:InvalidateLayout(true) + self.scroll:SizeToChildren(false, true) +end + +function PANEL:Paint() end + +vgui.Register("NutConfigListPanel", PANEL, "DPanel") + +-- the master panel, containing the left and center panels +PANEL = {} + +function PANEL:Init() + if nut.gui.config then + nut.gui.config:Remove() + end + + nut.gui.config = self + + self:InvalidateLayout(true) +end + +function PANEL:ClearConfigs() + if self.scroll then self.scroll:Clear() end +end + +function PANEL:AddElements() + --self.selectPanel = self:Add("NutConfigSelectPanel") + self.configListPanel = self:Add("NutConfigListPanel") +end + +local sin = math.sin + +function PANEL:Paint(w, h) + local colorR, colorG, colorB = nut.config.get("color"):Unpack() + local backgroundR, backgroundG, backgroundB = nut.config.get("colorBackground"):Unpack() + nut.util.drawBlur(self, 10) + + if not self.startTime then self.startTime = CurTime() end + + local curTime = (self.startTime - CurTime())/4 + local alpha = 200 * ((sin(curTime - 1.8719) + sin(curTime - 1.8719/2))/4 + 0.44) + + surface.SetDrawColor(colorR, colorG, colorB, alpha) + surface.DrawRect(0, 0, w, h) + + surface.SetDrawColor(backgroundR, backgroundG, backgroundB, 255) + surface.SetMaterial(gradientD) + surface.DrawTexturedRect(0, 0, w, h) + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, 0, w, h) + +--[[ local WebMaterial = surface.GetURL("https://i.redd.it/9tgk6up2ltb11.jpg", w, h) + surface.SetDrawColor( 255, 255, 255, 255 ) + surface.SetMaterial( WebMaterial ) + surface.DrawTexturedRect( 0, 0, WebMaterial:Width(), WebMaterial:Height() ) ]] + --lmao +end + +vgui.Register("NutConfigPanel", PANEL, "DPanel") diff --git a/gamemode/core/derma/cl_inventory.lua b/gamemode/core/derma/cl_inventory.lua index 97c2b1b9..42611b82 100644 --- a/gamemode/core/derma/cl_inventory.lua +++ b/gamemode/core/derma/cl_inventory.lua @@ -153,7 +153,13 @@ local buildActionFunc = function(action, actionIndex, itemTable, invID, sub) end end +local function nutDermaMenu(parentmenu, parent) + if ( not parentmenu ) then CloseDermaMenus() end + local dmenu = vgui.Create( "nutDMenu", parent ) + + return dmenu +end function PANEL:openActionMenu() local itemTable = self.itemTable @@ -161,7 +167,7 @@ function PANEL:openActionMenu() assert(itemTable, "attempt to open action menu for invalid item") itemTable.player = LocalPlayer() - local menu = DermaMenu() + local menu = nutDermaMenu() local override = hook.Run("OnCreateItemInteractionMenu", self, menu, itemTable) if (override) then if (IsValid(menu)) then @@ -196,7 +202,11 @@ function PANEL:openActionMenu() end end - menu:Open() + menu:Open(self:LocalToScreen(self:GetWide(), 0)) + -- position menu to be on the right of the icon + --[[ local x = self:LocalToScreen(self:GetWide(), 0) + menu:SetX(x) ]] + itemTable.player = nil end @@ -295,3 +305,231 @@ hook.Add("CreateMenuButtons", "nutInventory", function(tabs) end) end end) + +PANEL = {} + +function PANEL:Open( x, y, skipanimation, ownerpanel ) + + RegisterDermaMenuForClose( self ) + + local maunal = x and y + + x = x or gui.MouseX() + y = y or gui.MouseY() + + local OwnerHeight = 0 + local OwnerWidth = 0 + + if ( ownerpanel ) then + OwnerWidth, OwnerHeight = ownerpanel:GetSize() + end + + self:InvalidateLayout( true ) + + local w = self:GetWide() + local h = self:GetTall() + + + self:SetSize(0,0 ) + + if ( y + h > ScrH() ) then y = ( ( maunal and ScrH() ) or ( y + OwnerHeight ) ) - h end + if ( x + w > ScrW() ) then x = ( ( maunal and ScrW() ) or x ) - w end + if ( y < 1 ) then y = 1 end + if ( x < 1 ) then x = 1 end + + local p = self:GetParent() + if ( IsValid( p ) and p:IsModal() ) then + -- Can't popup while we are parented to a modal panel + -- We will end up behind the modal panel in that case + + x, y = p:ScreenToLocal( x, y ) + + -- We have to reclamp the values + if ( y + h > p:GetTall() ) then y = p:GetTall() - h end + if ( x + w > p:GetWide() ) then x = p:GetWide() - w end + if ( y < 1 ) then y = 1 end + if ( x < 1 ) then x = 1 end + + self:SetPos( x, y ) + else + self:SetPos( x, y ) + + -- Popup! + self:MakePopup() + end + + -- Make sure it's visible! + self:SetVisible( true ) + + -- Keep the mouse active while the menu is visible. + self:SetKeyboardInputEnabled( false ) + +end + +function PANEL:PerformLayout( w, h ) + + w = self:GetMinimumWidth() + + -- Find the widest one + for k, pnl in ipairs( self:GetCanvas():GetChildren() ) do + + pnl:InvalidateLayout( true ) + w = math.max( w, pnl:GetWide() ) + + end + + if self.animComplete then self:SetWide( w ) end + + local y = 0 -- for padding + + for k, pnl in ipairs( self:GetCanvas():GetChildren() ) do + + pnl:SetWide( w ) + pnl:SetPos( 0, y ) + pnl:InvalidateLayout( true ) + + y = y + pnl:GetTall() + + end + + y = math.min( y, self:GetMaxHeight() ) + + if self.animComplete then self:SetTall( y ) end + + if not self.animComplete and not self.animStarted then + self.animStarted = true + self:SetSize(0,0) + self:SizeTo(w, 10, 0.1, 0, -1, function() + self:SizeTo(w, y, 0.2, 0, 0.9, function() + self.animComplete = true + end) + end) + end + + derma.SkinHook( "Layout", "Menu", self ) + DScrollPanel.PerformLayout( self, w, h ) + + if not self.animComplete then + self:GetVBar():SetWide(0) + end +end + +local gradientL = nut.util.getMaterial("vgui/gradient-l") +local gradientR = nut.util.getMaterial("vgui/gradient-r") +local gradientD = nut.util.getMaterial("vgui/gradient-d") +local testGradient = nut.util.getMaterial("vgui/gradient_down") + +--[[ function PANEL:Paint(w, h) + local r, g ,b = nut.config.get("color"):Unpack() + + surface.SetDrawColor(r, g, b, 255) + surface.DrawRect(0, 0, w, h) + + surface.SetDrawColor(0, 0, 0, 255) + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, 0, w, h) + surface.SetMaterial(gradientD) + surface.DrawTexturedRect(0, 0, w, h) +end ]] + +function PANEL:AddOption( strText, funcFunction ) + + local pnl = vgui.Create( "nutDMenuOption", self ) + pnl:SetMenu( self ) + pnl:SetText( strText ) + if ( funcFunction ) then pnl.DoClick = funcFunction end + + self:AddPanel( pnl ) + + return pnl + +end + +function PANEL:AddSubMenu( strText, funcFunction ) + + local pnl = vgui.Create( "nutDMenuOption", self ) + local SubMenu = pnl:AddSubMenu( strText, funcFunction ) + + pnl:SetText( strText ) + if ( funcFunction ) then pnl.DoClick = funcFunction end + + self:AddPanel( pnl ) + + return SubMenu, pnl + +end + +vgui.Register("nutDMenu", PANEL, "DMenu") + +--remake DMenuOption as nutDMenuOption, so we can use nutDMenuOption in nutDMenu. Make the panel bigger +PANEL = {} + +function PANEL:Init() + + self:SetContentAlignment( 4 ) + self:SetTextInset( 32, 0 ) -- Room for icon on left + self:SetContentAlignment(5) + self:SetChecked( false ) + self:SetFont("nutSmallFont") +end + +function PANEL:PerformLayout( w, h ) + + self:SizeToContents() + self:SetWide( self:GetWide() + 30 ) + + local w = math.max( self:GetParent():GetWide(), self:GetWide() ) + + surface.SetFont( self:GetFont() ) + local _, y = surface.GetTextSize( "W" ) + self:SetSize( w, y + 5) + + if ( IsValid( self.SubMenuArrow ) ) then + + self.SubMenuArrow:SetSize( 15, 15 ) + self.SubMenuArrow:CenterVertical() + self.SubMenuArrow:AlignRight( 4 ) + + end + + DButton.PerformLayout( self, w, h ) + +end + +local glow = nut.util.getMaterial("particle/Particle_Glow_04_Additive") + +--[[ function PANEL:Paint(w, h) + local r, g, b = nut.config.get("color"):Unpack() + + local alpha = 0 + -- if hovered, alpha is 100, if selected alpha is 255 + if (self.Hovered) then + + alpha = 200 + + elseif (self:GetChecked()) then + alpha = 150 + end + + surface.SetDrawColor(r, g, b, alpha) + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, 0, w/2, h) + surface.DrawRect(0, 0, w, h) + surface.SetMaterial(glow) + surface.DrawTexturedRect(-w*0.25, 0, w*1.5, h*2.5) +end ]] + +function PANEL:AddSubMenu() + + local SubMenu = nutDermaMenu( true, self ) + SubMenu:SetVisible( false ) + SubMenu:SetParent( self ) + + self:SetSubMenu( SubMenu ) + + return SubMenu + +end + + +vgui.Register("nutDMenuOption", PANEL, "DMenuOption") \ No newline at end of file diff --git a/gamemode/core/derma/cl_tooltip.lua b/gamemode/core/derma/cl_tooltip.lua index ba4d460c..90506e61 100644 --- a/gamemode/core/derma/cl_tooltip.lua +++ b/gamemode/core/derma/cl_tooltip.lua @@ -15,11 +15,21 @@ hook.Add("TooltipInitialize", "nutItemTooltip", function(self, panel) end end) +local gradientL = nut.util.getMaterial("vgui/gradient-l") +local gradientR = nut.util.getMaterial("vgui/gradient-r") + hook.Add("TooltipPaint", "nutItemTooltip", function(self, w, h) if (self.isItemTooltip) then nut.util.drawBlur(self, 2, 2) - surface.SetDrawColor(0, 0, 0, 230) - surface.DrawRect(0, 0, w, h) + --[[ surface.SetDrawColor(0, 0, 0, 230) + surface.DrawRect(0, 0, w, h) ]] + + local r, g, b = nut.config.get("color"):Unpack() + surface.SetDrawColor(r, g, b, 255) + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, 0, w/2, h) + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(w/2, 0, w/2, h) if (self.markupObject) then self.markupObject:draw(PADDING_HALF, PADDING_HALF + 2) diff --git a/gamemode/core/hooks/cl_hooks.lua b/gamemode/core/hooks/cl_hooks.lua index df74f9c3..56f4b981 100644 --- a/gamemode/core/hooks/cl_hooks.lua +++ b/gamemode/core/hooks/cl_hooks.lua @@ -1,5 +1,6 @@ -function GM:LoadNutFonts(font, genericFont) - local oldFont, oldGenericFont = font, genericFont +function GM:LoadNutFonts(font, genericFont, configFont) + local oldFont, oldGenericFont, oldConfigFont = font, genericFont, configFont + local scale = math.Round(nut.config.get("fontScale", 1), 2) surface.CreateFont("nut3D2DFont", { font = font, @@ -218,9 +219,34 @@ function GM:LoadNutFonts(font, genericFont) antialias = true }) - hook.Run("LoadFonts", oldFont, oldGenericFont) + --config fonts + surface.CreateFont("nutConfigFont", { + font = configFont, + size = 22, + weight = 500, + extended = true, + antialias = true + }) + + surface.CreateFont("nutMediumConfigFont", { + font = configFont, + size = 25 * scale, + extended = true, + weight = 1000 + }) + + surface.CreateFont("nutSmallConfigFont", { + font = configFont, + size = math.max(ScreenScale(6), 17) * scale, + extended = true, + weight = 500 + }) + + hook.Run("LoadFonts", oldFont, oldGenericFont, oldConfigFont) end +local color_offRed = Color(255, 50, 50) + function GM:CreateLoadingScreen() if (IsValid(nut.gui.loading)) then nut.gui.loading:Remove() @@ -239,7 +265,7 @@ function GM:CreateLoadingScreen() label:SetText(L"loading") label:SetFont("nutNoticeFont") label:SetContentAlignment(5) - label:SetTextColor(color_white) + label:SetTextColor(nut.config.get("colorText", color_white)) label:InvalidateLayout(true) label:SizeToContents() @@ -257,7 +283,7 @@ function GM:CreateLoadingScreen() label:SetText(fault) label:SetContentAlignment(5) label:SizeToContentsY() - label:SetTextColor(Color(255, 50, 50)) + label:SetTextColor(color_offRed) end end end) @@ -273,7 +299,8 @@ function GM:InitializedConfig() hook.Run( "LoadNutFonts", nut.config.get("font"), - nut.config.get("genericFont") + nut.config.get("genericFont"), + nut.config.get("configFont") ) if (not nut.config.loaded) then @@ -282,6 +309,8 @@ function GM:InitializedConfig() end nut.config.loaded = true end + + hook.Run("nutUpdateColors") end function GM:CharacterListLoaded() @@ -476,6 +505,8 @@ end function GM:SetupQuickMenu(menu) -- Performance + menu:addCategory("Performance") + menu:addCheck(L"cheapBlur", function(panel, state) if (state) then RunConsoleCommand("nut_cheapblur", "1") @@ -485,6 +516,7 @@ function GM:SetupQuickMenu(menu) end, NUT_CVAR_CHEAP:GetBool()) -- Language settings + menu:addCategory("Language Settings") menu:addSpacer() local current @@ -532,7 +564,8 @@ function GM:ScreenResolutionChanged(oldW, oldH) hook.Run( "LoadNutFonts", nut.config.get("font"), - nut.config.get("genericFont") + nut.config.get("genericFont"), + nut.config.get("configFont") ) end diff --git a/gamemode/core/hooks/sv_hooks.lua b/gamemode/core/hooks/sv_hooks.lua index 402a2bee..f899ecfb 100644 --- a/gamemode/core/hooks/sv_hooks.lua +++ b/gamemode/core/hooks/sv_hooks.lua @@ -250,7 +250,6 @@ end function GM:PlayerSay(client, message) local chatType, message, anonymous = nut.chat.parse(client, message, true) - if (chatType == "ic") and (nut.command.parse(client, message)) then return "" end diff --git a/gamemode/core/libs/cl_easyicons.lua b/gamemode/core/libs/cl_easyicons.lua new file mode 100644 index 00000000..e85bb118 --- /dev/null +++ b/gamemode/core/libs/cl_easyicons.lua @@ -0,0 +1,32 @@ +NS_ICON_FONT = nil + +local function ScrapPage() + local d = deferred.new() + + http.Fetch('https://dobytchick.github.io/', function(resp) + local headpos = select(2, resp:find('
')) + local body = resp:sub(headpos) + local scrapped = {} + + for str in body:gmatch('(icon-%S+);') do + local whitespaced = str:gsub('">', ' ') + local nulled = whitespaced:gsub('&#', '0') + + local splitted = nulled:Split(' ') + scrapped[splitted[1]] = splitted[2] + end + + d:resolve(scrapped) + end) + + return d +end + +ScrapPage():next(function(scrapped) + NS_ICON_FONT = scrapped + hook.Run("EasyIconsLoaded") +end) + +function getIcon(sIcon, bIsCode) + return not bIsCode and utf8.char(tonumber(NS_ICON_FONT[sIcon])) or utf8.char(tonumber(sIcon)) +end \ No newline at end of file diff --git a/gamemode/core/sh_config.lua b/gamemode/core/sh_config.lua index 93271763..25f2df63 100644 --- a/gamemode/core/sh_config.lua +++ b/gamemode/core/sh_config.lua @@ -4,8 +4,14 @@ nut.config.stored = nut.config.stored or {} function nut.config.add(key, value, desc, callback, data, noNetworking, schemaOnly) assert(isstring(key), "expected config key to be string, got " .. type(key)) local oldConfig = nut.config.stored[key] + local savedValue + if (oldConfig) then + savedValue = oldConfig.value + else + savedValue = value + end - nut.config.stored[key] = {data = data, value = oldConfig and oldConfig.value or value, default = value, desc = desc, noNetworking = noNetworking, global = not schemaOnly, callback = callback} + nut.config.stored[key] = {data = data, value = savedValue, default = value, desc = desc, noNetworking = noNetworking, global = not schemaOnly, callback = callback} end function nut.config.setDefault(key, value) @@ -181,111 +187,145 @@ else end if (CLIENT) then + local legacyConfigMenu = CreateClientConVar("nut_legacyconfig", "0", true, true) + hook.Add("CreateMenuButtons", "nutConfig", function(tabs) if (not LocalPlayer():IsSuperAdmin() or hook.Run("CanPlayerUseConfig", LocalPlayer()) == false) then return end tabs["config"] = function(panel) - local scroll = panel:Add("DScrollPanel") - scroll:Dock(FILL) - hook.Run("CreateConfigPanel", panel) + if legacyConfigMenu:GetBool() ~= true then + local canvas = panel:Add("DPanel") + canvas:Dock(FILL) + canvas:SetPaintBackground(false) - local properties = scroll:Add("DProperties") - properties:SetSize(panel:GetSize()) + canvas:InvalidateLayout(true) - nut.gui.properties = properties + local config = canvas:Add("NutConfigPanel") + config:SetSize(panel:GetSize()) + config:AddElements() + else + local scroll = panel:Add("DScrollPanel") + scroll:Dock(FILL) - -- We're about to store the categories in this buffer. - local buffer = {} + hook.Run("CreateConfigPanel", panel) - for k, v in pairs(nut.config.stored) do - -- Get the category name. - local index = v.data and v.data.category or "misc" + local properties = scroll:Add("DProperties") + properties:SetSize(panel:GetSize()) - -- Insert the config into the category list. - buffer[index] = buffer[index] or {} - buffer[index][k] = v - end + nut.gui.properties = properties + + -- We're about to store the categories in this buffer. + local buffer = {} + + for k, v in pairs(nut.config.stored) do + -- Get the category name. + local index = v.data and v.data.category or "misc" + + -- Insert the config into the category list. + buffer[index] = buffer[index] or {} + buffer[index][k] = v + end - -- Loop through the categories in alphabetical order. - for category, configs in SortedPairs(buffer) do - category = L(category) - - -- Ditto, except we're looping through configs. - for k, v in SortedPairs(configs) do - -- Determine which type of panel to create. - local form = v.data and v.data.form - local value = nut.config.stored[k].default - - -- Let's see if the parameter has a form to perform some additional operations. - if (form) then - if (form == "Int") then - -- math.Round can create an error without failing silently as expected if the parameter is invalid. - -- So an alternate value is entered directly into the function and not outside of it. - value = math.Round(nut.config.get(k) or value) - elseif (form == "Float") then - value = tonumber(nut.config.get(k)) or value - elseif (form == "Boolean") then - value = tobool(nut.config.get(k)) or value + -- Loop through the categories in alphabetical order. + for category, configs in SortedPairs(buffer) do + category = L(category) + + -- Ditto, except we're looping through configs. + for k, v in SortedPairs(configs) do + -- Determine which type of panel to create. + local form = v.data and v.data.form + local value = nut.config.stored[k].default + + -- Let's see if the parameter has a form to perform some additional operations. + if (form) then + if (form == "Int") then + -- math.Round can create an error without failing silently as expected if the parameter is invalid. + -- So an alternate value is entered directly into the function and not outside of it. + value = math.Round(nut.config.get(k) or value) + elseif (form == "Float") then + value = tonumber(nut.config.get(k)) or value + elseif (form == "Boolean") then + value = tobool(nut.config.get(k)) or value + else + value = nut.config.get(k) or value + end else - value = nut.config.get(k) or value + local formType = type(value) + + if (formType == "number") then + form = "Int" + value = tonumber(nut.config.get(k)) or value + elseif (formType == "boolean") then + form = "Boolean" + value = tobool(nut.config.get(k)) + else + form = "Generic" + value = nut.config.get(k) or value + end end - else - local formType = type(value) - - if (formType == "number") then - form = "Int" - value = tonumber(nut.config.get(k)) or value - elseif (formType == "boolean") then - form = "Boolean" - value = tobool(nut.config.get(k)) - else - form = "Generic" - value = nut.config.get(k) or value + + if form == "Combo" then + v.data.data = v.data.data or {} + v.data.data.text = value + v.data.data.values = {} + for niceName, optionData in pairs(v.data.options) do + niceName = tonumber(niceName) and optionData or niceName + v.data.data.values[tonumber(niceName) and optionData or niceName] = optionData + + if optionData == value then + v.data.data.text = niceName + end + end end - end - -- VectorColor currently only exists for DProperties. - if (form == "Generic" and istable(value) and value.r and value.g and value.b) then - -- Convert the color to a vector. - value = Vector(value.r / 255, value.g / 255, value.b / 255) - form = "VectorColor" - end + -- VectorColor currently only exists for DProperties. + if (form == "Generic" and istable(value) and value.r and value.g and value.b) then + -- Convert the color to a vector. + value = Vector(value.r / 255, value.g / 255, value.b / 255) + form = "VectorColor" + end - local delay = 1 + local delay = 1 - if (form == "Boolean") then - delay = 0 - end + if (form == "Boolean") or (form == "Combo") then + delay = 0 + end - -- Add a new row for the config to the properties. - local row = properties:CreateRow(category, tostring(k)) - row:Setup(form, v.data and v.data.data or {}) - row:SetValue(value) - row:SetTooltip(v.desc) - row.DataChanged = function(this, newValue) - timer.Create("nutCfgSend" .. k, delay, 1, function() - if (not IsValid(row)) then - return - end + -- Add a new row for the config to the properties. + local row = properties:CreateRow(category, tostring(k)) + row:Setup(form, v.data and v.data.data or {}) + row:SetValue(value) + row:SetTooltip(v.desc) + row.DataChanged = function(this, newValue) + debug.Trace() + timer.Create("nutCfgSend" .. k, delay, 1, function() + if (not IsValid(row)) then + return + end - if (form == "VectorColor") then - local vector = Vector(newValue) + if (form == "VectorColor") then + local vector = Vector(newValue) - newValue = Color(math.floor(vector.x * 255), math.floor(vector.y * 255), math.floor(vector.z * 255)) - elseif (form == "Int" or form == "Float") then - newValue = tonumber(newValue) + newValue = Color(math.floor(vector.x * 255), math.floor(vector.y * 255), math.floor(vector.z * 255)) + elseif (form == "Int" or form == "Float") then + newValue = tonumber(newValue) - if (form == "Int") then - newValue = math.Round(newValue) + if (form == "Int") then + newValue = math.Round(newValue) + end + elseif (form == "Boolean") then + newValue = tobool(newValue) end - elseif (form == "Boolean") then - newValue = tobool(newValue) - end - netstream.Start("cfgSet", k, newValue) - end) + netstream.Start("cfgSet", k, newValue) + end) + end + + if form == "Combo" then + row.SetValue = function() end -- without this config gets set twice. idk why - Tov + end end end end diff --git a/gamemode/core/sh_util.lua b/gamemode/core/sh_util.lua index 24598565..a8f95a60 100644 --- a/gamemode/core/sh_util.lua +++ b/gamemode/core/sh_util.lua @@ -48,18 +48,18 @@ function nut.util.includeDir(directory, fromLua, recursive) return end - for k, v in pairs(files) do + for _, v in pairs(files) do nut.util.include(folder .. "/" .. v) end - for k, v in pairs(folders) do + for _, v in pairs(folders) do AddRecursive(folder .. "/" .. v) end end AddRecursive((fromLua and "" or baseDir)..directory) else -- Find all of the files within the directory. - for k, v in ipairs( + for _, v in ipairs( file.Find((fromLua and "" or baseDir)..directory.."/*.lua", "LUA") ) do -- Include the file from the prefix. @@ -80,7 +80,7 @@ end function nut.util.getAdmins(isSuper) local admins = {} - for k, v in ipairs(player.GetAll()) do + for _, v in ipairs(player.GetAll()) do if (isSuper) then if (v:IsSuperAdmin()) then admins[#admins + 1] = v @@ -113,7 +113,7 @@ function nut.util.findPlayer(identifier, allowPatterns) identifier = string.PatternSafe(identifier) end - for k, v in ipairs(player.GetAll()) do + for _, v in ipairs(player.GetAll()) do if (nut.util.stringMatches(v:Name(), identifier)) then return v end @@ -138,7 +138,7 @@ end function nut.util.getAllChar() local charTable = {} - for k, v in ipairs(player.GetAll()) do + for _, v in ipairs(player.GetAll()) do if (v:getChar()) then table.insert(charTable, v:getChar():getID()) end @@ -233,7 +233,7 @@ do end if (self.nutRestrictWeps) then - for k, v in ipairs(self.nutRestrictWeps) do + for _, v in ipairs(self.nutRestrictWeps) do self:Give(v) end diff --git a/gamemode/shared.lua b/gamemode/shared.lua index 4e5583b3..3f63727f 100644 --- a/gamemode/shared.lua +++ b/gamemode/shared.lua @@ -76,7 +76,8 @@ function GM:OnReloaded() hook.Run( "LoadNutFonts", nut.config.get("font"), - nut.config.get("genericFont") + nut.config.get("genericFont"), + nut.config.get("configFont") ) else -- Auto-reload support for faction pay timers. @@ -96,6 +97,7 @@ function GM:OnReloaded() end nut.faction.formatModelData() + hook.Run("nutUpdateColors") end -- Include default NutScript chat commands. diff --git a/plugins/area/derma/cl_areamanager.lua b/plugins/area/derma/cl_areamanager.lua index 7765e8fb..bcbe3675 100644 --- a/plugins/area/derma/cl_areamanager.lua +++ b/plugins/area/derma/cl_areamanager.lua @@ -9,7 +9,7 @@ function PANEL:Init() local noticeBar = self:Add("DLabel") noticeBar:Dock(TOP) - noticeBar:SetTextColor(color_white) + noticeBar:SetTextColor(nut.config.get("colorText", color_white)) noticeBar:SetExpensiveShadow(1, color_black) noticeBar:SetContentAlignment(8) noticeBar:SetFont("nutChatFont") @@ -31,7 +31,7 @@ function PANEL:loadAreas() local panel = self.list:Add("DButton") panel:SetText(data.name) panel:SetFont("ChatFont") - panel:SetTextColor(color_white) + panel:SetTextColor(nut.config.get("colorText", color_white)) panel:SetTall(30) local onConfirm = function(newName) netstream.Start("areaEdit", class, {name = newName}) diff --git a/plugins/area/sh_plugin.lua b/plugins/area/sh_plugin.lua index 13b24704..d4b5999d 100644 --- a/plugins/area/sh_plugin.lua +++ b/plugins/area/sh_plugin.lua @@ -12,7 +12,8 @@ nut.config.add("areaFontSize", 26, "The size of the font of Area Display.", hook.Run( "LoadNutFonts", nut.config.get("font"), - nut.config.get("genericFont") + nut.config.get("genericFont"), + nut.config.get("configFont") ) end end, @@ -343,6 +344,8 @@ else end end + local textR, textG, textB = nut.config.get("colorText", color_white):Unpack() + -- draw recursive for i = 1, math.min(maxDisplay, strEnd) do -- character scale/color lerp @@ -361,7 +364,7 @@ else math.Round(h / 3 - (sy or 0) * scale / 2), Vector(Format("%.2f", flipTable[i][1]), Format("%.2f", scale), 1), nil, - Color(255, 255, 255, + Color(textR, textG, textB, (dieTrigger and dieTimer < RealTime()) and dieAlpha or flipTable[i][2]) ) diff --git a/plugins/attributes/derma/cl_attributes_step.lua b/plugins/attributes/derma/cl_attributes_step.lua index 74a9938b..14e9a9f2 100644 --- a/plugins/attributes/derma/cl_attributes_step.lua +++ b/plugins/attributes/derma/cl_attributes_step.lua @@ -98,7 +98,7 @@ function PANEL:Init() self.quantity = self.buttons:Add("DLabel") self.quantity:SetFont("nutCharSubTitleFont") - self.quantity:SetTextColor(color_white) + self.quantity:SetTextColor(nut.config.get("colorText", color_white)) self.quantity:Dock(FILL) self.quantity:SetText("0") self.quantity:SetContentAlignment(5) @@ -106,7 +106,7 @@ function PANEL:Init() self.name = self:Add("DLabel") self.name:SetFont("nutCharSubTitleFont") self.name:SetContentAlignment(4) - self.name:SetTextColor(nut.gui.character.WHITE) + self.name:SetTextColor(nut.gui.character.color) self.name:Dock(FILL) self.name:DockMargin(8, 0, 0, 0) end diff --git a/plugins/attributes/sh_plugin.lua b/plugins/attributes/sh_plugin.lua index bc47c684..c579e611 100644 --- a/plugins/attributes/sh_plugin.lua +++ b/plugins/attributes/sh_plugin.lua @@ -55,13 +55,14 @@ if (SERVER) then end end else + local color_blackTransparent = Color(0,0,0,150) function PLUGIN:CreateCharInfoText(panel, suppress) if (suppress and suppress.attrib) then return end panel.attribName = panel.info:Add("DLabel") panel.attribName:Dock(TOP) panel.attribName:SetFont("nutMediumFont") - panel.attribName:SetTextColor(color_white) - panel.attribName:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + panel.attribName:SetTextColor(nut.config.get("colorText", color_white)) + panel.attribName:SetExpensiveShadow(1, color_blackTransparent) panel.attribName:DockMargin(0, 10, 0, 0) panel.attribName:SetText(L"attribs") diff --git a/plugins/business/derma/cl_business.lua b/plugins/business/derma/cl_business.lua index ce559548..f9ccdd21 100644 --- a/plugins/business/derma/cl_business.lua +++ b/plugins/business/derma/cl_business.lua @@ -6,6 +6,9 @@ function PANEL:Init() self:SetSize(size, size * 1.4) end +local color_blackTransparent = Color(0,0,0,200) +local color_blackTransparent2 = Color(0,0,0,150) + function PANEL:setItem(itemTable) self.itemName = L(itemTable.name):lower() @@ -13,17 +16,17 @@ function PANEL:setItem(itemTable) self.price:Dock(BOTTOM) self.price:SetText(itemTable:getPrice() and nut.currency.get(itemTable:getPrice()) or L"free":upper()) self.price:SetContentAlignment(5) - self.price:SetTextColor(color_white) + self.price:SetTextColor(nut.config.get("colorText", color_white)) self.price:SetFont("nutSmallFont") - self.price:SetExpensiveShadow(1, Color(0, 0, 0, 200)) + self.price:SetExpensiveShadow(1, color_blackTransparent) self.name = self:Add("DLabel") self.name:Dock(TOP) self.name:SetText(itemTable.getName and itemTable:getName() or L(itemTable.name)) self.name:SetContentAlignment(5) - self.name:SetTextColor(color_white) + self.name:SetTextColor(nut.config.get("colorText", color_white)) self.name:SetFont("nutSmallFont") - self.name:SetExpensiveShadow(1, Color(0, 0, 0, 200)) + self.name:SetExpensiveShadow(1, color_blackTransparent) self.name.Paint = function(this, w, h) surface.SetDrawColor(0, 0, 0, 75) surface.DrawRect(0, 0, w, h) @@ -60,7 +63,7 @@ function PANEL:Init() self.error:SetFont("nutMenuButtonLightFont") self.error:Dock(FILL) self.error:SetText(L"noBusiness") - self.error:SetTextColor(color_white) + self.error:SetTextColor(nut.config.get("colorText", color_white)) self.error:SetExpensiveShadow(1, color_black) self.error:SizeToContents() self.error:SetContentAlignment(5) @@ -109,11 +112,11 @@ function PANEL:Init() self.checkout = self:Add("DButton") self.checkout:Dock(BOTTOM) - self.checkout:SetTextColor(color_white) + self.checkout:SetTextColor(nut.config.get("colorText", color_white)) self.checkout:SetTall(36) self.checkout:SetFont("nutMediumFont") self.checkout:DockMargin(10, 10, 0, 0) - self.checkout:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + self.checkout:SetExpensiveShadow(1, color_blackTransparent2) self.checkout:SetText(L("checkout", 0)) self.checkout.DoClick = function() if (!IsValid(nut.gui.checkout) and self:getCartCount() > 0) then @@ -141,10 +144,10 @@ function PANEL:Init() button:SetTall(36) button:SetText(category) button:Dock(TOP) - button:SetTextColor(color_white) + button:SetTextColor(nut.config.get("colorText", color_white)) button:DockMargin(5, 5, 5, 0) button:SetFont("nutMediumFont") - button:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + button:SetExpensiveShadow(1, color_blackTransparent2) button.Paint = function(this, w, h) surface.SetDrawColor(self.selected == this and nut.config.get("color") or dark) surface.DrawRect(0, 0, w, h) @@ -156,7 +159,7 @@ function PANEL:Init() if (self.selected ~= this) then self.selected = this self:loadItems(realName) - timer.Simple(0.01, function() + timer.Simple(0.01, function() self.scroll:InvalidateLayout() end) end @@ -255,7 +258,7 @@ PANEL = {} self.buy = self:Add("DButton") self.buy:Dock(BOTTOM) self.buy:SetText(L"purchase") - self.buy:SetTextColor(color_white) + self.buy:SetTextColor(nut.config.get("colorText", color_white)) self.buy.DoClick = function(this) if ((this.nextClick or 0) < CurTime()) then this.nextClick = CurTime() + 0.5 @@ -285,7 +288,7 @@ PANEL = {} self.text = self:Add("DLabel") self.text:Dock(FILL) self.text:SetContentAlignment(5) - self.text:SetTextColor(color_white) + self.text:SetTextColor(nut.config.get("colorText", color_white)) self.text:SetText(L"purchasing") self.text:SetFont("nutMediumFont") @@ -317,14 +320,14 @@ PANEL = {} self.current = self.data:Add("DLabel") self.current:SetFont("nutSmallFont") self.current:SetContentAlignment(6) - self.current:SetTextColor(color_white) + self.current:SetTextColor(nut.config.get("colorText", color_white)) self.current:Dock(TOP) self.current:SetTextInset(4, 0) self.total = self.data:Add("DLabel") self.total:SetFont("nutSmallFont") self.total:SetContentAlignment(6) - self.total:SetTextColor(color_white) + self.total:SetTextColor(nut.config.get("colorText", color_white)) self.total:Dock(TOP) self.total:SetTextInset(4, 0) @@ -340,14 +343,14 @@ PANEL = {} self.final = self.data:Add("DLabel") self.final:SetFont("nutSmallFont") self.final:SetContentAlignment(6) - self.final:SetTextColor(color_white) + self.final:SetTextColor(nut.config.get("colorText", color_white)) self.final:Dock(TOP) self.final:SetTextInset(4, 0) self.finalGlow = self.final:Add("DLabel") self.finalGlow:Dock(FILL) self.finalGlow:SetFont("nutSmallFont") - self.finalGlow:SetTextColor(color_white) + self.finalGlow:SetTextColor(nut.config.get("colorText", color_white)) self.finalGlow:SetContentAlignment(6) self.finalGlow:SetAlpha(0) self.finalGlow:SetTextInset(4, 0) @@ -358,6 +361,9 @@ PANEL = {} self:onQuantityChanged() end + local color_offGreen = Color(46, 204, 113) + local color_offRed = Color(217, 30, 24) + function PANEL:onQuantityChanged() local price = 0 local money = LocalPlayer():getChar():getMoney() @@ -375,7 +381,7 @@ PANEL = {} self.current:SetText(L"currentMoney"..nut.currency.get(money)) self.total:SetText("- "..nut.currency.get(price)) self.final:SetText(L"moneyLeft"..nut.currency.get(money - price)) - self.final:SetTextColor((money - price) >= 0 and Color(46, 204, 113) or Color(217, 30, 24)) + self.final:SetTextColor((money - price) >= 0 and color_offGreen or color_offRed) self.preventBuy = (money - price) < 0 or valid == 0 end @@ -402,7 +408,7 @@ PANEL = {} slot.name:SetSize(180, 32) slot.name:SetFont("nutChatFont") slot.name:SetText(L(itemTable.getName and itemTable:getName() or L(itemTable.name)).." ("..(itemTable:getPrice() and nut.currency.get(itemTable:getPrice()) or L"free":upper())..")") - slot.name:SetTextColor(color_white) + slot.name:SetTextColor(nut.config.get("colorText", color_white)) slot.quantity = slot:Add("DTextEntry") slot.quantity:SetSize(32, 32) @@ -440,7 +446,7 @@ PANEL = {} function PANEL:Think() if (!self:HasFocus()) then self:MakePopup() - end + end end vgui.Register("nutBusinessCheckout", PANEL, "DFrame") diff --git a/plugins/chatbox/derma/cl_chatbox.lua b/plugins/chatbox/derma/cl_chatbox.lua index 33e51f59..c9ba646e 100644 --- a/plugins/chatbox/derma/cl_chatbox.lua +++ b/plugins/chatbox/derma/cl_chatbox.lua @@ -212,6 +212,8 @@ local PANEL = {} surface.DrawOutlinedRect(0, 0, w, h) end + local color_blackTransparent = Color(0,0,0,200) + function PANEL:addFilterButton(filter) local name = L(filter) @@ -222,8 +224,8 @@ local PANEL = {} tab:DockMargin(0, 0, 3, 0) tab:SetWide(tab:GetWide() + 32) tab:Dock(LEFT) - tab:SetTextColor(color_white) - tab:SetExpensiveShadow(1, Color(0, 0, 0, 200)) + tab:SetTextColor(nut.config.get("colorText", color_white)) + tab:SetExpensiveShadow(1, color_blackTransparent) tab.Paint = PaintFilterButton tab.DoClick = function(this) this.active = !this.active diff --git a/plugins/f1menu/derma/cl_menu.lua b/plugins/f1menu/derma/cl_menu.lua index 104a9514..943dba47 100644 --- a/plugins/f1menu/derma/cl_menu.lua +++ b/plugins/f1menu/derma/cl_menu.lua @@ -1,6 +1,9 @@ local PANEL = {} - local gradient = nut.util.getMaterial("vgui/gradient-u") - local gradient2 = nut.util.getMaterial("vgui/gradient-d") + local gradientU = nut.util.getMaterial("vgui/gradient-u") + local gradientD = nut.util.getMaterial("vgui/gradient-d") + local gradientL = nut.util.getMaterial("vgui/gradient-l") + local gradientR = nut.util.getMaterial("vgui/gradient-r") + local color_blackTransparent = Color(0,0,0,150) local alpha = 80 function PANEL:Init() @@ -27,8 +30,8 @@ local PANEL = {} self.title = self:Add("DLabel") self.title:SetPos(self.panel.x, self.panel.y - 80) - self.title:SetTextColor(color_white) - self.title:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + self.title:SetTextColor(nut.config.get("colorText", color_white)) + self.title:SetExpensiveShadow(1, color_blackTransparent) self.title:SetFont("nutTitleFont") self.title:SetText("") self.title:SetAlpha(0) @@ -102,42 +105,73 @@ local PANEL = {} local color_bright = Color(240, 240, 240, 180) function PANEL:Paint(w, h) +--[[ local r, g, b = nut.config.get("color"):Unpack() + surface.SetDrawColor(r, g, b, 200) + surface.DrawRect(-10, -10, w + 10, h + 10) + + surface.SetDrawColor(0, 0, 0, 255) + surface.SetMaterial(gradientD) + surface.DrawTexturedRect(-10, -10, w + 10, h + 10) + + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(-10, -10, w + 10, h + 10) + + nut.util.drawBlur(self) ]] nut.util.drawBlur(self, 12) + local r, g, b = nut.config.get("color"):Unpack() + surface.SetDrawColor(0, 0, 0) - surface.SetMaterial(gradient) + surface.SetMaterial(gradientU) surface.DrawTexturedRect(0, 0, w, h) - surface.SetDrawColor(30, 30, 30, alpha) - surface.DrawRect(0, 0, w, 78) + surface.SetDrawColor(r, g, b, alpha) + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, 0, w/2, 78) + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(w/2, 0, w/2, 78) surface.SetDrawColor(color_bright) surface.DrawRect(0, 78, w, 8) end + local color_offWhite = Color(250,250,250) + function PANEL:addTab(name, callback, uniqueID) name = L(name) local function paintTab(tab, w, h) + local r, g, b = nut.config.get("color"):Unpack() if (self.activeTab == tab) then - surface.SetDrawColor(ColorAlpha(nut.config.get("color"), 200)) - surface.DrawRect(0, h - 8, w, 8) + surface.SetDrawColor(r, g, b, 255) +--[[ surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, 0, w/2, 78) + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(w/2, 0, w/2, 78) ]] + + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, h - 8, w*0.26, 8) + surface.DrawRect(w*0.25, h - 8, w*0.5, 8) + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(w*0.74, h - 8, w*0.26, 8) elseif (tab.Hovered) then - surface.SetDrawColor(0, 0, 0, 50) - surface.DrawRect(0, h - 8, w, 8) + surface.SetDrawColor(r, g, b, 200) + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, h - 8, w/2, 8) + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(w/2, h - 8, w/2, 8) end end surface.SetFont("nutMenuButtonLightFont") local w = surface.GetTextSize(name) - local tab = self.tabs:Add("DButton") + local tab = self.tabs:Add("nutMenuButton") tab:SetSize(0, self.tabs:GetTall()) - tab:SetText(name) + tab:setText(name) tab:SetPos(self.tabs:GetWide(), 0) - tab:SetTextColor(Color(250, 250, 250)) tab:SetFont("nutMenuButtonLightFont") - tab:SetExpensiveShadow(1, Color(0, 0, 0, 150)) + tab:SetExpensiveShadow(1, color_blackTransparent) tab:SizeToContentsX() tab:SetWide(w + 32) tab.Paint = paintTab @@ -154,7 +188,10 @@ local PANEL = {} self.title:MoveAbove(self.panel, 8) self.panel:AlphaTo(255, 0.5, 0.1) + if self.activeTab then self.activeTab:setActive(false) end self.activeTab = this + this:setActive(true) + lastMenuTab = uniqueID if (callback) then diff --git a/plugins/f1menu/derma/cl_menubutton.lua b/plugins/f1menu/derma/cl_menubutton.lua index aa737ad8..8cc3f9e9 100644 --- a/plugins/f1menu/derma/cl_menubutton.lua +++ b/plugins/f1menu/derma/cl_menubutton.lua @@ -1,63 +1,61 @@ local PANEL = {} - function PANEL:Init() - self:SetFont("nutMenuButtonFont") - self:SetExpensiveShadow(2, Color(0, 0, 0, 200)) - self:SetTextColor(color_white) - self:SetPaintBackground(false) - self.OldSetTextColor = self.SetTextColor - self.SetTextColor = function(this, color) - this:OldSetTextColor(color) - this:SetFGColor(color) - end +local color = Color(0, 0, 0, 255) +local colorSelected = Color(0, 0, 0, 255) +local colorHovered = Color(0, 0, 0, 255) + +function PANEL:Init() + self:SetFont("nutMenuButtonLightFont") + self:SetExpensiveShadow(2, Color(0, 0, 0, 200)) + self:SetPaintBackground(false) + self.OldSetTextColor = self.SetTextColor + self.SetTextColor = function(this, color) + this:OldSetTextColor(color) + this:SetFGColor(color) end - function PANEL:setText(text, noTranslation) - surface.SetFont("nutMenuButtonFont") + local nscolor = table.Copy(nut.config.get("colorText", color_white)) + color.r, color.g, color.b = nscolor.r - 30, nscolor.g - 30, nscolor.b - 30 + colorHovered.r, colorHovered.g, colorHovered.b = nscolor.r - 15, nscolor.g - 15, nscolor.b - 15 + colorSelected.r, colorSelected.g, colorSelected.b = nscolor.r, nscolor.g, nscolor.b + self.color, self.colorHovered, self.colorSelected = color, colorHovered, colorSelected - self:SetText(noTranslation and text:upper() or L(text):upper()) + self:SetTextColor(self.active and self.colorSelected or self.color) +end - if (!noTranslation) then - self:SetTooltip(L(text.."Tip")) - end +function PANEL:setText(text, noTranslation) + self:SetText("") + text = noTranslation and text or L(text) + self:SetText(text) +end - local w, h = surface.GetTextSize(self:GetText()) - self:SetSize(w + 64, h + 32) - end - - function PANEL:OnCursorEntered() - local color = self:GetTextColor() - self:SetTextColor(Color(math.max(color.r - 25, 0), math.max(color.g - 25, 0), math.max(color.b - 25, 0))) +function PANEL:OnCursorEntered() + self:SetTextColor(self.colorHovered) + surface.PlaySound(SOUND_MENU_BUTTON_ROLLOVER) +end - surface.PlaySound(SOUND_MENU_BUTTON_ROLLOVER) - end +function PANEL:OnCursorExited() + self:SetTextColor(self.active and self.colorSelected or self.color) +end - function PANEL:OnCursorExited() - if (self.color) then - self:SetTextColor(self.color) - else - self:SetTextColor(color_white) - end - end +function PANEL:OnMousePressed(code) - function PANEL:OnMousePressed(code) - if (self.color) then - self:SetTextColor(self.color) - else - self:SetTextColor(nut.config.get("color")) - end + self:SetTextColor(self.colorSelected) - surface.PlaySound(SOUND_MENU_BUTTON_PRESSED) + surface.PlaySound(SOUND_MENU_BUTTON_PRESSED) - if (code == MOUSE_LEFT and self.DoClick) then - self:DoClick(self) - end + if (code == MOUSE_LEFT and self.DoClick) then + self:DoClick(self) end +end + +function PANEL:OnMouseReleased(key) + self:SetTextColor(self.active and self.colorSelected or self.color) +end + +function PANEL:setActive(active) + self.active = active + self:SetFont(active and "nutMenuButtonFont" or "nutMenuButtonLightFont") + self:SetTextColor(self.active and self.colorSelected or self.color) +end - function PANEL:OnMouseReleased(key) - if (self.color) then - self:SetTextColor(self.color) - else - self:SetTextColor(color_white) - end - end vgui.Register("nutMenuButton", PANEL, "DButton") \ No newline at end of file diff --git a/plugins/multichar/plugins/charselect/derma/cl_button.lua b/plugins/multichar/plugins/charselect/derma/cl_button.lua index 312a6e9b..20b8281d 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_button.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_button.lua @@ -3,17 +3,17 @@ local PANEL = {} function PANEL:Init() self:SetFont("nutCharButtonFont") self:SizeToContentsY() - self:SetTextColor(nut.gui.character.WHITE) + self:SetTextColor(nut.gui.character.color) self:SetPaintBackground(false) end function PANEL:OnCursorEntered() nut.gui.character:hoverSound() - self:SetTextColor(nut.gui.character.HOVERED) + self:SetTextColor(nut.gui.character.colorHovered) end function PANEL:OnCursorExited() - self:SetTextColor(nut.gui.character.WHITE) + self:SetTextColor(nut.gui.character.color) end function PANEL:OnMousePressed() diff --git a/plugins/multichar/plugins/charselect/derma/cl_character.lua b/plugins/multichar/plugins/charselect/derma/cl_character.lua index 9e801eb9..7c85117e 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_character.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_character.lua @@ -1,11 +1,7 @@ local PANEL = {} local WHITE = Color(255, 255, 255, 150) -local SELECTED = Color(255, 255, 255, 230) -PANEL.WHITE = WHITE -PANEL.SELECTED = SELECTED -PANEL.HOVERED = Color(255, 255, 255, 50) PANEL.ANIM_SPEED = 0.1 PANEL.FADE_SPEED = 0.5 @@ -38,36 +34,55 @@ function PANEL:createTabs() self:fadeOut() end end, true) - return + + else + + -- Otherwise, add a disconnect button. + self:addTab("leave", function() + vgui.Create("nutCharacterConfirm") + :setTitle(L("disconnect"):upper().."?") + :setMessage(L("You will disconnect from the server."):upper()) + :onConfirm(function() LocalPlayer():ConCommand("disconnect") end) + end, true) + end + + -- get the width of the tabs summed up + local totalWidth = -32 + for _, v in ipairs(self.tabs:GetChildren()) do + totalWidth = totalWidth + v:GetWide() end - -- Otherwise, add a disconnect button. - self:addTab("leave", function() - vgui.Create("nutCharacterConfirm") - :setTitle(L("disconnect"):upper().."?") - :setMessage(L("You will disconnect from the server."):upper()) - :onConfirm(function() LocalPlayer():ConCommand("disconnect") end) - end, true) + -- set the dock margin of self.tabs to center the tabs + if nut.config.get("charMenuAlignment", "center") == "center" then + self.tabs:DockMargin(self.tabs:GetWide() * 0.5 - totalWidth * 0.5, 0, 0, 0) + end end function PANEL:createTitle() + local alignment = nut.config.get("charMenuAlignment", "center") self.title = self:Add("DLabel") self.title:Dock(TOP) - self.title:DockMargin(64, 48, 0, 0) - self.title:SetContentAlignment(1) - self.title:SetTall(96) + self.title:DockMargin(alignment == "left" and 64 or 0, 48, alignment == "right" and 64 or 0, 0) + self.title:SetContentAlignment(alignment == "left" and 4 or alignment == "center" and 5 or 6) self.title:SetFont("nutCharTitleFont") self.title:SetText(L(SCHEMA and SCHEMA.name or "Unknown"):upper()) - self.title:SetTextColor(WHITE) + self.title:SetTextColor(self.color) + + surface.SetFont("nutCharTitleFont") + local _, h = surface.GetTextSize(self.title:GetText()) + self.title:SetTall(h) self.desc = self:Add("DLabel") self.desc:Dock(TOP) - self.desc:DockMargin(64, 0, 0, 0) - self.desc:SetTall(32) - self.desc:SetContentAlignment(7) + self.desc:DockMargin(alignment == "left" and 64 or 0, 0, alignment == "right" and 64 or 0, 0) + self.desc:SetContentAlignment(alignment == "left" and 7 or alignment == "center" and 8 or 9) self.desc:SetText(L(SCHEMA and SCHEMA.desc or ""):upper()) self.desc:SetFont("nutCharDescFont") - self.desc:SetTextColor(WHITE) + self.desc:SetTextColor(self.color) + + surface.SetFont("nutCharDescFont") + _, h = surface.GetTextSize(self.title:GetText()) + self.desc:SetTall(h) end function PANEL:loadBackground() @@ -109,7 +124,12 @@ function PANEL:loadBackground() end end -local gradient = nut.util.getMaterial("vgui/gradient-u") +local gradientU = nut.util.getMaterial("vgui/gradient-u") +local gradientD = nut.util.getMaterial("vgui/gradient-d") +local gradientR = nut.util.getMaterial("vgui/gradient-r") +local gradientL = nut.util.getMaterial("vgui/gradient-l") + +local sin = math.sin function PANEL:paintBackground(w, h) if (IsValid(self.background)) then return end @@ -119,9 +139,22 @@ function PANEL:paintBackground(w, h) surface.DrawRect(0, 0, w, h) end - surface.SetMaterial(gradient) - surface.SetDrawColor(0, 0, 0, 250) - surface.DrawTexturedRect(0, 0, w, h * 1.5) + if not self.startTime then self.startTime = CurTime() end + + local r, g, b = nut.config.get("color"):Unpack() + local curTime = (self.startTime - CurTime())/4 + local alpha = 200 * ((sin(curTime - 1.8719) + sin(curTime - 1.8719/2))/4 + 0.44) + + + surface.SetDrawColor(r, g, b, alpha) + surface.DrawRect(0,0,w,h) + + surface.SetDrawColor(0, 0, 0, 255) + surface.SetMaterial(gradientD) + surface.DrawTexturedRect(0,0,w,h) + + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(0,0,w,h) end function PANEL:addTab(name, callback, justClick) @@ -175,6 +208,12 @@ function PANEL:Init() end nut.gui.character = self + local color = nut.config.get("colorText") + + self.color = ColorAlpha(color, 150) + self.colorSelected = color + self.colorHovered = ColorAlpha(color, 50) + self:Dock(FILL) self:MakePopup() self:SetAlpha(0) @@ -195,6 +234,10 @@ function PANEL:Init() self.music = self:Add("nutCharBGMusic") self:loadBackground() + + self:InvalidateParent(true) + self:InvalidateChildren(true) + self:showContent() end diff --git a/plugins/multichar/plugins/charselect/derma/cl_character_slot.lua b/plugins/multichar/plugins/charselect/derma/cl_character_slot.lua index abafa3a4..6ab5af0a 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_character_slot.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_character_slot.lua @@ -1,6 +1,7 @@ local PANEL = {} local STRIP_HEIGHT = 4 +local WIDTH = 240 function PANEL:isCursorWithinBounds() local x, y = self:LocalCursorPos() @@ -17,7 +18,6 @@ function PANEL:confirmDelete() end function PANEL:Init() - local WIDTH = 240 self:SetWide(WIDTH) self:SetPaintBackground(false) @@ -37,12 +37,12 @@ function PANEL:Init() self.name:DockMargin(0, 16, 0, 0) self.name:SetContentAlignment(5) self.name:SetFont("nutCharSmallButtonFont") - self.name:SetTextColor(nut.gui.character.WHITE) + self.name:SetTextColor(nut.gui.character.color) self.name:SizeToContentsY() self.model = self:Add("nutModelPanel") self.model:Dock(FILL) - self.model:SetFOV(37) + self.model:SetFOV(30) self.model.PaintOver = function(model, w, h) if (self.banned) then local centerX, centerY = w * 0.5, h * 0.5 - 24 @@ -136,10 +136,14 @@ function PANEL:onHoverChanged(isHovered) self.faction:AlphaTo(isHovered and 250 or 100, ANIM_SPEED) end +local gradientU = nut.util.getMaterial("vgui/gradient-u") + function PANEL:Paint(w, h) - nut.util.drawBlur(self) - surface.SetDrawColor(0, 0, 0, 50) - surface.DrawRect(0, STRIP_HEIGHT, w, h) + --nut.util.drawBlur(self) + local secondaryR, secondaryG, secondaryB = nut.config.get("colorBackground"):Unpack() + surface.SetDrawColor(secondaryR, secondaryG, secondaryB, 200) + surface.SetMaterial(gradientU) + surface.DrawTexturedRect(0, STRIP_HEIGHT, w, h) if (not self:isCursorWithinBounds() and self.isHovered) then self:onHoverChanged(false) diff --git a/plugins/multichar/plugins/charselect/derma/cl_confirmation.lua b/plugins/multichar/plugins/charselect/derma/cl_confirmation.lua index c4ce2ac8..4bed4f64 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_confirmation.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_confirmation.lua @@ -22,25 +22,30 @@ function PANEL:Init() self.title = self.content:Add("DLabel") self.title:SetText(L("Are you sure?"):upper()) self.title:SetFont("nutCharButtonFont") - self.title:SetTextColor(color_white) + self.title:SetTextColor(nut.config.get("colorText", color_white)) self.title:SizeToContents() self.title:CenterHorizontal() self.title.y = 64 self.message = self.content:Add("DLabel") self.message:SetFont("nutCharSubTitleFont") - self.message:SetTextColor(color_white) + self.message:SetTextColor(nut.config.get("colorText", color_white)) self.message:SetSize(ScrW(), 32) self.message:CenterVertical() self.message:SetContentAlignment(5) local SPACING = 16 + local confirmText, cancelText = L("yes"):upper(), L("no"):upper() + surface.SetFont("nutCharSmallButtonFont") + local confirmWidth = surface.GetTextSize(confirmText) + SPACING + local cancelWidth = surface.GetTextSize(cancelText) + SPACING + self.confirm = self.content:Add("DButton") self.confirm:SetFont("nutCharSmallButtonFont") - self.confirm:SetText(L("yes"):upper()) + self.confirm:SetText(confirmText) self.confirm:SetPaintBackground(false) - self.confirm:SetSize(64, 32) + self.confirm:SetSize(confirmWidth, 32) self.confirm.OnCursorEntered = function() nut.gui.character:hoverSound() end self.confirm.OnCursorEntered = function(cancel) cancel.BaseClass.OnCursorEntered(cancel) @@ -60,9 +65,9 @@ function PANEL:Init() self.cancel = self.content:Add("DButton") self.cancel:SetFont("nutCharSmallButtonFont") - self.cancel:SetText(L("no"):upper()) + self.cancel:SetText(cancelText) self.cancel:SetPaintBackground(false) - self.cancel:SetSize(64, 32) + self.cancel:SetSize(cancelWidth, 32) self.cancel.OnCursorEntered = function(cancel) cancel.BaseClass.OnCursorEntered(cancel) nut.gui.character:hoverSound() diff --git a/plugins/multichar/plugins/charselect/derma/cl_creation.lua b/plugins/multichar/plugins/charselect/derma/cl_creation.lua index 5231b193..11db27fe 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_creation.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_creation.lua @@ -173,7 +173,7 @@ function PANEL:showMessage(message, ...) self.message = self:Add("DLabel") self.message:SetFont("nutCharButtonFont") - self.message:SetTextColor(nut.gui.character.WHITE) + self.message:SetTextColor(nut.gui.character.color) self.message:Dock(FILL) self.message:SetContentAlignment(5) self.message:SetText(message) diff --git a/plugins/multichar/plugins/charselect/derma/cl_selection.lua b/plugins/multichar/plugins/charselect/derma/cl_selection.lua index 5d210eab..b10cdfad 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_selection.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_selection.lua @@ -3,7 +3,9 @@ local PANEL = {} function PANEL:Init() self:Dock(FILL) self:DockMargin(0, 64, 0, 0) + self:InvalidateParent(true) self:InvalidateLayout(true) + self.panels = {} self.scroll = self:Add("nutHorizontalScroll") @@ -35,15 +37,19 @@ end -- Creates a nutCharacterSlot for each of the local player's characters. function PANEL:createCharacterSlots() + local alignment = nut.config.get("charMenuAlignment", "center") self.scroll:Clear() if (#nut.characters == 0) then return nut.gui.character:showContent() end + + local totalWide = 0 for _, id in ipairs(nut.characters) do local character = nut.char.loaded[id] if (not character) then continue end local panel = self.scroll:Add("nutCharacterSlot") + totalWide = totalWide + panel:GetWide() + 8 panel:Dock(LEFT) panel:DockMargin(0, 0, 8, 8) panel:setCharacter(character) @@ -51,6 +57,12 @@ function PANEL:createCharacterSlots() self:onCharacterSelected(character) end end + + totalWide = totalWide - 8 + self.scroll:SetWide(self:GetWide()) + -- This is a hack to make sure the scroll panel is the correct size + local multiplier = alignment == "center" and 0.5 or alignment == "left" and 0 or 1 + self.scroll:DockMargin(math.max(0, self.scroll:GetWide()*multiplier - totalWide*multiplier), 0, 0, 0) end -- Called when a character slot has been selected. This actually loads the diff --git a/plugins/multichar/plugins/charselect/derma/cl_tab_button.lua b/plugins/multichar/plugins/charselect/derma/cl_tab_button.lua index 211ff111..700a6eba 100644 --- a/plugins/multichar/plugins/charselect/derma/cl_tab_button.lua +++ b/plugins/multichar/plugins/charselect/derma/cl_tab_button.lua @@ -1,7 +1,8 @@ local PANEL = {} function PANEL:Init() - self:Dock(LEFT) + local alignment = nut.config.get("charMenuAlignment", "center") + self:Dock(alignment == "right" and RIGHT or LEFT) self:DockMargin(0, 0, 32, 0) self:SetContentAlignment(4) end @@ -23,7 +24,7 @@ function PANEL:setSelected(isSelected) local menu = nut.gui.character if (isSelected and IsValid(menu)) then if (IsValid(menu.lastTab)) then - menu.lastTab:SetTextColor(nut.gui.character.WHITE) + menu.lastTab:SetTextColor(nut.gui.character.color) menu.lastTab.isSelected = false end menu.lastTab = self @@ -31,8 +32,8 @@ function PANEL:setSelected(isSelected) self:SetTextColor( isSelected - and nut.gui.character.SELECTED - or nut.gui.character.WHITE + and nut.gui.character.colorSelected + or nut.gui.character.color ) self.isSelected = isSelected if (isfunction(self.callback)) then @@ -40,14 +41,28 @@ function PANEL:setSelected(isSelected) end end +local gradientR = nut.util.getMaterial("vgui/gradient-r") +local gradientL = nut.util.getMaterial("vgui/gradient-l") + function PANEL:Paint(w, h) if (self.isSelected or self:IsHovered()) then - surface.SetDrawColor( + local r, g, b = nut.config.get("color"):Unpack() +--[[ surface.SetDrawColor( self.isSelected and nut.gui.character.WHITE or nut.gui.character.HOVERED - ) - surface.DrawRect(0, h - 4, w, 4) + ) ]] + if (self.isSelected) then + surface.SetDrawColor(r, g, b, 200) + else + surface.SetDrawColor(r, g, b, 100) + end + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(0, h-4, w/2, 4) + + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(w/2, h-4, w/2, 4) + --surface.DrawRect(0, h - 4, w, 4) end end diff --git a/plugins/multichar/plugins/charselect/derma/steps/cl_faction.lua b/plugins/multichar/plugins/charselect/derma/steps/cl_faction.lua index 7b3ced5f..4b84879f 100644 --- a/plugins/multichar/plugins/charselect/derma/steps/cl_faction.lua +++ b/plugins/multichar/plugins/charselect/derma/steps/cl_faction.lua @@ -13,7 +13,7 @@ function PANEL:Init() surface.SetDrawColor(0, 0, 0, 100) surface.DrawRect(0, 0, w, h) end - self.faction:SetTextColor(color_white) + self.faction:SetTextColor(nut.config.get("colorText", color_white)) self.faction.OnSelect = function(faction, index, value, id) self:onFactionSelected(nut.faction.teams[id]) end diff --git a/plugins/multichar/plugins/charselect/sh_plugin.lua b/plugins/multichar/plugins/charselect/sh_plugin.lua index bec478de..1e78de89 100644 --- a/plugins/multichar/plugins/charselect/sh_plugin.lua +++ b/plugins/multichar/plugins/charselect/sh_plugin.lua @@ -38,6 +38,18 @@ nut.config.add( {category = PLUGIN.name} ) +nut.config.add( + "charMenuAlignment", + "center", + "Where the character menu is aligned.", + nil, + { + options = {"left", "center", "right"}, + form = "Combo", + category = PLUGIN.name + } +) + if (SERVER) then return end local function ScreenScale(size) diff --git a/plugins/newvoice.lua b/plugins/newvoice.lua index 50dbbe81..dcc3551e 100644 --- a/plugins/newvoice.lua +++ b/plugins/newvoice.lua @@ -11,7 +11,7 @@ if (CLIENT) then hi:SetFont("nutIconsMedium") hi:Dock(LEFT) hi:DockMargin(8, 0, 8, 0) - hi:SetTextColor(color_white) + hi:SetTextColor(nut.config.get("colorText", color_white)) hi:SetText("i") hi:SetWide(30) @@ -19,7 +19,7 @@ if (CLIENT) then self.LabelName:SetFont("nutMediumFont") self.LabelName:Dock(FILL) self.LabelName:DockMargin(0, 0, 0, 0) - self.LabelName:SetTextColor(color_white) + self.LabelName:SetTextColor(nut.config.get("colorText", color_white)) self.Color = color_transparent diff --git a/plugins/notices/derma/cl_notice.lua b/plugins/notices/derma/cl_notice.lua index f88f1707..74b5f885 100644 --- a/plugins/notices/derma/cl_notice.lua +++ b/plugins/notices/derma/cl_notice.lua @@ -6,7 +6,7 @@ local PANEL = {} self:SetContentAlignment(5) self:SetExpensiveShadow(1, Color(0, 0, 0, 150)) self:SetFont("nutNoticeFont") - self:SetTextColor(color_white) + self:SetTextColor(nut.config.get("colorText", color_white)) self:SetDrawOnTop(true) end diff --git a/plugins/nshud/sh_plugin.lua b/plugins/nshud/sh_plugin.lua index 9dbe3004..32e630f7 100644 --- a/plugins/nshud/sh_plugin.lua +++ b/plugins/nshud/sh_plugin.lua @@ -22,7 +22,8 @@ local toScreen = FindMetaTable("Vector").ToScreen local NUT_CVAR_NSHUD_DESCWIDTH = CreateClientConVar("nut_hud_descwidth", 0.5, true, false) function PLUGIN:SetupQuickMenu(menu) - menu:addSlider("HUD Desc Width Modifier", function(panel, value) + menu:addCategory("NSHUD") + menu:addSlider("Desc Width Modifier", function(panel, value) NUT_CVAR_NSHUD_DESCWIDTH:SetFloat(value) end, NUT_CVAR_NSHUD_DESCWIDTH:GetFloat(), 0.1, 1, 2) menu:addSpacer() @@ -127,9 +128,6 @@ function PLUGIN:DrawEntityInfo(entity, alpha, position) entity.nutDescCache = nil end - entity.nutNameCache = nil - entity.nutDescCache = nil - local name = hookRun("GetDisplayedName", entity, nil, "hud") or character.getName(character) if (name ~= entity.nutNameCache) then diff --git a/plugins/nsintro/derma/cl_intro.lua b/plugins/nsintro/derma/cl_intro.lua index f2e11dd8..a58a56f9 100644 --- a/plugins/nsintro/derma/cl_intro.lua +++ b/plugins/nsintro/derma/cl_intro.lua @@ -26,7 +26,7 @@ local PANEL = {} self.authors = self:Add("DLabel") self.authors:SetText(GAMEMODE.Author.." Presents") self.authors:SetFont("nutIntroMediumFont") - self.authors:SetTextColor(color_white) + self.authors:SetTextColor(nut.config.get("colorText", color_white)) self.authors:SetAlpha(0) self.authors:AlphaTo(255, 5, 1.5, function() self.authors:AlphaTo(0, 5, 3, function() @@ -60,7 +60,7 @@ local PANEL = {} self.name = self:Add("DLabel") self.name:SetText(GAMEMODE.Name) self.name:SetFont("nutIntroTitleFont") - self.name:SetTextColor(color_white) + self.name:SetTextColor(nut.config.get("colorText", color_white)) self.name:SizeToContents() self.name:Center() self.name:SetPos(self.name.x, ScrH() * 0.4) diff --git a/plugins/nstheme/derma/cl_skin.lua b/plugins/nstheme/derma/cl_skin.lua index dea65906..26e892f9 100644 --- a/plugins/nstheme/derma/cl_skin.lua +++ b/plugins/nstheme/derma/cl_skin.lua @@ -1,3 +1,10 @@ +local gradientU = nut.util.getMaterial("vgui/gradient-u") +local gradientD = nut.util.getMaterial("vgui/gradient-d") +local gradientL = nut.util.getMaterial("vgui/gradient-l") +local gradientR = nut.util.getMaterial("vgui/gradient-r") +local gradientC = nut.util.getMaterial("gui/center_gradient") +local palette = palette or {} + local SKIN = {} SKIN.fontFrame = "BudgetLabel" SKIN.fontTab = "nutSmallFont" @@ -7,34 +14,187 @@ local SKIN = {} SKIN.Colours.Window.TitleActive = Color(0, 0, 0) SKIN.Colours.Window.TitleInactive = Color(255, 255, 255) - SKIN.Colours.Button.Normal = Color(80, 80, 80) - SKIN.Colours.Button.Hover = Color(255, 255, 255) + local defaultLight, defaultDark = color_white, Color(80, 80, 80) + + SKIN.Colours.Button.Normal = defaultDark + SKIN.Colours.Button.Hover = defaultLight SKIN.Colours.Button.Down = Color(180, 180, 180) SKIN.Colours.Button.Disabled = Color(0, 0, 0, 100) - function SKIN:PaintFrame(panel) - nut.util.drawBlur(panel, 10) + local clamp = function(value) + return math.Clamp(value, 0.2, 1) + end - surface.SetDrawColor(45, 45, 45, 200) - surface.DrawRect(0, 0, panel:GetWide(), panel:GetTall()) + local toColor = function(baseColor) + return Color(baseColor.r, baseColor.g, baseColor.b) + end - surface.SetDrawColor(nut.config.get("color")) - surface.DrawRect(0, 0, panel:GetWide(), 24) + local themeGenerator = { + ["dark"] = function(h, s, l) + local secondary = HSVToColor(h, s, l - 0.5 <=0.2 and l + 0.3 or l - 0.5) + local background = HSVToColor(h, s - 0.3 < 0.1 and s + 0.3 or s - 0.3, l - 0.5 <=0.2 and l + 0.3 or l - 0.5) + local light = HSVToColor(h, 0.1, 1) + local dark = HSVToColor(h, 1, 0.2) - surface.SetDrawColor(nut.config.get("color")) - surface.DrawOutlinedRect(0, 0, panel:GetWide(), panel:GetTall()) + return toColor(secondary), toColor(background), toColor(light), toColor(dark) + end, + ["light"] = function(h, s, l) + local secondary = HSVToColor(h, s, l - 0.2 <=0.2 and l + 0.6 or l - 0.2) + local background = HSVToColor(h, s - 0.3 < 0.1 and s + 0.3 or s - 0.3, clamp(s + 0.05)) + local light = HSVToColor(h, 0.1, 1) + local dark = HSVToColor(h, 1, 0.2) + + return toColor(secondary), toColor(background), toColor(light), toColor(dark) + end, + } + -- Function to create a monochromatic color palette + local function createMonochromaticPalette() + -- Calculate the HSL values of the base color + local theme = nut.config.get("colorAutoTheme", "dark") + local primary = nut.config.get("color") + local h, s, l = ColorToHSV(primary) + local secondary = nut.config.get("colorSecondary", Color(55, 87, 140)) + local background = nut.config.get("colorBackground", Color(45, 45, 45)) + local light, dark = defaultLight, defaultDark + if themeGenerator[theme] ~= nil then + secondary, background, light, dark = themeGenerator[theme](h, s, l) + end + + return {primary = primary, secondary = secondary, background = background, light = light, dark = dark} + end + + hook.Add("PostDrawHUD", "nutdebugTestlalal", function() + --[[ if not table.IsEmpty(palette) then + local x, y = 0, 0 + local w, h = 100, 100 + for i = 1, #palette do + local color = palette[i] + surface.SetDrawColor(color) + surface.DrawRect(x, y, w, h) + --draw text inside the box with the color r,g,b + draw.SimpleText("R: "..color.r, "nutSmallFont", x + w/2, y + h*0.25, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + draw.SimpleText("G: "..color.g, "nutSmallFont", x + w/2, y + h*0.5, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + draw.SimpleText("B: "..color.b, "nutSmallFont", x + w/2, y + h*0.75, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) + + x = x + w + end + end ]] + end) + + local function updateColors() + + timer.Simple(0, function() + palette = createMonochromaticPalette() + local primary, secondary, background, light, dark = palette.primary, palette.secondary, palette.background, palette.light, palette.dark + nut.config.set("color", primary) + nut.config.set("colorSecondary", secondary) + nut.config.set("colorBackground", background) + + if themeGenerator[nut.config.get("colorAutoTheme", "dark")] ~= nil then + nut.config.setDefault("colorSecondary", secondary) + nut.config.setDefault("colorBackground", background) + end + + SKIN.Colours.Window.TitleActive = secondary + SKIN.Colours.Window.TitleInactive = Color(255, 255, 255) + + SKIN.tex.CategoryList.Header = function( x, y, w, h ) + surface.SetDrawColor( primary ) + surface.DrawRect( x, y, w, h ) + end + + SKIN.Colours.Button.Normal = light + +--[[ SKIN.Colours.Button.Normal = secondary + SKIN.Colours.Button.Hover = light + SKIN.Colours.Button.Down = dark + SKIN.Colours.Button.Disabled = background ]] + + SKIN.colTextEntryTextHighlight = secondary + end) + end + + hook.Add("nutUpdateColors", "nutSkinUpdateColors", updateColors) + + local function updateTextColors() + timer.Simple(0, function() + local normal = nut.config.get("colorText") + + local h, s, v = ColorToHSV(normal) + local h1, s1, v1 = ColorToHSV(nut.config.get("color")) + + local hover = HSVToColor(h1, s, v) + local down = HSVToColor(h, 0, v*0.2) + local bright = HSVToColor(h, 0, v*1.2) + local dark = HSVToColor(h, 0, v*0.8) + local disabled = HSVToColor(h, 0, v*0.5) + + SKIN.Colours.Button.Normal = normal + SKIN.Colours.Button.Hover = hover + SKIN.Colours.Button.Down = down + SKIN.Colours.Button.Disabled = disabled + + SKIN.Colours.Tree.Normal = normal + SKIN.Colours.Tree.Hover = hover + SKIN.Colours.Tree.Selected = down + + SKIN.Colours.Category.Line.Text = normal + SKIN.Colours.Category.Line.Text_Hover = hover + SKIN.Colours.Category.Line.Text_Selected = down + SKIN.Colours.Category.LineAlt.Text = normal + SKIN.Colours.Category.LineAlt.Text_Hover = hover + SKIN.Colours.Category.LineAlt.Text_Selected = down + SKIN.Colours.Label.Default = normal + SKIN.Colours.Label.Bright = bright + SKIN.Colours.Label.Dark = dark + SKIN.Colours.Label.Highlight = hover + end) + + if (IsValid(nut.gui.score)) then nut.gui.score:Remove() end end - function SKIN:DrawGenericBackground(x, y, w, h) - surface.SetDrawColor(45, 45, 45, 240) + hook.Add("nutUpdateColors", "nutSkinUpdateTextColors", updateTextColors) + + local function nsBackground(panel, x, y, w, h, alt) + local colorR, colorG, colorB = nut.config.get("color"):Unpack() + local backgroundR, backgroundG, backgroundB = nut.config.get("colorBackground"):Unpack() + nut.util.drawBlur(panel, 10) + + surface.SetDrawColor(alt and 255 or colorR, alt and 255 or colorG, alt and 255 or colorB, 200) surface.DrawRect(x, y, w, h) - surface.SetDrawColor(0, 0, 0, 180) - surface.DrawOutlinedRect(x, y, w, h) + surface.SetDrawColor(backgroundR, backgroundG, backgroundB, 255) + surface.SetMaterial(gradientD) + surface.DrawTexturedRect(x, y, w, h) + surface.SetMaterial(gradientR) + surface.DrawTexturedRect(x, y, w, h) + end + + local function nsComboBackground(panel, x, y, w, h, alt) + local colorR, colorG, colorB = nut.config.get("color"):Unpack() + local backgroundR, backgroundG, backgroundB = nut.config.get("colorSecondary"):Unpack() + --nut.util.drawBlur(panel, 10) + + surface.SetDrawColor(backgroundR, backgroundG, backgroundB, 255) + surface.DrawRect(x, y, w, h) + + if alt then + surface.SetDrawColor(colorR, colorG, colorB, 255) + surface.SetMaterial(gradientL) + surface.DrawTexturedRect(x, y, w, h) + end + end + + function SKIN:PaintFrame(panel, w, h) + nsBackground(panel, 0, 0, w, h) + + surface.SetDrawColor(nut.config.get("color")) + surface.DrawRect(0, 0, panel:GetWide(), 24) + + surface.SetDrawColor(nut.config.get("color")) + surface.DrawOutlinedRect(0, 0, panel:GetWide(), panel:GetTall()) - surface.SetDrawColor(100, 100, 100, 25) - surface.DrawOutlinedRect(x + 1, y + 1, w - 2, h - 2) end function SKIN:PaintPanel(panel) @@ -43,9 +203,11 @@ local SKIN = {} return end + local backgroundR, backgroundG, backgroundB = nut.config.get("colorBackground"):Unpack() + local w, h = panel:GetWide(), panel:GetTall() - surface.SetDrawColor(0, 0, 0, 100) + surface.SetDrawColor(backgroundR, backgroundG, backgroundB, 100) surface.DrawRect(0, 0, w, h) surface.DrawOutlinedRect(0, 0, w, h) end @@ -56,21 +218,24 @@ local SKIN = {} return end + local backgroundR, backgroundG, backgroundB = nut.config.get("colorBackground"):Unpack() + local secondaryR, secondaryG, secondaryB = nut.config.get("colorSecondary"):Unpack() + local w, h = panel:GetWide(), panel:GetTall() local alpha = 50 if (panel:GetDisabled()) then alpha = 10 elseif (panel.Depressed) then - alpha = 180 + alpha = 100 elseif (panel.Hovered) then alpha = 75 end - surface.SetDrawColor(30, 30, 30, alpha) + surface.SetDrawColor(backgroundR, backgroundG, backgroundB, alpha) surface.DrawRect(0, 0, w, h) - surface.SetDrawColor(0, 0, 0, 180) + surface.SetDrawColor(secondaryR, secondaryG, secondaryB, 180) surface.DrawOutlinedRect(0, 0, w, h) surface.SetDrawColor(180, 180, 180, 2) @@ -83,5 +248,159 @@ local SKIN = {} function SKIN:PaintWindowMaximizeButton(panel, w, h) end + + function SKIN:PaintCollapsibleCategory( panel, w, h ) + + if ( h <= panel:GetHeaderHeight() ) then + --self.tex.CategoryList.Header( 0, 0, w, h ) + draw.RoundedBoxEx( 6, 0, 0, w, h, palette.secondary, true, true, false, false ) + -- Little hack, draw the ComboBox's dropdown arrow to tell the player the category is collapsed and not empty + if ( !panel:GetExpanded() ) then self.tex.Input.ComboBox.Button.Down( w - 18, h / 2 - 8, 15, 15 ) end + return + end + + --self.tex.CategoryList.InnerH( 0, 0, w, panel:GetHeaderHeight() ) + draw.RoundedBoxEx( 6, 0, 0, w, panel:GetHeaderHeight(), palette.primary, true, true, false, false ) + --self.tex.CategoryList.Inner( 0, panel:GetHeaderHeight(), w, h - panel:GetHeaderHeight() ) + nsBackground(panel, 0, panel:GetHeaderHeight(), w, h - panel:GetHeaderHeight()) + + end + + --[[--------------------------------------------------------- + Panel + -----------------------------------------------------------]] + function SKIN:PaintPanel( panel, w, h ) + + if ( !panel.m_bBackground ) then return end + nsBackground(panel, 0, 0, w, h) + end + + --[[--------------------------------------------------------- + Tree + -----------------------------------------------------------]] + function SKIN:PaintTree( panel, w, h ) + + if ( !panel.m_bBackground ) then return end + nsBackground(panel, 0, 0, w, h) + end + + --[[--------------------------------------------------------- + Menu + -----------------------------------------------------------]] + function SKIN:PaintMenu( panel, w, h ) + + if ( panel:GetDrawColumn() ) then + self.tex.MenuBG_Column( 0, 0, w, h ) + else + nsBackground(panel, 0, 0, w, h) + end + end + + --[[--------------------------------------------------------- + MenuOption + -----------------------------------------------------------]] + function SKIN:PaintMenuOption( panel, w, h ) + + --[[ if ( panel.m_bBackground && !panel:IsEnabled() ) then + surface.SetDrawColor( Color( 0, 0, 0, 50 ) ) + surface.DrawRect( 0, 0, w, h ) + end ]] + + --[[ if ( panel.m_bBackground && ( panel.Hovered || panel.Highlight) ) then + self.tex.MenuBG_Hover( 0, 0, w, h ) + end ]] + + if ( panel:GetChecked() ) then + self.tex.Menu_Check( 5, h / 2 - 7, 15, 15 ) + end + + nsComboBackground(panel, 0, 0, w, h, panel.m_bBackground && ( panel.Hovered || panel.Highlight)) + + end + + --[[--------------------------------------------------------- + ComboBox + -----------------------------------------------------------]] + function SKIN:PaintComboBox( panel, w, h ) + + if ( panel:GetDisabled() ) then + return self.tex.Input.ComboBox.Disabled( 0, 0, w, h ) + end + + if ( panel.Depressed || panel:IsMenuOpen() ) then + return self.tex.Input.ComboBox.Down( 0, 0, w, h ) + end + + if ( panel.Hovered ) then + nsComboBackground(panel, 0, 0, w, h, true) + return + end + + nsComboBackground(panel, 0, 0, w, h) + + end + + + function SKIN:PaintCategoryButton( panel, w, h ) + local r, g, b = nut.config.get("colorSecondary"):Unpack() + local r2, g2, b2 = r - 25, g - 25, b - 25 + + + if ( panel.AltLine ) then + + surface.SetDrawColor( r, g, b ) + + else + + surface.SetDrawColor( r2, g2, b2 ) + + end + + surface.DrawRect( 0, 0, w, h ) + + end + + + function SKIN:PaintListBox( panel, w, h ) + + nsBackground(panel, 0, 0, w, h) + + end + + function SKIN:PaintListView( panel, w, h ) + + if ( !panel.m_bBackground ) then return end + + nsBackground(panel, 0, 0, w, h) + + end + + function SKIN:PaintMenuBar( panel, w, h ) + + local colorR, colorG, colorB = nut.config.get("color"):Unpack() + local backgroundR, backgroundG, backgroundB = nut.config.get("colorBackground"):Unpack() + nut.util.drawBlur(panel, 10) + + surface.SetDrawColor(backgroundR, backgroundG, backgroundB, 200) + surface.DrawRect(0, 0, w, h) + + surface.SetDrawColor(colorR, colorG, colorB, 255) + surface.SetMaterial(gradientC) + surface.DrawTexturedRect(0, 0, w, h) + end + + function SKIN:PaintProgress( panel, w, h ) + + local colorR, colorG, colorB = nut.config.get("color"):Unpack() + local backgroundR, backgroundG, backgroundB = nut.config.get("colorBackground"):Unpack() + + surface.SetDrawColor(backgroundR, backgroundG, backgroundB, 200) + surface.DrawRect(0, 0, w, h) + + surface.SetDrawColor(colorR, colorG, colorB, 255) + --surface.SetMaterial(gradientC) + surface.DrawRect(0, 0, w * panel:GetFraction(), h) + end + derma.DefineSkin("nutscript", "The base skin for the NutScript framework.", SKIN) -derma.RefreshSkins() +derma.RefreshSkins() \ No newline at end of file diff --git a/plugins/nstheme/derma/cl_skin_alt.lua b/plugins/nstheme/derma/cl_skin_alt.lua new file mode 100644 index 00000000..22cc0036 --- /dev/null +++ b/plugins/nstheme/derma/cl_skin_alt.lua @@ -0,0 +1,90 @@ +local palette = palette or {} + +local SKIN = {} + SKIN.fontFrame = "BudgetLabel" + SKIN.fontTab = "nutSmallFont" + SKIN.fontButton = "nutSmallFont" + + SKIN.Colours = table.Copy(derma.SkinList.Default.Colours) + SKIN.Colours.Window.TitleActive = Color(0, 0, 0) + SKIN.Colours.Window.TitleInactive = Color(255, 255, 255) + + local defaultLight, defaultDark = color_white, Color(80, 80, 80) + + SKIN.Colours.Button.Normal = defaultDark + SKIN.Colours.Button.Hover = defaultLight + SKIN.Colours.Button.Down = Color(180, 180, 180) + SKIN.Colours.Button.Disabled = Color(0, 0, 0, 100) + + local clamp = function(value) + return math.Clamp(value, 0.2, 1) + end + + local toColor = function(baseColor) + return Color(baseColor.r, baseColor.g, baseColor.b) + end + + local themeGenerator = { + ["dark"] = function(h, s, l) + local secondary = HSVToColor(h, s, l - 0.5 <=0.2 and l + 0.3 or l - 0.5) + local background = HSVToColor(h, s - 0.3 < 0.1 and s + 0.3 or s - 0.3, l - 0.5 <=0.2 and l + 0.3 or l - 0.5) + local light = HSVToColor(h, 0.1, 1) + local dark = HSVToColor(h, 1, 0.2) + + return toColor(secondary), toColor(background), toColor(light), toColor(dark) + end, + ["light"] = function(h, s, l) + local secondary = HSVToColor(h, s, l - 0.2 <=0.2 and l + 0.6 or l - 0.2) + local background = HSVToColor(h, s - 0.3 < 0.1 and s + 0.3 or s - 0.3, clamp(s + 0.05)) + local light = HSVToColor(h, 0.1, 1) + local dark = HSVToColor(h, 1, 0.2) + + return toColor(secondary), toColor(background), toColor(light), toColor(dark) + end, + } + -- Function to create a monochromatic color palette + local function createMonochromaticPalette() + -- Calculate the HSL values of the base color + local theme = nut.config.get("colorAutoTheme", "dark") + local primary = nut.config.get("color") + local h, s, l = ColorToHSV(primary) + local secondary = nut.config.get("colorSecondary", Color(55, 87, 140)) + local background = nut.config.get("colorBackground", Color(45, 45, 45)) + local light, dark = defaultLight, defaultDark + if themeGenerator[theme] ~= nil then + secondary, background, light, dark = themeGenerator[theme](h, s, l) + end + + return {primary = primary, secondary = secondary, background = background, light = light, dark = dark} + end + + local function updateColors() + + timer.Simple(0, function() + palette = createMonochromaticPalette() + local primary, secondary, background, light, dark = palette.primary, palette.secondary, palette.background, palette.light, palette.dark + nut.config.set("color", primary) + nut.config.set("colorSecondary", secondary) + nut.config.set("colorBackground", background) + + if themeGenerator[nut.config.get("colorAutoTheme", "dark")] ~= nil then + nut.config.setDefault("colorSecondary", secondary) + nut.config.setDefault("colorBackground", background) + end + + SKIN.Colours.Window.TitleActive = secondary + SKIN.Colours.Window.TitleInactive = Color(255, 255, 255) + + SKIN.tex.CategoryList.Header = function( x, y, w, h ) + surface.SetDrawColor( primary ) + surface.DrawRect( x, y, w, h ) + end + + SKIN.colTextEntryTextHighlight = secondary + end) + end + + hook.Add("nutUpdateColors", "nutSkinUpdateColors_Alt", updateColors) + +derma.DefineSkin("nutscript_alt", "Alternative skin for the NutScript framework.", SKIN) +derma.RefreshSkins() \ No newline at end of file diff --git a/plugins/nstheme/derma/cl_skin_old.lua b/plugins/nstheme/derma/cl_skin_old.lua new file mode 100644 index 00000000..cac76679 --- /dev/null +++ b/plugins/nstheme/derma/cl_skin_old.lua @@ -0,0 +1,87 @@ +local SKIN = {} + SKIN.fontFrame = "BudgetLabel" + SKIN.fontTab = "nutSmallFont" + SKIN.fontButton = "nutSmallFont" + + SKIN.Colours = table.Copy(derma.SkinList.Default.Colours) + SKIN.Colours.Window.TitleActive = Color(0, 0, 0) + SKIN.Colours.Window.TitleInactive = Color(255, 255, 255) + + SKIN.Colours.Button.Normal = Color(80, 80, 80) + SKIN.Colours.Button.Hover = Color(255, 255, 255) + SKIN.Colours.Button.Down = Color(180, 180, 180) + SKIN.Colours.Button.Disabled = Color(0, 0, 0, 100) + + function SKIN:PaintFrame(panel) + nut.util.drawBlur(panel, 10) + + surface.SetDrawColor(45, 45, 45, 200) + surface.DrawRect(0, 0, panel:GetWide(), panel:GetTall()) + + surface.SetDrawColor(nut.config.get("color")) + surface.DrawRect(0, 0, panel:GetWide(), 24) + + surface.SetDrawColor(nut.config.get("color")) + surface.DrawOutlinedRect(0, 0, panel:GetWide(), panel:GetTall()) + + end + + function SKIN:DrawGenericBackground(x, y, w, h) + surface.SetDrawColor(45, 45, 45, 240) + surface.DrawRect(x, y, w, h) + + surface.SetDrawColor(0, 0, 0, 180) + surface.DrawOutlinedRect(x, y, w, h) + + surface.SetDrawColor(100, 100, 100, 25) + surface.DrawOutlinedRect(x + 1, y + 1, w - 2, h - 2) + end + + function SKIN:PaintPanel(panel) + if (not panel.m_bBackground) then return end + if (panel.GetPaintBackground and not panel:GetPaintBackground()) then + return + end + + local w, h = panel:GetWide(), panel:GetTall() + + surface.SetDrawColor(0, 0, 0, 100) + surface.DrawRect(0, 0, w, h) + surface.DrawOutlinedRect(0, 0, w, h) + end + + function SKIN:PaintButton(panel) + if (not panel.m_bBackground) then return end + if (panel.GetPaintBackground and not panel:GetPaintBackground()) then + return + end + + local w, h = panel:GetWide(), panel:GetTall() + local alpha = 50 + + if (panel:GetDisabled()) then + alpha = 10 + elseif (panel.Depressed) then + alpha = 180 + elseif (panel.Hovered) then + alpha = 75 + end + + surface.SetDrawColor(30, 30, 30, alpha) + surface.DrawRect(0, 0, w, h) + + surface.SetDrawColor(0, 0, 0, 180) + surface.DrawOutlinedRect(0, 0, w, h) + + surface.SetDrawColor(180, 180, 180, 2) + surface.DrawOutlinedRect(1, 1, w - 2, h - 2) + end + + -- I don't think we gonna need minimize button and maximize button. + function SKIN:PaintWindowMinimizeButton(panel, w, h) + end + + function SKIN:PaintWindowMaximizeButton(panel, w, h) + end +derma.DefineSkin("nutscript_legacy", "The base skin for the NutScript framework.", SKIN) +derma.RefreshSkins() \ No newline at end of file diff --git a/plugins/nstheme/sh_plugin.lua b/plugins/nstheme/sh_plugin.lua index 21993361..95a78bcc 100644 --- a/plugins/nstheme/sh_plugin.lua +++ b/plugins/nstheme/sh_plugin.lua @@ -2,8 +2,27 @@ PLUGIN.name = "NutScript Theme" PLUGIN.author = "Cheesenut" PLUGIN.desc = "Adds a dark Derma skin for NutScript." +local function getRegisteredThemes() + local themes = {} + if CLIENT then + for k in pairs(derma.GetSkinTable()) do + themes[#themes + 1] = k + end + end + + return themes +end + +nut.config.add("theme", "nutscript", "Which derma skin to use. Requires restart to apply", nil, { + form = "Combo", + category = "appearance", + options = getRegisteredThemes() + } +) + if (CLIENT) then function PLUGIN:ForceDermaSkin() - return "nutscript" + local theme = nut.config.get("theme", "nutscript") + return derma.GetNamedSkin(theme) and theme or "nutscript" end end diff --git a/plugins/observer.lua b/plugins/observer.lua index 02081cae..4a756f90 100644 --- a/plugins/observer.lua +++ b/plugins/observer.lua @@ -41,6 +41,8 @@ if (CLIENT) then function PLUGIN:SetupQuickMenu(menu) if (LocalPlayer():IsAdmin()) then + menu:addCategory(self.name) + local buttonESP = menu:addCheck(L"toggleESP", function(panel, state) if (state) then RunConsoleCommand("nut_obsesp", "1") diff --git a/plugins/pluginconfig.lua b/plugins/pluginconfig.lua index 8e652476..6dc2d9c1 100644 --- a/plugins/pluginconfig.lua +++ b/plugins/pluginconfig.lua @@ -88,10 +88,10 @@ if (SERVER) then net.Receive("nutPluginList", function(_, client) if (not client:IsSuperAdmin()) then return end local plugins = PLUGIN:getPluginList() - local disabled, plugin + local disabled net.Start("nutPluginList") net.WriteUInt(#plugins, 32) - for k, plugin in ipairs(plugins) do + for _, plugin in ipairs(plugins) do if (PLUGIN.overwrite[plugin] ~= nil) then disabled = PLUGIN.overwrite[plugin] else @@ -105,7 +105,7 @@ if (SERVER) then else function PLUGIN:createPluginPanel(parent, plugins) local frame = vgui.Create("DFrame") - frame:SetTitle(L"Plugins") + frame:SetTitle(L"togglePlugins") frame:SetSize(256, 512) frame:MakePopup() frame:Center() @@ -119,10 +119,14 @@ else nut.gui.pluginConfig = frame local info = frame:Add("DLabel") - info:SetText("The map must be restarted after making changes!") + local text = L"togglePluginsDesc" + info:SetText(text) info:Dock(TOP) info:DockMargin(0, 0, 0, 4) info:SetContentAlignment(5) + surface.SetFont(info:GetFont()) + local _, h = surface.GetTextSize(text) + info:SetTall(h) local scroll = frame:Add("DScrollPanel") scroll:Dock(FILL) @@ -163,11 +167,11 @@ else function PLUGIN:CreateConfigPanel(parent) local button = parent:Add("DButton") - button:SetText(L"Plugins") + button:SetText(L"togglePlugins") button:Dock(TOP) button:DockMargin(0, 0, 0, 8) button:SetSkin("Default") - button.DoClick = function(button) + button.DoClick = function() self:createPluginPanel(parent) end end @@ -175,7 +179,7 @@ else net.Receive("nutPluginList", function() local length = net.ReadUInt(32) local plugins = {} - for i = 1, length do + for _ = 1, length do plugins[net.ReadString()] = net.ReadBit() == 1 end hook.Run("RetrievedPluginList", plugins) diff --git a/plugins/raiseweapons/cl_hooks.lua b/plugins/raiseweapons/cl_hooks.lua index 90a398fb..6bf17c0b 100644 --- a/plugins/raiseweapons/cl_hooks.lua +++ b/plugins/raiseweapons/cl_hooks.lua @@ -31,7 +31,7 @@ function PLUGIN:CalcViewModelView(weapon, viewModel, oldEyePos, oldEyeAngles, ey end function PLUGIN:SetupQuickMenu(menu) - menu:addSpacer() + menu:addCategory("Raise Weapons") menu:addCheck(L"altLower", function(panel, state) if (state) then RunConsoleCommand("nut_usealtlower", "1") diff --git a/plugins/scoreboard/derma/cl_scoreboard.lua b/plugins/scoreboard/derma/cl_scoreboard.lua index e1b6f77a..91084105 100644 --- a/plugins/scoreboard/derma/cl_scoreboard.lua +++ b/plugins/scoreboard/derma/cl_scoreboard.lua @@ -21,7 +21,7 @@ local PANEL = {} self.title:SetText(GetHostName()) self.title:SetFont("nutBigFont") self.title:SetContentAlignment(5) - self.title:SetTextColor(color_white) + self.title:SetTextColor(nut.config.get("colorText", color_white)) self.title:SetExpensiveShadow(1, color_black) self.title:Dock(TOP) self.title:SizeToContentsY() @@ -67,7 +67,7 @@ local PANEL = {} header:SetText(L(v.name)) header:SetTextInset(3, 0) header:SetFont("nutMediumFont") - header:SetTextColor(color_white) + header:SetTextColor(nut.config.get("colorText", color_white)) header:SetExpensiveShadow(1, color_black) header:SetTall(28) header.Paint = function(this, w, h) @@ -166,7 +166,7 @@ local PANEL = {} slot.name:DockMargin(65, 0, 48, 0) slot.name:SetTall(18) slot.name:SetFont("nutGenericFont") - slot.name:SetTextColor(color_white) + slot.name:SetTextColor(nut.config.get("colorText", color_white)) slot.name:SetExpensiveShadow(1, color_black) slot.ping = slot:Add("DLabel") @@ -180,7 +180,7 @@ local PANEL = {} end slot.ping:SetFont("nutGenericFont") slot.ping:SetContentAlignment(6) - slot.ping:SetTextColor(color_white) + slot.ping:SetTextColor(nut.config.get("colorText", color_white)) slot.ping:SetTextInset(16, 0) slot.ping:SetExpensiveShadow(1, color_black) @@ -189,7 +189,7 @@ local PANEL = {} slot.desc:DockMargin(65, 0, 48, 0) slot.desc:SetWrap(true) slot.desc:SetContentAlignment(7) - slot.desc:SetTextColor(color_white) + slot.desc:SetTextColor(nut.config.get("colorText", color_white)) slot.desc:SetExpensiveShadow(1, Color(0, 0, 0, 100)) slot.desc:SetFont("nutSmallFont") diff --git a/plugins/thirdperson.lua b/plugins/thirdperson.lua index 4116741f..884d5a68 100644 --- a/plugins/thirdperson.lua +++ b/plugins/thirdperson.lua @@ -72,6 +72,7 @@ if (CLIENT) then function PLUGIN:SetupQuickMenu(menu) if (isAllowed()) then + menu:addCategory("Thirdperson") local button = menu:addCheck(L"thirdpersonToggle", function(panel, state) if (state) then RunConsoleCommand("nut_tp_enabled", "1") From 1d9e45bfea8a6967d027106ceae5b05c51ffee21 Mon Sep 17 00:00:00 2001 From: TovarischPootis <54110479+TovarischPootis@users.noreply.github.com> Date: Mon, 26 Feb 2024 16:40:26 +0100 Subject: [PATCH 88/89] Sam Command Admin Chat (#157) * Sam Command Admin Chat SAM admin chat, internally, has a ~120 character limit, due to using :Say internally. It sucks. NS Chat does not have this weakness, so I remade the admin chat as a nut command/chat. Also added admin chat filter in the chatbox. ALSO also added a check to prevent sam commands from interfering with NS commands, such as !pm/pm --- plugins/sam_commands.lua | 96 ++++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 14 deletions(-) diff --git a/plugins/sam_commands.lua b/plugins/sam_commands.lua index 1d246bac..058c9a28 100644 --- a/plugins/sam_commands.lua +++ b/plugins/sam_commands.lua @@ -4,21 +4,89 @@ PLUGIN.author = "Tov" if not (sam and sam.command) then return end -- Make sure SAM is installed -for _, commandInfo in ipairs(sam.command.get_commands()) do - local customSyntax = "" - for _, argInfo in ipairs(commandInfo.args) do - customSyntax = customSyntax == "" and "[" or customSyntax .. " [" - customSyntax = customSyntax .. (argInfo.default and tostring(type(argInfo.default)) or "string") .. " " - customSyntax = customSyntax .. argInfo.name .. "]" +local color_red = Color(255, 0, 0) +local color_green = Color(0, 255, 0) + +nut.command.add("asay", { + syntax = "", + onCheckAccess = function(client) + return client:IsAdmin() or sam.config.get_updated("Reports", true).value + end, + onRun = function(client, arguments) + local text = table.concat(arguments, " ") + + if (text:find("%S")) then + if client:IsAdmin() then + nut.chat.send(client, "asay", text) + else + if sam.config.get_updated("Reports", true).value then + local message = table.concat(arguments, " ") + local success, time = sam.player.report(client, message) + if success == false then + client:sam_send_message("You need to wait {S Red} seconds.", { + S = time + }) + else + client:sam_send_message("to_admins", { + A = client, V = message + }) + end + end + end + else + client:notifyLocalized("invalid", "text") + end + end +}) + +nut.chat.register("asay", { + onCanSay = function(speaker, text) + return speaker:IsAdmin() + end, + onCanHear = function(speaker, listener) + return listener:IsAdmin() + end, + onChatAdd = function(speaker, text) + if speaker:IsAdmin() then + chat.AddText(color_red, "[Admin] ", speaker, " (" .. speaker:steamName() .. ") ", color_green, ": " .. text) + end + end, + font = "nutChatFont", + filter = "admin" +}) + +hook.Remove("PlayerSay", "SAM.Chat.Asay") + +function PLUGIN:PlayerSay(client, text) + if text:sub(1, 1) == "@" then + nut.command.run(client, "asay", {text:sub(2)}) + return "" end +end + +function PLUGIN:InitializedPlugins() + -- Add all the commands + for _, commandInfo in ipairs(sam.command.get_commands()) do + local customSyntax = "" + for _, argInfo in ipairs(commandInfo.args) do + customSyntax = customSyntax == "" and "[" or customSyntax .. " [" + customSyntax = customSyntax .. (argInfo.default and tostring(type(argInfo.default)) or "string") .. " " + customSyntax = customSyntax .. argInfo.name .. "]" + end - nut.command.add(commandInfo.name, { - adminOnly = commandInfo.default_rank == "admin", - superAdminOnly = commandInfo.default_rank == "superadmin", - syntax = customSyntax, - onRun = function(client, arguments) - --run the sam command - RunConsoleCommand("sam", commandInfo.name, unpack(arguments)) + if nut.command.list[commandInfo.name] then + print("SAM command " .. commandInfo.name .. " conflicts with a NutScript command, skipping!") + continue end - }) + + nut.command.add(commandInfo.name, { + adminOnly = commandInfo.default_rank == "admin", + superAdminOnly = commandInfo.default_rank == "superadmin", + syntax = customSyntax, + onRun = function(client, arguments) + --run the sam command + RunConsoleCommand("sam", commandInfo.name, unpack(arguments)) + end + }) + end end \ No newline at end of file From 52e2ceb8e3802ae928dbbf3d2819a7b550371186 Mon Sep 17 00:00:00 2001 From: Alexander <48864677+Dobytchick@users.noreply.github.com> Date: Sun, 14 Apr 2024 22:06:13 +0600 Subject: [PATCH 89/89] Fix debug.getregistry FindMetaTable("Item/Character etc...") has been restored --- gamemode/shared.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gamemode/shared.lua b/gamemode/shared.lua index 3f63727f..7740d130 100644 --- a/gamemode/shared.lua +++ b/gamemode/shared.lua @@ -5,6 +5,33 @@ GM.Website = "http://nutscript.net/" nut.version = "1.2.3" +local meta = {} +function meta.__index(self, key) + return FindMetaTable(key) +end + +local metas = {} +function meta.__newindex(self, key, value) + metas[ key ] = value +end + +debug.getregistry = function() + local tbl = {} + setmetatable(tbl, meta) + + return tbl +end + +local oldFindMetaTable = FindMetaTable +FindMetaTable = function( name ) + local f = oldFindMetaTable( name ) + if ( f ) then return f end + + return metas[ name ] +end + +_R = debug.getregistry() + -- Fix for client:SteamID64() returning nil when in single-player. do local playerMeta = FindMetaTable("Player")