("custom_unit_sceen_a", 0, mesh_load_window, [
(ti_on_presentation_load,
[
(presentation_set_duration, 999999),
(set_fixed_point_multiplier, 1000),#create_text_overlay
# (str_clear, s1),
# (str_clear, s2),
# (str_clear, s3),
# (str_clear, s4),
(assign, "$unit_helm_1", -1),
(assign, "$unit_helm_2", -1),
(assign, "$unit_helm_3", -1),
(assign, "$unit_helm_4", -1),
(assign, "$unit_armor_1", -1),
(assign, "$unit_armor_2", -1),
(assign, "$unit_armor_3", -1),
(assign, "$unit_armor_4", -1),
(assign, "$unit_one_handed_weapon_1", -1),
(assign, "$unit_one_handed_weapon_2", -1),
(assign, "$unit_two_handed_weapon_1", -1),
(assign, "$unit_two_handed_weapon_2", -1),
(assign, "$unit_polearm_1", -1),
(assign, "$unit_polearm_2", -1),
(assign, "$unit_shield_1", -1),
(assign, "$unit_shield_2", -1),
(assign, "$unit_shield_3", -1),
(assign, "$unit_choose_arm_type", -1),
(assign, "$unit_set_name", -1),
(assign, "$unit_set_desc", -1),
(assign, "$set_which_unit_to_select", -1),
(assign, "$unit_write_name", -1),
(assign, "$unit_name", -1),
(assign, "$unit_desc", -1),
(troop_get_slot, ":n", "$chosen_unit", slot_troop_name),
(troop_get_slot, ":d", "$chosen_unit", slot_troop_desc),
(str_store_string, s1, ":n"),
(str_store_string, s2, ":d"),
(create_combo_button_overlay, "$set_which_unit_to_select"),
(position_set_x, pos1, 500),
(position_set_y, pos1, 800),
(overlay_set_size, "$set_which_unit_to_select", pos1),
(position_set_x, pos1, 250),
(position_set_y, pos1, 650),
(overlay_set_position, "$set_which_unit_to_select", pos1),
(try_for_range, ":selected_troop", "trp_ct_inf_1", "trp_traveller"),
(str_store_troop_name, s0, ":selected_troop"),
(overlay_add_item, "$set_which_unit_to_select", s0),
# (try_for_range, ":selected_troop", "trp_ct_inf_1", "trp_traveller"),
# (overlay_set_val, "$set_which_unit_to_select", ":selected_troop"),
# (str_store_troop_name, s12, ":selected_troop"),
(overlay_set_val, "$set_which_unit_to_select", "$chosen_unit"),
(try_end),
(create_text_overlay, "$unit_name", "@{s1}", tf_scrollable),
(position_set_x, pos1, 850),
(position_set_y, pos1, 850),
(overlay_set_size, "$unit_name", pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, 650),
(overlay_set_position, "$unit_name", pos1),
(position_set_x, pos1, 360),
(position_set_y, pos1, 130),
(overlay_set_area_size, "$unit_name", pos1),
(create_text_overlay, "$unit_desc", "@{s2}", tf_scrollable),
(position_set_x, pos1, 850),
(position_set_y, pos1, 850),
(overlay_set_size, "$unit_desc", pos1),
(position_set_x, pos1, 800),
(position_set_y, pos1, 650),
(overlay_set_position, "$unit_desc", pos1),
(position_set_x, pos1, 200),
(position_set_y, pos1, 130),
(overlay_set_area_size, "$unit_desc", pos1),
(create_in_game_button_overlay, "$cik_su_prnstdan_test", "@Done"),
# (overlay_set_color, "$", 0x68eb4e),
(position_set_x, pos1, 800),
(position_set_y, pos1, 200),
(overlay_set_position, "$cik_su_prnstdan_test", pos1),
(position_set_x, pos1, 100),
(position_set_y, pos1, 100),
(overlay_set_size, "$cik_su_prnstdan_test", pos1),
(display_message, "@Unit's name is {s1}."),
(display_message, "@Unit's description is {s2}"),
]),
(ti_on_presentation_event_state_change,
[
(store_trigger_param_1, ":object"),
(store_trigger_param_2, ":val"),
(try_begin),
(eq, ":object", "$set_which_unit_to_select"),
(store_add, "$chosen_unit", ":val", custom_unit_troops_begin),
# (assign, "$chosen_unit", ":val"),
(presentation_set_duration, 0),
(start_presentation, "prsnt_custom_unit_sceen_a"),
(else_try),
(eq, ":object", "$cik_su_prnstdan_test"),
(presentation_set_duration, 0),
(try_end),
]),
]),