mirror of
https://github.com/raymoo/progress_tree.git
synced 2025-07-02 00:00:43 +02:00
Methodify
This commit is contained in:
6
init.lua
6
init.lua
@ -96,6 +96,9 @@ function progress_tree.new_player_data(tree, learned)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
tree_methods.new_player_data = progress_tree.new_player_data
|
||||||
|
|
||||||
|
|
||||||
-- Serialization to a string
|
-- Serialization to a string
|
||||||
function pd_methods.serialize(self)
|
function pd_methods.serialize(self)
|
||||||
return minetest.serialize(self.learned)
|
return minetest.serialize(self.learned)
|
||||||
@ -112,6 +115,9 @@ function progress_tree.deserialize_player_data(tree, learned_string)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
tree_methods.deserialize_player_data = progress_tree.deserialize_player_data
|
||||||
|
|
||||||
|
|
||||||
-- Tells whether the tech is already learned
|
-- Tells whether the tech is already learned
|
||||||
function pd_methods.knows(self, name)
|
function pd_methods.knows(self, name)
|
||||||
return self.learned[name] == true -- Want false when not in
|
return self.learned[name] == true -- Want false when not in
|
||||||
|
Reference in New Issue
Block a user