|
|
|
@ -401,7 +401,8 @@ function r2:initTypeUI(instance)
|
|
|
|
|
|
|
|
|
|
if tostring(instance.TypeNPC)=="-1" then
|
|
|
|
|
-- TypeNPC
|
|
|
|
|
r2:setNpcAttribute(instance.InstanceId, "TypeNPC", place)
|
|
|
|
|
debugInfo("FIXME: TypeNPC is not initialized, it should be a local value only as it's a convenience switch, verify against older versions");
|
|
|
|
|
r2.requestSetGhostNode(instance.InstanceId, "TypeNPC", place)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -1245,7 +1246,7 @@ function r2:updateSex()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- UPDATE SEX ---------------------------------------------------------------------------------
|
|
|
|
|
function r2:updateType()
|
|
|
|
|
function r2:updateType(existingAction)
|
|
|
|
|
|
|
|
|
|
local selection = r2:getSelectedInstance()
|
|
|
|
|
if selection == nil then return end
|
|
|
|
@ -1256,7 +1257,9 @@ function r2:updateType()
|
|
|
|
|
local base = r2.sheetTypeCB[typeNPC].Id
|
|
|
|
|
local typeElement = r2.getPaletteElement(base)
|
|
|
|
|
|
|
|
|
|
if not existingAction then
|
|
|
|
|
r2.requestNewAction(i18n.get("uiR2EDUpdateNpcTypeAction"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- TypeNPC
|
|
|
|
|
r2:setNpcAttribute(selection.InstanceId, "TypeNPC", typeNPC)
|
|
|
|
@ -1350,8 +1353,10 @@ function r2:updateType()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if not existingAction then
|
|
|
|
|
r2.requestEndAction()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- UPDATE FUCNTION ----------------------------------------------------------------------------
|
|
|
|
|
function r2:updateFunction()
|
|
|
|
@ -1368,7 +1373,7 @@ function r2:updateFunction()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- UPDATE LEVEL ------------------------------------------------------------------------------
|
|
|
|
|
r2.updateLevel = function(value)
|
|
|
|
|
r2.updateLevel = function(value, existingAction)
|
|
|
|
|
|
|
|
|
|
local selection = r2:getSelectedInstance()
|
|
|
|
|
assert(selection)
|
|
|
|
@ -1380,7 +1385,9 @@ r2.updateLevel = function(value)
|
|
|
|
|
local firstPart = string.sub(sheet, 1, s-2)
|
|
|
|
|
local newSheet = firstPart .. level .. ".creature"
|
|
|
|
|
|
|
|
|
|
if not existingAction then
|
|
|
|
|
r2.requestNewAction(i18n.get("uiR2EDUpdateNpcLevelAction"))
|
|
|
|
|
end
|
|
|
|
|
r2:setNpcAttribute(selection.InstanceId, "Sheet", newSheet)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|