Initial release

fork-master
A S Lewis 2020-05-28 16:14:37 +01:00
parent f4f769708c
commit dc77458051
1019 changed files with 2592 additions and 2 deletions

View File

@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found.
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,

60
LICENSE2 Normal file
View File

@ -0,0 +1,60 @@
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined below) for the purposes of this License.
"Creative Commons Compatible License" means a license that is listed at http://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as this License.
"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
to Distribute and Publicly Perform Adaptations.
For the avoidance of doubt:
Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested.
You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License; (III) You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Ssection 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

76
README.rst Normal file
View File

@ -0,0 +1,76 @@
==========
metrosigns
==========
This is a mod for `Minetest <https://www.minetest.net/>`__, providing an extended selection of signs for use in your train and metro networks.
.. image:: screenshots/example1.png
:alt: Train platform
The mod includes:
* Semi-realistic signage from twenty major cities - the London Underground, the Paris Metro, the New York Subway - and more!
* Line number signs from 1-99, using the colour scheme established by `advtrains_subwayblocks <https://git.gpcf.eu/?p=advtrains_subwayblocks.git>`__
* Platform signs from 1-99
* A sign-writing machine (for use in survival mode)
* Nodes from `advtrains_subwayblocks <https://git.gpcf.eu/?p=advtrains_subwayblocks.git>`__ and `trainblocks <https://github.com/maxhipp/trainblocks_bc>`__, if those mods aren't already loaded
* Over 1300 items in total
The mod includes and builds on material from the following mods:
* `advtrains_subwayblocks <https://git.gpcf.eu/?p=advtrains_subwayblocks.git>`__ by gpcf/orwell
* `trainblocks <https://github.com/maxhipp/trainblocks_bc>`__ by Maxx
* `roads <https://cheapiesystems.com/git/roads/>`__ by cheapie
Licences
--------
The sign writer and ink cartridges (code and textures) are licenced under CC-BY-SA 3.0 Unported.
Everything else is licenced under GNU Affero GPL.
Authors
-------
Code and textures: `A S Lewis <https://github.com/axcore/>`__.
Code and texture contributors: gpcf/orwell, Max, cheapie
Dependencies
------------
There are no dependencies. **NB This is currently not true - see below.**
Optional dependencies
---------------------
If default and `basic_materials <https://gitlab.com/VanessaE/basic_materials>`__ are loaded, the sign writing machine and ink cartridges are craftable.
If signs_api from `display_modpack <https://github.com/pyrollo/display_modpack>`__ is loaded, you can create signs with customisable text.
Downloads
---------
The latest release is available `here <https://github.com/axcore/metrosigns>`__.
Screenshots
-----------
.. image:: screenshots/example2.png
:alt: Sugn-writing machine
.. image:: screenshots/example3.png
:alt: Various light boxes
.. image:: screenshots/example4.png
:alt: Various line signs
.. image:: screenshots/example5.png
:alt: Various platform signs
Known bugs
----------
- Minetest will not (or cannot) read settingtypes.txt correctly. Until this is resolved, all nodes are available by default
- The sign-writing machine will not display more than one page of signs at a time
- signs_api from display_modpack should be an optional dependency, but the minetest game won't start (sometimes) if signs_api is not loaded
- Sounds for the sign-writing machine are commented out because I don't know how to make them work

1126
citysigns.lua Normal file

File diff suppressed because it is too large Load Diff

61
customsigns.lua Normal file
View File

@ -0,0 +1,61 @@
---------------------------------------------------------------------------------------------------
-- metrosigns mod for minetest by A S Lewis
-- https://github.com/axcore/metrosigns
-- Licence: GNU Affero GPL
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- Signs with customisable text (designed to be used alongside the map nodes). Requires signs_api
-- from display_modpack
---------------------------------------------------------------------------------------------------
if HAVE_SIGNS_API_FLAG and metrosigns.create_all_flag or metrosigns.create_text_flag then
local category = "Signs with text"
metrosigns.register_category(category)
width_table = {
[1] = "short",
[2] = "medium",
[3] = "long",
}
for width, width_descrip in pairs(width_table) do
signs_api.register_sign(
":signs_road",
"metrosigns_text_"..width_descrip,
{
depth = 2/16,
width = width,
height = 1,
entity_fields = {
size = { x = width, y = 12/16 },
maxlines = 3,
color = "#000",
},
node_fields = {
description = "Metrosigns Map Text ("..width_descrip..")",
tiles = {
"metrosigns_text_side.png",
"metrosigns_text_side.png",
"metrosigns_text_side.png",
"metrosigns_text_side.png",
"metrosigns_text_side.png",
"metrosigns_text_front.png",
},
inventory_image = "metrosigns_text_width_"..width_descrip.."_inv.png",
},
}
)
metrosigns.register_sign(
category,
"signs_road:metrosigns_text_"..width_descrip,
(metrosigns.writer.text_units * width)
)
minetest.override_item("signs_road:metrosigns_text_"..width_descrip, { light_source = 5 })
end
end

