mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-16 18:31:32 +00:00
remove some empty lines in LoW wml-tags.lua
my editors auto indention doesn't like them.
This commit is contained in:
parent
786d1ce66f
commit
2ff38262e6
@ -8,7 +8,6 @@ function wesnoth.wml_actions.shift_labels(cfg)
|
||||
for k, v in ipairs(labels) do
|
||||
wml_label { x = v.x, y = v.y }
|
||||
end
|
||||
|
||||
for k, v in ipairs(labels) do
|
||||
v.x = v.x + cfg.x
|
||||
v.y = v.y + cfg.y
|
||||
@ -29,35 +28,27 @@ function wesnoth.wml_actions.replace_map(cfg)
|
||||
if not cfg.x and not cfg.y then
|
||||
return replace_map(cfg)
|
||||
end
|
||||
|
||||
local x1,x2 = string.match(cfg.x, "(%d+)-(%d+)")
|
||||
local y1,y2 = string.match(cfg.y, "(%d+)-(%d+)")
|
||||
local map = cfg.map_data
|
||||
|
||||
x1 = tonumber(x1)
|
||||
y1 = tonumber(y1)
|
||||
x2 = x2 + 2
|
||||
y2 = y2 + 2
|
||||
|
||||
local t = {}
|
||||
local y = 1
|
||||
|
||||
for row in string.gmatch(map, "[^\n]+") do
|
||||
if y >= y1 and y <= y2 then
|
||||
local r = {}
|
||||
local x = 1
|
||||
|
||||
for tile in string.gmatch(row, "[^,]+") do
|
||||
if x >= x1 and x <= x2 then r[x - x1 + 1] = tile end
|
||||
x = x + 1
|
||||
end
|
||||
|
||||
t[y - y1 + 1] = table.concat(r, ',')
|
||||
end
|
||||
|
||||
y = y + 1
|
||||
end
|
||||
|
||||
local new_map = table.concat(t, '\n')
|
||||
replace_map { map = new_map, expand = true, shrink = true }
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user