1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-29 13:20:25 +02:00

Move hotbar code/textures, and damage sound, from player_api to default

These are unrelated to the Player API and player object.
All other GUI/HUD code and textures are in default.
All other engine hardcoded sounds are in default.
The player_api mod is highly likely to be used unchanged in new games,
so logical grouping of content will help the creation of new games.
This commit is contained in:
Paramat
2019-10-18 02:43:06 +01:00
committed by GitHub
parent 7c1fd9c24e
commit 7caa5d36f2
8 changed files with 16 additions and 44 deletions

View File

@ -14,10 +14,10 @@ default.get_translator = S
-- GUI related stuff
minetest.register_on_joinplayer(function(player)
-- Set formspec prepend
local formspec = [[
bgcolor[#080808BB;true]
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] ]]
local name = player:get_player_name()
local info = minetest.get_player_information(name)
if info.formspec_version > 1 then
@ -26,6 +26,10 @@ minetest.register_on_joinplayer(function(player)
formspec = formspec .. "background[5,5;1,1;gui_formbg.png;true]"
end
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)
function default.get_hotbar_bg(x,y)