#include "../avatarui_common.lua"

Avatar.CharItemViewModel = function()
    local vm =
    {
        avatarVM = nil,
        charModel = nil,

        getScale = function(self)
            local focusCaptureScale = self.charModel.isFocused and (1 + 62 * self.view.parent:_getLerpProgress() / 128) or 1
            local prevChar = self.avatarVM.prevFocusedChar
            local focusLostScale = self.charModel == prevChar and (1 + 62 * (1 - self.view.parent:_getLerpProgress()) / 128) or 1

            return focusCaptureScale * focusLostScale
        end
    }

    return vm
end