diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/sceneedit.lua b/code/ryzom/client/data/gamedev/interfaces_v3/sceneedit.lua index e0285da86..71777d8a1 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/sceneedit.lua +++ b/code/ryzom/client/data/gamedev/interfaces_v3/sceneedit.lua @@ -32,13 +32,15 @@ function SceneEditor:init(scene_id, form_url, translations, icons_url) self.T = translations end -function SceneEditor:reset() +function SceneEditor:reset(no_get_html) self.Shapes = {} self.Groups = {} self.LastEditedGroup = nil self.HaveUpdate = nil runAH(nil, "remove_shapes", "") - self:get_html("Reseted") + if no_get_html == true then + self:get_html("Reseted") + end end function SceneEditor:show_menu() @@ -364,24 +366,24 @@ end function SceneEditor:editGroup(group) if self.LastEditedGroup then - self:removeGroup(self.LastEditedGroup) + self:removeGroup(self.LastEditedGroup, true) self:addGroup(self.LastEditedGroup, 0, true, false) end - self:removeGroup(group); + self:removeGroup(group, true); self:addGroup(group, 0, true, true) self.LastEditedGroup = group end -function SceneEditor:addFromDb(group, db_id, json_shape) +function SceneEditor:addFromDb(group, db_id, json_shape, edit) shape = Json.decode(json_shape) shape.db_id = db_id shape.group = group shape.modified = "" - if hide then - shape_id = addShape(shape.file, shape.pos[1], shape.pos[2], shape.pos[3], "user", 1, false, "", "") - else + if edit then shape_id = addShape(shape.file, shape.pos[1], shape.pos[2], shape.pos[3], "user", 1, true, "", "SceneEditor:show_menu()") + else + shape_id = addShape(shape.file, shape.pos[1], shape.pos[2], shape.pos[3], "user", 1, true, "", "") end rotateShape(shape_id, tostring(shape.rot[1]), tostring(shape.rot[2]), tostring(shape.rot[3])) setupShape(shape_id, shape.setup) @@ -393,7 +395,7 @@ function SceneEditor:addFromDb(group, db_id, json_shape) end -function SceneEditor:removeGroup(group) +function SceneEditor:removeGroup(group, no_get_html) if self.Groups[group] == nil then return end @@ -404,6 +406,7 @@ function SceneEditor:removeGroup(group) deleteShape(shape_id) end end + self.Groups[group] = nil if self.LastEditedGroup == group then self.LastEditedGroup = nil @@ -412,7 +415,9 @@ function SceneEditor:removeGroup(group) ui.active=false end end - self:get_html("Group Removed") + if no_get_html == nil then + self:get_html("Group Removed") + end end function SceneEditor:enc64(data) @@ -479,20 +484,7 @@ function SceneEditor:show_shape_list() end end - -function SceneEditor:get_html_section(message, color) - return '
'..message..' |