Add luacheck, repo cleanup
This commit is contained in:
parent
78e74b019f
commit
0f67c9e6b8
17
.gitattributes
vendored
17
.gitattributes
vendored
@ -1,17 +1,2 @@
|
|||||||
# Auto detect text files and perform LF normalization
|
# Auto detect text files and perform LF normalization
|
||||||
* text=auto
|
* text=auto
|
||||||
|
|
||||||
# Custom for Visual Studio
|
|
||||||
*.cs diff=csharp
|
|
||||||
|
|
||||||
# Standard to msysgit
|
|
||||||
*.doc diff=astextplain
|
|
||||||
*.DOC diff=astextplain
|
|
||||||
*.docx diff=astextplain
|
|
||||||
*.DOCX diff=astextplain
|
|
||||||
*.dot diff=astextplain
|
|
||||||
*.DOT diff=astextplain
|
|
||||||
*.pdf diff=astextplain
|
|
||||||
*.PDF diff=astextplain
|
|
||||||
*.rtf diff=astextplain
|
|
||||||
*.RTF diff=astextplain
|
|
10
.github/workflows/luacheck.yml
vendored
Normal file
10
.github/workflows/luacheck.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
name: luacheck
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
luacheck:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@master
|
||||||
|
- name: Luacheck
|
||||||
|
uses: lunarmodules/luacheck@master
|
47
.gitignore
vendored
47
.gitignore
vendored
@ -1,47 +0,0 @@
|
|||||||
# Windows image file caches
|
|
||||||
Thumbs.db
|
|
||||||
ehthumbs.db
|
|
||||||
|
|
||||||
# Folder config file
|
|
||||||
Desktop.ini
|
|
||||||
|
|
||||||
# Recycle Bin used on file shares
|
|
||||||
$RECYCLE.BIN/
|
|
||||||
|
|
||||||
# Windows Installer files
|
|
||||||
*.cab
|
|
||||||
*.msi
|
|
||||||
*.msm
|
|
||||||
*.msp
|
|
||||||
|
|
||||||
# Windows shortcuts
|
|
||||||
*.lnk
|
|
||||||
|
|
||||||
# =========================
|
|
||||||
# Operating System Files
|
|
||||||
# =========================
|
|
||||||
|
|
||||||
# OSX
|
|
||||||
# =========================
|
|
||||||
|
|
||||||
.DS_Store
|
|
||||||
.AppleDouble
|
|
||||||
.LSOverride
|
|
||||||
|
|
||||||
# Thumbnails
|
|
||||||
._*
|
|
||||||
|
|
||||||
# Files that might appear in the root of a volume
|
|
||||||
.DocumentRevisions-V100
|
|
||||||
.fseventsd
|
|
||||||
.Spotlight-V100
|
|
||||||
.TemporaryItems
|
|
||||||
.Trashes
|
|
||||||
.VolumeIcon.icns
|
|
||||||
|
|
||||||
# Directories potentially created on remote AFP share
|
|
||||||
.AppleDB
|
|
||||||
.AppleDesktop
|
|
||||||
Network Trash Folder
|
|
||||||
Temporary Items
|
|
||||||
.apdisk
|
|
8
.luacheckrc
Normal file
8
.luacheckrc
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
read_globals = {
|
||||||
|
"minetest",
|
||||||
|
"default"
|
||||||
|
}
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
"castle_shields"
|
||||||
|
}
|
@ -2,25 +2,14 @@ minetest.register_alias("castle:shield", "castle_shields:shield_1")
|
|||||||
minetest.register_alias("castle:shield_2", "castle_shields:shield_2")
|
minetest.register_alias("castle:shield_2", "castle_shields:shield_2")
|
||||||
minetest.register_alias("castle:shield_3", "castle_shields:shield_3")
|
minetest.register_alias("castle:shield_3", "castle_shields:shield_3")
|
||||||
|
|
||||||
|
-- Translation support
|
||||||
|
local S = minetest.get_translator("castle_shields")
|
||||||
|
|
||||||
-- Used for localization, choose either built-in or intllib.
|
-- The following colors are permitted:
|
||||||
|
-- "black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey",
|
||||||
|
-- "magenta", "orange", "pink", "red", "violet", "white", "yellow"
|
||||||
|
|
||||||
local MP, S, NS = nil
|
-- The following patterns are permitted:
|
||||||
|
|
||||||
if (minetest.get_modpath("intllib") == nil) then
|
|
||||||
S = minetest.get_translator("castle_shields")
|
|
||||||
|
|
||||||
else
|
|
||||||
-- internationalization boilerplate
|
|
||||||
MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--The following colors are permitted:
|
|
||||||
-- "black", "blue", "brown", "cyan", "dark_green", "dark_grey", "green", "grey", "magenta", "orange", "pink", "red", "violet", "white", "yellow"
|
|
||||||
--The following patterns are permitted:
|
|
||||||
-- "slash", "chevron", "cross"
|
-- "slash", "chevron", "cross"
|
||||||
|
|
||||||
-- method parameters are name, desc, background_color, foreground_color, pattern
|
-- method parameters are name, desc, background_color, foreground_color, pattern
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
default
|
|
||||||
dye
|
|
||||||
intllib?
|
|
@ -1 +0,0 @@
|
|||||||
Adds decorative wall shields
|
|
45
intllib.lua
45
intllib.lua
@ -1,45 +0,0 @@
|
|||||||
|
|
||||||
-- Fallback functions for when `intllib` is not installed.
|
|
||||||
-- Code released under Unlicense <http://unlicense.org>.
|
|
||||||
|
|
||||||
-- Get the latest version of this file at:
|
|
||||||
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
|
||||||
|
|
||||||
local function format(str, ...)
|
|
||||||
local args = { ... }
|
|
||||||
local function repl(escape, open, num, close)
|
|
||||||
if escape == "" then
|
|
||||||
local replacement = tostring(args[tonumber(num)])
|
|
||||||
if open == "" then
|
|
||||||
replacement = replacement..close
|
|
||||||
end
|
|
||||||
return replacement
|
|
||||||
else
|
|
||||||
return "@"..open..num..close
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
|
||||||
end
|
|
||||||
|
|
||||||
local gettext, ngettext
|
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
if intllib.make_gettext_pair then
|
|
||||||
-- New method using gettext.
|
|
||||||
gettext, ngettext = intllib.make_gettext_pair()
|
|
||||||
else
|
|
||||||
-- Old method using text files.
|
|
||||||
gettext = intllib.Getter()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Fill in missing functions.
|
|
||||||
|
|
||||||
gettext = gettext or function(msgid, ...)
|
|
||||||
return format(msgid, ...)
|
|
||||||
end
|
|
||||||
|
|
||||||
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
|
||||||
return format(n==1 and msgid or msgid_plural, ...)
|
|
||||||
end
|
|
||||||
|
|
||||||
return gettext, ngettext
|
|
@ -1,3 +1,2 @@
|
|||||||
# textdomain:castle_shields
|
# textdomain: castle_shields
|
||||||
|
|
||||||
Mounted Shield=Scudo appeso
|
Mounted Shield=Scudo appeso
|
||||||
|
23
locale/it.po
23
locale/it.po
@ -1,23 +0,0 @@
|
|||||||
# ITALIAN LOCALE FILE FOR THE CASTLE SHIELDS MODULE
|
|
||||||
# Copyright (C) 2017 Philipbenr And DanDuncombe
|
|
||||||
# This file is distributed under the same license as the CASTLE SHIELDS package.
|
|
||||||
# Hamlet <h4mlet@riseup.net>, 2017.
|
|
||||||
#
|
|
||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Project-Id-Version: Castle Shields\n"
|
|
||||||
"Report-Msgid-Bugs-To: \n"
|
|
||||||
"POT-Creation-Date: 2017-02-25 14:47-0700\n"
|
|
||||||
"PO-Revision-Date: 2017-09-10 22:38+0100\n"
|
|
||||||
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
|
|
||||||
"Language-Team: \n"
|
|
||||||
"MIME-Version: 1.0\n"
|
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
|
||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
||||||
"Language: it\n"
|
|
||||||
"X-Generator: Poedit 1.6.10\n"
|
|
||||||
|
|
||||||
#: init.lua:6 init.lua:41 init.lua:75
|
|
||||||
msgid "Mounted Shield"
|
|
||||||
msgstr "Scudo appeso"
|
|
@ -1,21 +0,0 @@
|
|||||||
# SOME DESCRIPTIVE TITLE.
|
|
||||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
||||||
# This file is distributed under the same license as the PACKAGE package.
|
|
||||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
||||||
#
|
|
||||||
#, fuzzy
|
|
||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
|
||||||
"Report-Msgid-Bugs-To: \n"
|
|
||||||
"POT-Creation-Date: 2017-02-25 14:47-0700\n"
|
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
||||||
"MIME-Version: 1.0\n"
|
|
||||||
"Content-Type: text/plain; charset=CHARSET\n"
|
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
|
||||||
|
|
||||||
#: init.lua:6 init.lua:41 init.lua:75
|
|
||||||
msgid "Mounted Shield"
|
|
||||||
msgstr ""
|
|
@ -1,3 +1,2 @@
|
|||||||
# textdomain:castle_shields
|
# textdomain: castle_shields
|
||||||
|
|
||||||
Mounted Shield=
|
Mounted Shield=
|
||||||
|
3
mod.conf
3
mod.conf
@ -1,4 +1,3 @@
|
|||||||
name = castle_shields
|
name = castle_shields
|
||||||
description = Adds decorative wall shields
|
description = Adds decorative wall shields
|
||||||
depends = default, dye
|
depends = default, dye
|
||||||
optional_depends = intllib
|
|
@ -1,15 +1,16 @@
|
|||||||
castle_shields.register_shield = function(name, desc, background_color, foreground_color, mask, disable_recipe)
|
castle_shields.register_shield = function(name, desc, background_color, foreground_color, mask, disable_recipe)
|
||||||
|
|
||||||
local tile_side = "castle_shield_"..background_color..".png"
|
local tile_side = "castle_shield_"..background_color..".png"
|
||||||
local tile_front = "castle_shield_"..background_color..".png^(castle_shield_"..foreground_color..".png^[mask:castle_shield_mask_"..mask..".png)"
|
local tile_front = "castle_shield_"..background_color..".png^(castle_shield_"..foreground_color..
|
||||||
|
".png^[mask:castle_shield_mask_"..mask..".png)"
|
||||||
|
|
||||||
minetest.register_node(minetest.get_current_modname()..":"..name, {
|
minetest.register_node(minetest.get_current_modname()..":"..name, {
|
||||||
description = desc,
|
description = desc,
|
||||||
tiles = {tile_side, tile_side, tile_side, tile_side, "castle_shield_back.png", tile_front},
|
tiles = {tile_side, tile_side, tile_side, tile_side, "castle_shield_back.png", tile_front},
|
||||||
drawtype="nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
groups={cracky=3},
|
groups = {cracky=3},
|
||||||
sounds = default.node_sound_metal_defaults(),
|
sounds = default.node_sound_metal_defaults(),
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -27,7 +28,7 @@ castle_shields.register_shield = function(name, desc, background_color, foregrou
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if disable_recipe then
|
if disable_recipe then
|
||||||
-- recipe disabled by caller
|
-- recipe disabled by caller
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user