122
extsigns.lua Normal file
View File

@ -0,0 +1,122 @@
---------------------------------------------------------------------------------------------------
-- metrosigns mod for minetest by A S Lewis
-- https://github.com/axcore/metrosigns
-- Licence: GNU Affero GPL
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- Extended line and platform signs
---------------------------------------------------------------------------------------------------
line_flag = metrosigns.create_all_flag or metrosigns.create_ext_line_flag
line_min = metrosigns.ext_line_min
line_max = metrosigns.ext_line_max
if not isint(line_min) or not isint(line_max) or line_min < 0 or line_max > 99 then
line_flag = false
end
if line_flag then
line_category = "Extended line signs"
metrosigns.register_category(line_category)
end
platform_flag = metrosigns.create_all_flag or metrosigns.create_ext_platform_flag
platform_min = metrosigns.ext_platform_min
platform_max = metrosigns.ext_platform_max
if not isint(platform_min) or not isint(platform_max) or platform_min < 0 or platform_max > 99 then
platform_flag = false
end
if platform_flag then
platform_category = "Extended platform signs"
metrosigns.register_category(platform_category)
end
if line_flag or platform_flag then
for m = 0, 9, 1 do
for n = 0, 9, 1 do
num = (m*10) + n
if n == 6 then
col = "black"
else
col = "white"
end
if num >= line_min and num <= line_max then
minetest.register_node("metrosigns:sign_line_"..m..n, {
description = "Line "..num.." sign",
tiles = {
"metrosigns_bg_small_"..n..".png^metrosigns_char_small_"..col.."_"..m
.."0.png^metrosigns_char_small_"..col.."_"..n..".png"
},
inventory_image = "metrosigns_bg_large_"..n..".png^metrosigns_char_large_"..col
.."_"..m.."0.png^metrosigns_char_large_"..col.."_"..n..".png",
groups = {
attached_node = 1, choppy = 2, flammable = 2, oddly_breakable_by_hand = 3
},
light_source = 12,
drawtype = "nodebox",
is_ground_content = false,
legacy_wallmounted = true,
node_box = {
type = "wallmounted",
wall_top = {-8/16, -4/16, -4/16, -7/16, 4/16, 4/16},
wall_bottom = {-8/16, -4/16, -4/16, -7/16, 4/16, 4/16},
wall_side = {-8/16, -4/16, -5/16, -7/16, 4/16, 5/16}
},
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false
})
metrosigns.register_sign(
line_category, "metrosigns:sign_line_"..m..n, metrosigns.writer.sign_units
)
end
if num >= platform_min and num <= platform_max then
minetest.register_node("metrosigns:sign_platform_"..m..n, {
description = "Platform "..num.." sign",
tiles = {
"metrosigns_bg_small_platform.png^metrosigns_char_small_white_"..m
.."0.png^metrosigns_char_small_white_"..n..".png"
},
inventory_image
= "metrosigns_bg_large_platform.png^metrosigns_char_large_white_"..m
.."0.png^metrosigns_char_large_white_"..n..".png",
groups = {cracky = 3},
light_source = 5,
drawtype = "nodebox",
is_ground_content = false,
legacy_wallmounted = true,
node_box = {
type = "wallmounted",
wall_top = {-8/16, -4/16, -4/16, -7/16, 4/16, 4/16},
wall_bottom = {-8/16, -4/16, -4/16, -7/16, 4/16, 4/16},
wall_side = {-8/16, -4/16, -5/16, -7/16, 4/16, 5/16}
},
node_box = {
type = "fixed",
fixed = {
{ -5/16, -4/16, 6/16, 5/16, 4/16, 8/16},
},
},
paramtype = "light",
paramtype2 = "facedir",
walkable = false
})
metrosigns.register_sign(
platform_category,
"metrosigns:sign_platform_"..m..n,
metrosigns.writer.sign_units
)
end
end
end
end

234
init.lua Normal file
View File

