Merge pull request #4 from Niklp09/main

Minor cleanup & texture optimization
This commit is contained in:
Alexsandro Percy 2024-10-05 15:57:12 -03:00 committed by GitHub
commit 0f2bc0e241
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
34 changed files with 23 additions and 23 deletions

9
.luacheckrc Normal file
View File

@ -0,0 +1,9 @@
unused_args = false
allow_defined_top = true
read_globals = {
"minetest",
"airutils",
"vector",
"DIR_DELIM",
}

View File

@ -20,11 +20,11 @@ minetest.register_craftitem("ju52:ju52", {
if pointed_thing.type ~= "node" then
return
end
local pointed_pos = pointed_thing.under
--local node_below = minetest.get_node(pointed_pos).name
--local nodedef = minetest.registered_nodes[node_below]
pointed_pos.y=pointed_pos.y+3.0
local new_ju52 = minetest.add_entity(pointed_pos, "ju52:ju52")
if new_ju52 and placer then
@ -45,7 +45,7 @@ minetest.register_craftitem("ju52:ju52", {
-- crafting
--
if not minetest.settings:get_bool('ju52.disable_craftitems') and minetest.get_modpath("default") then
--[[minetest.register_craft({
minetest.register_craft({
output = "ju52:wings",
recipe = {
{"wool:white", "farming:string", "wool:white"},
@ -67,5 +67,5 @@ if not minetest.settings:get_bool('ju52.disable_craftitems') and minetest.get_mo
{"ju52:wings",},
{"ju52:body",},
}
})]]--
})
end

View File

@ -22,17 +22,17 @@ initial_properties = {
"airutils_metal.png", --roda trem
},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('ju52:cabin_interactor',{
@ -46,12 +46,12 @@ minetest.register_entity('ju52:cabin_interactor',{
},
dist_moved = 0,
max_hp = 65535,
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
@ -73,7 +73,7 @@ minetest.register_entity('ju52:cabin_interactor',{
if parent_self.co_pilot and parent_self._have_copilot then
copilot_name = parent_self.co_pilot
end
if name == parent_self.driver_name then
local itmstck=clicker:get_wielded_item()
local item_name = ""

View File

@ -8,7 +8,7 @@ function ju52.paint_formspec(name)
basic_form = basic_form.."image_button[0.5,0.5;3,1;ju52_p_lufthansa.png;lufthansa;Lufthansa;false;true;]"
basic_form = basic_form.."image_button[0.5,1.6;3,1;ju52_p_lufthansa.png;lufthansa2;Lufthansa 2;false;true;]"
basic_form = basic_form.."image_button[0.5,2.7;3,1;ju52_p_luftwaffe.png;luftwaffe;Luftwaffe;false;true;]"
--basic_form = basic_form.."image_button[1,4.3;3,1;ju52_white.png^[multiply:#2b2b2b;black;Black;false;true;]"
--basic_form = basic_form.."image_button[1,4.3;3,1;ju52_white.png^[multiply:#2b2b2b;black;Black;false;true;]"
minetest.show_formspec(name, "ju52:paint", basic_form)
end
@ -23,7 +23,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
local ent = plane_obj:get_luaentity()
if ent then
if fields.lufthansa then ent._skin = "ju52_skin_lufthansa.png" end
if fields.lufthansa2 then ent._skin = "ju52_skin_lufthansa2.png" end
if fields.luftwaffe then ent._skin = "ju52_skin_luftwaffe.png" end

View File

@ -48,8 +48,6 @@ end
function ju52.destroy_parts_method(self)
if self.wheels then self.wheels:remove() end
if self.cabin then self.cabin:remove() end
local pos = self.object:get_pos()
end
function ju52.step_additional_function(self)
@ -69,7 +67,7 @@ function ju52.step_additional_function(self)
local energy_indicator_angle = airutils.get_gauge_angle((self._max_fuel - self._energy)/3) - 90
self.object:set_bone_position("fuel", {x=0, y=-40.6, z=15.35}, {x=0, y=(energy_indicator_angle+180), z=0})
self.object:set_bone_position("compass", {x=0, y=-40.55, z=18.2}, {x=0, y=(math.deg(self._yaw)), z=0})
self.object:set_bone_position("compass_plan", {x=0, y=-40.4, z=18.2}, {x=0, y=airutils.get_adf_angle(self, pos), z=0})
@ -274,13 +272,6 @@ dofile(minetest.get_modpath("ju52") .. DIR_DELIM .. "entities.lua")
-- items
--
settings = Settings(minetest.get_worldpath() .. "/ju52.conf")
local function fetch_setting(name)
local sname = name
return settings and settings:get(sname) or minetest.settings:get(sname)
end
local old_entities = {"ju52:seat_base","ju52:engine"}
for _,entity_name in ipairs(old_entities) do
minetest.register_entity(":"..entity_name, {

View File

@ -1,6 +1,6 @@
name = ju52
depends = airutils
optional_depends = compassgps,climate_api,biofuel
optional_depends = compassgps,climate_api,biofuel,default
author = APercy
description = Adds a Ju52 airplane
title = Ju52

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 636 B

BIN
textures/ju52_compass_plan.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 79 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 11 KiB

BIN
textures/ju52_skin_lufthansa2.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 201 B