player: 3d_armor without skins

This commit is contained in:
Alexander Weber 2017-06-30 00:30:13 +02:00
parent 4240d1d0f8
commit 297fc06a10

View File

@ -157,24 +157,26 @@ local function update_page(state)
else else
state:get("skinlicense"):setText("") state:get("skinlicense"):setText("")
end end
end
state.param.skins_list = skins.get_skinlist("player:"..name, true) -- set the skins list
local cur_skin = skins.get_player_skin(player_obj) state.param.skins_list = skins.get_skinlist("player:"..name, true)
local skins_grid_data = {} local cur_skin = skins.get_player_skin(player_obj)
local grid_skins = state:get("skins_grid") local skins_grid_data = {}
for idx, skin in ipairs(state.param.skins_list) do local grid_skins = state:get("skins_grid")
table.insert(skins_grid_data, { for idx, skin in ipairs(state.param.skins_list) do
image = skin:get_preview(), table.insert(skins_grid_data, {
tooltip = skin:get_meta_string("name"), image = skin:get_preview(),
is_button = true, tooltip = skin:get_meta_string("name"),
size = { w = 0.87, h = 1.30 } is_button = true,
}) size = { w = 0.87, h = 1.30 }
if not state.param.skins_initial_page_adjusted and skin:get_key() == cur_skin:get_key() then })
grid_skins:setFirstVisible(idx - 19) --8x5 (grid size) / 2 -1 if not state.param.skins_initial_page_adjusted and skin:get_key() == cur_skin:get_key() then
state.param.skins_initial_page_adjusted = true grid_skins:setFirstVisible(idx - 19) --8x5 (grid size) / 2 -1
state.param.skins_initial_page_adjusted = true
end
end end
grid_skins:setList(skins_grid_data)
end end
grid_skins:setList(skins_grid_data)
end end
local function move_item_to_armor(state, item) local function move_item_to_armor(state, item)