City_load_images = { 

--[[
	["none"] = {
		pegs = { "ui_mm_load_temp_01", "ui_mm_load_temp_02", "ui_mm_load_temp_03" },
		img1 = "ui_mainmenu_load_temp_01.tga", img2 = "ui_mainmenu_load_temp_02.tga", img3 = "ui_mainmenu_load_temp_03.tga"
	},
]]
	
	--THIRD STREET SAINTS
	["tss01"] = {
		pegs = { "ui_mm_load_tss01" },
		img1 = "ui_mainmenu_load_tss01_01.tga", img2 = "ui_mainmenu_load_tss01_02.tga", img3 = "ui_mainmenu_load_tss01_03.tga"
	},
	
	["tss02"] = {
		pegs = { "ui_mm_load_tss02" },
		img1 = "ui_mainmenu_load_tss02_01.tga", img2 = "ui_mainmenu_load_tss02_02.tga", img3 = "ui_mainmenu_load_tss02_03.tga"
	},
	
	["tss03"] = {
		pegs = { "ui_mm_load_tss03" },
		img1 = "ui_mainmenu_load_tss03_01.tga", img2 = "ui_mainmenu_load_tss03_02.tga", img3 = "ui_mainmenu_load_tss03_03.tga"
	},
	
	["tss04"] = {
		pegs = { "ui_mm_load_tss04" },
		img1 = "ui_mainmenu_load_tss04_01.tga", img2 = "ui_mainmenu_load_tss04_02.tga", img3 = "ui_mainmenu_load_tss04_03.tga"
	},
	
	--BROTHERHOOD
	["bh01"] = {
		pegs = { "ui_mm_load_bh01" },
		img1 = "ui_mainmenu_load_bh01_01.tga", img2 = "ui_mainmenu_load_bh01_02.tga", img3 = "ui_mainmenu_load_bh01_03.tga"
	},
	
	["bh02"] = {
		pegs = { "ui_mm_load_bh02" },
		img1 = "ui_mainmenu_load_bh02_01.tga", img2 = "ui_mainmenu_load_bh02_02.tga", img3 = "ui_mainmenu_load_bh02_03.tga"
	},
	
	["bh03"] = {
		pegs = { "ui_mm_load_bh03" },
		img1 = "ui_mainmenu_load_bh03_01.tga", img2 = "ui_mainmenu_load_bh03_02.tga", img3 = "ui_mainmenu_load_bh03_03.tga"
	},
	
	["bh04"] = {
		pegs = { "ui_mm_load_bh04" },
		img1 = "ui_mainmenu_load_bh04_01.tga", img2 = "ui_mainmenu_load_bh04_02.tga", img3 = "ui_mainmenu_load_bh04_03.tga"
	},
	
	["bh05"] = {
		pegs = { "ui_mm_load_bh05" },
		img1 = "ui_mainmenu_load_bh05_01.tga", img2 = "ui_mainmenu_load_bh05_02.tga", img3 = "ui_mainmenu_load_bh05_03.tga"
	},
	
	["bh06"] = {
		pegs = { "ui_mm_load_bh06" },
		img1 = "ui_mainmenu_load_bh06_01.tga", img2 = "ui_mainmenu_load_bh06_02.tga", img3 = "ui_mainmenu_load_bh06_03.tga"
	},
	
	["bh07"] = {
		pegs = { "ui_mm_load_bh07" },
		img1 = "ui_mainmenu_load_bh07_01.tga", img2 = "ui_mainmenu_load_bh07_02.tga", img3 = "ui_mainmenu_load_bh07_03.tga"
	},
	
	["bh08"] = {
		pegs = { "ui_mm_load_bh08" },
		img1 = "ui_mainmenu_load_bh08_01.tga", img2 = "ui_mainmenu_load_bh08_02.tga", img3 = "ui_mainmenu_load_bh08_03.tga"
	},
	
	["bh09"] = {
		pegs = { "ui_mm_load_bh09" },
		img1 = "ui_mainmenu_load_bh09_01.tga", img2 = "ui_mainmenu_load_bh09_02.tga", img3 = "ui_mainmenu_load_bh09_03.tga"
	},
	
	["bh10"] = {
		pegs = { "ui_mm_load_bh10" },
		img1 = "ui_mainmenu_load_bh10_01.tga", img2 = "ui_mainmenu_load_bh10_02.tga", img3 = "ui_mainmenu_load_bh10_03.tga"
	},
	
	["bh11"] = {
		pegs = { "ui_mm_load_bh11" },
		img1 = "ui_mainmenu_load_bh11_01.tga", img2 = "ui_mainmenu_load_bh11_02.tga", img3 = "ui_mainmenu_load_bh11_03.tga"
	},
	
	
	--RONIN
	["rn01"] = {
		pegs = { "ui_mm_load_rn01" },
		img1 = "ui_mainmenu_load_rn01_01.tga", img2 = "ui_mainmenu_load_rn01_02.tga", img3 = "ui_mainmenu_load_rn01_03.tga"
	},
	
	["rn02"] = {
		pegs = { "ui_mm_load_rn02" },
		img1 = "ui_mainmenu_load_rn02_01.tga", img2 = "ui_mainmenu_load_rn02_02.tga", img3 = "ui_mainmenu_load_rn02_03.tga"
	},
	
	["rn03"] = {
		pegs = { "ui_mm_load_rn03" },
		img1 = "ui_mainmenu_load_rn03_01.tga", img2 = "ui_mainmenu_load_rn03_02.tga", img3 = "ui_mainmenu_load_rn03_03.tga"
	},
	
	["rn04"] = {
		pegs = { "ui_mm_load_rn04" },
		img1 = "ui_mainmenu_load_rn04_01.tga", img2 = "ui_mainmenu_load_rn04_02.tga", img3 = "ui_mainmenu_load_rn04_03.tga"
	},
	
	["rn05"] = {
		pegs = { "ui_mm_load_rn05" },
		img1 = "ui_mainmenu_load_rn05_01.tga", img2 = "ui_mainmenu_load_rn05_02.tga", img3 = "ui_mainmenu_load_rn05_03.tga"
	},
	
	["rn06"] = {
		pegs = { "ui_mm_load_rn06" },
		img1 = "ui_mainmenu_load_rn06_01.tga", img2 = "ui_mainmenu_load_rn06_02.tga", img3 = "ui_mainmenu_load_rn06_03.tga"
	},
	
	["rn07"] = {
		pegs = { "ui_mm_load_rn07" },
		img1 = "ui_mainmenu_load_rn07_01.tga", img2 = "ui_mainmenu_load_rn07_02.tga", img3 = "ui_mainmenu_load_rn07_03.tga"
	},
	
	["rn08"] = {
		pegs = { "ui_mm_load_rn08" },
		img1 = "ui_mainmenu_load_rn08_01.tga", img2 = "ui_mainmenu_load_rn08_02.tga", img3 = "ui_mainmenu_load_rn08_03.tga"
	},
	
	["rn09"] = {
		pegs = { "ui_mm_load_rn09" },
		img1 = "ui_mainmenu_load_rn09_01.tga", img2 = "ui_mainmenu_load_rn09_02.tga", img3 = "ui_mainmenu_load_rn09_03.tga"
	},
	
	["rn10"] = {
		pegs = { "ui_mm_load_rn10" },
		img1 = "ui_mainmenu_load_rn10_01.tga", img2 = "ui_mainmenu_load_rn10_02.tga", img3 = "ui_mainmenu_load_rn10_03.tga"
	},
	
	["rn11"] = {
		pegs = { "ui_mm_load_rn11" },
		img1 = "ui_mainmenu_load_rn11_01.tga", img2 = "ui_mainmenu_load_rn11_02.tga", img3 = "ui_mainmenu_load_rn11_03.tga"
	},
	
	
	--SAMEDI
	["ss01"] = {
		pegs = { "ui_mm_load_ss01" },
		img1 = "ui_mainmenu_load_ss01_01.tga", img2 = "ui_mainmenu_load_ss01_02.tga", img3 = "ui_mainmenu_load_ss01_03.tga"
	},
	
	["ss02"] = {
		pegs = { "ui_mm_load_ss02" },
		img1 = "ui_mainmenu_load_ss02_01.tga", img2 = "ui_mainmenu_load_ss02_02.tga", img3 = "ui_mainmenu_load_ss02_03.tga"
	},
	
	["ss03"] = {
		pegs = { "ui_mm_load_ss03" },
		img1 = "ui_mainmenu_load_ss03_01.tga", img2 = "ui_mainmenu_load_ss03_02.tga", img3 = "ui_mainmenu_load_ss03_03.tga"
	},
	
	["ss04"] = {
		pegs = { "ui_mm_load_ss04" },
		img1 = "ui_mainmenu_load_ss04_01.tga", img2 = "ui_mainmenu_load_ss04_02.tga", img3 = "ui_mainmenu_load_ss04_03.tga"
	},
	
	["ss05"] = {
		pegs = { "ui_mm_load_ss05" },
		img1 = "ui_mainmenu_load_ss05_01.tga", img2 = "ui_mainmenu_load_ss05_02.tga", img3 = "ui_mainmenu_load_ss05_03.tga"
	},
	
	["ss06"] = {
		pegs = { "ui_mm_load_ss06" },
		img1 = "ui_mainmenu_load_ss06_01.tga", img2 = "ui_mainmenu_load_ss06_02.tga", img3 = "ui_mainmenu_load_ss06_03.tga"
	},
	
	["ss07"] = {
		pegs = { "ui_mm_load_ss07" },
		img1 = "ui_mainmenu_load_ss07_01.tga", img2 = "ui_mainmenu_load_ss07_02.tga", img3 = "ui_mainmenu_load_ss07_03.tga"
	},
	
	["ss08"] = {
		pegs = { "ui_mm_load_ss08" },
		img1 = "ui_mainmenu_load_ss08_01.tga", img2 = "ui_mainmenu_load_ss08_02.tga", img3 = "ui_mainmenu_load_ss08_03.tga"
	},
	
	["ss09"] = {
		pegs = { "ui_mm_load_ss09" },
		img1 = "ui_mainmenu_load_ss09_01.tga", img2 = "ui_mainmenu_load_ss09_02.tga", img3 = "ui_mainmenu_load_ss09_03.tga"
	},
	
	["ss10"] = {
		pegs = { "ui_mm_load_ss10" },
		img1 = "ui_mainmenu_load_ss10_01.tga", img2 = "ui_mainmenu_load_ss10_02.tga", img3 = "ui_mainmenu_load_ss10_03.tga"
	},
	
	["ss11"] = {
		pegs = { "ui_mm_load_ss11" },
		img1 = "ui_mainmenu_load_ss11_01.tga", img2 = "ui_mainmenu_load_ss11_02.tga", img3 = "ui_mainmenu_load_ss11_03.tga"
	},
	
	
	--EPILOGUE ULTOR
	["ep01"] = {
		pegs = { "ui_mm_load_ep01" },
		img1 = "ui_mainmenu_load_ep01_01.tga", img2 = "ui_mainmenu_load_ep01_02.tga", img3 = "ui_mainmenu_load_ep01_03.tga"
	},
	
	["ep02"] = {
		pegs = { "ui_mm_load_ep02" },
		img1 = "ui_mainmenu_load_ep02_01.tga", img2 = "ui_mainmenu_load_ep02_02.tga", img3 = "ui_mainmenu_load_ep02_03.tga"
	},
	
	["ep03"] = {
		pegs = { "ui_mm_load_ep03" },
		img1 = "ui_mainmenu_load_ep03_01.tga", img2 = "ui_mainmenu_load_ep03_02.tga", img3 = "ui_mainmenu_load_ep03_03.tga"
	},
	
	["ep04"] = {
		pegs = { "ui_mm_load_ep04" },
		img1 = "ui_mainmenu_load_ep04_01.tga", img2 = "ui_mainmenu_load_ep04_02.tga", img3 = "ui_mainmenu_load_ep04_03.tga"
	},
	
	
	--EXTRA MISSION
	["em01"] = {
		pegs = { "ui_mm_load_em01" },
		img1 = "ui_mainmenu_load_em01_01.tga", img2 = "ui_mainmenu_load_em01_02.tga", img3 = "ui_mainmenu_load_em01_03.tga"
	},
	
	--NEW GAME
	["none"] = {
		pegs = { "ui_mm_load_new_game" },
		img1 = "ui_mainmenu_load_new_game_01.tga", img2 = "ui_mainmenu_load_new_game_02.tga", img3 = "ui_mainmenu_load_new_game_03.tga"
	},
	
	
	--CUSTOM MISSIONS

	["dlc04"] = {
		pegs = { "ui_mm_load_ep01" },
		img1 = "ui_mainmenu_load_ep01_01.tga", img2 = "ui_mainmenu_load_ep01_02.tga", img3 = "ui_mainmenu_load_ep01_03.tga"
	},

	["dlc05"] = {
		pegs = { "ui_mm_load_ep01" },
		img1 = "ui_mainmenu_load_ep01_01.tga", img2 = "ui_mainmenu_load_ep01_02.tga", img3 = "ui_mainmenu_load_ep01_03.tga"
	},
	
	
	
	
	
	handles = { },
}

