Compare commits
10 Enmetoj
c0c021a19f
...
0b758cbca4
Author | SHA1 | Date | |
---|---|---|---|
Jaidyn Ann | 0b758cbca4 | ||
Jaidyn Ann | ec1fecdf36 | ||
Juraj Vajda | 6948bc2a94 | ||
Juraj Vajda | e57d6352c0 | ||
Juraj Vajda | dadca4d319 | ||
Juraj Vajda | 20e11b7711 | ||
Juraj Vajda | e5023d35b4 | ||
Juraj Vajda | 39a37540f0 | ||
Juraj Vajda | 56c3b843d1 | ||
Juraj Vajda | bc28f617ca |
|
@ -19,7 +19,8 @@ globals = {
|
|||
'XBows',
|
||||
'XBowsQuiver',
|
||||
'XBowsEntityDefBase',
|
||||
'XBowsEntityDefCustom'
|
||||
'XBowsEntityDefCustom',
|
||||
'sfinv'
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
|
|
49
api.lua
49
api.lua
|
@ -1,6 +1,6 @@
|
|||
--[[
|
||||
X Bows. Adds bow and arrows with API.
|
||||
Copyright (C) 2023 SaKeL <juraj.vajda@gmail.com>
|
||||
Copyright (C) 2024 SaKeL
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -18,8 +18,6 @@
|
|||
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
sfinv = sfinv --[[@as Sfinv]]
|
||||
|
||||
---Check if table contains value
|
||||
---@param table table
|
||||
---@param value string|number
|
||||
|
@ -1154,7 +1152,10 @@ function XBowsEntityDef.on_step(self, selfObj, dtime)
|
|||
)
|
||||
or (
|
||||
pointed_thing.ref:get_luaentity()
|
||||
and pointed_thing.ref:get_luaentity().physical
|
||||
and (
|
||||
pointed_thing.ref:get_luaentity().physical
|
||||
or pointed_thing.ref:get_properties().physical
|
||||
)
|
||||
and pointed_thing.ref:get_luaentity().name ~= '__builtin:item'
|
||||
)
|
||||
)
|
||||
|
@ -2242,7 +2243,7 @@ end
|
|||
---@param self XBowsQuiver
|
||||
function XBowsQuiver.sfinv_register_page(self)
|
||||
sfinv.register_page('x_bows:quiver_page', {
|
||||
title = 'X Bows',
|
||||
title = S('X Bows'),
|
||||
get = function(this, player, context)
|
||||
local formspec = {
|
||||
---arrow
|
||||
|
@ -2299,7 +2300,7 @@ end
|
|||
---Register i3 page
|
||||
function XBowsQuiver.i3_register_page(self)
|
||||
i3.new_tab('x_bows_quiver_page', {
|
||||
description = 'X Bows',
|
||||
description = S('X Bows'),
|
||||
slots = true,
|
||||
formspec = function(player, data, fs)
|
||||
local formspec = {
|
||||
|
@ -2409,7 +2410,7 @@ function XBowsQuiver.ui_register_page(self)
|
|||
unified_inventory.register_button('x_bows:quiver_page', {
|
||||
type = 'image',
|
||||
image = "x_bows_bow_wood_charged.png",
|
||||
tooltip = 'X Bows',
|
||||
tooltip = S('X Bows'),
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -2428,8 +2429,12 @@ function XBowsQuiver.show_3d_quiver(self, player, props)
|
|||
end
|
||||
|
||||
if self.skinsdb then
|
||||
minetest.after(1, function()
|
||||
local textures = player_api.get_textures(player)
|
||||
minetest.after(1, function(v_player)
|
||||
if not v_player then
|
||||
return
|
||||
end
|
||||
|
||||
local textures = player_api.get_textures(v_player)
|
||||
|
||||
---cleanup
|
||||
for index, value in ipairs(textures) do
|
||||
|
@ -2445,15 +2450,15 @@ function XBowsQuiver.show_3d_quiver(self, player, props)
|
|||
player_textures = textures
|
||||
|
||||
if player_textures then
|
||||
if _props.is_empty and not self.quiver_empty_state[player:get_player_name()] then
|
||||
self.quiver_empty_state[player:get_player_name()] = true
|
||||
player_api.set_textures(player, player_textures)
|
||||
elseif not _props.is_empty and self.quiver_empty_state[player:get_player_name()] then
|
||||
self.quiver_empty_state[player:get_player_name()] = false
|
||||
player_api.set_textures(player, player_textures)
|
||||
if _props.is_empty and not self.quiver_empty_state[v_player:get_player_name()] then
|
||||
self.quiver_empty_state[v_player:get_player_name()] = true
|
||||
player_api.set_textures(v_player, player_textures)
|
||||
elseif not _props.is_empty and self.quiver_empty_state[v_player:get_player_name()] then
|
||||
self.quiver_empty_state[v_player:get_player_name()] = false
|
||||
player_api.set_textures(v_player, player_textures)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end, player)
|
||||
|
||||
return
|
||||
elseif self._3d_armor then
|
||||
|
@ -2526,8 +2531,12 @@ function XBowsQuiver.hide_3d_quiver(self, player)
|
|||
local player_textures
|
||||
|
||||
if self.skinsdb then
|
||||
minetest.after(1, function()
|
||||
local textures = player_api.get_textures(player)
|
||||
minetest.after(1, function(v_player)
|
||||
if not v_player then
|
||||
return
|
||||
end
|
||||
|
||||
local textures = player_api.get_textures(v_player)
|
||||
|
||||
---cleanup
|
||||
for index, value in ipairs(textures) do
|
||||
|
@ -2543,9 +2552,9 @@ function XBowsQuiver.hide_3d_quiver(self, player)
|
|||
player_textures = textures
|
||||
|
||||
if player_textures then
|
||||
player_api.set_textures(player, player_textures)
|
||||
player_api.set_textures(v_player, player_textures)
|
||||
end
|
||||
end)
|
||||
end, player)
|
||||
|
||||
return
|
||||
elseif self._3d_armor then
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--[[
|
||||
X Bows. Adds bow and arrows with API.
|
||||
Copyright (C) 2023 SaKeL <juraj.vajda@gmail.com>
|
||||
Copyright (C) 2024 SaKeL
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
|
4
init.lua
4
init.lua
|
@ -1,6 +1,6 @@
|
|||
--[[
|
||||
X Bows. Adds bow and arrows with API.
|
||||
Copyright (C) 2023 SaKeL <juraj.vajda@gmail.com>
|
||||
Copyright (C) 2024 SaKeL
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -126,7 +126,7 @@ minetest.register_allow_player_inventory_action(function(player, action, invento
|
|||
else
|
||||
return 0
|
||||
end
|
||||
elseif action == 'move' and inventory_info.from_list == 'x_bows:arrow_inv' then
|
||||
elseif action == 'move' and inventory_info.from_list == 'x_bows:arrow_inv' and inventory_info.to_list ~= 'x_bows:quiver_inv' then
|
||||
local stack = inventory:get_stack(inventory_info.from_list, inventory_info.from_index)
|
||||
|
||||
if minetest.get_item_group(stack:get_name(), 'arrow') ~= 0 then
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--[[
|
||||
X Bows. Adds bow and arrows with API.
|
||||
Copyright (C) 2023 SaKeL <juraj.vajda@gmail.com>
|
||||
Copyright (C) 2024 SaKeL
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -8,6 +8,7 @@ Charge Time=
|
|||
Faster Arrows=
|
||||
Arrow Damage=
|
||||
No Ammo=
|
||||
X Bows=
|
||||
Arrows=
|
||||
Quiver=
|
||||
Empty=
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
# textdomain: x_bows
|
||||
Critical Arrow Chance=Ŝanco de profunda trafo
|
||||
Strength=Forteco
|
||||
Allowed ammunition=Uzeblaj pafaĵoj
|
||||
none=neniu
|
||||
Damage=Forteco
|
||||
Charge Time=Tirprokrasto
|
||||
Faster Arrows=Plirapidaj sagoj
|
||||
Arrow Damage=Forteco de sago
|
||||
No Ammo=Neniu pafaĵo
|
||||
X Bows=X Pafarkoj
|
||||
Arrows=Sagoj
|
||||
Quiver=Sagujo
|
||||
Empty=Malplena
|
||||
Wooden Bow=Ligna pafarko
|
||||
Arrow Wood=Ligna sago
|
||||
Arrow Stone=Ŝtona sago
|
||||
Arrow Bronze=Bronza sago
|
||||
Arrow Steel=Ŝtala sago
|
||||
Arrow Mese=Mesea sago
|
||||
Arrow Diamond=Diamanta sago
|
||||
Target=Pafcelo
|
|
@ -8,6 +8,7 @@ Charge Time=Doba nabíjania
|
|||
Faster Arrows=Rýchlejšie šípy
|
||||
Arrow Damage=Poškodenie šípom
|
||||
No Ammo=Žiadne strelivo
|
||||
X Bows=
|
||||
Arrows=Šípy
|
||||
Quiver=Púzdro
|
||||
Empty=Prázdne
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--[[
|
||||
X Bows. Adds bow and arrows with API.
|
||||
Copyright (C) 2023 SaKeL <juraj.vajda@gmail.com>
|
||||
Copyright (C) 2024 SaKeL
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--[[
|
||||
X Bows. Adds bow and arrows with API.
|
||||
Copyright (C) 2023 SaKeL <juraj.vajda@gmail.com>
|
||||
Copyright (C) 2024 SaKeL
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Deploy code to CDB
|
||||
* Copyright (C) 2023 SaKeL <juraj.vajda@gmail.com>
|
||||
* Copyright (C) 2024 SaKeL
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
Ŝarĝante…
Reference in New Issue