@ -0,0 +1,234 @@
---------------------------------------------------------------------------------------------------
-- metrosigns mod for minetest by A S Lewis
-- https://github.com/axcore/metrosigns
-- Licence: GNU Affero GPL
---------------------------------------------------------------------------------------------------
-- Includes code/textures from advtrains_subwayblocks by gpcf/orwell
-- https://git.gpcf.eu/?p=advtrains_subwayblocks.git
-- Licence: GNU Affero GPL
--
-- Includes code/textures from trainblocks by Maxx
-- https://github.com/maxhipp/trainblocks_bc
-- https://forum.minetest.net/viewtopic.php?t=19743
-- Licence: GNU Affero GPL
--
-- Includes code/textures from roads by cheapie
-- https://cheapiesystems.com/git/roads/
-- https://forum.minetest.net/viewtopic.php?t=13904
-- Licence: CC-BY-SA 3.0 Unported
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- Create namespaces
---------------------------------------------------------------------------------------------------
metrosigns = {}
metrosigns.name = "metrosigns"
metrosigns.ver_max = 1
metrosigns.ver_min = 0
metrosigns.ver_rev = 0
metrosigns.writer = {}
---------------------------------------------------------------------------------------------------
-- Constants
---------------------------------------------------------------------------------------------------
metrosigns.path_mod = minetest.get_modpath(minetest.get_current_modname())
-- If default and basic_materials are loaded, the sign writer and cartridges are craftable
if minetest.get_modpath("default") then
HAVE_DEFAULT_FLAG = true
else
HAVE_DEFAULT_FLAG = false
end
if minetest.get_modpath("basic_materials") then
HAVE_BASIC_MATERIALS_FLAG = true
else
HAVE_BASIC_MATERIALS_FLAG = false
end
-- If signs_api from display_modpack is loaded, create signs with customisable text
if minetest.get_modpath("signs_api") then
HAVE_SIGNS_API_FLAG = true
else
HAVE_SIGNS_API_FLAG = false
end
-- If advtrains_subwayblocks is loaded, we don't create duplicate blocks
if minetest.get_modpath("advtrains_subwayblocks") then
HAVE_SUBWAYBLOCKS_FLAG = true
else
HAVE_SUBWAYBLOCKS_FLAG = false
end
-- If trainblocks is loaded, we don't create duplicate blocks
if minetest.get_modpath("trainblocks") then
HAVE_TRAINBLOCKS_FLAG = true
else
HAVE_TRAINBLOCKS_FLAG = false
end
-- Cartridge ink levels are implemented using wear
-- Ink capacity of a cartridge
metrosigns.writer.cartridge_max = 60000
-- Amount of ink used for one unit
metrosigns.writer.cartridge_min = 1000
-- Number of units used for printing various kinds of sign
metrosigns.writer.box_units = 30
metrosigns.writer.sign_units = 5
metrosigns.writer.map_units = 10
metrosigns.writer.text_units = 10
-- Used in material copied from advtrains_subwayblocks and trainblocks
box_groups = {cracky = 3}
box_light_source = 10
---------------------------------------------------------------------------------------------------
-- Variables
---------------------------------------------------------------------------------------------------
-- Signs are divided into categories. A category's name is the same as the city description (i.e.
-- "London Underground" rather than "London"
-- Ordered list of categories, as displayed in the sign-writing
-- machine's dropdrown box, e.g. categories[1] = "London Underground",
-- categories[2] = "Paris Metro"
metrosigns.writer.categories = {}
-- The current category; one of the values in metrosigns.writer.categories. Only signs in this
-- category are visible in the sign-writing machine's list
metrosigns.writer.current_category = nil
-- Ordered list of signs in each category and their properties. The properties are arranged in a
-- table:
-- category - one of the values in metrosigns.writer.current_category
-- name - the name of the sign's node, e.g. "metrosigns:map_london_bakerloo_line"
-- ink_needed - the amount of ink removed from each cartridge when printing the sign, e.g. 10
-- Thus we have, e.g. signtypes["London Underground"][1] = property_table,
-- signtypes["London Underground"][2] = property_table, etc
metrosigns.writer.signtypes = {}
-- The number of signs in each category, e.g. signcounts["London Underground"] = 20
metrosigns.writer.signcounts = {}
---------------------------------------------------------------------------------------------------
-- Load settings
---------------------------------------------------------------------------------------------------
-- All settings temporarily enabled, because I can't get settingtypes.txt to behave as intended
--metrosigns.create_all_flag = minetest.setting_get("metrosigns_create_all") or false
metrosigns.create_all_flag = minetest.setting_get("metrosigns_create_all") or true
metrosigns.create_subwayblocks_flag = minetest.setting_get("metrosigns_create_subwayblocks")
or false
metrosigns.create_trainblocks_flag = minetest.setting_get("metrosigns_create_trainblocks") or false
metrosigns.create_ext_line_flag = minetest.setting_get("metrosigns_create_ext_line") or true
--metrosigns.ext_line_min = minetest.setting_get("metrosigns_ext_line_min") or 11
--metrosigns.ext_line_max = minetest.setting_get("metrosigns_ext_line_min") or 20
metrosigns.ext_line_min = minetest.setting_get("metrosigns_ext_line_min") or 1
metrosigns.ext_line_max = minetest.setting_get("metrosigns_ext_line_min") or 99
metrosigns.create_ext_platform_flag = minetest.setting_get("metrosigns_create_ext_platform") or true
--metrosigns.ext_platform_min = minetest.setting_get("metrosigns_ext_platform_min") or 11
--metrosigns.ext_platform_max = minetest.setting_get("metrosigns_ext_platform_min") or 20
metrosigns.ext_platform_min = minetest.setting_get("metrosigns_ext_platform_min") or 1
metrosigns.ext_platform_max = minetest.setting_get("metrosigns_ext_platform_min") or 99
metrosigns.create_text_flag = minetest.setting_get("metrosigns_create_text") or true
metrosigns.create_athens_flag = minetest.setting_get("metrosigns_create_athens") or false
metrosigns.create_bangkok_flag = minetest.setting_get("metrosigns_create_bangkok") or false
metrosigns.create_berlin_flag = minetest.setting_get("metrosigns_create_berlin") or false
metrosigns.create_bucharest_flag = minetest.setting_get("metrosigns_create_bucharest") or false
metrosigns.create_budapest_flag = minetest.setting_get("metrosigns_create_budapest") or false
metrosigns.create_glasgow_flag = minetest.setting_get("metrosigns_create_glasgow")or false
metrosigns.create_hcmc_flag = minetest.setting_get("metrosigns_create_hcmc") or false
metrosigns.create_london_flag = minetest.setting_get("metrosigns_create_london") or true
metrosigns.create_luton_flag = minetest.setting_get("metrosigns_create_luton") or false
metrosigns.create_madrid_flag = minetest.setting_get("metrosigns_create_madrid") or false
metrosigns.create_moscow_flag = minetest.setting_get("metrosigns_create_moscow") or false
metrosigns.create_newyork_flag = minetest.setting_get("metrosigns_create_newyork") or false
metrosigns.create_paris_flag = minetest.setting_get("metrosigns_create_paris") or false
metrosigns.create_prague_flag = minetest.setting_get("metrosigns_create_prague") or false
metrosigns.create_rome_flag = minetest.setting_get("metrosigns_create_rome") or false
metrosigns.create_stockholm_flag = minetest.setting_get("metrosigns_create_stockholm") or false
metrosigns.create_taipei_flag = minetest.setting_get("metrosigns_create_taipei") or false
metrosigns.create_tokyo_flag = minetest.setting_get("metrosigns_create_tokyo") or false
metrosigns.create_toronto_flag = minetest.setting_get("metrosigns_create_toronto") or false
metrosigns.create_vienna_flag = minetest.setting_get("metrosigns_create_vienna") or false
---------------------------------------------------------------------------------------------------
-- General functions
---------------------------------------------------------------------------------------------------
function capitalise(str)
if str == "newyork" then
return "New York"
else
return (str:gsub("^%l", string.upper))
end
end
function isint(n)
return n==math.floor(n)
end
-- (Used by the sign-writing machine, if it is created)
function metrosigns.register_category(category)
table.insert(metrosigns.writer.categories, category)
metrosigns.writer.signcounts[category] = 0
metrosigns.writer.signtypes[category] = {}
if metrosigns.writer.current_category == nil then
metrosigns.writer.current_category = category
end
end
function metrosigns.register_sign(category, node, ink_needed)
local data = {category=category, name=node, ink_needed=ink_needed}
table.insert(metrosigns.writer.signtypes[category], data)
metrosigns.writer.signcounts[category] = metrosigns.writer.signcounts[category] + 1
end
---------------------------------------------------------------------------------------------------
-- Original material from advtrains_subwayblocks by gpcf/orwell
---------------------------------------------------------------------------------------------------
dofile(metrosigns.path_mod.."/subwayblocks.lua")
---------------------------------------------------------------------------------------------------
-- Original material from trainblocks by Maxx
---------------------------------------------------------------------------------------------------
dofile(metrosigns.path_mod.."/trainblocks.lua")
---------------------------------------------------------------------------------------------------
-- Extended line and platform signs
---------------------------------------------------------------------------------------------------
dofile(metrosigns.path_mod.."/extsigns.lua")
---------------------------------------------------------------------------------------------------
-- Signs with customisable text (designed to be used alongside the map nodes). Requires signs_api
-- from display_modpack
---------------------------------------------------------------------------------------------------
dofile(metrosigns.path_mod.."/customsigns.lua")
---------------------------------------------------------------------------------------------------
-- City-specific signs
---------------------------------------------------------------------------------------------------
dofile(metrosigns.path_mod.."/citysigns.lua")
---------------------------------------------------------------------------------------------------
-- Sign-writing machines and ink cartridges
---------------------------------------------------------------------------------------------------
dofile(metrosigns.path_mod.."/machine.lua")

