State as being for 5.1.0. Add custom hotbar texture code but commented-out. Use temporary fix for 'player information' bug

master
paramat 2020-02-17 01:13:21 +00:00
parent 45c2d99b06
commit 641f258215
3 changed files with 16 additions and 14 deletions

View File

@ -1,5 +1,5 @@
minipeli 0.2.0 by paramat. minipeli 0.2.2 by paramat.
A game for Minetest Engine 5.0.0 and later. A game for Minetest Engine 5.1.0 and later.
Authors of media Authors of media
@ -14,11 +14,10 @@ About Minipeli
'Peli' is the Finnish word for 'game'. 'Peli' is the Finnish word for 'game'.
This game is intended to be an example of minimal requirements for a Minetest Engine game, to help others create their own games. This game is intended to be an example of minimal requirements for a Minetest Engine game, to help others create their own games.
This also suggests a good mod structure, as opposed to the problematic structure of the game called 'Minetest Game', which has most content in one large mod called 'default'. It is better to split the content into many mods. This also suggests a good mod structure, as opposed to the problematic structure of the game called 'Minetest Game', which has most content in one large mod called 'default'. It is better to split the content into many smaller mods.
Because creating animated meshes is difficult, the player model from Minetest Game is used, it seems suitable for many games. Because creating animated meshes is difficult, the player model from Minetest Game is used, it seems suitable for many games.
The player API of Minetest Game is very useful and quite fundamental. The player API of Minetest Game is very useful and quite fundamental, so the 'player_api' mod from Minetest Game is included, but with new player textures.
So, the 'player_api' mod from Minetest Game is included, but with new player textures.
The 'light' mod is only provided to illuminate caves and dungeons during testing. The 'light' mod is only provided to illuminate caves and dungeons during testing.
@ -33,8 +32,8 @@ Mapgen v6 is very different to all the other mapgens, it has hardcoded biomes an
I recommended that games do not support Mapgen v6 for these reasons. I recommended that games do not support Mapgen v6 for these reasons.
The mods The mods and their functions
-------- ----------------------------
'player_api' 'player_api'
A mod from Minetest Game, mostly unmodified, but new player textures are used. A mod from Minetest Game, mostly unmodified, but new player textures are used.
@ -46,6 +45,7 @@ Sets suitable animations according to control inputs and player health.
Contains formspec and HUD related stuff: Contains formspec and HUD related stuff:
Formspec background, hotbar background, bubble and heart textures. Formspec background, hotbar background, bubble and heart textures.
Sets the formspec prepend. Sets the formspec prepend.
Sets custom hotbar textures if code un-commented and textures added.
'hand' 'hand'
Contains the hand tool related stuff: Contains the hand tool related stuff:
@ -93,8 +93,7 @@ Textures:
bubble bubble
heart heart
init.lua: init.lua:
minetest.register_on_joinplayer player:set_formspec_prepend with custom hotbar texture code removed. minetest.register_on_joinplayer to set the formspec prepend. The custom hotbar texture code is commented-out. Also use a temporary fix for minetest.get_player_information occasionally being 'nil'.
Use 'if info and info.formspec_version > 1 then' to avoid error.
'hand' mod contains: 'hand' mod contains:
Textures: Textures:
@ -103,9 +102,9 @@ init.lua:
minetest.register_item to register the hand tool. minetest.register_item to register the hand tool.
'media' mod contains: 'media' mod contains:
Code:
Required non-functional init.lua.
Textures: Textures:
crack_anylength crack_anylength
Sounds: Sounds:
player_damage player_damage
init.lua:
Required but empty.

View File

@ -1,10 +1,8 @@
See license.txt in each mod directory for more license information.
License of media (textures, schematics) License of media (textures, schematics)
--------------------------------------- ---------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2019 paramat Copyright (C) 2020 paramat
You are free to: You are free to:

View File

@ -6,10 +6,15 @@ minetest.register_on_joinplayer(function(player)
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] ]] listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] ]]
local name = player:get_player_name() local name = player:get_player_name()
local info = minetest.get_player_information(name) local info = minetest.get_player_information(name)
-- 'info and' is a temporary workaround for an engine bug
if info and info.formspec_version > 1 then if info and info.formspec_version > 1 then
formspec = formspec .. "background9[5,5;1,1;gui_formbg.png;true;10]" formspec = formspec .. "background9[5,5;1,1;gui_formbg.png;true;10]"
else else
formspec = formspec .. "background[5,5;1,1;gui_formbg.png;true]" formspec = formspec .. "background[5,5;1,1;gui_formbg.png;true]"
end end
player:set_formspec_prepend(formspec) player:set_formspec_prepend(formspec)
-- Set hotbar textures
--player:hud_set_hotbar_image("gui_hotbar.png")
--player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
end) end)