mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-22 15:33:12 +09:00
.
This commit is contained in:
1 parent
f4693ecb41
commit
836b277f22
1 file changed
+1
-14
@@ -257,16 +257,6 @@ local function surface_index_from_element(controls)
|
|||||||
local surface = 0
|
local surface = 0
|
||||||
if element and game.surfaces[element.selected_index] then
|
if element and game.surfaces[element.selected_index] then
|
||||||
surface = element.selected_index
|
surface = element.selected_index
|
||||||
--[[
|
|
||||||
local surface_name = element.items[element.selected_index]
|
|
||||||
if surface_name then
|
|
||||||
---@diagnostic disable-next-line: undefined-field
|
|
||||||
local s = game.surfaces[surface_name]
|
|
||||||
if s then
|
|
||||||
surface = s.index
|
|
||||||
end
|
|
||||||
end
|
|
||||||
]]
|
|
||||||
end
|
end
|
||||||
return surface
|
return surface
|
||||||
end
|
end
|
||||||
@@ -306,11 +296,8 @@ Elements.surface_dropdown = Gui.define("vlayer/surface_dropdown")
|
|||||||
--- @param surfaces LuaSurface[]
|
--- @param surfaces LuaSurface[]
|
||||||
function Elements.surface_dropdown.refresh(surface_dropdown, surfaces)
|
function Elements.surface_dropdown.refresh(surface_dropdown, surfaces)
|
||||||
local items = {}
|
local items = {}
|
||||||
-- local index = 1
|
|
||||||
for _, surface in pairs(surfaces) do
|
for _, surface in pairs(surfaces) do
|
||||||
items[surface.index] = surface.name
|
items[surface.index] = surface.localised_name
|
||||||
-- items[index] = surface.name
|
|
||||||
-- index = index + 1
|
|
||||||
end
|
end
|
||||||
surface_dropdown.items = items
|
surface_dropdown.items = items
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user