initial, not working mod

master
ademant 2019-02-20 14:45:43 +01:00
commit a4f0810e1f
6 changed files with 90 additions and 0 deletions

32
README.md Normal file
View File

@ -0,0 +1,32 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# Minetest Game mod: Kiosk
See license.txt for license information.
Main repository:
https://notabug.org/ademant/minetest_kiosk.git
Mirrors:
https://gitlab.com/ademant/minetest_kiosk.git
https://github.com/ademant/minetest_kiosk.git
## Short description
Allows a quite simple trading by selling items via unified_inventory.
## Chat Commands
Following chat commands are available:
## Usage
## Authors of source code
ademant (MIT)
## Authors of media (textures)
Created by ademant (CC BY 3.0):

36
init.lua Normal file
View File

@ -0,0 +1,36 @@
-- base copied from 3d_armor_ui
-- support for i18n
local S = armor_i18n.gettext
local F = minetest.formspec_escape
if not minetest.global_exists("unified_inventory") then
minetest.log("warning", S("Kiosk: Mod loaded but unused."))
return
end
if unified_inventory.sfinv_compat_layer then
return
end
unified_inventory.register_button("kiosk", {
type = "image",
image = "kiosk_button_128.png",
tooltip = S("Kiosk")
})
unified_inventory.register_page("kiosk", {
get_formspec = function(player, perplayer_formspec)
local fy = perplayer_formspec.formspec_y
local name = player:get_player_name()
if armor.def[name].init_time == 0 then
return {formspec="label[0,0;"..F(S("Armor not initialized!")).."]"}
end
local formspec = "label[0,0;"..F(S("Kiosk")).."]"..
"list[detached:"..name.."_kiosk;kiosk;0,"..fy..";1,2;]"..
"label[5.0,"..(fy + 0.0)..";"..F(S("Buy at")).."]"..
"label[5.0,"..(fy + 0.5)..";"..F(S("Sell at")).."]"..
"listring[current_player;main]"..
"listring[detached:"..name.."_kiosk;kiosk]"
return {formspec=formspec}
end,
})

15
license.txt Normal file
View File

@ -0,0 +1,15 @@
License of source code
----------------------
The MIT License (MIT)
Copyright 2018 ademant
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more details:
https://opensource.org/licenses/mit-license.php

7
mod.conf Normal file
View File

@ -0,0 +1,7 @@
name = kiosk
title = kiosk
author = ademant
description = Global trading via unified_inventories
depends = default,basic_functions,unified_inventory
license = MIT
version = 1.0.0

BIN
texture/kiosk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB