# Alerts system ported from TNO by TheGeneral # # How to use: # 1. Set up a token ID in common/ideas/zzz_Alerts.txt henceforth refered to as # - Add an on_add to assign a sound effect to your alert as it gets added # 2. Set up the GFX in interface/md_alerts.gfx as GFX_ # - Place the GFX file under gfx/interface/md_alerts/ # - Template is available in that folder, named blank.dds # 3. Set up any effects that clicking your alert does in common/scripted_effects/md_alerts_scripted_effect.txt # - Do this under the md_alert_click effect # 4. Localize the alert in localisation//md_alerts_l_.yml # - The loc key as and description as _Desc (it is important that the D is capitalized) # - If you would like to do custom scripted localisation here, use common/scripted_localisations/md_alerts_scripted_localisation.txt # 5. In order to show an alert, do the following: # # set_temp_variable = { alert_id = token: } # set_temp_variable = { alert_color = (1/2) } # 1 is for a yellow glow while 2 is for a red glow # set_temp_variable = { alert_data = <...> } # (Optional) This can be used to store any sort of data that corresponds to the alert # add_md_alert = yes # alternatively, add_md_alert_unless_exists # # 6. In order to remove an alert, do the following: # # set_temp_variable = { alert_id = token: } # remove_md_alert = yes scripted_gui = { md_alert_icon_gui = { window_name = "md_alert_icon_window" context_type = player_context parent_window_name = "after_intel_agency_button" dirty = md_alertbar_dirty visible = { check_variable = { md_alerts^num > 0 } } dynamic_lists = { md_alert_icon_window_gridbox = { array = md_alerts change_scope = no entry_container = md_alert_icon_entry index = alert_idx } } effects = { alert_click = { md_alert_click = yes } alert_right_click = { md_alert_right_click = yes } alert_shift_click = { md_alert_restore_suppressed = yes } } triggers = { alert_icon_glow_yellow_visible = { check_variable = { md_alert_color^alert_idx = 1 } } alert_icon_glow_red_visible = { check_variable = { md_alert_color^alert_idx = 2 } } } properties = { alert = { image = "[Get_md_alert_GFX]" } } } }