From 3839cb6781892f302a039532826a368b3d53d7a0 Mon Sep 17 00:00:00 2001 From: kilbith Date: Mon, 24 Aug 2015 21:12:38 +0200 Subject: [PATCH] Refine some patterns capitalizing --- nodes.lua | 8 ++++---- worktable.lua | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nodes.lua b/nodes.lua index bcf20cb..15c8268 100644 --- a/nodes.lua +++ b/nodes.lua @@ -209,7 +209,7 @@ local colors = {"red"} -- Add more curtains colors simply here. for _, c in pairs(colors) do xdecor.register("curtain_"..c, { - description = c:gsub("%l", string.upper, 1).." Curtain", + description = c:gsub("^%l", string.upper).." Curtain", use_texture_alpha = true, walkable = false, tiles = {"xdecor_curtain.png^[colorize:"..c..":130"}, @@ -271,7 +271,7 @@ local door_types = { for _, d in pairs(door_types) do doors.register_door("xdecor:"..d[1].."_door", { - description = d[1]:gsub("%l", string.upper, 1).." Door", + description = d[1]:gsub("^%l", string.upper).." Door", inventory_image = "xdecor_"..d[1].."_door_inv.png", groups = {choppy=3, flammable=2, door=1}, tiles_bottom = {"xdecor_"..d[1].."_door_b.png", "xdecor_"..d[2]..".png"}, @@ -557,8 +557,8 @@ local stonish = {"desertstone_tile", "stone_tile", "stone_rune", for _, t in pairs(stonish) do xdecor.register(t, { drawtype = "normal", - description = string.sub(t:gsub("%l", string.upper, 1), 1, -6) - .." "..t:sub(-4):gsub("%l", string.upper, 1), + description = string.sub(t:gsub("^%l", string.upper), 1, -6) + .." "..t:sub(-4):gsub("^%l", string.upper), tiles = {"xdecor_"..t..".png"}, groups = {cracky=2}, sounds = sound.stone diff --git a/worktable.lua b/worktable.lua index 34e0fd4..9fc670b 100644 --- a/worktable.lua +++ b/worktable.lua @@ -194,7 +194,7 @@ xdecor.register("worktable", { }) local function description(m, w) - return m:gsub("%l", string.upper, 1).." "..w:gsub("%l", string.upper, 1) + return m:gsub("^%l", string.upper).." "..w:gsub("^%l", string.upper) end local function groups(m)