-- Defines for specially handled finish/palettes
--
STORE_VEHICLE_HERO_MATTE = 0
STORE_VEHICLE_HERO_GLOSS = 1
STORE_VEHICLE_IRIDESCENT = 2
STORE_VEHICLE_PEARLESCENT = 3
STORE_VEHICLE_CANDY = 4
function vdo_grid_button_layered_init()
end
function vdo_grid_button_layered_cleanup()
end
-- Inherited from Vdo_base_object
Vdo_grid_button_layered = Vdo_base_object:new_base()
-- Sets the check box
function Vdo_grid_button_layered:set_check_box(is_checked,is_locked)
end
--sets the icon for the grid button
function Vdo_grid_button_layered:set_icon(swatch)
local base_h = Vdo_base_object:new("base", self.handle)
local fres_h = Vdo_base_object:new("fres", self.handle)
local irr_h = Vdo_base_object:new("irr", self.handle)
local refl_h = Vdo_base_object:new("refl", self.handle)
local sky_h = Vdo_base_object:new("sky", self.handle)
local spec_h = Vdo_base_object:new("spec", self.handle)
-- Hide everything except base until we need it
fres_h:set_visible(false)
irr_h:set_visible(false)
refl_h:set_visible(false)
sky_h:set_visible(false)
spec_h:set_visible(false)
-- Common: every color hase a base color
base_h:set_color(swatch.base_r, swatch.base_g, swatch.base_b)
-- Are we a color type other than matte?
if swatch.palette_type == STORE_VEHICLE_HERO_GLOSS then
-- Gloss = spec, reflection
spec_h:set_visible(true)
spec_h:set_color(swatch.spec_col_r, swatch.spec_col_g, swatch.spec_col_b)
spec_h:set_alpha(swatch.spec_alpha)
refl_h:set_visible(true)
refl_h:set_color(swatch.base_r, swatch.base_g, swatch.base_b)
refl_h:set_alpha(.2)--swatch.refl_alpha)
elseif swatch.palette_type == STORE_VEHICLE_PEARLESCENT then
-- Pearlescent = spec, reflection, fresnel
spec_h:set_visible(true)
spec_h:set_color(swatch.spec_col_r, swatch.spec_col_g, swatch.spec_col_b)
spec_h:set_alpha(swatch.spec_alpha)
refl_h:set_visible(true)
refl_h:set_color(swatch.base_r, swatch.base_g, swatch.base_b)
refl_h:set_alpha(.6)--swatch.refl_alpha)
fres_h:set_visible(true)
fres_h:set_color(swatch.fres_col_r, swatch.fres_col_g, swatch.fres_col_b)
fres_h:set_alpha(1)
elseif swatch.palette_type == STORE_VEHICLE_IRIDESCENT then
-- Irridescent = spec, reflection, fresnel, irridescence
spec_h:set_visible(true)
spec_h:set_color(swatch.spec_col_r, swatch.spec_col_g, swatch.spec_col_b)
spec_h:set_alpha(swatch.spec_alpha)
refl_h:set_visible(true)
refl_h:set_color(swatch.base_r, swatch.base_g, swatch.base_b)
refl_h:set_alpha(.4)--swatch.refl_alpha)
fres_h:set_visible(true)
fres_h:set_color(swatch.fres_col_r, swatch.fres_col_g, swatch.fres_col_b)
fres_h:set_alpha(1)
irr_h:set_visible(true)
irr_h:set_color(swatch.spec_col_r, swatch.spec_col_g, swatch.spec_col_b)
elseif swatch.palette_type == STORE_VEHICLE_CANDY then
spec_h:set_visible(true)
spec_h:set_color(swatch.spec_col_r, swatch.spec_col_g, swatch.spec_col_b)
spec_h:set_alpha(swatch.spec_alpha)
refl_h:set_visible(true)
refl_h:set_color(swatch.base_r, swatch.base_g, swatch.base_b)
refl_h:set_alpha(.3)--swatch.refl_alpha)
end
--[[--base_h:set_image(swatch.icon)
local base_adj = 1.5
-- Setup the colors
base_h:set_color(swatch.base_r * base_adj, swatch.base_g * base_adj, swatch.base_b * base_adj)
-- if swatch.is_glass == true then
-- base_h:set_image("ui_bms_veh_glass")
-- fresh_h:set_visible(false)
-- irr_h:set_visible(false)
-- refl_h:set_visible(false)
-- sky_h:set_visible(false)
-- spec_h:set_visible(false)
-- return
-- end
if swatch.is_glass == true then
--vint_set_property(icon_h, "scale", 0.86, 0.86)
--vint_set_property(icon_h, "anchor", -1, -1)
--base, make this dark
base_h:set_image("ui_menu_veh_glass") -- dark
base_h:set_alpha(0.4)
base_h:set_color(0,0,0)
base_h:set_anchor(3,3)
--make the irr channel be the tinted color of glass
irr_h:set_image("ui_menu_veh_glass") --normal
irr_h:set_alpha(1)
irr_h:set_color(swatch.base_r * base_adj, swatch.base_g * base_adj, swatch.base_b * base_adj)
--make reflection turn on, be normal color to simulate real reflection
refl_h:set_image("ui_menu_veh_glass")
refl_h:set_alpha(0.62)
refl_h:set_color(1,1,1)
--turn off other shit
fres_h:set_visible(false)
sky_h:set_visible(false)
spec_h:set_visible(false)
return
end
base_h:set_image("ui_menu_veh_pnt_base")
irr_h:set_image("ui_menu_veh_pnt_base")
refl_h:set_image("ui_menu_veh_pnt_base")
--Setup the alphas
if swatch.spec_alpha ~= nil then
spec_h:set_alpha(swatch.spec_alpha) --* 0.8)
spec_h:set_color(swatch.spec_col_r, swatch.spec_col_g, swatch.spec_col_b)
irr_h:set_color(swatch.spec_col_r, swatch.spec_col_g, swatch.spec_col_b)
else
spec_h:set_alpha(0)
end
if swatch.refl ~= nil then
refl_h:set_alpha(swatch.refl)
else
refl_h:set_alpha(0)
end
if swatch.sky_h ~= nil then
sky_h:set_alpha(swatch.refl)-- * 0.2)
else
sky_h:set_alpha(0)
end
if swatch.fres_con ~= nil then
fres_h:set_alpha(swatch.fres_con)-- * 0.5)
fres_h:set_color(swatch.fres_col_r, swatch.fres_col_g, swatch.fres_col_b)
sky_h:set_color(swatch.fres_col_r, swatch.fres_col_g, swatch.fres_col_b)
refl_h:set_color(swatch.fres_col_r, swatch.fres_col_g, swatch.fres_col_b)
else
fres_h:set_alpha(0)
end
if swatch.fres_con == 0 then
irr_h:set_visible(false)
else
irr_h:set_alpha(0)
end ]]--
end
--sets the icon for the grid button using a crc of the image name
--Used by the mp badge selection screen
function Vdo_grid_button_layered:set_icon_crc(new_icon_crc)
local icon = Vdo_base_object:new("grid_icon", self.handle)
icon:set_property("image_crc", new_icon_crc)
end
-- Sets the width of the grid button
function Vdo_grid_button_layered:set_size(width,height)
local button_grp = Vdo_base_object:new("button_grp", self.handle)
local button_grp_w, button_grp_h = button_grp:get_screen_size()
button_grp:set_scale(width/button_grp_w, height/button_grp_h)
end
-- Sets the highlighted state of the grid button to on or off
function Vdo_grid_button_layered:set_highlight(is_highlighted)
end
function Vdo_grid_button_layered:set_highlight_color()
end