Fixed stores in gui

This commit is contained in:
Cooldude2606
2019-10-15 22:37:48 +01:00
parent 258ca8dbde
commit 3b5c69cfd1
103 changed files with 213 additions and 243 deletions

View File

@@ -37,8 +37,7 @@ local ElemButton = {
_prototype=Prototype.extend{
on_element_update = Prototype.event,
on_store_update = Prototype.event,
add_store = Prototype.store(false,store_update),
add_sync_store = Prototype.store(true,store_update)
add_store = Prototype.store(store_update)
}
}
@@ -56,8 +55,7 @@ function ElemButton.new_elem_button(name)
end
if self.store then
local category = self.categorize and self.categorize(element) or nil
local value = self:get_store(category)
local value = self:get_store(element)
if value then element.elem_value = value end
end
end)
@@ -67,8 +65,7 @@ function ElemButton.new_elem_button(name)
local value = element.elem_value
if self.store then
local category = self.categorize and self.categorize(element) or value
self:set_store(category,value)
self:set_store(element,value)
else
self:raise_event('on_element_update',event.player,element,value)