Cte_nemo_chair_doc_handle = -1
local Cte_nemo_chair_update_thread_handle = -1
local Screen_grp_h = -1
local Screen_in_anim_h = -1
Right_side_twns = {}
function cte_nemo_chair_init()
if vint_is_std_res() then
--dim out parts that will flicker in standard def
local right_side_boxes_h = vint_object_find("right_side_boxes")
local right_side_elements_h = vint_object_find("right_side_elements")
vint_set_property(right_side_boxes_h, "alpha", .33)
vint_set_property(right_side_elements_h, "alpha", .33)
end
Cte_nemo_chair_doc_handle = vint_document_find("cte_nemo_chair")
Screen_grp_h = vint_object_find("screen_grp", 0, Cte_nemo_chair_doc_handle)
Screen_in_anim_h = vint_object_find("screen_in_anim", 0, Cte_nemo_chair_doc_handle)
--Figure out stuff for bottom line graph animation...
local anim_h = vint_object_find("bottom_graph_line_anim")
local bottom_graph_line_h = vint_object_find("bottom_graph_line")
local bottom_graph_cap_twn_h = vint_object_find("bottom_graph_cap_twn")
local bottom_graph_line_twn_h = vint_object_find("bottom_graph_line_twn")
local line_grp_h = bottom_graph_line_h
local cap_twn_h = bottom_graph_cap_twn_h
local line_twn_h = bottom_graph_line_twn_h
local total_loops = 40
for i = 0, total_loops do
if i > 0 then
line_grp_h = vint_object_clone(bottom_graph_line_h)
cap_twn_h = vint_object_clone(bottom_graph_cap_twn_h)
line_twn_h = vint_object_clone(bottom_graph_line_twn_h)
end
local x, y = vint_get_property(line_grp_h, "anchor")
x = i * 4
vint_set_property(line_grp_h, "anchor", x, y)
local line_h = vint_object_find("bottom_vert_line", line_grp_h)
local cap_h = vint_object_find("bottom_vert_line_cap", line_grp_h)
local rand_time = rand_float(.01,.2)
vint_set_property(cap_twn_h, "start_time", i * (.1 + rand_time))
vint_set_property(line_twn_h, "start_time", i * (.1 + rand_time))
vint_set_property(line_twn_h, "duration", .5 + rand_time )
vint_set_property(cap_twn_h, "duration", .5+ rand_time )
vint_set_property(cap_twn_h, "target_handle", cap_h)
vint_set_property(line_twn_h, "target_handle", line_h)
end
--Play Bottom line graph animation..
lua_play_anim(anim_h, -5)
--Figure out stuff for right line graph animation...
anim_h = vint_object_find("right_graph_line_anim")
local right_graph_bar_h = vint_object_find("right_graph_bar")
local right_line_cap_h = vint_object_find("right_line_cap_anchor_twn")
local right_line_fill_h = vint_object_find("right_line_fill_scale_twn")
local line_grp_h = right_graph_bar_h
local cap_twn_h = right_line_cap_h
local line_twn_h = right_line_fill_h
--Figure out stuff for bottom line graph animation...
local total_loops = 8
for i = 0, total_loops do
if i > 0 then
line_grp_h = vint_object_clone(right_graph_bar_h)
cap_twn_h = vint_object_clone(right_line_cap_h)
line_twn_h = vint_object_clone(right_line_fill_h)
end
local x, y = vint_get_property(line_grp_h, "anchor")
y = i * 12
vint_set_property(line_grp_h, "anchor", x, y)
local line_h = vint_object_find("right_line_fill", line_grp_h)
local cap_h = vint_object_find("right_line_cap", line_grp_h)
local rand_time = rand_float(.01,.2)
vint_set_property(cap_twn_h, "start_time", i * (.1 + rand_time))
local start_time = i * (.1 + rand_time)
if start_time < .1 then
start_time = .1
end
vint_set_property(line_twn_h, "start_time", start_time)
vint_set_property(line_twn_h, "duration", .1 + rand_time )
local max_scale = 25.4
local min_scale = 0.1
local y_scale = 0.625
local min_x = 9
local max_x = 413
local rand_min = rand_float(.1,1)
local rand_max = rand_float(.1,1)
local target_min_scale = min_scale + (max_scale - min_scale) * rand_min
local target_max_scale = min_scale + (max_scale - min_scale) * rand_max
local target_min_x = min_x + (max_x - min_x) * rand_min
local target_max_x = min_x + (max_x - min_x) * rand_max
vint_set_property(line_twn_h, "start_value", target_min_scale, y_scale)
vint_set_property(line_twn_h, "end_value", target_max_scale, y_scale)
vint_set_property(cap_twn_h, "start_value", target_min_x, 0 )
vint_set_property(cap_twn_h, "end_value", target_max_x, 0 )
vint_set_property(cap_twn_h, "duration", 2 + rand_time )
vint_set_property(line_twn_h, "duration", 2 + rand_time )
vint_set_property(cap_twn_h, "target_handle", cap_h)
vint_set_property(line_twn_h, "target_handle", line_h)
Right_side_twns[line_twn_h] = {cap_twn_h = cap_twn_h, cap_h = cap_h, line_h = line_h}
vint_set_property(line_twn_h, "end_event", "cte_nemo_chair_right_side_cb")
end
--Play Right line graph animation..
lua_play_anim(anim_h)
local Cte_nemo_chair_update_thread_handle = thread_new("cte_nemo_chair_update_txt")
end
function cte_nemo_chair_16in_play()
vint_set_property(Screen_grp_h, "visible", true)
lua_play_anim(Screen_in_anim_h)
end
function cte_nemo_chair_16in_show()
vint_set_property(Screen_grp_h, "visible", true)
end
function cte_nemo_chair_16in_hide()
vint_set_property(Screen_grp_h, "visible", false)
end
function cte_nemo_chair_cleanup()
if Cte_nemo_chair_update_thread_handle ~= -1 then
thread_kill(Cte_nemo_chair_update_thread_handle)
end
end
function cte_nemo_chair_right_side_cb(tween_h)
local line_twn_h = tween_h
local cap_twn_h = Right_side_twns[tween_h].cap_twn_h
local cap_h = Right_side_twns[tween_h].cap_h
local line_h = Right_side_twns[tween_h].line_h
local max_scale = 25.4
local min_scale = 0.1
local y_scale = 0.625
local min_x = 9
local max_x = 413
local rand_min = rand_float(.1,1)
local rand_max = rand_float(.1,1)
local target_max_scale = min_scale + (max_scale - min_scale) * rand_max
local target_max_x = min_x + (max_x - min_x) * rand_max
local start_scale_x, start_scale_y = vint_get_property(line_h, "scale")
local start_x, start_y = vint_get_property(cap_h, "anchor")
local should_i_wait = rand_int(1,3)
if should_i_wait == 1 then
target_max_scale = start_scale_x
target_max_x = start_x
end
vint_set_property(line_twn_h, "start_value", start_scale_x, y_scale)
vint_set_property(line_twn_h, "end_value", target_max_scale, y_scale)
vint_set_property(cap_twn_h, "start_value", start_x, 0)
vint_set_property(cap_twn_h, "end_value", target_max_x, 0)
local rand_time = rand_float(1.01,2.2)
vint_set_property(cap_twn_h, "duration", rand_time)
vint_set_property(line_twn_h, "duration", rand_time)
--algorithm...
local algorithms = {"ease_in_out_quad", "ease_in_out_exp"}
local algorithm = algorithms[rand_int(1, #algorithms-1)]
vint_set_property(cap_twn_h, "algorithm", algorithm)
vint_set_property(line_twn_h, "algorithm", algorithm)
local time_index = vint_get_time_index(0)
vint_set_property(cap_twn_h, "start_time", time_index)
vint_set_property(line_twn_h, "start_time", time_index)
end
function cte_nemo_chair_update_txt()
-- Left side text elements...
local core_temp_txt_h = vint_object_find("core_temp_txt")
local initialized_txt_h = vint_object_find("initialized_txt")
local processes_txt_h = vint_object_find("processes_txt")
local processing_txt_h = vint_object_find("processing_txt")
-- Right side text elements...
local speed_txt_h = vint_object_find("speed_txt")
local core_anal_1_txt_h = vint_object_find("core_anal_1_txt")
local core_anal_2_txt_h = vint_object_find("core_anal_2_txt")
-- SYSTEM STATUS...
local initialized_txt = "SYSTEM STATUS\nREADY"
vint_set_property(initialized_txt_h, "text_tag", initialized_txt)
-- Set CPU PCT...
local cpu_pct = rand_float(.1,1)
-- List of file names...
local process_list = {
"AEVEMENTS.XTBL",
"AON_NODES.XTBL",
"AON_NODE_NPCS.XTBL",
"A_ACTIONS.XTBL",
"A_AUTO.XTBL",
"A_AUTO_APC.XTBL",
"A_AUTO_MONSTER.XTBL",
"A_BIPLANE.XTBL",
"A_BLEND_TREES.XTBL",
"A_BOATS.XTBL",
"A_BOATS_CRAFT.XTBL",
"A_BOATS_SPED1.XTBL",
"A_BROTHERHOOD.XTBL",
"A_ENVIRONMENT.XTBL",
"A_FACE.XTBL",
"A_FILES.XTBL",
"A_FILES_FLAGS.XTBL",
"A_FLINCHES.XTBL",
"A_HELI.XTBL",
"A_HELIFIGHTER.XTBL",
"A_IK_LOCATION.XTBL",
"A_IK_SITUATION.XTBL",
"A_JET.XTBL",
"A_MOTO.XTBL",
"A_MOTO_ATV.XTBL",
"A_MOTO_CRUISER.XTBL",
"A_MOTO_DIRT.XTBL",
"A_MOTO_MOPED.XTBL",
"A_MOTO_ROCKET.XTBL",
"A_PLANES.XTBL",
"A_PLANE_STANDARD.XTBL",
"A_POLICE_4D.XTBL",
"A_PROP_SETS.XTBL",
"A_REACTIONS.XTBL",
"A_SET_FILENAMES.XTBL",
"A_SET_PROPERTIES.XTBL",
"A_STATES.XTBL",
"A_SYNCED.XTBL",
"A_TAGS.XML",
"A_TRANSITIONS.XTBL",
"A_TRIGGERS.XTBL",
"A_VEHICLES.XTBL",
"AO_CONSTANTS.XTBL",
"AO_EVENTS.XTBL",
"AO_LINE_TAGS.XTBL",
"AO_MARKERS.XTBL",
"AO_PERSONAS.XTBL",
"AO_SETTINGS.XTBL",
"AO_SYNCS.XTBL",
"BAP_MATERIALS.XTBL",
"BES.XTBL",
"BE.XTBL",
"BE_BRUISER.XTBL",
"BE_ZOMBIE.XTBL",
"CRA_FREE.XTBL",
"CRA_SHAKE.XTBL",
"CORAMP.XTBL",
"CDEALERSHIPS.XTBL",
"C_PHONE.XTBL",
"CACTER.XTBL",
"CTS.XTBL",
"CLIFE.XTBL",
"CSWT1.XTBL",
"CERCIALS.XTBL",
"MC_STORE.XTBL",
"NRIETY.XTBL",
"NRIETY_LEVELS.XTBL",
"NRIETY_SPAWN.XTBL",
"NCOLOR_PALETTE.XTBL",
"PCHUTE.XTBL",
"P.XTBL",
"P_LIFE.XTBL",
"PE_TABLE.XTBL",
"P.XTBL",
"P.XTBL",
"P_ZOMBIE.XTBL",
"PSTREAKER.XTBL",
"PON_YACHT.XTBL",
"RO_ACTIVITIES.XTBL",
"RO_EVENTS.XTBL",
"S_NAMES.XTBL",
"S_COLOR_POOL.XTBL",
"SOX_EFFECTS.XTBL",
"SEDOOR.XTBL",
"SE_WEAPONS.XTBL",
"SFE_ANGLES.XTBL",
"S_ROPE.XTBL",
"TOO_COLOR_POOL.XTBL",
"TS.XTBL",
"TR.XTBL",
"T_OF_DAY.XTBL",
"T_OF_DAY_OBJECTS.XTBL",
"TFIC_LANES.XTBL",
"TFIC_TYPES.XTBL",
"TGERS.XTBL",
"TK_TABLE.XTBL",
"UCKABLES.XTBL",
"U_INTERFACE.XTBL",
"VCLES.XTBL",
"VBLACKHAWK.XTBL",
"VHELI_MAD03.XTBL",
"VPONY.XTBL",
"VRIOT.XTBL",
"VTANK.XTBL",
"VVTOL.XTBL",
"VVTOL2.XTBL",
"VGAT_LS.XTBL",
"VJOSH_LS.XTBL",
"VKIA_LS.XTBL",
"VKILLBANE_LS.XTBL",
"VKINZIE_LS.XTBL",
"VMATT_LS.XTBL",
"01_LS.XTBL",
"02_LS.XTBL",
"03_LS.XTBL",
"VOLEG_LS.XTBL",
"VPHILLIPE_LS.XTBL",
"VPIERCE_LS.XTBL",
"VPLAYER_BF_LS.XTBL",
"VPLAYER_BM_LS.XTBL",
"VPLAYER_HF_LS.XTBL",
"VPLAYER_HM_LS.XTBL",
"VPLAYER_WFA_LS.XTBL",
"VPLAYER_WF_LS.XTBL",
"VPLAYER_WMA_LS.XTBL",
"VPLAYER_WM_LS.XTBL",
"VPLAYER_Z_LS.XTBL",
}
local current_frame = 0
while true do
--Update stuff only every some amount of items... fill in with random shit...
if current_frame % 20 == 0 then
local core_temp = rand_float(90,100)
core_temp = (floor(core_temp * 100)) * .01 + 1
local core_tmp_txt = "CORE TEMP\n" .. core_temp
vint_set_property(core_temp_txt_h, "text_tag", core_tmp_txt)
end
if current_frame % 4 == 0 then
local processing_txt = "PROCESSING...\n" .. process_list[rand_int(1, #process_list - 1)]
vint_set_property(processing_txt_h, "text_tag", processing_txt)
end
if current_frame % 27 == 0 then
local process_count = rand_int(89, 120)
local processes_txt = "PROCESSES\n" .. process_count
vint_set_property(processes_txt_h, "text_tag", processes_txt)
end
if current_frame % 27 == 0 then
local cpu_pct = rand_float(.1,1)
local text = 12 * cpu_pct
local text = floor(text*1000) * .001
vint_set_property(speed_txt_h, "text_tag", text)
end
if current_frame % 10 == 0 then
local right_large_fill_h = vint_object_find("right_large_fill")
local right_large_cap_h = vint_object_find("right_large_cap")
local width, height = element_get_actual_size(right_large_fill_h)
local x, y = vint_get_property(right_large_cap_h, "anchor")
width = rand_int(20, 380 * cpu_pct) -- floor(current_frame*.1)
element_set_actual_size(right_large_fill_h, width, height)
vint_set_property(right_large_cap_h, "anchor", width+7, y)
local width, height =element_get_actual_size(right_large_cap_h)
width = rand_int(2, max(3,floor(current_frame*.1)))
element_set_actual_size(right_large_cap_h, width, height)
end
if current_frame % 30 == 0 then
local text = rand_int(0, 99)
vint_set_property(core_anal_1_txt_h, "text_tag", text)
end
if current_frame % 60 == 0 then
local text = rand_int(0, 325)
vint_set_property(core_anal_2_txt_h, "text_tag", text)
end
current_frame = current_frame + 1
if current_frame == 1000 then
current_frame = 0
end
thread_yield()
end
end