Skip to content

Commit

Permalink
临时修复代码
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo0812 committed Nov 9, 2023
1 parent 4f8d695 commit 91e245c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions script/store/db_property.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ local function on_db_prop_remove(primary_id, sheet, db_key)
event_mgr:notify_listener("on_db_prop_remove", primary_id, sheet, db_key)
end

local function db_prop_op_sheet_key(class, sheet, sheetkey, sheetprimary)
local function db_prop_op_sheet_key(class, sheet, sheetkey, sheetroot, sheetprimary)
class["flush_sheet_db"] = function(self, values)
on_db_prop_update(self[sheetroot][sheetprimary], sheet, self[sheetkey], values)
end
end

local function db_root_prop_op_sheet_key(class, sheet, sheetkey, sheetprimary)
class["load_" .. sheet .. "_db"] = function(self, primary_key, data)
self[sheetkey] = ""
self[sheetprimary] = primary_key
Expand Down Expand Up @@ -190,7 +196,9 @@ function db_property(class, sheet, root)
store_objects = property_accessor_objects
}
if root then
db_prop_op_sheet_key(prop.__class, sheet, prop.__key, prop.__primary)
db_root_prop_op_sheet_key(prop.__class, sheet, prop.__key, prop.__primary)
else
db_prop_op_sheet_key(prop.__class, sheet, prop.__key, prop.__root, prop.__primary)
end
return prop
end

0 comments on commit 91e245c

Please sign in to comment.