Skip to content

Commit

Permalink
Merge remote-tracking branch 'mt-mods/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
luk3yx committed Dec 3, 2023
2 parents bd1dfb5 + 2c00acf commit 46a330e
Show file tree
Hide file tree
Showing 125 changed files with 542 additions and 2,926 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
unused_args = false

read_globals = {
"minetest",
"table",
"vector",
"default"
}

globals = {
"boards",
"display_api",
"font_api",
"ontime_clocks",
"signs",
"signs_api",
"signs_road",
"steles"
}
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Display Modpack
Version 1.3.1

This modpack provides mods with dynamic display. Mods are :
![](https://github.com/mt-mods/display_modpack/workflows/luacheck/badge.svg)
[![ContentDB](https://content.minetest.net/packages/mt-mods/display_modpack/shields/downloads/)](https://content.minetest.net/packages/mt-mods/display_modpack/)

- **[display_api](https://github.com/pyrollo/display_modpack/tree/master/display_api)**: A library for adding display entities to nodes;
- **[font_api](https://github.com/pyrollo/display_modpack/tree/master/font_api)**: A library for displaying fonts on entities;
- **[signs_api](https://github.com/pyrollo/display_modpack/tree/master/signs_api)**: A library for the easy creation of signs;
- **[font_metro](https://github.com/pyrollo/display_modpack/tree/master/font_metro)**: A font mod used as default font (includes uppercase, lowercase and accentuated latin letters, usual signs, cyrillic and greek letters)
Requires Minetest 5.0+

- **[boards](https://github.com/pyrollo/display_modpack/tree/master/boards)**: A mod providing school boards (includes *tiny cursive font*, a handwriting style font);
- **[ontime_clocks](https://github.com/pyrollo/display_modpack/tree/master/ontime_clocks)**: A mod providing clocks which display the ingame time;
- **[signs](https://github.com/pyrollo/display_modpack/tree/master/signs)**: A mod providing signs and direction signs displaying text;
- **[signs_road](https://github.com/pyrollo/display_modpack/tree/master/signs_road)**: A mod providing road signs displaying text;
- **[steles](https://github.com/pyrollo/display_modpack/tree/master/steles)**: A mod providing stone steles with text;
This modpack provides mods with dynamic display. Mods are:

- **[display_api](https://github.com/mt-mods/display_modpack/tree/master/display_api)**: A library for adding display entities to nodes;
- **[font_api](https://github.com/mt-mods/display_modpack/tree/master/font_api)**: A library for displaying fonts on entities;
- **[signs_api](https://github.com/mt-mods/display_modpack/tree/master/signs_api)**: A library for the easy creation of signs;
- **[font_metro](https://github.com/mt-mods/display_modpack/tree/master/font_metro)**: A font mod used as default font (includes uppercase, lowercase and accentuated latin letters, usual signs, cyrillic and greek letters)

- **[boards](https://github.com/mt-mods/display_modpack/tree/master/boards)**: A mod providing school boards (includes *tiny cursive font*, a handwriting style font);
- **[ontime_clocks](https://github.com/mt-mods/display_modpack/tree/master/ontime_clocks)**: A mod providing clocks which display the ingame time;
- **[signs](https://github.com/mt-mods/display_modpack/tree/master/signs)**: A mod providing signs and direction signs displaying text;
- **[signs_road](https://github.com/mt-mods/display_modpack/tree/master/signs_road)**: A mod providing road signs displaying text;
- **[steles](https://github.com/mt-mods/display_modpack/tree/master/steles)**: A mod providing stone steles with text;

For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?t=19365) at the Minetest forums.

![Presentation image of Display_Modpack](screenshot.png)
![Presentation image of Display_Modpack](https://raw.githubusercontent.com/mt-mods/display_modpack/master/screenshot.png)

## Extra fonts

Expand Down
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

166 changes: 0 additions & 166 deletions boards/LICENSE.txt

This file was deleted.

2 changes: 0 additions & 2 deletions boards/copyright.txt

This file was deleted.

2 changes: 0 additions & 2 deletions boards/depends.txt

This file was deleted.

6 changes: 4 additions & 2 deletions boards/font_tinycurs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
released under CC-BY-SA license
https://fontstruct.com/fontstructions/show/63155/tiny_cursive
Derivative texture are under CC-BY-SA license
Code is under LGPL v3 license
--]]

-- widths is not split into several lines, because the font is generated by 'make_font_lua.sh'
-- luacheck: ignore
font_api.register_font('tinycurs',
{
default = false, -- Don't register this font as a possible default font
margintop = -2,
marginbottom = -2,
linespacing = -4,
height = 19,
widths = {
widths = {
[0]=9, [32]=9, [33]=6, [34]=7, [35]=10, [36]=14, [37]=14, [38]=12, [39]=3, [40]=6, [41]=6, [42]=9, [43]=8, [44]=3, [45]=7, [46]=3, [47]=9, [48]=9, [49]=7, [50]=10, [51]=9, [52]=9, [53]=10, [54]=10, [55]=9, [56]=10, [57]=8, [58]=5, [59]=5, [60]=8, [61]=8, [62]=8, [63]=8, [64]=12, [65]=9, [66]=7, [67]=9, [68]=10, [69]=8, [70]=8, [71]=8, [72]=10, [73]=7, [74]=8, [75]=9, [76]=9, [77]=12, [78]=10, [79]=9, [80]=9, [81]=9, [82]=11, [83]=11, [84]=8, [85]=11, [86]=11, [87]=12, [88]=12, [89]=11, [90]=11, [91]=8, [92]=5, [93]=8, [94]=8, [95]=8, [96]=5, [97]=6, [98]=6, [99]=6, [100]=7, [101]=6, [102]=5, [103]=6, [104]=6, [105]=4, [106]=5, [107]=7, [108]=5, [109]=9, [110]=8, [111]=6, [112]=9, [113]=8, [114]=7, [115]=7, [116]=6, [117]=8, [118]=8, [119]=11, [120]=10, [121]=8, [122]=8, [123]=8, [124]=6, [125]=9, [126]=10, [8216]=4, [8217]=4, [8220]=6, [8221]=6
},
}
Expand Down
39 changes: 28 additions & 11 deletions boards/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ boards = {}
boards.name = minetest.get_current_modname()
boards.path = minetest.get_modpath(boards.name)

-- Load support for intllib.
local S, NS = dofile(boards.path.."/intllib.lua")
boards.intllib = S
local F = function(...) return minetest.formspec_escape(S(...)) end
-- Translation support
local S = minetest.get_translator(boards.name)
local FS = function(...) return minetest.formspec_escape(S(...)) end

-- Load font
dofile(boards.path.."/font_tinycurs.lua")

local function set_formspec(pos)
local meta = minetest.get_meta(pos)
local display_text = minetest.formspec_escape(meta:get_string("display_text"))
meta:set_string("formspec",
"size[6,4]"..default.gui_bg..default.gui_bg_img..default.gui_slots..
"textarea[0.5,0.7;5.5,3;display_text;"..F("Text")..";${display_text}]"..
"button_exit[3,3.5;2,1;ok;"..F("Write").."]"..
"button_exit[1,3.5;2,1;wipe;"..F("Wipe").."]")
"size[6,3.5]"..default.gui_bg..default.gui_bg_img..default.gui_slots..
"textarea[0.55,0.25;5.5,3;display_text;"..FS("Text")..";" .. display_text .. "]"..
"button_exit[1,2.75;2,1;ok;"..FS("Write").."]"..
"button[3,2.75;2,1;font;"..FS("Font").."]")
end

-- On boards, everyone is allowed to write and wipe
Expand All @@ -50,13 +50,14 @@ local function on_receive_fields(pos, formname, fields, player)
minetest.pos_to_string(pos)
))
end
if fields.wipe then
signs_api.set_display_text(pos, "", fields.font)
if fields.font then
signs_api.set_display_text(pos, fields.display_text)
font_api.show_font_list(player, pos)
end
end
end

models = {
local models = {
black_board = {
depth = 1/16, width = 1, height = 1,
entity_fields = {
Expand All @@ -72,6 +73,7 @@ models = {
tiles = { "default_wood.png", "default_wood.png",
"default_wood.png", "default_wood.png",
"default_wood.png", "board_black_front.png" },
_itemframe_texture = "board_black_front.png",
drawtype = "nodebox",
node_box = {
type = "fixed",
Expand All @@ -84,6 +86,13 @@ models = {
set_formspec(pos)
display_api.on_construct(pos)
end,
on_punch = function(pos)
set_formspec(pos)
display_api.update_entities(pos)
end,
on_rightclick = function(pos)
set_formspec(pos)
end,
on_receive_fields = on_receive_fields,
},
},
Expand All @@ -103,6 +112,7 @@ models = {
"default_wood.png", "default_wood.png",
"default_wood.png", "board_green_front.png" },
drawtype = "nodebox",
_itemframe_texture = "board_green_front.png",
node_box = {
type = "fixed",
fixed = {
Expand All @@ -114,6 +124,13 @@ models = {
set_formspec(pos)
display_api.on_construct(pos)
end,
on_punch = function(pos)
set_formspec(pos)
display_api.update_entities(pos)
end,
on_rightclick = function(pos)
set_formspec(pos)
end,
on_receive_fields = on_receive_fields,
},
},
Expand Down
Loading

0 comments on commit 46a330e

Please sign in to comment.