local module = class("moduleAvatarHeight", G_UIModuleBase)
local _AvatarTpl = L_GameTpl:getWardrobeAvatarTpl()

function module.bind()
  return {
    value_sliderMin = 90,
    value_sliderMax = 110,
    value_slider = 100,
    heightList = {
      moduleName = "pages/MOD/Module/modHeightSelectItem"
    }
  }
end

function module.methods()
  return {
    sliderChange = function(self, value)
      local heightList = _AvatarTpl:getAllAvatarIdByType(L_ModStore.modType.height, L_ModStore:getModData().Sex)
      for i = 1, #heightList do
        local heightId = heightList[i]
        local heightTpl = _AvatarTpl:getTplById(heightId)
        local height = _AvatarTpl:getHeight(heightTpl)
        if math.abs(height - value) <= 0.5 and height ~= value then
          self.bind.value_slider = height
          return
        end
      end
      L_ModStore:setIsChanged(true)
    end
  }
end

function module:refreshUI()
end

function module:open()
end

function module:close()
end

function module:setModuleData()
end

return module
