FS2_Open
Open source remastering of the Freespace 2 engine
|
#include "anim/animplay.h"
#include "anim/packunpack.h"
#include "cfile/cfile.h"
#include "cmdline/cmdline.h"
#include "gamehelp/contexthelp.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/alphacolors.h"
#include "hud/hudbrackets.h"
#include "io/mouse.h"
#include "io/timer.h"
#include "lighting/lighting.h"
#include "localization/localize.h"
#include "menuui/snazzyui.h"
#include "missionui/chatbox.h"
#include "missionui/missionbrief.h"
#include "missionui/missionscreencommon.h"
#include "missionui/missionshipchoice.h"
#include "missionui/missionweaponchoice.h"
#include "model/model.h"
#include "network/multi.h"
#include "network/multi_pmsg.h"
#include "network/multimsgs.h"
#include "network/multiteamselect.h"
#include "network/multiui.h"
#include "network/multiutil.h"
#include "parse/parselo.h"
#include "popup/popup.h"
#include "render/3d.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
Go to the source code of this file.
Classes | |
struct | wl_bitmap_group |
struct | wl_buttons |
struct | wl_ship_class_info |
struct | wl_icon_info |
struct | carried_icon |
Typedefs | |
typedef struct wl_bitmap_group | wl_bitmap_group |
typedef struct wl_ship_class_info | wl_ship_class_info |
typedef struct wl_icon_info | wl_icon_info |
typedef struct carried_icon | carried_icon |
#define IS_BANK_PRIMARY | ( | x | ) | (x < MAX_SHIP_PRIMARY_BANKS) |
Definition at line 44 of file missionweaponchoice.cpp.
#define IS_BANK_SECONDARY | ( | x | ) | (x >= MAX_SHIP_PRIMARY_BANKS) |
Definition at line 45 of file missionweaponchoice.cpp.
#define IS_LIST_PRIMARY | ( | x | ) | (Weapon_info[x].subtype != WP_MISSILE) |
Definition at line 47 of file missionweaponchoice.cpp.
#define IS_LIST_SECONDARY | ( | x | ) | (Weapon_info[x].subtype == WP_MISSILE) |
Definition at line 48 of file missionweaponchoice.cpp.
#define MAX_WEAPON_BUTTONS 8 |
Definition at line 82 of file missionweaponchoice.cpp.
#define MAX_WEAPON_ICONS_ON_SCREEN 8 |
Definition at line 209 of file missionweaponchoice.cpp.
#define MIN_WEAPON_BUTTONS 7 |
Definition at line 83 of file missionweaponchoice.cpp.
#define NUM_WEAPON_BUTTONS (Uses_apply_all_button ? MAX_WEAPON_BUTTONS : MIN_WEAPON_BUTTONS) |
Definition at line 84 of file missionweaponchoice.cpp.
#define NUM_WEAPON_SETTINGS 2 |
Definition at line 80 of file missionweaponchoice.cpp.
#define WEAPON_ANIM_LOOP_FRAME 52 |
Definition at line 72 of file missionweaponchoice.cpp.
#define WEAPON_DESC_MAX_LENGTH 50 |
Definition at line 360 of file missionweaponchoice.cpp.
#define WEAPON_DESC_MAX_LINES 7 |
Definition at line 359 of file missionweaponchoice.cpp.
#define WEAPON_DESC_WIPE_TIME 1.5f |
Definition at line 358 of file missionweaponchoice.cpp.
#define WEAPON_ICON_FRAME_DISABLED 3 |
Definition at line 77 of file missionweaponchoice.cpp.
#define WEAPON_ICON_FRAME_HOT 1 |
Definition at line 75 of file missionweaponchoice.cpp.
#define WEAPON_ICON_FRAME_NORMAL 0 |
Definition at line 74 of file missionweaponchoice.cpp.
#define WEAPON_ICON_FRAME_SELECTED 2 |
Definition at line 76 of file missionweaponchoice.cpp.
#define WEAPON_SELECT_NUM_TEXT 2 |
Definition at line 405 of file missionweaponchoice.cpp.
#define WL_BUTTON_APPLY_ALL 7 |
Definition at line 94 of file missionweaponchoice.cpp.
#define WL_BUTTON_DUMMY 5 |
Definition at line 92 of file missionweaponchoice.cpp.
#define WL_BUTTON_MULTI_LOCK 6 |
Definition at line 93 of file missionweaponchoice.cpp.
#define WL_BUTTON_RESET 4 |
Definition at line 91 of file missionweaponchoice.cpp.
#define WL_BUTTON_SCROLL_PRIMARY_DOWN 1 |
Definition at line 88 of file missionweaponchoice.cpp.
#define WL_BUTTON_SCROLL_PRIMARY_UP 0 |
Definition at line 87 of file missionweaponchoice.cpp.
#define WL_BUTTON_SCROLL_SECONDARY_DOWN 3 |
Definition at line 90 of file missionweaponchoice.cpp.
#define WL_BUTTON_SCROLL_SECONDARY_UP 2 |
Definition at line 89 of file missionweaponchoice.cpp.
typedef struct carried_icon carried_icon |
typedef struct wl_bitmap_group wl_bitmap_group |
typedef struct wl_icon_info wl_icon_info |
typedef struct wl_ship_class_info wl_ship_class_info |
Definition at line 2172 of file missionweaponchoice.cpp.
Mouse over ship weapon
index | Bank index on ship (0..6) |
Definition at line 2196 of file missionweaponchoice.cpp.
Draw icon with number
list_count | list position on screen (0-7) |
weapon_class | class of weapon |
Definition at line 3076 of file missionweaponchoice.cpp.
void draw_wl_icons | ( | ) |
Draw the weapon icons that are available
Definition at line 3098 of file missionweaponchoice.cpp.
Drop the Carried_wl_icon onto the specified slot. The slot numbering is:
0->2: primary weapons 3-6: secondary weapons
Definition at line 2121 of file missionweaponchoice.cpp.
Return true if weapon_flags indicates a weapon that is legal for use in current game type. Function added by MK on 9/6/99 to support separate legal loadouts for dogfight missions. name changed by Goober5000 to better reflect what it actually does
Definition at line 1089 of file missionweaponchoice.cpp.
Definition at line 2156 of file missionweaponchoice.cpp.
Change to the weapon that corresponds to the ship weapon slot
index | index of bank (0..2 primary, 0..6 secondary) |
Definition at line 1198 of file missionweaponchoice.cpp.
Change to the weapon that corresponds to index in the weapon list
index | weapon icon index |
Definition at line 1164 of file missionweaponchoice.cpp.
A slot index was clicked on, maybe change Selected_wl_slot
Definition at line 1143 of file missionweaponchoice.cpp.
Pick from ship slot
num | index into shipb banks (0..2 primary, 3..6 secondary) |
Definition at line 3170 of file missionweaponchoice.cpp.
Start the current weapon animation from playing.
Definition at line 3324 of file missionweaponchoice.cpp.
void stop_weapon_animation | ( | ) |
Definition at line 567 of file missionweaponchoice.cpp.
void weapon_buttons_init | ( | ) |
Definition at line 668 of file missionweaponchoice.cpp.
void weapon_check_buttons | ( | ) |
Check if any weapons loadout screen buttons have been pressed, and call weapon_button_do() if they have.
Definition at line 631 of file missionweaponchoice.cpp.
void weapon_select_close | ( | ) |
Free the bitmap slot and memory that was allocated to store the mask bitmap.
Definition at line 2860 of file missionweaponchoice.cpp.
void weapon_select_close_team | ( | ) |
Close out what weapon_select_init_team() set up but only when we are not acutally in the weapon select screen - taylor
Definition at line 1918 of file missionweaponchoice.cpp.
void weapon_select_common_init | ( | ) |
This init is called even before the weapons loadout screen is entered. It is called when the briefing state is entered.
Definition at line 1931 of file missionweaponchoice.cpp.
Calls to common_ functions are made for those functions which are common to the ship select and briefing screens.
Definition at line 2449 of file missionweaponchoice.cpp.
void weapon_select_init | ( | ) |
Called to load the bitmaps and set up the mask regions for the weapon loadout screen. common_select_init() is called to load the animations and bitmaps which are in common with the ship select and briefing screens.
Definition at line 1960 of file missionweaponchoice.cpp.
Initialize team specific weapon select data structures
Definition at line 1901 of file missionweaponchoice.cpp.
Definition at line 2262 of file missionweaponchoice.cpp.
Add a weapon_class to ui lists
Definition at line 1709 of file missionweaponchoice.cpp.
int wl_apply | ( | int | mode, |
int | from_bank, | ||
int | from_list, | ||
int | to_bank, | ||
int | to_list, | ||
int | ship_slot, | ||
int | player_index, | ||
bool | dont_play_sound | ||
) |
Definition at line 3856 of file missionweaponchoice.cpp.
void wl_apply_current_loadout_to_all_ships_in_current_wing | ( | ) |
Definition at line 3960 of file missionweaponchoice.cpp.
void wl_bash_ship_weapons | ( | ship_weapon * | swp, |
wss_unit * | slot | ||
) |
Bash ship weapons, based on what is stored in the stored weapons loadout
Definition at line 3397 of file missionweaponchoice.cpp.
Determine how many ballistics of type 'wi_index' will fit into capacity - Goober5000
Definition at line 1502 of file missionweaponchoice.cpp.
Determine how many missiles of type 'wi_index' will fit into capacity
Definition at line 1518 of file missionweaponchoice.cpp.
int wl_carried_icon_moved | ( | ) |
Determine if the carried icon has moved
Definition at line 527 of file missionweaponchoice.cpp.
Ensure that there aren't any bogus weapons assigned by default
Definition at line 1637 of file missionweaponchoice.cpp.
Draw the icons for the weapons that are currently on the selected ship
index | Slot to draw weapons for |
Definition at line 3030 of file missionweaponchoice.cpp.
int wl_drop | ( | int | from_bank, |
int | from_list, | ||
int | to_bank, | ||
int | to_list, | ||
int | ship_slot, | ||
int | player_index, | ||
bool | dont_play_sound | ||
) |
Definition at line 3918 of file missionweaponchoice.cpp.
void wl_dump_carried_icon | ( | ) |
Definition at line 2095 of file missionweaponchoice.cpp.
Definition at line 3649 of file missionweaponchoice.cpp.
void wl_fill_slots | ( | ) |
Init the weapons portion of Wss_slots[] and the ui data in Wl_slots[]
Definition at line 1819 of file missionweaponchoice.cpp.
void wl_free_ship_class_data | ( | ) |
Free any allocated ship-class specific data
Definition at line 1367 of file missionweaponchoice.cpp.
Get the weapons info that should be on ship by default
Definition at line 1665 of file missionweaponchoice.cpp.
Set wep and wep_count from a ship which sits in the ship arrivals list at index sa_index
Definition at line 1595 of file missionweaponchoice.cpp.
Definition at line 541 of file missionweaponchoice.cpp.
Definition at line 1077 of file missionweaponchoice.cpp.
Fill out the weapons for this ship_class
Definition at line 1531 of file missionweaponchoice.cpp.
Fill out the wep[] and wep_count[] arrays for a ship
Definition at line 1561 of file missionweaponchoice.cpp.
Definition at line 3674 of file missionweaponchoice.cpp.
int wl_icon_being_carried | ( | ) |
Is an icon being carried?
Definition at line 497 of file missionweaponchoice.cpp.
void wl_init_icon_lists | ( | ) |
Set up the primary and secondary icons lists that hold the weapons the player can choose from
Definition at line 1847 of file missionweaponchoice.cpp.
Initialize Wl_pool[] to mission default
Definition at line 1228 of file missionweaponchoice.cpp.
void wl_init_ship_class_data | ( | ) |
init ship-class specific data
Definition at line 1351 of file missionweaponchoice.cpp.
void wl_load_all_icons | ( | ) |
Load all the icons for weapons in the pool
Definition at line 1293 of file missionweaponchoice.cpp.
Load the icons for a specific ship class
Definition at line 1255 of file missionweaponchoice.cpp.
void wl_maybe_flash_button | ( | ) |
Maybe flash a button if player hasn't done anything for a while
Definition at line 2249 of file missionweaponchoice.cpp.
void wl_maybe_reset_selected_slot | ( | ) |
Called whenever it is possible that the current selected slot has had it's ship disappear
Definition at line 1428 of file missionweaponchoice.cpp.
void wl_maybe_reset_selected_weapon_class | ( | ) |
If Selected_wl_class is -1, choose the first weapon available from the pool for an animation
Definition at line 1451 of file missionweaponchoice.cpp.
Determine if an icon from the scrollable weapon list can be picked up (for drag and drop).
It calculates the difference in x & y between the icon and the mouse, so we can move the icon with the mouse in a realistic way
index | (0..7) |
Definition at line 3126 of file missionweaponchoice.cpp.
void wl_redraw_pressed_buttons | ( | ) |
Redraw any weapon loadout buttons that are pressed down. This function is needed since we sometimes need to draw pressed buttons last to ensure the entire button gets drawn (and not overlapped by other buttons)
Definition at line 650 of file missionweaponchoice.cpp.
Remove the weapons specified by wep[] and wep_count[] from Wl_pool[].
Definition at line 1736 of file missionweaponchoice.cpp.
void wl_render_icon | ( | int | index, |
int | x, | ||
int | y, | ||
int | num, | ||
int | draw_num_flag, | ||
int | hot_mask, | ||
int | hot_bank_mask, | ||
int | select_mask | ||
) |
Render icon
index | index into Wl_icons[], identifying which weapon to draw |
x | x screen position to draw icon at |
y | y screen position to draw icon at |
num | count for weapon |
draw_num_flag | 0 if not to draw count for weapon, nonzero otherwise |
hot_mask | value that should match Hot_weapon_icon to show mouse is over |
hot_bank_mask | value that should match Hot_weapon_bank_icon to show mouse is over |
select_mask | value that should match Selected_wl_class to show icon is selected |
Definition at line 2927 of file missionweaponchoice.cpp.
Renders the number next to the weapon icon
num | the actual count to be printed |
x | x screen position OF THE ICON (NOT where you want the text, this is calculated to prevent overlapping) |
y | y screen position OF THE ICON (NOT where you want the text, this is calculated to prevent overlapping) |
Definition at line 2899 of file missionweaponchoice.cpp.
Definition at line 713 of file missionweaponchoice.cpp.
void wl_render_weapon_desc | ( | ) |
Draw the weapon description text
Definition at line 2275 of file missionweaponchoice.cpp.
void wl_reset_carried_icon | ( | ) |
Reset the data inside Carried_wl_icon
Definition at line 486 of file missionweaponchoice.cpp.
void wl_reset_selected_slot | ( | ) |
Set selected slot to first placed ship
Definition at line 1394 of file missionweaponchoice.cpp.
void wl_reset_team_pointers | ( | ) |
Reset the necessary pointers to defaults
Definition at line 1888 of file missionweaponchoice.cpp.
void wl_reset_to_defaults | ( | ) |
Reset the weapons loadout to the defaults in the mission
Definition at line 3378 of file missionweaponchoice.cpp.
Utility function used to put back overflow into the weapons pool
Definition at line 3475 of file missionweaponchoice.cpp.
Set carried icon data
Definition at line 509 of file missionweaponchoice.cpp.
Go through the possible weapons to choose from, and flag some as disabled since that ship class cannot use that kind of weapon. The weapon filter is specified in ships.tbl, where each ship has a list of all the possible weapons it can use.
Definition at line 1109 of file missionweaponchoice.cpp.
Call when Selected_wl_slot needs to be changed
Definition at line 1490 of file missionweaponchoice.cpp.
Set the necessary pointers
Definition at line 1878 of file missionweaponchoice.cpp.
Determine if this slot has no weapons
Definition at line 3212 of file missionweaponchoice.cpp.
Definition at line 3763 of file missionweaponchoice.cpp.
Definition at line 3503 of file missionweaponchoice.cpp.
Utility function for swapping two banks
Definition at line 3448 of file missionweaponchoice.cpp.
void wl_synch_interface | ( | ) |
Update any interface data that may be dependent on Wss_slots[]
Definition at line 3852 of file missionweaponchoice.cpp.
const char* wl_tooltip_handler | ( | const char * | str | ) |
Definition at line 458 of file missionweaponchoice.cpp.
void wl_unload_all_anims | ( | ) |
Free source anim data if allocated
Definition at line 1246 of file missionweaponchoice.cpp.
void wl_unload_icons | ( | ) |
Frees the bitmaps used for weapon icons
Definition at line 1318 of file missionweaponchoice.cpp.
Set the Pilot subsystem of a parse_object to the weapons that are setup for the wing_block,wing_slot ship
pobjp | Pointer to parse object that references Pilot subsystem |
slot | Pointer to slot object |
Definition at line 3258 of file missionweaponchoice.cpp.
Change a ship's weapons based on the information contained in the Weapon_data[] structure that is filled in during weapon loadout
Definition at line 3231 of file missionweaponchoice.cpp.
void wl_weapon_desc_start_wipe | ( | ) |
Re-inits wiping vars and causes the current text to wipe in again
Definition at line 2381 of file missionweaponchoice.cpp.
int anim_timer_start |
Definition at line 77 of file missionshipchoice.cpp.
int Multi_ping_timestamp |
Definition at line 30 of file fredstubs.cpp.
int Plist[MAX_WEAPON_TYPES] |
Definition at line 340 of file missionweaponchoice.cpp.
int Plist_size |
Definition at line 341 of file missionweaponchoice.cpp.
int Plist_start |
Definition at line 341 of file missionweaponchoice.cpp.
int Slist[MAX_WEAPON_TYPES] |
Definition at line 343 of file missionweaponchoice.cpp.
int Slist_size |
Definition at line 344 of file missionweaponchoice.cpp.
int Slist_start |
Definition at line 344 of file missionweaponchoice.cpp.
int Weapon_select_background_bitmap |
Definition at line 193 of file missionweaponchoice.cpp.
int Weapon_select_open = 0 |
Definition at line 60 of file missionweaponchoice.cpp.
int Weapon_select_overlay_id = -1 |
Definition at line 98 of file missionweaponchoice.cpp.
UI_XSTR Weapon_select_text[GR_NUM_RESOLUTIONS][WEAPON_SELECT_NUM_TEXT] |
Definition at line 406 of file missionweaponchoice.cpp.
int Weapon_title_max_width[GR_NUM_RESOLUTIONS] = { 200, 320 } |
Definition at line 366 of file missionweaponchoice.cpp.
UI_WINDOW Weapon_ui_window |
Definition at line 205 of file missionweaponchoice.cpp.
wl_icon_info* Wl_icons = NULL |
Definition at line 338 of file missionweaponchoice.cpp.
wl_icon_info Wl_icons_teams[MAX_TVT_TEAMS][MAX_WEAPON_TYPES] |
Definition at line 337 of file missionweaponchoice.cpp.
wl_ship_class_info Wl_ships[MAX_SHIP_CLASSES] |
Definition at line 326 of file missionweaponchoice.cpp.