City_load_current_images = 0

function city_load_init()
	debug_print("vint", "city_load_init \n")

	peg_load("ui_mm_load_sr2_logo")
	
	local h = -1
	City_load_images.handles.loading_grp_h = vint_object_find("loading_grp")
	h = City_load_images.handles.loading_grp_h
	City_load_images.handles.logo_jp = vint_object_find("logo_jp", h)
	City_load_images.handles.images_h = vint_object_find("images")
	h = City_load_images.handles.images_h
	City_load_images.handles.bmp1_h = vint_object_find("bmp1", h)
	City_load_images.handles.bmp2_h = vint_object_find("bmp2", h)
	City_load_images.handles.bmp3_h = vint_object_find("bmp3", h)
	
	--looping animation stuff
	City_load_images.handles.transition2_h = vint_object_find("transition2")
	h = City_load_images.handles.transition2_h
	City_load_images.handles.load3_bmp1_in_h = vint_object_find("load3_bmp1_in", h)
	local twn_h = City_load_images.handles.load3_bmp1_in_h
	
	if get_language() == "JP" then
		vint_set_property(City_load_images.handles.logo_jp, "visible", true)
	else
		vint_set_property(City_load_images.handles.logo_jp, "visible", false)
	end
	
	vint_set_property(twn_h, "end_event", "city_load_transition")
	
