Files
xshxdex98 8194c5a00b Online co-op: play the campaign together over LAN and the internet
Hosting a co-op level from the Map screen (CO-OP CAMPAIGN, a level and its
difficulty, then Server Setup) makes a network game on the campaign map
with no game engine, which is what co-op is. Only the host runs the
scripts and the AI; port/linux/game/network_coop.c sends clients what the
scripts do (cutscenes, camera, fades, HUD, sounds, devices, named objects,
animations), and network_actors.c drives the host's AI units on every
machine. Players spawn beside each other, respawn beside a safe teammate,
and spectate while dead or waiting. Skipping a cutscene is a vote.
Players can join a game in progress at any time.
2026-10-05 00:31:30 -05:00

127 lines
2.7 KiB
C

/*
HUD_MESSAGING.H
header included in hcex build.
*/
#ifndef __HUD_MESSAGING_H
#define __HUD_MESSAGING_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
struct icon_hud_element_definition;
union real_argb_color;
/* ---------- prototypes/HUD_MESSAGING.C */
void hud_messaging_initialize(
void);
void hud_messaging_initialize_for_new_map(
void);
void hud_messaging_dispose_from_old_map(
void);
void hud_messaging_dispose(
void);
/* port: network co-op (port/linux/game/network_coop.c) */
struct hud_timer_state
{
long reference_time;
short ticks;
short flash_cutoff;
short x, y;
short corner;
boolean paused;
boolean enabled;
};
void hud_messaging_port_timer_get(
struct hud_timer_state *state);
void hud_messaging_port_timer_set(
struct hud_timer_state const *state);
short hud_messaging_port_message_count(
void);
void scripted_hud_set_state_message(
short message_index);
void hud_messaging_globals_update(
void);
void scripted_hud_set_flashing_state(
boolean flash);
void scripted_hud_restart_flashing(
void);
void scripted_hud_set_objective(
short message_index);
void scripted_hud_set_timer_position(
short x,
short y,
short corner);
void scripted_hud_show_timer(
boolean show);
void scripted_hud_pause_timer(
boolean pause);
void scripted_hud_set_timer_time(
short minutes,
word seconds);
void scripted_hud_set_timer_warning_cutoff(
short minutes,
word seconds);
short scripted_hud_get_timer_ticks(
void);
void scripted_hud_time_code_show(
boolean show);
void scripted_hud_time_code_start(
boolean start);
void scripted_hud_time_code_reset(
void);
void scripted_hud_messages_clear(
void);
void hud_render_timer(
void);
void hud_print_message(
short local_player_index,
wchar_t const *message);
void hud_add_item_message(
short local_player_index,
long item_definition_index,
short quantity,
char message_offset);
void hud_broadcast_team_message(
long victim_player_index,
wchar_t const *message);
void hud_messaging_update(
short local_player_index);
void hud_set_state_message(
short local_player_index,
short message_index);
void hud_set_state_message_text(
short local_player_index,
short custom_icon_index,
short icon_string_index,
boolean uses_scenario_names);
void hud_set_state_message_icon(
short local_player_index,
short custom_icon_index,
struct icon_hud_element_definition const *icon);
void hud_enable_custom_state_message(
short local_player_index,
boolean enabled);
void hud_set_state_text(
short local_player_index,
wchar_t const *message);
wchar_t *hud_messaging_get_objective(
void);
long hud_get_font_index(
void);
union real_argb_color *hud_get_text_color(
union real_argb_color *result);
/* ---------- globals */
/* ---------- public code */
#endif // __HUD_MESSAGING_H