376
machine.lua Normal file
View File

@ -0,0 +1,376 @@
---------------------------------------------------------------------------------------------------
-- metrosigns mod for minetest by A S Lewis
-- https://github.com/axcore/metrosigns
-- Licence: GNU Affero GPL
---------------------------------------------------------------------------------------------------
-- Code/textures from roads by cheapie
-- https://forum.minetest.net/viewtopic.php?t=13904
-- https://cheapiesystems.com/git/roads/
-- Licence: CC-BY-SA 3.0 Unported
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- Sign-writing machine functions, based on the printer in the roads mod by cheapie
-- Functions
---------------------------------------------------------------------------------------------------
function metrosigns.writer.can_dig(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return (
inv:is_empty("redcart") and inv:is_empty("greencart")
and inv:is_empty("bluecart") and inv:is_empty("plastic")
)
end
function metrosigns.writer.checksupplies(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local redcart = inv:get_stack("redcart", 1)
local greencart = inv:get_stack("greencart", 1)
local bluecart = inv:get_stack("bluecart", 1)
local plastic = inv:get_stack("plastic", 1)
if not redcart:to_table() or not greencart:to_table() or not bluecart:to_table()
or not plastic:to_table() then
return false
end
local redcart_good = redcart:to_table().name == "metrosigns:cartridge_red"
and redcart:to_table().wear <= metrosigns.writer.cartridge_max
local greencart_good = greencart:to_table().name == "metrosigns:cartridge_green"
and greencart:to_table().wear <= metrosigns.writer.cartridge_max
local bluecart_good = bluecart:to_table().name == "metrosigns:cartridge_blue"
and bluecart:to_table().wear <= metrosigns.writer.cartridge_max
local plastic_good = plastic:to_table().name == "basic_materials:plastic_sheet"
local good = redcart_good and greencart_good and bluecart_good and plastic_good
return good
end
function metrosigns.writer.nom(pos, amount)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local redcart = inv:get_stack("redcart", 1)
local greencart = inv:get_stack("greencart", 1)
local bluecart = inv:get_stack("bluecart", 1)
local plastic = inv:get_stack("plastic", 1)
redcart:add_wear(amount * metrosigns.writer.cartridge_min )
greencart:add_wear(amount * metrosigns.writer.cartridge_min )
bluecart:add_wear(amount * metrosigns.writer.cartridge_min )
plastic:take_item(1)
inv:set_stack("redcart", 1, redcart)
inv:set_stack("greencart", 1, greencart)
inv:set_stack("bluecart", 1, bluecart)
inv:set_stack("plastic", 1, plastic)
end
function metrosigns.writer.populateoutput(pos)
-- Sanity check: If no signs have been defined, then there is no need to display a formspec
if metrosigns.writer.current_category == nil then
return
end
local typescount = metrosigns.writer.signcounts[metrosigns.writer.current_category]
local pagesize = 8*5
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local page = meta:get_int("page")
local maxpage = math.ceil(typescount/pagesize)
inv:set_list("output", {})
inv:set_size("output", typescount)
if metrosigns.writer.checksupplies(pos) then
for k,v in pairs(metrosigns.writer.signtypes[metrosigns.writer.current_category]) do
inv:set_stack("output", k, v.name)
end
end
local dropdown_string = ""
for k, v in ipairs(metrosigns.writer.categories) do
if k == 1 then
dropdown_string = v
else
dropdown_string = dropdown_string..","..v
end
end
meta:set_string("formspec", "size[11,10]"..
-- Cartridges
"label[0,0;Red\nCartridge]" ..
"list[current_name;redcart;1.5,0;1,1;]" ..
"label[0,1;Green\nCartridge]" ..
"list[current_name;greencart;1.5,1;1,1;]" ..
"label[0,2;Blue\nCartridge]" ..
"list[current_name;bluecart;1.5,2;1,1;]" ..
-- Plastic
"label[0,3;Plastic\nSheeting]" ..
"list[current_name;plastic;1.5,3;1,1;]" ..
-- Sign categories
"label[0,5;Sign\nCategory]" ..
"dropdown[1.5,5;3.75,1;category;"..dropdown_string..";1]" ..
-- List of signs
"list[current_name;output;2.8,0;8,5;"..tostring((page-1)*pagesize).."]" ..
-- Player inventory
"list[current_player;main;1.5,6.25;8,4;]"..
-- Page buttons
"button[5.5,5;1,1;prevpage;<<<]"..
"button[8.5,5;1,1;nextpage;>>>]"..
"label[6.75,5.25;Page "..page.." of "..maxpage.."]"
)
meta:set_int("maxpage",maxpage)
end
function metrosigns.writer.on_construct(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
meta:set_int("page", 1)
meta:set_int("maxpage", 1)
inv:set_size("redcart", 1)
inv:set_size("greencart", 1)
inv:set_size("bluecart", 1)
inv:set_size("plastic", 1)
metrosigns.writer.populateoutput(pos)
end
function metrosigns.writer.on_receive_fields(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
if fields.category then
minetest.log(fields.category)
-- User has activated the dropdown box
if metrosigns.writer.signtypes[fields.category] ~= nil then
metrosigns.writer.current_category = fields.category
end
else
-- User has clicked the page buttons
local page = meta:get_int("page")
local maxpage = meta:get_int("maxpage")
if fields.prevpage then
page = page - 1
if page < 1 then
page = maxpage
end
meta:set_int("page",page)
elseif fields.nextpage then
page = page + 1
if page > maxpage then
page = 1
end
meta:set_int("page",page)
end
end
-- In all cases, redraw the list of signs for the current category
metrosigns.writer.populateoutput(pos)
end
function metrosigns.writer.allow_metadata_inventory_put(pos, listname, index, stack, player)
if listname == "redcart" then
if stack:get_name() == "metrosigns:cartridge_red" then
return 1
else
return 0
end
elseif listname == "greencart" then
if stack:get_name() == "metrosigns:cartridge_green" then
return 1
else
return 0
end
elseif listname == "bluecart" then
if stack:get_name() == "metrosigns:cartridge_blue" then
return 1
else
return 0
end
elseif listname == "plastic" then
if stack:get_name() == "basic_materials:plastic_sheet" then
return stack:get_count()
else
return 0
end
else
return 0
end
end
function metrosigns.writer.on_metadata_inventory_put(pos)
metrosigns.writer.populateoutput(pos)
end
function metrosigns.writer.on_metadata_inventory_take(pos, listname, index)
if listname == "output" then
local cost
= metrosigns.writer.signtypes[metrosigns.writer.current_category][index].ink_needed
metrosigns.writer.nom(pos, cost)
end
metrosigns.writer.populateoutput(pos)
end
function metrosigns.writer.allow_metadata_inventory_move(
pos, from_list, from_index, to_list, to_index, count, player
)
return 0
end
---------------------------------------------------------------------------------------------------
-- Register crafts for the machine and its ink cartridges
---------------------------------------------------------------------------------------------------
minetest.register_tool("metrosigns:cartridge_red",
{
description = "Red Ink Cartridge",
inventory_image = "streets_cartridge_red.png"
}
)
minetest.register_tool("metrosigns:cartridge_green",
{
description = "Green Ink Cartridge",
inventory_image = "streets_cartridge_green.png"
}
)
minetest.register_tool("metrosigns:cartridge_blue",
{
description = "Blue Ink Cartridge",
inventory_image = "streets_cartridge_blue.png"
}
)
if HAVE_DEFAULT_FLAG and HAVE_BASIC_MATERIALS_FLAG then
local sheeting = "basic_materials:plastic_sheet"
minetest.register_craft({
output = "metrosigns:cartridge_red",
recipe = {
{sheeting, sheeting, sheeting},
{sheeting, "dye:red", sheeting},
{sheeting, "", ""},
}
})
minetest.register_craft({
output = "metrosigns:cartridge_green",
recipe = {
{sheeting, sheeting, sheeting},
{sheeting, "dye:green", sheeting},
{sheeting, "", ""},
}
})
minetest.register_craft({
output = "metrosigns:cartridge_blue",
recipe = {
{sheeting, sheeting, sheeting},
{sheeting, "dye:blue", sheeting},
{sheeting, "", ""},
}
})
-- Refills
minetest.register_craft({
output = "metrosigns:cartridge_red",
type = "shapeless",
recipe = {"metrosigns:cartridge_red", "dye:red"}
})
minetest.register_craft({
output = "metrosigns:cartridge_green",
type = "shapeless",
recipe = {"metrosigns:cartridge_green", "dye:green"}
})
minetest.register_craft({
output = "metrosigns:cartridge_blue",
type = "shapeless",
recipe = {"metrosigns:cartridge_blue", "dye:blue"}
})
minetest.register_craft({
output = "metrosigns:sign_writer",
recipe = {
{sheeting, "default:steel_ingot", sheeting},
{"default:steel_ingot", "basic_materials:energy_crystal_simple", "default:steel_ingot"},
{"basic_materials:motor", "default:steel_ingot", "basic_materials:motor"},
}
})
end
---------------------------------------------------------------------------------------------------
-- Register the sign-writing machine itself
---------------------------------------------------------------------------------------------------
minetest.register_node("metrosigns:sign_writer", {
description = "Sign Writer",
tiles = {
"metrosigns_writer_top.png",
"metrosigns_writer_side.png",
"metrosigns_writer_side.png",
"metrosigns_writer_side.png",
"metrosigns_writer_side.png",
"metrosigns_writer_front.png",
},
inventory_image = "metrosigns_writer_front.png",
groups = {snappy = 3},
paramtype = "light",
paramtype2 = "facedir",
-- Commented out because I don't know how to fix the error
-- sound = default.node_sound_wood_defaults(),
walkable = true,
-- Callbacks
allow_metadata_inventory_move = metrosigns.writer.allow_metadata_inventory_move,
allow_metadata_inventory_put = metrosigns.writer.allow_metadata_inventory_put,
can_dig = metrosigns.writer.can_dig,
on_construct = metrosigns.writer.on_construct,
on_metadata_inventory_put = metrosigns.writer.on_metadata_inventory_put,
on_metadata_inventory_take = metrosigns.writer.on_metadata_inventory_take,
on_receive_fields = metrosigns.writer.on_receive_fields,
})

4
mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = metrosigns
descriptions = Extensive library of signs for train/metro systems
depends =
optional_depends = advtrains_subwayblocks, basic_materials, default, signs_api, trainblocks

BIN
screenshots/example1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

BIN
screenshots/example2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
screenshots/example3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
screenshots/example4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
screenshots/example5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

94
settingtypes.txt Normal file
View File

@ -0,0 +1,94 @@
# -------------------------------------------------------------------------------------------------
# metrosigns settings
# -------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------
# Override settings
# -------------------------------------------------------------------------------------------------
# If enabled, create all items, regardless of the value of other flag settings
metrosigns_create_all (Enable to create all items. true/false) bool false
# -------------------------------------------------------------------------------------------------
# Settings for items borrowed from other mods
# -------------------------------------------------------------------------------------------------
# If enabled, create items from advtrains_subwayblocks. Ignored if that module has been loaded
metrosigns_create_subwayblocks (Enable to create all items. true/false) bool false
# If enabled, create items from trainblocks. Ignored if that module has been loaded
metrosigns_create_trainblocks (Enable to create all items. true/false) bool false
# -------------------------------------------------------------------------------------------------
# Extended line signs
# -------------------------------------------------------------------------------------------------
# If enabled, create extended line signs (in the range 00-99)
metrosigns_create_ext_line (Enable to create extended line signs. true/false) bool true
# If the flag above is enabled, the range of signs to create: minimum and maxium values (must be
# integers in the range 0-99. If values are invalid, no extended line signs are created)
metrosigns_ext_line_min (Lowest extended line sign. int) int 11
metrosigns_ext_line_max (Highest extended line sign. int) int 20
# -------------------------------------------------------------------------------------------------
# Extended platform signs
# -------------------------------------------------------------------------------------------------
# If enabled, create extended platform signs (in the range 00-99)
metrosigns_create_ext_platform (Enable to create extended platform signs. true/false) bool true
# If the flag above is enabled, the range of signs to create: minimum and maxium values (must be
# integers in the range 0-99. If values are invalid, no extended platform signs are created)
metrosigns_ext_platform_min (Lowest extended platform sign. int) int 11
metrosigns_ext_platform_max (Highest extended platform sign. int) int 20
# -------------------------------------------------------------------------------------------------
# Map text signs
# -------------------------------------------------------------------------------------------------
# If enabled, create signs with text (designed to be used alongside the map nodes; requires
# signs_api)
metrosigns_create_text (Enable to create signs with text. true/false) bool true
# -------------------------------------------------------------------------------------------------
# City settings
# -------------------------------------------------------------------------------------------------
# If enabled, create items for Athens Metro
metrosigns_create_athens (Enable to create Athens Metro items. true/false) bool false
# If enabled, create items for Bangkok BTS Skytrain
metrosigns_create_bangkok (Enable to create Bangkok BTS Skytrain items. true/false) bool false
# If enabled, create items for Berlin U-Bahn
metrosigns_create_berlin (Enable to create Berlin U-Bahn items. true/false) bool false
# If enabled, create items for Bucharest Metro
metrosigns_create_bucharest (Enable to create Bucharest Metro items. true/false) bool false
# If enabled, create items for Budapest Metro
metrosigns_create_budapest (Enable to create Budapest Metro items. true/false) bool false
# If enabled, create items for Glasgow Subway
metrosigns_create_glasgow (Enable to create Glasgow Subway items. true/false) bool false
# If enabled, create items for Ho Chi Minh City Metro
metrosigns_create_hcmc (Enable to create Ho Chi Minh City Metro items. true/false) bool false
# If enabled, create items for London Underground
metrosigns_create_london (Enable to create London Underground items. true/false) bool true
# If enabled, create items for Luton to Dunstable Busway
metrosigns_create_luton (Enable to create Luton to Dunstable Busway items. true/false) bool false
# If enabled, create items for Madrid Metro
metrosigns_create_madrid (Enable to create Madrid Metro items. true/false) bool false
# If enabled, create items for Moscow Metro
metrosigns_create_moscow (Enable to create Moscow Metro items. true/false) bool false
# If enabled, create items for New York City Subway
metrosigns_create_newyork (Enable to create New York City Subway items. true/false) bool false
# If enabled, create items for Paris Metro
metrosigns_create_paris (Enable to create Paris Metro items. true/false) bool false
# If enabled, create items for Prague Metro
metrosigns_create_prague (Enable to create Prague Metro items. true/false) bool false
# If enabled, create items for Rome Metro
metrosigns_create_rome (Enable to create Rome Metro items. true/false) bool false
# If enabled, create items for Stockholm Metro
metrosigns_create_stockholm (Enable to create Stockholm Metro items. true/false) bool false
# If enabled, create items for Taipei Metro
metrosigns_create_taipei (Enable to create Taipei Metro items. true/false) bool false
# If enabled, create items for Tokyo Metro
metrosigns_create_tokyo (Enable to create Tokyo Metro items. true/false) bool false
# If enabled, create items for Toronto Subway
metrosigns_create_toronto (Enable to create Toronto Subway items. true/false) bool false
# If enabled, create items for Vienna U-Bahn
metrosigns_create_vienna (Enable to create Vienna U-Bahn items. true/false) bool false

130
subwayblocks.lua Normal file
View File

@ -0,0 +1,130 @@
---------------------------------------------------------------------------------------------------
-- metrosigns mod for minetest by A S Lewis
-- https://github.com/axcore/metrosigns
-- Licence: GNU Affero GPL
---------------------------------------------------------------------------------------------------
-- Code/textures from advtrains_subwayblocks by gpcf/orwell
-- https://git.gpcf.eu/?p=advtrains_subwayblocks.git
-- Licence: GNU Affero GPL
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- Original material from advtrains_subwayblocks by gpcf/orwell
---------------------------------------------------------------------------------------------------
if not HAVE_SUBWAYBLOCKS_FLAG
and (metrosigns.create_all_flag or metrosigns.create_subwayblocks_flag) then
local category = "Signs from subwayblocks mod"
metrosigns.register_category(category)
minetest.register_node("metrosigns:sb_box_berlin", {
description = "Berlin U-Bahn lightbox (subwayblocks)",
tiles = {
"advtrains_subwayblocks_box_berlin_top.png",
"advtrains_subwayblocks_box_berlin_top.png",
"advtrains_subwayblocks_box_berlin_side.png",
"advtrains_subwayblocks_box_berlin_side.png",
"advtrains_subwayblocks_box_berlin_side.png",
"advtrains_subwayblocks_box_berlin_side.png",
},
groups = box_groups,
light_source = box_light_source,
})
metrosigns.register_sign(category, "metrosigns:sb_box_berlin", metrosigns.writer.box_units)
minetest.register_node("metrosigns:sb_box_london", {
description = "London Underground lightbox (subwayblocks)",
tiles = {
"advtrains_subwayblocks_box_london_top.png",
"advtrains_subwayblocks_box_london_top.png",
"advtrains_subwayblocks_box_london_side.png",
"advtrains_subwayblocks_box_london_side.png",
"advtrains_subwayblocks_box_london_side.png",
"advtrains_subwayblocks_box_london_side.png",
},
groups = box_groups,
light_source = box_light_source,
})
metrosigns.register_sign(category, "metrosigns:sb_box_london", metrosigns.writer.box_units)
minetest.register_node("metrosigns:sb_box_madrid", {
description = "Madrid Metro lightbox (subwayblocks)",
tiles = {
"advtrains_subwayblocks_box_madrid_top.png",
"advtrains_subwayblocks_box_madrid_top.png",
"advtrains_subwayblocks_box_madrid_side.png",
"advtrains_subwayblocks_box_madrid_side.png",
"advtrains_subwayblocks_box_madrid_side.png",
"advtrains_subwayblocks_box_madrid_side.png",
},
groups = box_groups,
light_source = box_light_source,
})
metrosigns.register_sign(category, "metrosigns:sb_box_madrid", metrosigns.writer.box_units)
minetest.register_node("metrosigns:sb_box_mountain", {
description = "Mountain Railway lightbox (subwayblocks)",
tiles = {
"advtrains_subwayblocks_box_mountain_top.png",
"advtrains_subwayblocks_box_mountain_top.png",
"advtrains_subwayblocks_box_mountain_side.png",
"advtrains_subwayblocks_box_mountain_side.png",
"advtrains_subwayblocks_box_mountain_side.png",
"advtrains_subwayblocks_box_mountain_side.png",
},
groups = box_groups,
light_source = box_light_source,
})
metrosigns.register_sign(category, "metrosigns:sb_box_mountain", metrosigns.writer.box_units)
minetest.register_node("metrosigns:sb_box_paris", {
description = "Paris Metro lightbox (subwayblocks)",
tiles = {
"advtrains_subwayblocks_box_paris_top.png",
"advtrains_subwayblocks_box_paris_top.png",
"advtrains_subwayblocks_box_paris_side.png",
"advtrains_subwayblocks_box_paris_side.png",
"advtrains_subwayblocks_box_paris_side.png",
"advtrains_subwayblocks_box_paris_side.png",
},
groups = box_groups,
light_source = box_light_source,
})
metrosigns.register_sign(category, "metrosigns:sb_box_paris", metrosigns.writer.box_units)
for i = 1, 10, 1 do
-- (Put signs in the right order in unified_inventory, etc)
if i < 10 then
num = "0"..i
else
num = i
end
minetest.register_node("metrosigns:sb_sign_line_"..num, {
description = "Line "..i.." sign (subwayblocks)",
tiles = {"advtrains_subwayblocks_sign_line_"..i..".png"},
inventory_image = "advtrains_subwayblocks_sign_line_"..i.."_inv.png",
groups = {attached_node = 1, choppy = 2, flammable = 2, oddly_breakable_by_hand = 3},
light_source = 12,
drawtype = "nodebox",
is_ground_content = false,
legacy_wallmounted = true,
node_box = {
type = "wallmounted",
wall_top = {-8/16, -4/16, -4/16, -7/16, 4/16, 4/16},
wall_bottom = {-8/16, -4/16, -4/16, -7/16, 4/16, 4/16},
wall_side = {-8/16, -4/16, -4/16, -7/16, 4/16, 4/16},
},
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false
})
metrosigns.register_sign(
category, "metrosigns:sb_sign_line_"..num, metrosigns.writer.sign_units
)
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Some files were not shown because too many files have changed in this diff Show More