end


-- this is called by the game after city_load_init
function city_load_info(name)
	debug_print("vint", "city_load_INFO "..name.." \n")
	local images = City_load_images[name]
	
	if images == nil then
		images = City_load_images["none"]
	end
	
	for i, v in images.pegs do
		peg_load(v)
	end
	
	debug_print("vint", "images.img1: " .. images.img1 .. "\n")
	debug_print("vint", "images.img2: " .. images.img2 .. "\n")
	debug_print("vint", "images.img3: " .. images.img3 .. "\n")
	
	vint_set_property(City_load_images.handles.bmp1_h, "image", images.img1)
	vint_set_property(City_load_images.handles.bmp2_h, "image", images.img2)
	vint_set_property(City_load_images.handles.bmp3_h, "image", images.img3)
	City_load_current_images = images

end

function city_load_transition()
	vint_set_property(City_load_images.handles.bmp1_h, "alpha", 1)
	vint_set_property(City_load_images.handles.bmp2_h, "alpha", 1)
	vint_set_property(City_load_images.handles.bmp3_h, "alpha", 1)
	debug_print("vint", "city_load_transition, end of anim reached, looping now \n")
	lua_play_anim(City_load_images.handles.transition2_h, 0)
end

function city_load_cleanup()
	debug_print("vint", "city_load_CLEANUP \n")
	for i, v in City_load_current_images.pegs do
		peg_unload(v)
	end
	peg_unload("ui_mm_load_sr2_logo")
end
