EmmyLua -> LuaLS

This commit is contained in:
Van
2026-06-16 17:50:29 +03:00
parent 60003eea73
commit 1799d6d32e
37 changed files with 135 additions and 314 deletions

View File

@@ -48,16 +48,16 @@ local function getFormSpecString(self, playerName, isSelect)
if isSelect then
---@type ItemStackString
local item = self:getContex(playerName, 'select_item')
local itemDef = core.registered_items[item]
local itemSettings = Smc.getItemDefinition(item).settings
listForm
:itemImage(11, 0.5, 2, 2, item)
:areaLabel(11, 4.5, 4, 1, 'Add to inventory:')
:button(11, 5, 3, 1, 'admin_commands:list_add_item', '1')
:button(14, 5,3, 1, 'admin_commands:list_add_item', ''..tostring(itemDef.stack_max))
:button(14, 5,3, 1, 'admin_commands:list_add_item', ''..tostring(itemSettings.stack_max))
:areaLabel(14.5, 0.5, 6, 4,
item..'\n\n'..
(itemDef._title or itemDef.description)..'\n'..
(itemDef._description or ''))
(itemSettings._title or itemSettings.description)..'\n'..
(itemSettings._description or ''))
end
return listForm:toString()

View File

@@ -240,17 +240,17 @@ end
---Context keys for the `PlayerInventoryUI` class.
---@alias PlayerInventoryUI.ContexKey
--- 'compact_mode'|
--- 'node_tab_pos'|
--- 'node_tab'|
---|'compact_mode'
---|'node_tab_pos'
---|'node_tab'
---
--- 'left_tab_name'|
--- 'right_tab_name'|
---|'left_tab_name'|
---|'right_tab_name'|
---
--- 'left_craft_tab_craft_data'|
--- 'right_craft_tab_craft_data'|
--- 'left_node_tab_craft_data'|
--- 'right_node_tab_craft_data'
---|'left_craft_tab_craft_data'|
---|'right_craft_tab_craft_data'|
---|'left_node_tab_craft_data'|
---|'right_node_tab_craft_data'
---@class PlayerInventoryUI : BaseUI
@@ -265,7 +265,6 @@ local PlayerInventoryUI = BaseUI:new('', getFormSpecString, false)
---@param tabName 'craft_tab'|'node_tab'
---@return PlayerInventoryUI.CraftTabData
function PlayerInventoryUI:getTabCraftData(playerName, tabType, tabName)
---@diagnostic disable-next-line: param-type-not-match
---@type PlayerInventoryUI.CraftTabData
local craftTabData = self:getContex(playerName, tabType..'_'..tabName..'_craft_data')
@@ -277,7 +276,6 @@ end
---@param tabName 'craft_tab'|'node_tab'
---@param data PlayerInventoryUI.CraftTabData
function PlayerInventoryUI:setTabCraftData(playerName, tabType, tabName, data)
---@diagnostic disable-next-line: param-type-not-match
self:setContex(playerName, tabType..'_'..tabName..'_craft_data', data)
end
@@ -716,7 +714,7 @@ core.register_allow_player_inventory_action(function(player, action, inventory,
-- Equipment items will automatically place themselves in their slots
-- when you hold down the shift key.
if inventoryInfo.to_list == 'listring_equip' then
return equipListring(player, inventory, inventoryInfo.from_list, inventoryInfo.from_index)
return equipListring(player --[[@as Player]], inventory, inventoryInfo.from_list, inventoryInfo.from_index)
end
-- Checking if a slot is an equipment slot.

View File

@@ -26,7 +26,7 @@ local function getBagTab(self, playerName, tabType)
BagLists
:image(0.5, 0, 9.875, (lines)*1.25+1, background)
:itemImage(0.5625, 0.0625, 1, 1, bag:get_name())
:label(1.7625, 0.5, bag:get_definition()._title or '')
:label(1.7625, 0.5, Smc.getItemDefinition(bag).settings._title or '')
:list('current_player', 'inventory_back', 0.5625, 1.25, 8, 4)
containerHeight = containerHeight + lines * 1.25 + 1
@@ -43,7 +43,7 @@ local function getBagTab(self, playerName, tabType)
BagLists
:image(0.5, containerHeight, 9.875, (lines)*1.25+1, background)
:itemImage(0.5625, containerHeight + 0.0625, 1, 1, bag:get_name())
:label(1.7625, containerHeight + 0.5, bag:get_definition()._title or '')
:label(1.7625, containerHeight + 0.5, Smc.getItemDefinition(bag).settings._title or '')
:list('current_player', 'inventory_left_thigh', 0.5625, containerHeight + 1.25, 8, 4)
containerHeight = containerHeight + lines * 1.25 + 1
@@ -60,7 +60,7 @@ local function getBagTab(self, playerName, tabType)
BagLists
:image(0.5, containerHeight, 9.875, (lines)*1.25+1, background)
:itemImage(0.5625, containerHeight + 0.0625, 1, 1, bag:get_name())
:label(1.7625, containerHeight + 0.5, bag:get_definition()._title or '')
:label(1.7625, containerHeight + 0.5, Smc.getItemDefinition(bag).settings._title or '')
:list('current_player', 'inventory_right_thigh', 0.5625, containerHeight + 1.25, 8, 4)
containerHeight = containerHeight + lines * 1.25 + 1

View File

@@ -34,15 +34,15 @@ local function getFormSpecString(self, playerName, isSelect)
if isSelect then
local stage = craft.stagesByName[craft.startStageName]
local outputDef = core.registered_nodes[craft.output]
local outputSettings = Smc.getItemDefinition(craft.output).settings
listForm
:itemImage(9, 0.5, 2, 2, craft.output)
:areaLabel(9, 6, 2, 1, 'Start crafting:')
:button(9, 6.5, 3, 1, 'work_station:start_craft', 'x1')
:button(12, 6.5,3, 1, 'work_station:start_craft', 'x10')
:areaLabel(11.5, 0.5, 4, 4,
outputDef._title..'\n'..
outputDef._description)
outputSettings._title..'\n'..
outputSettings._description)
:areaLabel(9, 2.5, 6, 4, 'Craft description:'..'\n'..craft:toString())
end