The binaries and packages committed as RC2 in 8bfaf9b9 no longer match the
source tree: MW4.exe, mw4print.exe and three resource packages have all changed
since. RC2's own notes warn about exactly this situation with RC1, so this is a
version bump rather than an edit in place.
Console title -> V5.1.0b3, with a new dated line in the ConLobby.script
changelog block; the existing lines are left alone. That string lives in
props.mw4, so it only appears on a pod after the repack, which is what makes it
a usable "did this machine get the new content" check.
Release notes and checklist renamed RC2 -> RC3. The notes' front matter was
restructured rather than having a third block stacked on it: "Already testing
RC2? Here is what is new in RC3" now leads, followed by "What was new in RC2"
for anyone jumping two versions.
New in the notes, written for pod owners rather than engineers:
* Damage displays corrected on 22 'Mechs, described as the two faults an
operator would actually notice -- the figure was mirrored, and the zones did
not line up with the artwork -- plus the note that Rifleman and Battlemaster
had been using another chassis' layout entirely.
* The target picture on the MFD showed the wrong 'Mech. Includes the
gos-displays.txt line to look for, and what it means if the card refuses the
larger atlas and falls back.
* High Explosive charges now fire, how to use them (weapon group, not eject),
the NARC side effect, and the advice to refit the charge on saved variants.
* Three content faults corrected. Cauldron Born is explicitly flagged as
behaviour-unchanged so nobody hunts for a difference that is not there.
* mw4print -debug.
* A warning that this build changes artwork as well as the executable, and
upgrade step 2 now says to copy the whole folder. An old hsh\ with a new
MW4.exe gives wrong damage displays, which is the trap this build creates.
Checklist gained sections 18-22, 88 -> 133 checkboxes, all marked as never
having been run on hardware:
* 18 names every one of the 22 chassis individually for both displays, and
makes handedness an explicit check, since the mirroring is the fault that
reads as "slightly odd" rather than obviously broken. Calls out that the
Atlas MFD doll was regenerated and so replaces shipped art.
* 19 leads with targeting a Zeus, and requires flying a Behemoth II in the
RELEASE build -- that fault was fatal in Release and masked in Profile by the
placeholder texture, so testing it with MW4pro.exe proves nothing.
* 20 includes the NARC ammo-count regression check.
* 21 frames the content fixes as "confirm nothing moved".
* 22 covers mw4print -debug.
The build-requirements header was materially wrong and has been rewritten. It
named props.mw4 only; core.mw4 and textures.mw4 now change too, each must be
deleted before repacking because the packer carries stale entries forward and
never drops deleted ones, coord.cpp is #included by DXRasterizer.cpp so a
mapping change needs a full exe rebuild, and the 21 changed hsh\ dolls are
loose files that arrive only via deploy-mw4.ps1.
All three documents remain pure ASCII with CRLF endings so they open correctly
in Notepad on a pod; the HTML was checked for balanced tags.
Nothing here covers the six staged V4H chassis. They are not in the source tree.
Co-authored-by: Claude Opus 5 (Anthropic) <noreply@anthropic.com>
Co-authored-by: GitHub Copilot <copilot@github.com>
4249 lines
144 KiB
Plaintext
4249 lines
144 KiB
Plaintext
//--------------------------------------------------------------------------
|
|
// Date Who Modification
|
|
// -------- --- ----------------------------------------------------------
|
|
// 11/01/02 MSL Added "Mech Randomizer" button
|
|
// 11/01/02 MSL Added "Default Settings" button
|
|
// 11/01/02 MSL Modified default Mech setting for each player slot
|
|
// 11/06/02 MSL Corrected reprint button states
|
|
// 11/06/02 MSL Corrected launch button states
|
|
// 11/06/02 MSL Corrected skin selection for Bot.
|
|
// Bot skin = 36 = skin"_"4.tga
|
|
// 11/06/02 MSL Modified "Text" error messages
|
|
// 08/05/03 MSL Added "Recall" button
|
|
// 08/05/03 MSL Changed Team Player limit from 4 to 7
|
|
// 10/10/03 MSL Added Cameraship to RESET_AFTER_LAUNCH
|
|
// 10/17/05 MSL Added all remaining Mechs (55)
|
|
// 06/19/18 AVB Update tab stops
|
|
// 06/24/26 Cyd MechCorps is given access to this script and the loading method (-diskfirst). This includes the CS timer fix.
|
|
// 06/27/26 MCHL MechCorps Highlight: Change Fab4 to Super6.
|
|
// 07/19/26 RT Bumped console title to V5.1.0b1
|
|
// 08/06/26 RT Bumped console title to V5.1.0b2
|
|
// 08/09/26 RT Bumped console title to V5.1.0b3
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
// jcem - start
|
|
#include "Content\\ShellScripts\\ctcl_params.h"
|
|
// jcem - end
|
|
#include "Content\\ShellScripts\\stddefs.h"
|
|
#include "Content\\ShellScripts\\ShellFunctionHeaders.hpp"
|
|
#include "Content\\ShellScripts\\NetParams.h"
|
|
#include "Content\\GameTypes.h"
|
|
#include "Content\\ShellScripts\\buttons.script"
|
|
#include "Content\\ShellScripts\\Multiplayer\\Tonnage_listboxes.script"
|
|
#include "Content\\ShellScripts\\Multiplayer\\con_skins_listbox.script"
|
|
#include "Content\\ShellScripts\\Multiplayer\\mc_listboxes.script"
|
|
#include "Content\\ShellScripts\\Multiplayer\\mech_var_listbox.script"
|
|
#include "Content\\ShellScripts\\editbox.script"
|
|
#include "Content\\ShellScripts\\common_shell.script"
|
|
#include "Content\\ShellScripts\\ErrorScreen.script"
|
|
#include "Content\\ShellScripts\\WeaponNames.h"
|
|
|
|
#define scriptpath "content\\ShellScripts\\Multiplayer\\"
|
|
|
|
#define DEMO_CODE 1
|
|
|
|
#define USE_O_BACK 0 // 0: hide o_back, 1: use o_back
|
|
//#define USE_O_MECH_VARIANT2 0 // 0: hide o_mech_variant2, 1: use o_mech_variant2
|
|
|
|
// MSL 5.06
|
|
#define USE_O_MECH_VARIANT2 $$g_nMechVariant$$ // 0 = hide variants 1 = allow variants
|
|
#define USE_O_BLACKMECH $$g_nBlackMech$$ // 0 = hide BlackMech 1 = Show BlackMech
|
|
|
|
#define TESLA_PREFIX "< "
|
|
#define TESLA_POSTFIX " >"
|
|
|
|
#define FONT_EDIT_BOX szPATH_FONTS localize$(IDS_F_GEN_EDITBOX)
|
|
|
|
#define FONT_LIST_BOX FPATH localize$(IDS_F_ML_LABEL)
|
|
#define FONT_LIST_LABEL FPATH localize$(IDS_F_ML_LABEL)
|
|
|
|
#define SKIN_LIST_BOX FPATH localize$(IDS_F_ML_LABEL)
|
|
#define SKIN_LIST_LABEL FPATH localize$(IDS_F_ML_LABEL)
|
|
|
|
#define DECAL_LIST_BOX FPATH localize$(IDS_F_ML_LABEL)
|
|
#define DECAL_LIST_LABEL FPATH localize$(IDS_F_ML_LABEL)
|
|
|
|
#define TEAM_LIST_BOX FPATH localize$(IDS_F_ML_LABEL)
|
|
#define TEAM_LIST_LABEL FPATH localize$(IDS_F_ML_LABEL)
|
|
|
|
#define TABS_Y_DIFFER 15
|
|
|
|
#ifndef FRAME_HIGHLIGHT_COLOR // don't use #undef, gosscript don't redefine(& undefine too) symbols
|
|
#define FRAME_HIGHLIGHT_COLOR packcolor(64,64,64,255) // jcem
|
|
#endif // FRAME_HIGHLIGHT_COLOR
|
|
|
|
// MSL 5.06
|
|
#define USE_O_MORE_PODS $$g_nMechPodNum$$ // 0 = use only 8
|
|
|
|
#if USE_O_MORE_PODS
|
|
#define MAX_ROSTER_COUNT 16 // Was 8
|
|
#define MAX_TEAMMATE_COUNT 8 // Was 4
|
|
#else
|
|
#define MAX_ROSTER_COUNT 8
|
|
#define MAX_TEAMMATE_COUNT 4 // Was 4
|
|
#endif
|
|
|
|
#define MAX_SKIN_COUNT 16
|
|
// MSL 5.05
|
|
#define MAX_DECAL_COUNT 20 //jpp decal total num in dropdown
|
|
#define DO_VIRTUAL_TEST 0
|
|
|
|
#define USE_ALLOWED_MECHS 1
|
|
|
|
// MSL ADD MECH
|
|
// Max Allowed Mech = 65
|
|
#define MAX_ALLOWED_MECHS 65
|
|
|
|
#define VAR_LIST_HEIGHT 20
|
|
|
|
#define HEADER_TITLE_Y 56
|
|
#define ROSTER_DISPLAY_COUNT 8
|
|
#define ROSTER_START_X 1
|
|
#define ROSTER_LINE_START_X 440
|
|
#define ROSTER_START_Y 80
|
|
#define ROSTER_GAP2 3
|
|
#define ROSTER_HEIGHT ((VAR_LIST_HEIGHT * 2) + (ROSTER_GAP2 * 3))
|
|
#define ROSTER_OFFS1 (ROSTER_GAP2)
|
|
#define ROSTER_OFFS2 (ROSTER_HEIGHT - ROSTER_GAP2 - VAR_LIST_HEIGHT)
|
|
#define TESLA_STATUS_X 25//15//40
|
|
#define TESLA_STATUS_WIDTH 19
|
|
#define TESLA_STATUS_HEIGHT 19
|
|
#define BOT_LIST_X 50//75
|
|
#define BOT_LIST_WIDTH 120
|
|
#define PLAYER_EDIT_WIDTH 136
|
|
|
|
#if USE_O_MECH_VARIANT2
|
|
#define PRINT_TEXT_X 55//218//243 // Pod status
|
|
#else // !USE_O_MECH_VARIANT2
|
|
#define PRINT_TEXT_X 218//243 // Pod status
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
#if USE_O_MECH_VARIANT2
|
|
#define MECH_LIST_X 218//223
|
|
#define MECH_LIST_WIDTH 100//120
|
|
#define MECH_LIST_X2 218
|
|
#define MECH_LIST_WIDTH2 100
|
|
#define MECH_RAND_WIDTH 20 //(MECH_LIST_X2 - MECH_LIST_X)
|
|
#else // !USE_O_MECH_VARIANT2
|
|
#define MECH_LIST_X 218//243 // 223
|
|
#define MECH_LIST_WIDTH 100 // 120
|
|
#define MECH_RAND_WIDTH 20 // (MECH_LIST_X2 - MECH_LIST_X)
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
// MSL 5.05
|
|
#define DECAL_LIST_X 405 // Header
|
|
#define DECAL_BOX_SIZE 32
|
|
#define DECAL_BOX_X 400 // Image
|
|
#define DECAL_SIZE_X 24
|
|
#define DECAL_SIZE_Y 16
|
|
#define DECAL_X 441 // Dropdown list
|
|
#define SKIN_BOX_SIZE 32
|
|
#define SKIN_BOX_X 375//400 Image
|
|
#define SKIN_SIZE_X 24
|
|
#define SKIN_SIZE_Y 16
|
|
#define SKIN_X 376//370 // Dropdown list
|
|
#define TEAM_SIZE_X 16
|
|
#define TEAM_SIZE_Y 16
|
|
#define TEAM_X 374
|
|
#define CAM_STATUS_Y ((ROSTER_START_Y + ROSTER_HEIGHT * ROSTER_DISPLAY_COUNT) + 12)
|
|
#define CAM_DISPLAY_COUNT 3
|
|
|
|
#define DIVIDER_Y1 (HEADER_TITLE_Y + 20)
|
|
#define DIVIDER_Y2 (ROSTER_START_Y + ROSTER_HEIGHT * ROSTER_DISPLAY_COUNT + 3)
|
|
|
|
#define DISP_PLAYERS_X BOT_LIST_X
|
|
#define DISP_PLAYERS_Y (CAM_STATUS_Y + VAR_LIST_HEIGHT + 8)
|
|
|
|
#define ERROR_STRING_X 40 // MECH_LIST_X2
|
|
#define ERROR_STRING_X2 550
|
|
#define ERROR_STRING_Y 535
|
|
#define ERROR_STRING_Y2 (535 + 41) // see o_launch_button
|
|
|
|
#define ROWFIELD_TYPE_BOTTYPE 0
|
|
#define ROWFIELD_TYPE_EDITBOX 1
|
|
#define ROWFIELD_TYPE_MECH 2
|
|
#if USE_O_MECH_VARIANT2
|
|
#define ROWFIELD_TYPE_MECHVARIANT 3
|
|
#define ROWFIELD_TYPE_TEAMCAMO 4
|
|
#define ROWFIELD_TYPE_TEAMDECAL 5
|
|
#define MAX_SLOT_ITEMS 6
|
|
#else
|
|
#define ROWFIELD_TYPE_TEAMCAMO 3
|
|
#define ROWFIELD_TYPE_TEAMDECAL 4
|
|
#define MAX_SLOT_ITEMS 5
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
#define MAIL_ROSTER_LIST_MAXDISPLAY 19999
|
|
#define MAIL_ROSTER_LIST_CHANGED 20000
|
|
#define MAIL_PLAYER_TYPE_CHANGED 20001
|
|
#define MAIL_RESET_AFTER_LAUNCH 20002
|
|
#define MAIL_REMOVE_ALL_BOTS 20003
|
|
#define MAIL_CHANGE_LAUNCH_STATE 20004
|
|
#define MAIL_GET_SLOTTYPE 20005 // cur-row, return: 0: none, +1: user, +2: bot, 3: currently used
|
|
#define MAIL_SLOTTYPE_NONE 0
|
|
#define MAIL_SLOTTYPE_USER 1
|
|
#define MAIL_SLOTTYPE_BOT 2
|
|
#define MAIL_SLOTTYPE_USED 3
|
|
#define MAIL_PROCESS_TABEVENT 20006 // slot_item-index, dir(-1,+1)
|
|
#define MAIL_POSSIBLE_TABEVENT 20007 // row, slottype, item_index
|
|
#define MAIL_SET_ROOKIE_MISSION -1111 // sync with conlobby.script
|
|
#define MAIL_SET_ROOKIE_MISSION_PARAMS -3333 // sync with conlobby.script
|
|
#define MAIL_PREVIOUS_MISSION -2222
|
|
#define MAIL_RECORD_MISSION -4444
|
|
#define MAIL_PREVIOUS_MISSION_PARAMS -5555
|
|
#define MAIL_LOAD_AUTO_MISSION -6666 // [automaticmode] sync with Multiplayer/ConLobbyMission.script
|
|
|
|
// MSL 5.06
|
|
// MSL ADD MECH
|
|
// MechCorps Highlight: expanded from Fab4 to Super6 (added Archer and Warhammer)
|
|
#define ROOKIEMECH1 1 // Archer
|
|
#define ROOKIEMECH2 38 // Loki
|
|
#define ROOKIEMECH3 40 // Madcat
|
|
#define ROOKIEMECH4 56 // Thor
|
|
#define ROOKIEMECH5 61 // Vulture
|
|
#define ROOKIEMECH6 62 // Warhammer
|
|
|
|
main
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int nInterErrorCount = 0
|
|
int nVritual = DO_VIRTUAL_TEST
|
|
int mLauncherConnection // 0: no connection, +1: connection, -1: connecting
|
|
int mConnection2 // 0: no connection, +1: connection, -1: connecting
|
|
int mApplType
|
|
int mApplState
|
|
int mGameState
|
|
int mGameTime
|
|
int mGameIsServer
|
|
|
|
int nInitialRookieMission = 1 // initially, set rookie mission
|
|
int nLaunchState = 0
|
|
// 0 - not validated, 1: validated, 2: preparing loading, 3: loading, 4: loaded(before launch), 5: launching
|
|
// -1 : network map is not initiated
|
|
// -2 : total team count exceed
|
|
// -3 : team player count exceed
|
|
// -4 : no tesla player
|
|
// -5 : Player state error
|
|
// -6 : Player name is invalid
|
|
// -7 : Player-count exceeds maximum(16)
|
|
|
|
//Makes the connection to the string table .dll
|
|
//Requires the #include "Content\\ShellScripts\\ScriptStrings.h" in every script with localizable text
|
|
setresource("ScriptStrings.dll")
|
|
|
|
font3d boldfont = FPATH localize$(IDS_F_ML_DATA)
|
|
font3d regfont = FPATH localize$(IDS_F_ML_LABEL)
|
|
|
|
string null_string // null string
|
|
null_string = ""
|
|
|
|
string launch_states[6]
|
|
launch_states[0] = "LOAD"
|
|
launch_states[1] = "LOAD"
|
|
launch_states[2] = "Preparing..."
|
|
launch_states[3] = "LOADING..."
|
|
launch_states[4] = "LAUNCH"
|
|
launch_states[5] = "LAUNCHING..."
|
|
|
|
// object o_interlace = interlace
|
|
// o_interlace.location = 0, 0, 10
|
|
// o_interlace.lace_color = packcolor (100, 150, 255, 175)
|
|
|
|
object o_frame = frame
|
|
o_frame.type = 0
|
|
o_frame.location = 0, 0, 100
|
|
// MSL Version
|
|
o_frame.screen_name = "BattleTech Console V5.1.0b3" // localize$(IDS_MP_LOBBY_GAME_LOBBY)
|
|
initialize(o_frame)
|
|
|
|
int team_camo[16] // team_camo[selected team number] is skin number(0..36)...
|
|
team_camo[0] = 0 // blue
|
|
team_camo[1] = 1 // red
|
|
team_camo[2] = 2 // yellow
|
|
team_camo[3] = 3 // Green
|
|
team_camo[4] = 4 // Purple
|
|
team_camo[5] = 5 // Light Blue
|
|
team_camo[6] = 6 // Orange
|
|
team_camo[7] = 7 // charcoal
|
|
team_camo[8] = 15 //
|
|
team_camo[9] = 19 //
|
|
team_camo[10] = 26 //
|
|
team_camo[11] = 23 //
|
|
team_camo[12] = 28 //
|
|
team_camo[13] = 30 //
|
|
team_camo[14] = 36 //
|
|
team_camo[15] = 37 //
|
|
|
|
int TEAM_DECAL[17] // team_decal[selected team number] is decal number(0..63)...
|
|
TEAM_DECAL[0] = 3 // Steiner
|
|
TEAM_DECAL[1] = 4 // Kurita
|
|
TEAM_DECAL[2] = 2 // Davion
|
|
TEAM_DECAL[3] = 5 // Liao
|
|
TEAM_DECAL[4] = 6 // Marik
|
|
TEAM_DECAL[5] = 9 // Comstar
|
|
TEAM_DECAL[6] = 50 // VGL
|
|
TEAM_DECAL[7] = 10 // Star League
|
|
TEAM_DECAL[8] = 11 // Wolf
|
|
TEAM_DECAL[9] = 12 // Falcon
|
|
TEAM_DECAL[10] = 16 // Ghost Bear
|
|
TEAM_DECAL[11] = 20 // Hell Horses
|
|
TEAM_DECAL[12] = 21 // Coyote
|
|
TEAM_DECAL[13] = 22 // Blood Spirit
|
|
TEAM_DECAL[14] = 24 // Ice Hellion
|
|
TEAM_DECAL[15] = 27 // Goliath Scorpian
|
|
TEAM_DECAL[16] = 48 // 331st
|
|
|
|
int ffa_decal[36] // ffa_decal[selected skin number] is decal number(0..63)...
|
|
// currently, these values is useless... just for later usage //JPP add new decal here for in game use
|
|
ffa_decal[0] = 3
|
|
ffa_decal[1] = 4
|
|
ffa_decal[2] = 2
|
|
ffa_decal[3] = 5
|
|
ffa_decal[4] = 6
|
|
ffa_decal[5] = 9
|
|
ffa_decal[6] = 50
|
|
ffa_decal[7] = 10
|
|
ffa_decal[8] = 11 // Wolf
|
|
ffa_decal[9] = 12 // Falcon
|
|
ffa_decal[10] = 16 // Ghost Bears
|
|
ffa_decal[11] = 20 // Hell Horses
|
|
ffa_decal[12] = 21 // Coyote
|
|
ffa_decal[13] = 22 // Blood Spirit
|
|
ffa_decal[14] = 24 // Ice Hellion
|
|
ffa_decal[15] = 27 // Goliath Scorpion
|
|
ffa_decal[16] = 48 // 331st
|
|
ffa_decal[17] = 49 // ddc
|
|
ffa_decal[18] = 47 // FSA
|
|
ffa_decal[19] = 46 // BKG
|
|
ffa_decal[20] = 0 // below will not used, because "o_skins[x].list_size = 16"
|
|
//ffa_decal[18-36] = ...
|
|
|
|
int drop_count_mech[ROSTER_DISPLAY_COUNT]
|
|
drop_count_mech[0] = 21
|
|
drop_count_mech[1] = 21
|
|
drop_count_mech[2] = 20
|
|
drop_count_mech[3] = 17
|
|
drop_count_mech[4] = 14
|
|
drop_count_mech[5] = 12
|
|
drop_count_mech[6] = 9
|
|
drop_count_mech[7] = 7
|
|
|
|
int drop_count_skin[ROSTER_DISPLAY_COUNT]
|
|
drop_count_skin[0] = 21
|
|
drop_count_skin[1] = 21
|
|
drop_count_skin[2] = 20
|
|
drop_count_skin[3] = 17
|
|
drop_count_skin[4] = 14
|
|
drop_count_skin[5] = 12
|
|
drop_count_skin[6] = 9
|
|
drop_count_skin[7] = 7
|
|
|
|
int drop_count_decal[ROSTER_DISPLAY_COUNT]
|
|
drop_count_decal[0] = 21
|
|
drop_count_decal[1] = 21
|
|
drop_count_decal[2] = 20
|
|
drop_count_decal[3] = 17
|
|
drop_count_decal[4] = 14
|
|
drop_count_decal[5] = 12
|
|
drop_count_decal[6] = 9
|
|
drop_count_decal[7] = 7
|
|
|
|
int night_parameter = NIGHT_TIME_PARAMETER
|
|
int num_of_teams = TEAM_COUNT_PARAMETER
|
|
int team_param = TEAM_PARAMETER
|
|
int team_max_plyrs = TEAM_MAX_PLAYERS
|
|
int teamskin = TEAM_SKIN
|
|
int teamdecal = TEAM_DECAL[6]
|
|
|
|
int k
|
|
int x
|
|
|
|
callback($$CTCL_SetCDSP$$) // CTCL_SetConDefaultSeerverParameters
|
|
|
|
//do not delete
|
|
int game_type = RULE_TYPE_PARAMETER
|
|
int cur_game_type = callback($$GetLocalNetworkMissionParamater$$, game_type)
|
|
|
|
int team_allowed = TEAM_ALLOWED_PARAMETER
|
|
int cur_team_val
|
|
int cur_team_count[8]
|
|
|
|
cur_team_val = callback($$CTCL_GetTeamParams$$, cur_team_count[0])
|
|
|
|
int skin_id ///////VERY IMPORTANT FOR NEW SKIN INTERFACE
|
|
int skin_ids[17]
|
|
int update_skin = false
|
|
// MSL 5.05
|
|
int decal_id ///////VERY IMPORTANT FOR NEW DECAL INTERFACE
|
|
int decal_ids[20] //JPP was 18
|
|
int update_decal = false
|
|
int m_bApplyingAutoLoad = false // suppress skin_box auto decal sync during Load File apply
|
|
int ROSTER_top_of_list = 0
|
|
int block_launch_or_ready = FALSE
|
|
int MAX_ITEMS = 60
|
|
int MAX_MC_ITEMS = 30 //MAXIMUM NUMBER OF ITEMS LISTED
|
|
int MAX_MC_COLUMNS = 1
|
|
int MAX_MCCB_ITEMS = 30
|
|
int MAX_MCCB_COLUMNS = 2
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
/////////Tesla Interface - CTCL
|
|
////////////////////////////////////////////////////////////////////////////
|
|
int MAXTESLA = callback($$CTCL_Get$$, _CTCL_GetTeslaCountAll)
|
|
int MAXTESLA_P = callback($$CTCL_Get$$, _CTCL_GetTeslaCount)
|
|
|
|
// MSL 5.06
|
|
#if !USE_O_MORE_PODS
|
|
if (MAXTESLA_P > 8)
|
|
MAXTESLA_P = 8
|
|
#endif
|
|
int nRosterCount
|
|
|
|
if (MAX_ROSTER_COUNT < MAXTESLA_P)
|
|
nRosterCount = MAXTESLA_P
|
|
else
|
|
nRosterCount = MAX_ROSTER_COUNT
|
|
|
|
string m_aTeslaName[MAXTESLA]
|
|
int nTeslaIndex
|
|
for nTeslaIndex = 0; nTeslaIndex < MAXTESLA; nTeslaIndex++
|
|
{
|
|
m_aTeslaName[nTeslaIndex] = " " // important
|
|
callback($$CTCL_Get$$, _CTCL_GetTeslaName, nTeslaIndex, m_aTeslaName[nTeslaIndex])
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
/////////BOT STATUS BUTTON LISTBOX
|
|
////////////////////////////////////////////////////////////////////////////
|
|
object o_status_droplist = s_mc_listbox
|
|
o_status_droplist.location = 100,100,10000
|
|
o_status_droplist.boxFont3d = FPATH localize$(IDS_F_ML_LABEL) //MUST BE INITIALIZED
|
|
o_status_droplist.itemWidth = 100 //MUST BE INITIALIZED
|
|
o_status_droplist.itemHeight = 1 //This refers to the height of a step (or scroll distance in pixels) defined by you. NOT the height of all items
|
|
o_status_droplist.itemHeight_padding = 1 // 4//10
|
|
o_status_droplist.list_size = 4 //MAX_MCCB_ITEMS
|
|
o_status_droplist.NUM_OF_COLUMNS = 1
|
|
o_status_droplist.column_header_height = 0 //MUST BE INITIALIZED
|
|
o_status_droplist.max_displayed = 50 //30 // max number of itemheight's. maz_displayed*itemheight = height of listbox //MUST BE INITIALIZED
|
|
o_status_droplist.uniform_item_height = VAR_LIST_HEIGHT
|
|
|
|
o_status_droplist.backColor = packcolor (0, 0, 0, 255) //CAN BE INITIALIZED
|
|
|
|
o_status_droplist.label = "" //CAN BE INITIALIZED
|
|
o_status_droplist.labelFont3d = FPATH localize$(IDS_F_ML_LABEL) //CAN BE INITIALIZED
|
|
o_status_droplist.offsetLabel = 0,-18 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
|
|
o_status_droplist.buttonwidth = 16 //CAN BE INITIALIZED
|
|
o_status_droplist.first_delay = 10 //time delay value n/60; for the buttons
|
|
o_status_droplist.second_delay = 1 //time delay value n/60; for the buttons
|
|
o_status_droplist.column[0].location.x = 3
|
|
o_status_droplist.column[0].fontcolor = packcolor (255,255,255,255)
|
|
o_status_droplist.column[0].fontAlignment = just_left
|
|
o_status_droplist.nselected = 4
|
|
|
|
int greatest_x = 0
|
|
int greatest_y = 0
|
|
for k = 0; k < o_status_droplist.list_size; k++
|
|
{
|
|
if exists(o_status_droplist.column[0].list_icon[k])
|
|
{
|
|
if getwidth(o_status_droplist.column[0].list_icon[k]) > greatest_x
|
|
greatest_x = getwidth(o_status_droplist.column[0].list_icon[k])
|
|
|
|
if getheight(o_status_droplist.column[0].list_icon[k]) > greatest_y
|
|
greatest_y = getheight(o_status_droplist.column[0].list_icon[k])
|
|
}
|
|
}
|
|
if greatest_x > 0 && greatest_y > 0
|
|
bitmap_create black = greatest_x,greatest_y //comment out if you don't have any images
|
|
|
|
for k = 0;k < MAX_MCCB_ITEMS; k++
|
|
{
|
|
o_status_droplist.list_order[k] = k
|
|
}
|
|
|
|
o_status_droplist.column[0].list_item[0] = "Load/Kill" // localize$(IDS_MP_LOBBY_KICK_OUT)
|
|
o_status_droplist.column[0].list_item[1] = "Shutdown" // localize$(IDS_MP_LOBBY_CANCEL)
|
|
o_status_droplist.column[0].list_item[2] = "Reboot" // localize$(IDS_MP_LOBBY_CANCEL)
|
|
o_status_droplist.column[0].list_item[3] = "Cancel" // localize$(IDS_MP_LOBBY_CANCEL)
|
|
|
|
initialize (o_status_droplist)
|
|
deactivate (o_status_droplist)
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
/////////ADD BOT LISTBOX
|
|
////////////////////////////////////////////////////////////////////////////
|
|
object o_add_bot_droplist = s_mc_listbox
|
|
o_add_bot_droplist.location = 100,100,200
|
|
o_add_bot_droplist.boxFont3d = FONT_LIST_BOX
|
|
o_add_bot_droplist.itemWidth = 100 //MUST BE INITIALIZED
|
|
o_add_bot_droplist.itemHeight = 1 //This refers to the height of a step (or scroll distance in pixels) defined by you. NOT the height of all items
|
|
o_add_bot_droplist.itemHeight_padding = 4//10
|
|
o_add_bot_droplist.list_size = 2 //MAX_MCCB_ITEMS
|
|
o_add_bot_droplist.NUM_OF_COLUMNS = 1
|
|
o_add_bot_droplist.column_header_height = 0 //MUST BE INITIALIZED
|
|
o_add_bot_droplist.max_displayed = 40//30 // max number of itemheight's. maz_displayed*itemheight = height of listbox //MUST BE INITIALIZED
|
|
o_add_bot_droplist.uniform_item_height = 0
|
|
|
|
o_add_bot_droplist.backColor = packcolor (0, 0, 0, 255) //CAN BE INITIALIZED
|
|
|
|
o_add_bot_droplist.label = "" //CAN BE INITIALIZED
|
|
o_add_bot_droplist.labelFont3d = FONT_LIST_LABEL
|
|
o_add_bot_droplist.offsetLabel = 0,-18 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
|
|
o_add_bot_droplist.buttonwidth = 16 //CAN BE INITIALIZED
|
|
o_add_bot_droplist.first_delay = 10 //time delay value n/60; for the buttons
|
|
o_add_bot_droplist.second_delay = 1 //time delay value n/60; for the buttons
|
|
o_add_bot_droplist.column[0].location.x = 3
|
|
o_add_bot_droplist.column[0].fontcolor = packcolor (255,255,255,255)
|
|
o_add_bot_droplist.column[0].fontAlignment = just_left
|
|
o_add_bot_droplist.nselected = 3
|
|
|
|
greatest_x = 0
|
|
greatest_y = 0
|
|
|
|
for k = 0; k < o_add_bot_droplist.list_size; k++
|
|
{
|
|
if exists(o_add_bot_droplist.column[0].list_icon[k])
|
|
{
|
|
if getwidth(o_add_bot_droplist.column[0].list_icon[k]) > greatest_x
|
|
greatest_x = getwidth(o_add_bot_droplist.column[0].list_icon[k])
|
|
|
|
if getheight(o_add_bot_droplist.column[0].list_icon[k]) > greatest_y
|
|
greatest_y = getheight(o_add_bot_droplist.column[0].list_icon[k])
|
|
}
|
|
}
|
|
if greatest_x > 0 && greatest_y > 0
|
|
black = greatest_x,greatest_y //comment out if you don't have any images
|
|
|
|
|
|
for k = 0;k < MAX_MCCB_ITEMS; k++
|
|
{
|
|
o_add_bot_droplist.list_order[k] = k
|
|
}
|
|
|
|
o_add_bot_droplist.column[0].list_item[0] = localize$(IDS_MP_LOBBY_ADD_BOT)
|
|
o_add_bot_droplist.column[0].list_item[1] = localize$(IDS_MP_LOBBY_CANCEL)
|
|
|
|
initialize (o_add_bot_droplist)
|
|
deactivate (o_add_bot_droplist)
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
///---------holds faction name for scroll list
|
|
string faction_name[17]
|
|
|
|
callback($$Shell_CallbackHandler$$, ShellInitMPScreen)
|
|
|
|
//this is your list of mechs to choose from
|
|
string mech[$$m_mechCount$$]
|
|
int stock_id[$$m_mechCount$$]
|
|
int stock_array[$$m_mechCount$$ + 1]
|
|
int allowed_mechs[MAX_ALLOWED_MECHS]
|
|
callback($$Shell_CallbackHandler$$, ShellDataGetMechs ,mech[], stock_id[])
|
|
|
|
if (USE_ALLOWED_MECHS)
|
|
{
|
|
// MSL ADD MECH
|
|
|
|
allowed_mechs[ 0 ] = 0 // Annihilator
|
|
allowed_mechs[ 1 ] = 1 // Archer
|
|
allowed_mechs[ 2 ] = 2 // Arctic Wolf
|
|
allowed_mechs[ 3 ] = 3 // Ares
|
|
allowed_mechs[ 4 ] = 4 // Argus
|
|
allowed_mechs[ 5 ] = 5 // Assassin2
|
|
allowed_mechs[ 6 ] = 6 // Atlas
|
|
allowed_mechs[ 7 ] = 7 // Avatar
|
|
allowed_mechs[ 8 ] = 8 // Awesome
|
|
allowed_mechs[ 9 ] = 9 // Battlemaster
|
|
allowed_mechs[ 10 ] = 10 // Battlemasteriic
|
|
allowed_mechs[ 11 ] = 11 // Behemoth
|
|
allowed_mechs[ 12 ] = 12 // Behemoth II
|
|
allowed_mechs[ 13 ] = 13 // Black Hawk
|
|
allowed_mechs[ 14 ] = 14 // Black Knight
|
|
allowed_mechs[ 15 ] = 15 // Black Lanner
|
|
allowed_mechs[ 16 ] = 16 // Brigand
|
|
allowed_mechs[ 17 ] = 17 // Bushwacker
|
|
allowed_mechs[ 18 ] = 18 // Catapult
|
|
allowed_mechs[ 19 ] = 19 // cauldron-born
|
|
allowed_mechs[ 20 ] = 20 // Chimera
|
|
allowed_mechs[ 21 ] = 21 // Commando
|
|
allowed_mechs[ 22 ] = 22 // Cougar
|
|
allowed_mechs[ 23 ] = 23 // Cyclops
|
|
allowed_mechs[ 24 ] = 24 // Daishi
|
|
allowed_mechs[ 25 ] = 25 // Deimos
|
|
allowed_mechs[ 26 ] = 26 // Dragon
|
|
allowed_mechs[ 27 ] = 27 // Fafnir
|
|
allowed_mechs[ 28 ] = 28 // Flea
|
|
allowed_mechs[ 29 ] = 29 // Gladiator
|
|
allowed_mechs[ 30 ] = 30 // Grizzly
|
|
allowed_mechs[ 31 ] = 31 // Hauptmann
|
|
allowed_mechs[ 32 ] = 32 // Hellhound
|
|
allowed_mechs[ 33 ] = 33 // Hellspawn
|
|
allowed_mechs[ 34 ] = 34 // Highlander
|
|
allowed_mechs[ 35 ] = 35 // Hollander II
|
|
allowed_mechs[ 36 ] = 36 // Hunchback
|
|
allowed_mechs[ 37 ] = 37 // Kodiak
|
|
allowed_mechs[ 38 ] = 38 // Loki
|
|
allowed_mechs[ 39 ] = 39 // Longbow
|
|
allowed_mechs[ 40 ] = 40 // Madcat
|
|
allowed_mechs[ 41 ] = 41 // Madcat Mk. II
|
|
allowed_mechs[ 42 ] = 42 // Masakari
|
|
allowed_mechs[ 43 ] = 43 // Mauler
|
|
allowed_mechs[ 44 ] = 44 // Novacat
|
|
allowed_mechs[ 45 ] = 45 // Osiris
|
|
allowed_mechs[ 46 ] = 46 // Owens
|
|
allowed_mechs[ 47 ] = 47 // Puma
|
|
allowed_mechs[ 48 ] = 48 // Raven
|
|
allowed_mechs[ 49 ] = 49 // Rifleman
|
|
allowed_mechs[ 50 ] = 50 // Ryoken
|
|
allowed_mechs[ 51 ] = 51 // Shadowcat
|
|
allowed_mechs[ 52 ] = 52 // Solitaire
|
|
allowed_mechs[ 53 ] = 53 // Sunder
|
|
allowed_mechs[ 54 ] = 54 // Templar
|
|
allowed_mechs[ 55 ] = 55 // Thanatos
|
|
allowed_mechs[ 56 ] = 56 // Thor
|
|
allowed_mechs[ 57 ] = 57 // Uller
|
|
allowed_mechs[ 58 ] = 58 // Urbanmech
|
|
allowed_mechs[ 59 ] = 59 // Uziel
|
|
allowed_mechs[ 60 ] = 60 // Victor
|
|
allowed_mechs[ 61 ] = 61 // Vulture
|
|
allowed_mechs[ 62 ] = 62 // Warhammer
|
|
allowed_mechs[ 63 ] = 63 // Wolfhound
|
|
allowed_mechs[ 64 ] = 64 // Zeus
|
|
|
|
}
|
|
|
|
string mech2[$$m_mechCount$$]
|
|
int variant_step = 0
|
|
int stock_len = 0
|
|
for (k = 0; k < $$m_mechCount$$; k++)
|
|
{
|
|
if (stock_id[k] == 1)
|
|
{
|
|
//if (k == 0) // Cameraship is already excluded
|
|
// mech2[k] = mech[k]
|
|
//else
|
|
mech2[k] = localize$(IDS_MP_LOBBY_STOCK)
|
|
stock_len = length$(mech[k]) + 1
|
|
stock_array[variant_step] = k
|
|
variant_step++
|
|
}
|
|
else
|
|
{
|
|
mech2[k] = right$(mech[k], length$(mech[k]) - stock_len)
|
|
}
|
|
}
|
|
stock_array[variant_step] = k
|
|
|
|
font3d gFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
pane droplist_button = WPATH "DropList_arrowdown.tga"
|
|
alphamode (droplist_button) = am_alpha_oneone
|
|
|
|
pane down_arrow = WPATH "iagndownarrow.tga"
|
|
alphamode (down_arrow) = am_alpha_oneone
|
|
|
|
sound press = SPATH "sfx_button5.wav"
|
|
sound launchSound = SPATH "sfx_mech_explode.WAV"
|
|
|
|
// region = 0,0 to 10,10
|
|
font3d screen_font = FPATH localize$(IDS_F_ML_LABEL)
|
|
|
|
int valid_player
|
|
int team_legal_to_join[9] // needed for dropdowns on team selections
|
|
team_legal_to_join[8] = TRUE
|
|
int update_team = 0
|
|
|
|
int max_players = 16
|
|
|
|
int player_num = 0
|
|
// int num_of_teams = 8
|
|
int mech_id
|
|
int name_color[17]
|
|
int lupe
|
|
|
|
for lupe = 0; lupe < nRosterCount;lupe++
|
|
{
|
|
name_color[lupe]= packcolor(255,255,255,255)
|
|
}
|
|
|
|
callback($$InitNetworkScenarios$$)
|
|
|
|
object o_display_num_of_players = display_num_of_players
|
|
o_display_num_of_players.location = DISP_PLAYERS_X,DISP_PLAYERS_Y,10
|
|
|
|
object o_launch_button = s_multistatepane
|
|
o_launch_button.total_states = 3
|
|
o_launch_button.textsize = 1
|
|
o_launch_button.text = "LOAD" // localize$(IDS_MP_LOBBY_LAUNCH)
|
|
o_launch_button.file = WPATH "button_main_200x41_3state.tga"
|
|
o_launch_button.location = 570, 535, o_frame.location.z + 1
|
|
o_launch_button.state = 2 // MSL
|
|
initialize(o_launch_button)
|
|
|
|
player_num = -1
|
|
|
|
// ComboBox for the Player Type
|
|
object o_BotList[17]
|
|
object o_BotList_bu[17]
|
|
int m_naLastSelected[17]
|
|
for x = 0; x < nRosterCount; x++
|
|
{
|
|
m_naLastSelected[x] = 0
|
|
}
|
|
object o_Editbox[17]
|
|
object o_print_text[17]
|
|
object o_mech_variant[17]
|
|
object o_mech_variant_bu[17]
|
|
#if USE_O_MECH_VARIANT2
|
|
object o_mech_variant2[17]
|
|
object o_mech_variant2_bu[17]
|
|
#endif // USE_O_MECH_VARIANT2
|
|
object o_mech_rand[17]
|
|
object o_skins[17]
|
|
object o_skins_bu[17]
|
|
// MSL 5.05
|
|
object o_decal[18]
|
|
object o_decal_bu[18]
|
|
object o_team[18]
|
|
object o_team_bu[18]
|
|
object o_decal_box[18]
|
|
object o_skin_box[18]
|
|
object o_status[18]
|
|
int roster_posy[18]
|
|
int coolbaby
|
|
|
|
int stock_size = 0
|
|
int last_mech = 0
|
|
int last_count = 0
|
|
int mech_selected = 0
|
|
int stock_mech_selected = 0
|
|
#if USE_O_MECH_VARIANT2
|
|
int variant_mech_selected = 0
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
for x = 0; x < nRosterCount; x++
|
|
{
|
|
roster_posy[x] = ROSTER_START_Y+(x*ROSTER_HEIGHT)//84+(x*44)
|
|
o_status[x] = status_control
|
|
#if USE_O_MECH_VARIANT2
|
|
o_status[x].location = TESLA_STATUS_X,roster_posy[x] + ROSTER_OFFS1,5
|
|
#else // !USE_O_MECH_VARIANT2
|
|
o_status[x].location = TESLA_STATUS_X,roster_posy[x] + ROSTER_OFFS1,5
|
|
#endif // USE_O_MECH_VARIANT2
|
|
o_status[x].file = GPATH "multiplayer\\5state_lobby_status.tga"
|
|
o_status[x].total_states = 5
|
|
o_status[x].id = x
|
|
if (x < MAXTESLA_P) // tesla
|
|
o_status[x].state = 0
|
|
else
|
|
o_status[x].state = 3
|
|
|
|
initialize (o_status[x])
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
activate (o_status[x])
|
|
else
|
|
deactivate (o_status[x])
|
|
|
|
MAX_ITEMS = 11 // 1(blank) 1(tesla) 9
|
|
o_BotList[x] = s_droplistbox
|
|
// MSL 5.02
|
|
o_BotList_bu[x] = s_droplistbox
|
|
MAX_ITEMS = 60
|
|
o_BotList[x].location = BOT_LIST_X,roster_posy[x] + ROSTER_OFFS1,10*((35-x)+1)
|
|
o_BotList[x].label = ""
|
|
o_BotList[x].itemWidth = BOT_LIST_WIDTH
|
|
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
o_BotList[x].max_displayed = drop_count_mech[x]
|
|
else
|
|
o_BotList[x].max_displayed = 16
|
|
|
|
o_BotList[x].boxFont3d = FONT_LIST_BOX
|
|
o_BotList[x].backColor = packcolor (0, 0, 0, 255)
|
|
o_BotList[x].boxTextColor = packcolor (255, 255, 255, 255)
|
|
o_BotList[x].boxTextSelectedColor = packcolor (125, 125, 125, 255)
|
|
o_BotList[x].frameHighlightColor = FRAME_HIGHLIGHT_COLOR // packcolor (255, 255, 255, 255)
|
|
o_BotList[x].boxhighlightColor = packcolor (50, 120, 255, 200)
|
|
o_BotList[x].ItemHighlightColor = packcolor (0, 0, 0, 255)
|
|
o_BotList[x].selectedColor = packcolor (120, 120, 255, 150)
|
|
o_BotList[x].labelTextColor = packcolor (255, 255, 255, 255)
|
|
o_BotList[x].borderColor = packcolor (255, 255, 255, 255)
|
|
o_BotList[x].itemHeight = VAR_LIST_HEIGHT
|
|
o_BotList[x].labelFont3d = FONT_LIST_LABEL
|
|
o_BotList[x].offsetLabel = 0,0
|
|
o_BotList[x].arrowHeight = 15
|
|
|
|
nTeslaIndex = 0
|
|
o_BotList[x].list_item[nTeslaIndex++] = ""
|
|
if (x < MAXTESLA_P)
|
|
{
|
|
o_BotList[x].list_item[nTeslaIndex++] = TESLA_PREFIX m_aTeslaName[x] TESLA_POSTFIX
|
|
}
|
|
|
|
o_BotList[x].list_item[nTeslaIndex++] = "Target Practice"
|
|
o_BotList[x].list_item[nTeslaIndex++] = "Rookie - 2"
|
|
o_BotList[x].list_item[nTeslaIndex++] = "Regular - 3"
|
|
o_BotList[x].list_item[nTeslaIndex++] = "Regular - 4"
|
|
o_BotList[x].list_item[nTeslaIndex++] = "Regular - 5"
|
|
o_BotList[x].list_item[nTeslaIndex++] = "Veteran - 6"
|
|
o_BotList[x].list_item[nTeslaIndex++] = "Veteran - 7"
|
|
o_BotList[x].list_item[nTeslaIndex++] = "Expert - 8"
|
|
o_BotList[x].list_item[nTeslaIndex++] = "Expert - 9"
|
|
// MSL 5.02
|
|
o_BotList_bu[x].nselected = 0
|
|
o_BotList[x].nselected = 0
|
|
o_BotList[x].list_size = nTeslaIndex
|
|
|
|
initialize(o_BotList[x])
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
activate(o_BotList[x])
|
|
else
|
|
deactivate(o_BotList[x])
|
|
|
|
o_Editbox[x] = s_editbox
|
|
o_Editbox[x].location = BOT_LIST_X, roster_posy[x] + ROSTER_OFFS2, 10
|
|
o_Editbox[x].boxWidth = PLAYER_EDIT_WIDTH
|
|
o_Editbox[x].boxHeight = VAR_LIST_HEIGHT
|
|
o_Editbox[x].boxFont3D = FONT_EDIT_BOX
|
|
o_Editbox[x].labelFont3D = szPATH_FONTS localize$(IDS_F_GEN_LABEL)
|
|
//o_Editbox[x].label = localize$(IDS_MP_BOT_NAME)
|
|
o_Editbox[x].boxTextOffset = 5, 3
|
|
o_Editbox[x].offset = 0, -15
|
|
o_Editbox[x].boxtextlimit = 16
|
|
o_Editbox[x].Auto_Update = false
|
|
o_Editbox[x].disable_forward_slash = true
|
|
o_Editbox[x].bl_noEdit = false
|
|
initialize(o_Editbox[x])
|
|
deactivate(o_Editbox[x])
|
|
|
|
o_print_text[x] = s_print_text
|
|
o_print_text[x].location = PRINT_TEXT_X,roster_posy[x] + ROSTER_OFFS2,5
|
|
|
|
o_print_text[x].id = x
|
|
o_print_text[x].text_font = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_print_text[x].text_color = packcolor(255,255,255,255)
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
activate(o_print_text[x])
|
|
else
|
|
deactivate(o_print_text[x])
|
|
|
|
MAX_ITEMS = $$m_mechCount$$
|
|
o_mech_variant[x] = s_droplistbox_mech
|
|
// MSL 5.02
|
|
o_mech_variant_bu[x] = s_droplistbox_mech
|
|
MAX_ITEMS = 60
|
|
o_mech_variant[x].location = MECH_LIST_X,roster_posy[x] + ROSTER_OFFS1,10*((35-x)+1)
|
|
o_mech_variant[x].label = ""
|
|
o_mech_variant[x].itemWidth = MECH_LIST_WIDTH
|
|
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
o_mech_variant[x].max_displayed = drop_count_mech[x]
|
|
else
|
|
o_mech_variant[x].max_displayed = 16
|
|
|
|
o_mech_variant[x].boxFont3d = FONT_LIST_BOX
|
|
o_mech_variant[x].backColor = packcolor (0, 0, 0, 255)
|
|
o_mech_variant[x].boxTextColor = packcolor (255, 255, 255, 255)
|
|
o_mech_variant[x].boxTextSelectedColor = packcolor (125, 125, 125, 255)
|
|
o_mech_variant[x].frameHighlightColor = FRAME_HIGHLIGHT_COLOR // packcolor (255, 255, 255, 255)
|
|
o_mech_variant[x].boxhighlightColor = packcolor (50, 120, 255, 200)
|
|
o_mech_variant[x].ItemHighlightColor = packcolor (0, 0, 0, 255)
|
|
o_mech_variant[x].selectedColor = packcolor (120, 120, 255, 150)
|
|
o_mech_variant[x].labelTextColor = packcolor (255, 255, 0, 255)
|
|
o_mech_variant[x].borderColor = packcolor (255, 255, 255, 255)
|
|
o_mech_variant[x].itemHeight = VAR_LIST_HEIGHT
|
|
o_mech_variant[x].labelFont3d = FONT_LIST_LABEL
|
|
o_mech_variant[x].offsetLabel = 0,0
|
|
o_mech_variant[x].arrowHeight = 15
|
|
|
|
stock_size = 0
|
|
if (USE_ALLOWED_MECHS)
|
|
{
|
|
o_mech_variant[x].list_size = MAX_ALLOWED_MECHS
|
|
for k = 0; k < MAX_ALLOWED_MECHS; k++
|
|
{
|
|
o_mech_variant[x].list_item[stock_size] = mech[stock_array[allowed_mechs[k]]]
|
|
stock_size++
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for k = 0; k < $$m_mechCount$$; k++
|
|
{
|
|
if (stock_id[k] == 1)
|
|
{
|
|
o_mech_variant[x].list_item[stock_size] = mech[k]
|
|
stock_size++
|
|
}
|
|
}
|
|
}
|
|
o_mech_variant[x].list_size = stock_size
|
|
#if USE_O_MECH_VARIANT2
|
|
MAX_ITEMS = $$m_mechCount$$
|
|
o_mech_variant2[x] = s_droplistbox_mech
|
|
o_mech_variant2_bu[x] = s_droplistbox_mech
|
|
MAX_ITEMS = 60
|
|
o_mech_variant2[x].location = MECH_LIST_X2,roster_posy[x] + ROSTER_OFFS2,10*((35-x)+1) - 4
|
|
o_mech_variant2[x].label = ""
|
|
o_mech_variant2[x].itemWidth = MECH_LIST_WIDTH2
|
|
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
o_mech_variant2[x].max_displayed = drop_count_mech[x] - 1
|
|
else
|
|
o_mech_variant2[x].max_displayed = 16
|
|
|
|
o_mech_variant2[x].boxFont3d = FONT_LIST_BOX
|
|
o_mech_variant2[x].backColor = packcolor (0, 0, 0, 255)
|
|
o_mech_variant2[x].boxTextColor = packcolor (255, 255, 255, 255)
|
|
o_mech_variant2[x].boxTextSelectedColor = packcolor (125, 125, 125, 255)
|
|
o_mech_variant2[x].frameHighlightColor = FRAME_HIGHLIGHT_COLOR // packcolor (255, 255, 255, 255)
|
|
o_mech_variant2[x].boxhighlightColor = packcolor (50, 120, 255, 200)
|
|
o_mech_variant2[x].ItemHighlightColor = packcolor (0, 0, 0, 255)
|
|
o_mech_variant2[x].selectedColor = packcolor (120, 120, 255, 150)
|
|
o_mech_variant2[x].labelTextColor = packcolor (255, 255, 255, 255)
|
|
o_mech_variant2[x].borderColor = packcolor (255, 255, 255, 255)
|
|
o_mech_variant2[x].itemHeight = VAR_LIST_HEIGHT
|
|
o_mech_variant2[x].labelFont3d = FONT_LIST_LABEL
|
|
o_mech_variant2[x].offsetLabel = 0,0
|
|
o_mech_variant2[x].arrowHeight = 15
|
|
#endif // USE_O_MECH_VARIANT2
|
|
last_mech = 0
|
|
if (USE_ALLOWED_MECHS)
|
|
{
|
|
stock_mech_selected = allowed_mechs[last_mech]
|
|
}
|
|
else
|
|
{
|
|
stock_mech_selected = last_mech
|
|
}
|
|
last_count = stock_array[stock_mech_selected]
|
|
#if USE_O_MECH_VARIANT2
|
|
o_mech_variant2[x].list_size = 0
|
|
do
|
|
{
|
|
o_mech_variant2[x].list_item[o_mech_variant2[x].list_size] = mech2[last_count]
|
|
o_mech_variant2[x].list_size++
|
|
last_count++
|
|
if (last_count == $$m_MechCount$$)
|
|
break
|
|
}
|
|
while (stock_id[last_count] != 1)
|
|
|
|
o_mech_variant[x].nselected = last_mech
|
|
o_mech_variant2[x].nselected = 0
|
|
#endif // USE_O_MECH_VARIANT2
|
|
initialize(o_mech_variant[x])
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
activate(o_mech_variant[x])
|
|
else
|
|
deactivate(o_mech_variant[x])
|
|
#if USE_O_MECH_VARIANT2
|
|
initialize(o_mech_variant2[x])
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
activate(o_mech_variant2[x])
|
|
else
|
|
deactivate(o_mech_variant2[x])
|
|
#endif // USE_O_MECH_VARIANT2
|
|
o_mech_rand[x] = mech_randomizer
|
|
o_mech_rand[x].id = x
|
|
o_mech_rand[x].location = MECH_LIST_X - MECH_RAND_WIDTH, roster_posy[x] + ROSTER_OFFS1,10*((35-x)+1) - 4
|
|
o_mech_rand[x].itemWidth = MECH_RAND_WIDTH
|
|
o_mech_rand[x].itemHeight = VAR_LIST_HEIGHT
|
|
initialize(o_mech_rand[x])
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
activate(o_mech_rand[x])
|
|
else
|
|
deactivate(o_mech_rand[x])
|
|
|
|
//------------------------------------------------------------------------------------------------------------
|
|
|
|
o_decal[x] = s_droplistbox_skins
|
|
o_decal_bu[x] = s_droplistbox_skins
|
|
o_decal[x].location = DECAL_X,(roster_posy[x] + (ROSTER_HEIGHT - DECAL_SIZE_Y) / 2)-3,5*((25-x)+1)
|
|
o_decal[x].list_size = MAX_DECAL_COUNT // MSL - Changed from 36
|
|
o_decal[x].label = ""
|
|
o_decal[x].itemWidth = DECAL_SIZE_X // +65
|
|
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
o_decal[x].max_displayed = drop_count_decal[x]
|
|
else
|
|
o_decal[x].max_displayed = 17
|
|
|
|
o_decal[x].boxFont3d = DECAL_LIST_BOX
|
|
o_decal[x].frameHighlightColor = FRAME_HIGHLIGHT_COLOR // packcolor (255, 255, 255, 255)
|
|
o_decal[x].itemHeight = DECAL_SIZE_Y
|
|
o_decal[x].labelFont3d = DECAL_LIST_LABEL
|
|
o_decal[x].offsetLabel = 0,0
|
|
o_decal[x].arrowHeight = 15
|
|
o_decal[x].id = x
|
|
|
|
// o_decal[x].list_item[0] = "STIENER"
|
|
// o_decal[x].list_item[1] = "KURITA"
|
|
// o_decal[x].list_item[2] = "DAVION"
|
|
// o_decal[x].list_item[3] = "LIAO"
|
|
// o_decal[x].list_item[4] = "MARIK"
|
|
// o_decal[x].list_item[5] = "COMSTAR"
|
|
// o_decal[x].list_item[6] = "VGL"
|
|
// o_decal[x].list_item[7] = "LEAGUE"
|
|
// o_decal[x].list_item[8] = "WOLF"
|
|
// o_decal[x].list_item[9] = "FALCON"
|
|
// o_decal[x].list_item[10] = "BEAR"
|
|
// o_decal[x].list_item[11] = "HORSES"
|
|
// o_decal[x].list_item[12] = "COYOTE"
|
|
// o_decal[x].list_item[13] = "SPIRIT"
|
|
// o_decal[x].list_item[14] = "HELLION"
|
|
// o_decal[x].list_item[15] = "SCORPION"
|
|
// o_decal[x].list_item[16] = "331st"
|
|
|
|
for coolbaby = 0; coolbaby < MAX_DECAL_COUNT; coolbaby++
|
|
o_decal[x].list_item[coolbaby] = conv$(ffa_decal[coolbaby])
|
|
o_decal[x].list_item[MAX_DECAL_COUNT] = "00" // bot/default entry
|
|
|
|
o_decal[x].nselected = 3
|
|
decal_ids[x] = 1
|
|
|
|
initialize(o_decal[x])
|
|
//if (x < ROSTER_DISPLAY_COUNT) && !cur_team_val
|
|
// activate(o_decal[x])
|
|
//else
|
|
deactivate(o_decal[x])
|
|
|
|
//-----------------------------
|
|
o_skins[x] = s_droplistbox_skins
|
|
o_skins_bu[x] = s_droplistbox_skins
|
|
o_skins[x].location = SKIN_X,(roster_posy[x] + (ROSTER_HEIGHT - SKIN_SIZE_Y) / 2)-3,5*((25-x)+1)
|
|
o_skins[x].list_size = MAX_SKIN_COUNT // MSL - Changed from 36
|
|
o_skins[x].label = ""
|
|
o_skins[x].itemWidth = SKIN_SIZE_X // +65
|
|
|
|
if (x < ROSTER_DISPLAY_COUNT)
|
|
o_skins[x].max_displayed = drop_count_skin[x]
|
|
else
|
|
o_skins[x].max_displayed = 16
|
|
|
|
o_skins[x].boxFont3d = SKIN_LIST_BOX
|
|
o_skins[x].frameHighlightColor = FRAME_HIGHLIGHT_COLOR // packcolor (255, 255, 255, 255)
|
|
o_skins[x].itemHeight = SKIN_SIZE_Y
|
|
o_skins[x].labelFont3d = SKIN_LIST_LABEL
|
|
o_skins[x].offsetLabel = 0,0
|
|
o_skins[x].arrowHeight = 15
|
|
o_skins[x].id = x
|
|
|
|
// o_skins[x].list_item[0] = "STIENER"
|
|
// o_skins[x].list_item[1] = "KURITA"
|
|
// o_skins[x].list_item[2] = "DAVION"
|
|
// o_skins[x].list_item[3] = "LIAO"
|
|
// o_skins[x].list_item[4] = "MARIK"
|
|
// o_skins[x].list_item[5] = "COMSTAR"
|
|
// o_skins[x].list_item[6] = "VGL"
|
|
// o_skins[x].list_item[7] = "LEAGUE"
|
|
// o_skins[x].list_item[8] = "WOLF"
|
|
// o_skins[x].list_item[9] = "FALCON"
|
|
// o_skins[x].list_item[10] = "BEAR"
|
|
// o_skins[x].list_item[11] = "HORSES"
|
|
// o_skins[x].list_item[12] = "COYOTE"
|
|
// o_skins[x].list_item[13] = "SPIRIT"
|
|
// o_skins[x].list_item[14] = "HELLION"
|
|
// o_skins[x].list_item[15] = "SCORPION"
|
|
|
|
o_skins[x].list_item[0] = "1"
|
|
o_skins[x].list_item[1] = "2"
|
|
o_skins[x].list_item[2] = "3"
|
|
o_skins[x].list_item[3] = "4"
|
|
o_skins[x].list_item[4] = "5"
|
|
o_skins[x].list_item[5] = "6"
|
|
o_skins[x].list_item[6] = "7"
|
|
o_skins[x].list_item[7] = "8"
|
|
o_skins[x].list_item[8] = "9"
|
|
o_skins[x].list_item[9] = "10"
|
|
o_skins[x].list_item[10] = "11"
|
|
o_skins[x].list_item[11] = "12"
|
|
o_skins[x].list_item[12] = "13"
|
|
o_skins[x].list_item[13] = "14"
|
|
o_skins[x].list_item[14] = "15"
|
|
o_skins[x].list_item[15] = "16"
|
|
|
|
for coolbaby = 16;coolbaby < o_skins[x].list_size+1;coolbaby++
|
|
o_skins[x].list_item[coolbaby] = conv$(coolbaby+1)
|
|
|
|
o_skins[x].nselected = 3
|
|
skin_ids[x] = 1
|
|
|
|
initialize(o_skins[x])
|
|
//if (x < ROSTER_DISPLAY_COUNT) && !cur_team_val
|
|
// activate(o_skins[x])
|
|
//else
|
|
deactivate(o_skins[x])
|
|
|
|
o_team[x] = s_droplistbox_skins
|
|
o_team_bu[x] = s_droplistbox_skins
|
|
o_team[x].dlb_type = 1
|
|
o_team[x].location = TEAM_X+2,(roster_posy[x] + (ROSTER_HEIGHT - TEAM_SIZE_Y) / 2)-3,5*((25-x)+1)
|
|
o_team[x].list_size = cur_team_val
|
|
o_team[x].label = ""
|
|
o_team[x].itemWidth = TEAM_SIZE_X
|
|
o_team[x].max_displayed = 16
|
|
o_team[x].boxFont3d = TEAM_LIST_BOX
|
|
o_team[x].frameHighlightColor = FRAME_HIGHLIGHT_COLOR // packcolor (255, 255, 255, 255)
|
|
o_team[x].itemHeight = TEAM_SIZE_Y
|
|
o_team[x].labelFont3d = TEAM_LIST_LABEL
|
|
o_team[x].offsetLabel = 0,0
|
|
o_team[x].arrowHeight = 15
|
|
o_team[x].id = x
|
|
|
|
if !o_team[x].list_size
|
|
o_team[x].list_size = 1
|
|
|
|
o_team[x].list_item[0] = "1"
|
|
o_team[x].list_item[1] = "2"
|
|
o_team[x].list_item[2] = "3"
|
|
o_team[x].list_item[3] = "4"
|
|
o_team[x].list_item[4] = "5"
|
|
o_team[x].list_item[5] = "6"
|
|
o_team[x].list_item[6] = "7"
|
|
o_team[x].list_item[7] = "8"
|
|
|
|
o_team[x].nselected = 0//8
|
|
|
|
initialize(o_team[x])
|
|
if (x < ROSTER_DISPLAY_COUNT) && cur_team_val
|
|
activate(o_team[x])
|
|
else
|
|
deactivate(o_team[x])
|
|
|
|
o_skin_box[x] = skin_box
|
|
o_skin_box[x].location = SKIN_BOX_X-35,(roster_posy[x] + (ROSTER_HEIGHT - SKIN_BOX_SIZE) / 2)-3,5
|
|
o_skin_box[x].id = x
|
|
// if (x < ROSTER_DISPLAY_COUNT)
|
|
// activate(o_skin_box[x])
|
|
// else
|
|
deactivate(o_skin_box[x])
|
|
|
|
o_decal_box[x] = decal_box
|
|
o_decal_box[x].location = DECAL_BOX_X-35,(roster_posy[x] + (ROSTER_HEIGHT - DECAL_BOX_SIZE) / 2)-3,5
|
|
o_decal_box[x].id = x
|
|
// if (x < ROSTER_DISPLAY_COUNT)
|
|
// activate(o_decal_box[x])
|
|
// else
|
|
deactivate(o_decal_box[x])
|
|
}
|
|
|
|
object o_cam_status = status_control
|
|
o_cam_status.location = TESLA_STATUS_X, CAM_STATUS_Y,5
|
|
o_cam_status.file = GPATH "multiplayer\\5state_lobby_status.tga"
|
|
o_cam_status.total_states = 5
|
|
o_cam_status.id = -1
|
|
o_cam_status.state = 0
|
|
|
|
initialize (o_cam_status)
|
|
|
|
MAX_ITEMS = 1 + (MAXTESLA - MAXTESLA_P) // 1(blank) + (MAXTESLA - MAXTESLA_P)
|
|
|
|
// Live Cam Drop Box
|
|
object o_cam_list = s_droplistbox
|
|
MAX_ITEMS = 60
|
|
o_cam_list.location = BOT_LIST_X, CAM_STATUS_Y,10
|
|
o_cam_list.label = ""
|
|
o_cam_list.itemWidth = BOT_LIST_WIDTH
|
|
o_cam_list.max_displayed = CAM_DISPLAY_COUNT
|
|
o_cam_list.boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_cam_list.backColor = packcolor (0, 0, 0, 255)
|
|
o_cam_list.boxTextColor = packcolor (255, 255, 255, 255)
|
|
o_cam_list.boxTextSelectedColor = packcolor (125, 125, 125, 255)
|
|
o_cam_list.frameHighlightColor = FRAME_HIGHLIGHT_COLOR // packcolor (255, 255, 255, 255)
|
|
o_cam_list.boxhighlightColor = packcolor (50, 120, 255, 200)
|
|
o_cam_list.ItemHighlightColor = packcolor (0, 0, 0, 255)
|
|
o_cam_list.selectedColor = packcolor (120, 120, 255, 150)
|
|
o_cam_list.labelTextColor = packcolor (255, 255, 255, 255)
|
|
o_cam_list.borderColor = packcolor (255, 255, 255, 255)
|
|
o_cam_list.itemHeight = VAR_LIST_HEIGHT
|
|
o_cam_list.labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_cam_list.offsetLabel = 0,0
|
|
o_cam_list.arrowHeight = 15
|
|
|
|
nTeslaIndex = 0
|
|
o_cam_list.list_item[nTeslaIndex++] = ""
|
|
for x = MAXTESLA_P; x < MAXTESLA; x++
|
|
{
|
|
o_cam_list.list_item[nTeslaIndex++] = TESLA_PREFIX m_aTeslaName[x] TESLA_POSTFIX
|
|
}
|
|
o_cam_list.nselected = 0
|
|
o_cam_list.list_size = 1 + (MAXTESLA - MAXTESLA_P)
|
|
|
|
initialize(o_cam_list)
|
|
|
|
object o_cam_print_text = s_print_text
|
|
|
|
// Let's move this so it's clearly not in the same line as the o_cam_list
|
|
o_cam_print_text.location = (PRINT_TEXT_X + PLAYER_EDIT_WIDTH + ROSTER_GAP2), (CAM_STATUS_Y + ROSTER_GAP2),5
|
|
|
|
o_cam_print_text.id = -1
|
|
o_cam_print_text.text_font = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_cam_print_text.text_color = packcolor(255,255,255,255)
|
|
o_cam_print_text.text = "DEFAULT" // Give it some default value to start up with.
|
|
activate(o_cam_print_text)
|
|
|
|
object o_reprint = s_multistatepane
|
|
o_reprint.total_states = 3
|
|
o_reprint.textsize = 1
|
|
o_reprint.text = "Reprint"
|
|
o_reprint.file = WPATH "button_reg_138x23m_3state.tga"
|
|
o_reprint.location = 627, 510 o_frame.location.z + 1
|
|
o_reprint.state = 0 // initially disabled
|
|
initialize(o_reprint)
|
|
o_reprint.state = 3
|
|
|
|
// MSL Added Recall button
|
|
object o_recall = s_multistatepane
|
|
o_recall.total_states = 3
|
|
o_recall.textsize = 1
|
|
o_recall.text = "Recall"
|
|
o_recall.file = WPATH "button_reg_138x23m_3state.tga"
|
|
o_recall.location = 627, 485, o_frame.location.z + 1
|
|
o_recall.state = 0 // initially disabled
|
|
initialize(o_recall)
|
|
o_recall.state = 3
|
|
|
|
// MSL Added Mech Randomizer button
|
|
object o_all_random_mech = s_multistatepane
|
|
o_all_random_mech.total_states = 3
|
|
o_all_random_mech.textsize = 1
|
|
o_all_random_mech.text = "Pick Mechs"
|
|
o_all_random_mech.file = WPATH "button_reg_138x23m_3state.tga"
|
|
o_all_random_mech.location = 467, 460, o_frame.location.z + 1
|
|
o_all_random_mech.state = 0 // initially enabled
|
|
initialize(o_all_random_mech)
|
|
|
|
// [automaticmode] Load File button -- below Pick Cond., left of Reprint
|
|
object o_load_file = s_multistatepane
|
|
o_load_file.total_states = 3
|
|
o_load_file.textsize = 1
|
|
o_load_file.text = "Load File"
|
|
o_load_file.file = WPATH "button_reg_138x23m_3state.tga"
|
|
o_load_file.location = 467, 510, o_frame.location.z + 1
|
|
o_load_file.state = 0 // initially enabled
|
|
initialize(o_load_file)
|
|
if ($$g_bAutomaticMode$$ != 1)
|
|
o_load_file.state = 3 // hide when automaticmode is not active
|
|
|
|
// MSL Added default settings button
|
|
object o_default = s_multistatepane
|
|
o_default.total_states = 3
|
|
o_default.textsize = 1
|
|
o_default.text = "Default"
|
|
o_default.file = WPATH "button_reg_138x23m_3state.tga"
|
|
o_default.location = 627, 460, o_frame.location.z + 1
|
|
o_default.state = 0 // initially enabled
|
|
initialize(o_default)
|
|
|
|
// MSL Added Credit button
|
|
// object o_vwe_credit = s_multistatepane
|
|
// o_vwe_credit.total_states = 3
|
|
// o_vwe_credit.textsize = 1
|
|
// o_vwe_credit.text = "Credits"
|
|
// o_vwe_credit.file = WPATH "button_reg_138x23m_3state.tga"
|
|
// o_vwe_credit.location = 20, 20, o_frame.location.z + 1
|
|
// o_vwe_credit.state = 0 // initially enabled
|
|
// initialize(o_vwe_credit)
|
|
|
|
#if USE_O_BACK
|
|
object o_back = s_multistatepane
|
|
o_back.total_states = 3
|
|
o_back.textsize = 1
|
|
o_back.text = "Back" // localize$(IDS_MP_LOBBY_DISCONNECT) // "Stop/Reset Mission"
|
|
o_back.file = WPATH "button_reg_200x27m_3state.tga"
|
|
o_back.location = 570, 570, o_frame.location.z + 1
|
|
o_back.state = 0
|
|
initialize(o_back)
|
|
#endif // USE_O_BACK
|
|
|
|
if greatest_x > 0 && greatest_y > 0
|
|
bitmap_create black = greatest_x,greatest_y //comment out if you don't have any images
|
|
|
|
int i
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
object o_tabs = tabs
|
|
o_tabs.location = 0, 0, 5
|
|
initialize(o_tabs)
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//Is vehicle OK?------------------------------------------------------------
|
|
object o_background = background
|
|
|
|
script_run SCRIPTPATH "conlobbymission.script", 0x1000
|
|
// script_pause @conlobbymission@,2
|
|
script_run SCRIPTPATH "hostlobbymap.script", 0x1000
|
|
script_pause @hostlobbymap@,2
|
|
script_run SCRIPTPATH "HostLobbyserver.script", 0x1000
|
|
script_pause @HostLobbyserver@,2
|
|
|
|
//// this is for scrolling the roster list
|
|
object o_roster_list_scroll_controls = roster_list_scroll_controls
|
|
|
|
o_roster_list_scroll_controls.list_size = nRosterCount
|
|
|
|
object o_error_string = s_error_string
|
|
o_error_string.location = ERROR_STRING_X, ERROR_STRING_Y, 5
|
|
o_error_string.width = ERROR_STRING_X2 - ERROR_STRING_X
|
|
o_error_string.height = ERROR_STRING_Y2 - ERROR_STRING_Y
|
|
|
|
framerate = 30
|
|
|
|
focus(o_BotList[0]) // focus(this)
|
|
}
|
|
|
|
GUI_DESTROY
|
|
{
|
|
focus(NULL)
|
|
script_end "hostlobbymap.script"
|
|
script_end "conlobbymission.script"
|
|
script_end "HostLobbyserver.script"
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
// GetSlotType
|
|
if (sender == this) && (getmessage() == MAIL_GET_SLOTTYPE)
|
|
{
|
|
int cur_row = getmessage(1)
|
|
if (cur_row < MAXTESLA_P)
|
|
{
|
|
if (o_BotList[cur_row].nselected == 1)
|
|
{
|
|
return MAIL_SLOTTYPE_USER
|
|
}
|
|
}
|
|
if (o_BotList[cur_row].nselected == 0)
|
|
{
|
|
return MAIL_SLOTTYPE_NONE
|
|
}
|
|
else
|
|
{
|
|
return MAIL_SLOTTYPE_BOT
|
|
}
|
|
}
|
|
// IsPossibleTabEvent(cur_row, slottype, cur_item)
|
|
if (sender == this) && (getmessage() == MAIL_POSSIBLE_TABEVENT)
|
|
{
|
|
int cur_row = getmessage(1)
|
|
int slottype = getmessage(2)
|
|
int cur_item = getmessage(3)
|
|
if (cur_item == ROWFIELD_TYPE_BOTTYPE)
|
|
{
|
|
return 1
|
|
}
|
|
if (cur_item == ROWFIELD_TYPE_EDITBOX)
|
|
{
|
|
if (slottype == MAIL_SLOTTYPE_USER)
|
|
{
|
|
return 1
|
|
}
|
|
return 0
|
|
}
|
|
if (cur_item == ROWFIELD_TYPE_MECH)
|
|
{
|
|
if (slottype == MAIL_SLOTTYPE_USER) || (slottype == MAIL_SLOTTYPE_BOT)
|
|
{
|
|
return 1
|
|
}
|
|
return 0
|
|
}
|
|
#if USE_O_MECH_VARIANT2
|
|
if (cur_item == ROWFIELD_TYPE_MECHVARIANT)
|
|
{
|
|
if (slottype == MAIL_SLOTTYPE_USER) || (slottype == MAIL_SLOTTYPE_BOT)
|
|
{
|
|
return 1
|
|
}
|
|
return 0
|
|
}
|
|
#endif // USE_O_MECH_VARIANT2
|
|
if (cur_item == ROWFIELD_TYPE_TEAMCAMO) || (cur_item == ROWFIELD_TYPE_TEAMDECAL)
|
|
{
|
|
if (slottype == MAIL_SLOTTYPE_USER)
|
|
{
|
|
return 1
|
|
}
|
|
if (slottype == MAIL_SLOTTYPE_BOT)
|
|
{
|
|
if (cur_team_val)
|
|
{
|
|
return 1
|
|
}
|
|
return 0
|
|
}
|
|
}
|
|
return 0
|
|
}
|
|
// ProcessTabEvent
|
|
if (sender == this) && (getmessage() == MAIL_PROCESS_TABEVENT)
|
|
{
|
|
int cur_index = getmessage(1) // row * MAX_SLOT_ITEMS + slot-item-index(bot-type, edit-field, mech-type, ?mech-variant,? team/camo, decal)
|
|
int tab_dir = getmessage(2) // -1 or +1
|
|
int old_row = -1
|
|
int cur_row
|
|
int cur_item
|
|
int slottype
|
|
int done = 0
|
|
|
|
while(!done)
|
|
{
|
|
cur_index = cur_index + tab_dir
|
|
if !done && (cur_index < 0)
|
|
{
|
|
done = 1
|
|
focus(o_cam_list) // focus(@ConLobbyMission@o_game_options[13]) // MAX_OPTIONS-1
|
|
}
|
|
if !done && (nRosterCount * MAX_SLOT_ITEMS <= cur_index)
|
|
{
|
|
done = 1
|
|
focus(@ConLobbyMission@o_game_options[0])
|
|
}
|
|
if (!done)
|
|
{
|
|
cur_row = cur_index / MAX_SLOT_ITEMS
|
|
cur_item = cur_index % MAX_SLOT_ITEMS
|
|
if (old_row != cur_row)
|
|
{
|
|
old_row = cur_row
|
|
slottype = mail(MAIL_GET_SLOTTYPE, cur_row, this)
|
|
}
|
|
if mail(MAIL_POSSIBLE_TABEVENT, cur_row, slottype, cur_item, this)
|
|
{
|
|
done = 1
|
|
if (cur_item == 0)
|
|
{
|
|
focus(o_BotList[cur_row])
|
|
}
|
|
if (cur_item == 1) // Bot Select
|
|
{
|
|
focus(o_Editbox[cur_row])
|
|
}
|
|
if (cur_item == 2) // Edit Box
|
|
{
|
|
focus(o_mech_variant[cur_row])
|
|
}
|
|
#if USE_O_MECH_VARIANT2
|
|
if (cur_item == 3) // Mech Box
|
|
{
|
|
focus(o_mech_variant2[cur_row])
|
|
}
|
|
#endif // USE_O_MECH_VARIANT2
|
|
if (cur_item == 4)
|
|
{
|
|
if (cur_team_val)
|
|
focus(o_team[cur_row])
|
|
else
|
|
focus(o_skins[cur_row])
|
|
}
|
|
if (cur_item == ROWFIELD_TYPE_TEAMDECAL)
|
|
{
|
|
focus(o_decal[cur_row])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
if (sender != this) && (getmessage() == M_TABEVENT)
|
|
{
|
|
if (sender == @conlobbymission@)
|
|
{
|
|
//play press,1
|
|
if (getmessage(1) == -1)
|
|
mail(MAIL_PROCESS_TABEVENT, nRosterCount * MAX_SLOT_ITEMS, -1, this)
|
|
else
|
|
focus(o_cam_list) // mail(MAIL_PROCESS_TABEVENT, -1, +1, this)
|
|
return
|
|
}
|
|
int nTabDir
|
|
if (getkeystate(key_lshift))
|
|
nTabDir = -1
|
|
else
|
|
nTabDir = +1
|
|
if (sender == o_cam_list)
|
|
{
|
|
if (nTabDir == -1)
|
|
focus(@ConLobbyMission@o_game_options[14]) // MAX_OPTIONS-1
|
|
else
|
|
mail(MAIL_PROCESS_TABEVENT, -1, +1, this)
|
|
return
|
|
}
|
|
|
|
int cur_index = 0
|
|
int nItemFound = 0
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
if (sender == o_BotList[k])
|
|
{
|
|
nItemFound++
|
|
cur_index = cur_index + ROWFIELD_TYPE_BOTTYPE
|
|
}
|
|
if (sender == o_Editbox[k])
|
|
{
|
|
nItemFound++
|
|
cur_index = cur_index + ROWFIELD_TYPE_EDITBOX
|
|
}
|
|
if (sender == o_mech_variant[k])
|
|
{
|
|
nItemFound++
|
|
cur_index = cur_index + ROWFIELD_TYPE_MECH
|
|
}
|
|
if (sender == o_mech_variant2[k])
|
|
{
|
|
nItemFound++
|
|
cur_index = cur_index + ROWFIELD_TYPE_MECHVARIANT
|
|
}
|
|
if (sender == o_skins[k]) || (sender == o_team[k])
|
|
{
|
|
nItemFound++
|
|
cur_index = cur_index + ROWFIELD_TYPE_TEAMCAMO
|
|
}
|
|
if (sender == o_decal[k])
|
|
{
|
|
nItemFound++
|
|
cur_index = cur_index + ROWFIELD_TYPE_TEAMDECAL
|
|
}
|
|
if (nItemFound)
|
|
{
|
|
//play press,1
|
|
mail(MAIL_PROCESS_TABEVENT, cur_index, nTabDir, this)
|
|
break
|
|
}
|
|
cur_index = cur_index + MAX_SLOT_ITEMS
|
|
}
|
|
return
|
|
} // End TAB_EVENT
|
|
if (sender == o_roster_list_scroll_controls)
|
|
{
|
|
if (getmessage() == MAIL_ROSTER_LIST_MAXDISPLAY)
|
|
mail(MAIL_ROSTER_LIST_MAXDISPLAY, getmessage(1), this)
|
|
if (getmessage() == MAIL_ROSTER_LIST_CHANGED)
|
|
mail(MAIL_ROSTER_LIST_CHANGED, getmessage(1), this)
|
|
return
|
|
}
|
|
// MSL 5.02 Recall Button
|
|
if (sender == o_recall)
|
|
{
|
|
play press,1
|
|
mail(MAIL_PREVIOUS_MISSION, @ConLobbyMission@) // // set rookie, see conlobbymission.script
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
o_BotList[k].nselected = o_BotList_bu[k].nselected
|
|
if (o_BotList[k].nselected > 0)
|
|
{
|
|
activate(o_BotList[k])
|
|
}
|
|
o_Editbox[k].boxValue = o_Editbox[k].backup
|
|
if (o_BotList[k].nselected == 1)
|
|
{
|
|
initialize(o_Editbox[k])
|
|
activate(o_Editbox[k])
|
|
}
|
|
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
m_naLastSelected[k] = o_BotList[k].nselected
|
|
|
|
o_mech_variant[k].nselected = o_mech_variant_bu[k].nselected
|
|
|
|
initialize(o_mech_variant[k])
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
activate(o_mech_variant[k])
|
|
else
|
|
deactivate(o_mech_variant[k])
|
|
#if USE_O_MECH_VARIANT2
|
|
if (USE_ALLOWED_MECHS)
|
|
last_count = stock_array[allowed_mechs[o_mech_variant[k].nselected]]
|
|
else
|
|
last_count = stock_array[o_mech_variant[k].nselected]
|
|
o_mech_variant2[k].list_size = 0
|
|
do
|
|
{
|
|
o_mech_variant2[k].list_item[o_mech_variant2[k].list_size] = mech2[last_count]
|
|
o_mech_variant2[k].list_size++
|
|
last_count++
|
|
if (last_count == $$m_MechCount$$)
|
|
break
|
|
}
|
|
while(stock_id[last_count] != 1)
|
|
|
|
o_mech_variant2[k].nselected = o_mech_variant2_bu[k].nselected
|
|
|
|
initialize(o_mech_variant2[k])
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
activate(o_mech_variant2[k])
|
|
else
|
|
deactivate(o_mech_variant2[k])
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
o_skins[k].nselected = o_skins_bu[k].nselected
|
|
o_team[k].nselected = o_team_bu[k].nselected
|
|
o_decal[k].nselected = o_decal_bu[k].nselected
|
|
|
|
}
|
|
return
|
|
}
|
|
if (sender == o_all_random_mech)
|
|
{
|
|
play press,1
|
|
int pick_mech = 0
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
last_mech = random(0, MAX_ALLOWED_MECHS - 1)
|
|
if (USE_ALLOWED_MECHS)
|
|
{
|
|
stock_mech_selected = allowed_mechs[last_mech]
|
|
}
|
|
else
|
|
{
|
|
stock_mech_selected = last_mech
|
|
}
|
|
last_count = stock_array[stock_mech_selected]
|
|
|
|
#if USE_O_MECH_VARIANT2
|
|
o_mech_variant2[k].list_size = 0
|
|
do
|
|
{
|
|
o_mech_variant2[k].list_item[o_mech_variant2[k].list_size] = mech2[last_count]
|
|
o_mech_variant2[k].list_size++
|
|
last_count++
|
|
if (last_count == $$m_MechCount$$)
|
|
break
|
|
}
|
|
while(stock_id[last_count] != 1)
|
|
|
|
variant_mech_selected = random(0, o_mech_variant2[k].list_size - 1)
|
|
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
o_mech_variant[k].nselected = last_mech
|
|
|
|
#if USE_O_MECH_VARIANT2
|
|
o_mech_variant2[k].nselected = variant_mech_selected
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
initialize(o_mech_variant[k])
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
activate(o_mech_variant[k])
|
|
else
|
|
deactivate(o_mech_variant[k])
|
|
#if USE_O_MECH_VARIANT2
|
|
initialize(o_mech_variant2[k])
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
activate(o_mech_variant2[k])
|
|
else
|
|
deactivate(o_mech_variant2[k])
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
if (o_mech_variant[k].nselected == 3)
|
|
{
|
|
o_mech_variant[k].labelTextColor = packcolor (255, 255, 0, 255)
|
|
}
|
|
}
|
|
return
|
|
}
|
|
// if (sender == o_vwe_credit)
|
|
// {
|
|
// play press,1
|
|
// unfocus
|
|
// if exists(@netserver@)
|
|
// {
|
|
// @netserver@currentScreen = CINEMAOPTIONS
|
|
// }
|
|
// return
|
|
// }
|
|
if (sender == o_default)
|
|
{
|
|
play press,1
|
|
mail(MAIL_RESET_AFTER_LAUNCH, this) // reset
|
|
return
|
|
}
|
|
// [automaticmode] Load File button handler
|
|
if (sender == o_load_file)
|
|
{
|
|
play press, 1
|
|
if callback($$CTCL_LoadAutoFile$$)
|
|
{
|
|
m_bApplyingAutoLoad = true
|
|
// Apply game options using dedicated Auto globals.
|
|
// Rookie Mission globals are NOT touched so the Default button keeps working.
|
|
int m
|
|
if exists(@ConLobbyMission@)
|
|
{
|
|
mail(MAIL_LOAD_AUTO_MISSION, @ConLobbyMission@)
|
|
}
|
|
// Update team state synchronously so slot display is correct on the first click.
|
|
// MAIL_LOAD_AUTO_MISSION is async; setting team_allowed directly here lets
|
|
// CTCL_GetTeamParams return the correct cur_team_val before the slot loop runs.
|
|
callback($$SetNetworkMissionParamater$$, team_allowed, $$g_nAutoTeamAllowed$$)
|
|
if $$g_nAutoTeamAllowed$$
|
|
callback($$SetNetworkMissionParamater$$, num_of_teams, $$g_nAutoTeamCount$$)
|
|
cur_team_val = callback($$CTCL_GetTeamParams$$, cur_team_count[0])
|
|
// Clear all slots
|
|
o_cam_list.nselected = 0
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
if (1 <= o_BotList[k].nselected)
|
|
{
|
|
if (o_BotList[k].nselected == 1) && (k < MAXTESLA_P)
|
|
{
|
|
o_Editbox[k].boxValue = ""
|
|
initialize(o_Editbox[k])
|
|
deactivate(o_Editbox[k])
|
|
}
|
|
o_BotList[k].nselected = 0
|
|
m_naLastSelected[k] = 0
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
}
|
|
}
|
|
// Apply per-slot data from file
|
|
string szAutoName
|
|
string szAutoMech
|
|
int nAutoType
|
|
int j
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
nAutoType = callback($$CTCL_GetAutoSlotInt$$, k, 0)
|
|
if nAutoType > 0
|
|
{
|
|
o_BotList[k].nselected = nAutoType
|
|
m_naLastSelected[k] = nAutoType
|
|
if (o_BotList[k].nselected > 0)
|
|
activate(o_BotList[k])
|
|
if (nAutoType == 1) && (k < MAXTESLA_P)
|
|
{
|
|
callback($$CTCL_GetAutoSlotName$$, szAutoName, k)
|
|
o_Editbox[k].boxValue = szAutoName
|
|
initialize(o_Editbox[k])
|
|
activate(o_Editbox[k])
|
|
}
|
|
callback($$CTCL_GetAutoSlotMech$$, szAutoMech, k)
|
|
if (!equal$(szAutoMech, ""))
|
|
{
|
|
#if USE_ALLOWED_MECHS
|
|
// stock_array[j] = index in mech[] where chassis j lives (skips variant entries).
|
|
// mech[allowed_mechs[j]] would hit variant names; stock_array corrects this.
|
|
for (j = 0; j < MAX_ALLOWED_MECHS; j++)
|
|
{
|
|
if equal$(mech[stock_array[allowed_mechs[j]]], szAutoMech)
|
|
{
|
|
o_mech_variant[k].nselected = j
|
|
break
|
|
}
|
|
}
|
|
#else
|
|
for (j = 0; j < $$m_mechCount$$; j++)
|
|
{
|
|
if equal$(mech[j], szAutoMech)
|
|
{
|
|
o_mech_variant[k].nselected = j
|
|
break
|
|
}
|
|
}
|
|
#endif
|
|
}
|
|
// Always set both team and skin unconditionally.
|
|
// The game type may not have propagated to cur_team_val yet
|
|
// (MAIL_SET_ROOKIE_MISSION is async); setting both is safe --
|
|
// the launch code uses whichever is correct for the active mode.
|
|
int nAutoDecal
|
|
int nAutoDecalIndex
|
|
o_team[k].nselected = callback($$CTCL_GetAutoSlotInt$$, k, 1)
|
|
o_skins[k].nselected = callback($$CTCL_GetAutoSlotInt$$, k, 2)
|
|
nAutoDecal = callback($$CTCL_GetAutoSlotInt$$, k, 3)
|
|
nAutoDecalIndex = 20 // fallback to safe/default decal slot
|
|
for (j = 0; j <= MAX_DECAL_COUNT; j++)
|
|
{
|
|
if (ffa_decal[j] == nAutoDecal)
|
|
{
|
|
nAutoDecalIndex = j
|
|
break
|
|
}
|
|
}
|
|
o_decal[k].nselected = nAutoDecalIndex
|
|
initialize(o_mech_variant[k])
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
{
|
|
activate(o_mech_variant[k])
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
}
|
|
else
|
|
deactivate(o_mech_variant[k])
|
|
}
|
|
}
|
|
m_bApplyingAutoLoad = false
|
|
}
|
|
return
|
|
}
|
|
if (sender == o_reprint)
|
|
{
|
|
play press,1
|
|
callback($$CTCL_DoReprint$$, 1)
|
|
return
|
|
}
|
|
|
|
if (sender == this)
|
|
{
|
|
int nFromThis = getmessage()
|
|
if (nFromThis == MAIL_CHANGE_LAUNCH_STATE)
|
|
{
|
|
int nLS = nLaunchState
|
|
int nBS
|
|
if (nLS < 0)
|
|
nLS = 0
|
|
o_launch_button.text = launch_states[nLS]
|
|
if ((nLS == 1) || (nLS == 4))
|
|
nBS = 2
|
|
else
|
|
nBS = 3
|
|
if ((nBS != o_launch_button.state) || !equal$(o_launch_button.text, launch_states[nLS]))
|
|
{
|
|
o_launch_button.text = launch_states[nLS]
|
|
o_launch_button.state = nBS
|
|
// MSL initialize(o_launch_button)
|
|
}
|
|
#if USE_O_BACK
|
|
string strBack
|
|
if (nLS <= 1)
|
|
{
|
|
nBS = 2
|
|
strBack = "Back"
|
|
}
|
|
else
|
|
{
|
|
nBS = 3
|
|
strBack = ""
|
|
}
|
|
if (o_back.state != nBS) || (strBack != o_back.text)
|
|
{
|
|
o_back.text = strBack
|
|
o_back.state = nBS
|
|
initialize(o_back)
|
|
}
|
|
#endif // USE_O_BACK
|
|
return
|
|
}
|
|
// MSL 5.02
|
|
if (nFromThis == MAIL_RECORD_MISSION)
|
|
{
|
|
for (k = 0; k< nRosterCount; K++)
|
|
{
|
|
o_Editbox[k].backup = o_Editbox[k].boxValue
|
|
o_BotList_bu[k].nselected = o_BotList[k].nselected
|
|
o_mech_variant_bu[k].nselected = o_mech_variant[k].nselected
|
|
#if USE_O_MECH_VARIANT2
|
|
o_mech_variant2_bu[k].nselected = o_mech_variant2[k].nselected
|
|
#endif // USE_O_MECH_VARIANT2
|
|
o_skins_bu[k].nselected = o_skins[k].nselected
|
|
o_team_bu[k].nselected = o_team[k].nselected
|
|
o_decal_bu[k].nselected = o_decal[k].nselected
|
|
}
|
|
return
|
|
}
|
|
if (nFromThis == MAIL_RESET_AFTER_LAUNCH)
|
|
{
|
|
// mission launched : remove all players...
|
|
// MSL 5.02 Added Cameraship to Reset
|
|
o_cam_list.nselected = 0
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
if (1 <= o_BotList[k].nselected)
|
|
{
|
|
if (o_BotList[k].nselected == 1) && (k < MAXTESLA_P)
|
|
{ // real player
|
|
o_Editbox[k].boxValue = ""
|
|
initialize(o_Editbox[k])
|
|
deactivate(o_Editbox[k])
|
|
}
|
|
o_BotList[k].nselected = 0
|
|
m_naLastSelected[k] = 0
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
{
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
}
|
|
}
|
|
}
|
|
mail(MAIL_SET_ROOKIE_MISSION, this)
|
|
mail(MAIL_PROCESS_TABEVENT, -1, +1, this)
|
|
}
|
|
if (nFromThis == MAIL_SET_ROOKIE_MISSION)
|
|
{
|
|
// reset camos...
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
o_skins[k].nselected = k % MAX_SKIN_COUNT
|
|
o_decal[k].nselected = k % MAX_DECAL_COUNT
|
|
}
|
|
// Reset Mech Selection
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
// MSL
|
|
// MechCorps Highlight: Super6 slot assignments (16 slots, 6-mech cycle; Vulture+Warhammer appear twice)
|
|
if k == 0
|
|
o_mech_variant[k].nselected = ROOKIEMECH1 // Archer
|
|
if k == 1
|
|
o_mech_variant[k].nselected = ROOKIEMECH2 // Loki
|
|
if k == 2
|
|
o_mech_variant[k].nselected = ROOKIEMECH3 // Madcat
|
|
if k == 3
|
|
o_mech_variant[k].nselected = ROOKIEMECH4 // Thor
|
|
if k == 4
|
|
o_mech_variant[k].nselected = ROOKIEMECH5 // Vulture
|
|
if k == 5
|
|
o_mech_variant[k].nselected = ROOKIEMECH6 // Warhammer
|
|
if k == 6
|
|
o_mech_variant[k].nselected = ROOKIEMECH1 // Archer
|
|
if k == 7
|
|
o_mech_variant[k].nselected = ROOKIEMECH2 // Loki
|
|
if k == 8
|
|
o_mech_variant[k].nselected = ROOKIEMECH3 // Madcat
|
|
if k == 9
|
|
o_mech_variant[k].nselected = ROOKIEMECH4 // Thor
|
|
if k == 10
|
|
o_mech_variant[k].nselected = ROOKIEMECH5 // Vulture
|
|
if k == 11
|
|
o_mech_variant[k].nselected = ROOKIEMECH6 // Warhammer
|
|
if k == 12
|
|
o_mech_variant[k].nselected = ROOKIEMECH1 // Archer
|
|
if k == 13
|
|
o_mech_variant[k].nselected = ROOKIEMECH2 // Loki
|
|
if k == 14
|
|
o_mech_variant[k].nselected = ROOKIEMECH3 // Madcat
|
|
if k == 15
|
|
o_mech_variant[k].nselected = ROOKIEMECH4 // Thor
|
|
#if USE_O_MECH_VARIANT2
|
|
if (USE_ALLOWED_MECHS)
|
|
last_count = stock_array[allowed_mechs[o_mech_variant[k].nselected]]
|
|
else
|
|
last_count = stock_array[o_mech_variant[k].nselected]
|
|
o_mech_variant2[k].list_size = 0
|
|
do
|
|
{
|
|
o_mech_variant2[k].list_item[o_mech_variant2[k].list_size] = mech2[last_count]
|
|
o_mech_variant2[k].list_size++
|
|
last_count++
|
|
if (last_count == $$m_MechCount$$)
|
|
break
|
|
}
|
|
while (stock_id[last_count] != 1)
|
|
initialize(o_mech_variant2[k])
|
|
o_mech_variant2[k].nselected = 0
|
|
|
|
if k == 0
|
|
o_mech_variant2[k].nselected = 0 // Loki
|
|
if k == 1
|
|
o_mech_variant2[k].nselected = 0 // Madcat
|
|
if k == 2
|
|
o_mech_variant2[k].nselected = 0 // Thor
|
|
if k == 3
|
|
o_mech_variant2[k].nselected = 0 // vulture
|
|
if k == 4
|
|
o_mech_variant2[k].nselected = 0 // Loki
|
|
if k == 5
|
|
o_mech_variant2[k].nselected = 0 // Madcat
|
|
if k == 6
|
|
o_mech_variant2[k].nselected = 0 // Thor
|
|
if k == 7
|
|
o_mech_variant2[k].nselected = 0 // Vulture
|
|
if k == 8
|
|
o_mech_variant2[k].nselected = 0 // Loki
|
|
if k == 9
|
|
o_mech_variant2[k].nselected = 0 // Madcat
|
|
if k == 10
|
|
o_mech_variant2[k].nselected = 0 // Thor
|
|
if k == 11
|
|
o_mech_variant2[k].nselected = 0 // vulture
|
|
if k == 12
|
|
o_mech_variant2[k].nselected = 0 // Loki
|
|
if k == 13
|
|
o_mech_variant2[k].nselected = 0 // Madcat
|
|
if k == 14
|
|
o_mech_variant2[k].nselected = 0 // Thor
|
|
if k == 15
|
|
o_mech_variant2[k].nselected = 0 // Vulture
|
|
#endif // USE_O_MECH_VARIANT2
|
|
}
|
|
mail(MAIL_SET_ROOKIE_MISSION, @ConLobbyMission@) // // set rookie, see conlobbymission.script
|
|
return
|
|
}
|
|
if (nFromThis == MAIL_REMOVE_ALL_BOTS)
|
|
{
|
|
// remove all bots...
|
|
int nRemoveThisBot
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
nRemoveThisBot = 0
|
|
if (k < MAXTESLA_P)
|
|
{
|
|
if (2 <= o_BotList[k].nselected)
|
|
{
|
|
nRemoveThisBot = 1
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (1 <= o_BotList[k].nselected)
|
|
{
|
|
nRemoveThisBot = 1
|
|
}
|
|
}
|
|
if (nRemoveThisBot)
|
|
{
|
|
o_BotList[k].nselected = 0
|
|
m_naLastSelected[k] = 0
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
{
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (nFromThis == MAIL_ROSTER_LIST_MAXDISPLAY)
|
|
{
|
|
k = getmessage(1)
|
|
int nMaxDisp = drop_count_mech[k - ROSTER_top_of_list]
|
|
int nMaxDispSkin = drop_count_skin[k - ROSTER_top_of_list]
|
|
int nMaxDispDecal = drop_count_decal[k - ROSTER_top_of_list]
|
|
|
|
o_BotList[k].max_displayed = nMaxDisp
|
|
o_mech_variant[k].max_displayed = nMaxDisp
|
|
#if USE_O_MECH_VARIANT2
|
|
o_mech_variant2[k].max_displayed = nMaxDisp - 1
|
|
#endif // USE_O_MECH_VARIANT2
|
|
o_skins[k].max_displayed = nMaxDispSkin
|
|
o_decal[k].max_displayed = nMaxDispDecal
|
|
o_team[k].max_displayed = nMaxDispSkin
|
|
|
|
return
|
|
}
|
|
if (nFromThis == MAIL_ROSTER_LIST_CHANGED)
|
|
{
|
|
k = getmessage(1)
|
|
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
{ // shown
|
|
mail(MAIL_ROSTER_LIST_MAXDISPLAY, k, this)
|
|
|
|
activate(o_status[k])
|
|
activate(o_BotList[k])
|
|
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
|
|
activate(o_mech_variant[k])
|
|
#if USE_O_MECH_VARIANT2
|
|
activate(o_mech_variant2[k])
|
|
#endif // USE_O_MECH_VARIANT2
|
|
activate(o_mech_rand[k])
|
|
}
|
|
else
|
|
{ // hidden
|
|
deactivate(o_status[k])
|
|
deactivate(o_BotList[k])
|
|
deactivate(o_Editbox[k])
|
|
deactivate(o_print_text[k])
|
|
deactivate(o_mech_variant[k])
|
|
#if USE_O_MECH_VARIANT2
|
|
deactivate(o_mech_variant2[k])
|
|
#endif // USE_O_MECH_VARIANT2
|
|
deactivate(o_mech_rand[k])
|
|
deactivate(o_skins[k])
|
|
deactivate(o_decal[k])
|
|
deactivate(o_team[k])
|
|
deactivate(o_skin_box[k])
|
|
deactivate(o_decal_box[k])
|
|
}
|
|
}
|
|
if (nFromThis == MAIL_PLAYER_TYPE_CHANGED)
|
|
{
|
|
k = getmessage(1)
|
|
|
|
if (o_BotList[k].nselected == 0)
|
|
{ // no selection
|
|
deactivate(o_Editbox[k])
|
|
activate(o_print_text[k])
|
|
deactivate(o_skins[k])
|
|
deactivate(o_team[k])
|
|
deactivate(o_decal[k])
|
|
deactivate(o_skin_box[k])
|
|
deactivate(o_decal_box[k])
|
|
return
|
|
}
|
|
if ((k < MAXTESLA_P) && (o_BotList[k].nselected == 1))
|
|
{ // to real player...
|
|
activate(o_Editbox[k])
|
|
deactivate(o_print_text[k])
|
|
if cur_team_val
|
|
{
|
|
// MSL 5.05
|
|
deactivate(o_skins[k])
|
|
activate(o_team[k])
|
|
activate(o_decal[k])
|
|
}
|
|
else
|
|
{
|
|
activate(o_skins[k])
|
|
deactivate(o_team[k])
|
|
activate(o_decal[k])
|
|
}
|
|
}
|
|
else
|
|
{ // bot
|
|
deactivate(o_Editbox[k])
|
|
activate(o_print_text[k])
|
|
deactivate(o_skins[k])
|
|
if cur_team_val
|
|
{
|
|
activate(o_team[k])
|
|
deactivate(o_decal[k])
|
|
}
|
|
else
|
|
{
|
|
deactivate(o_team[k])
|
|
deactivate(o_decal[k])
|
|
}
|
|
}
|
|
activate(o_skin_box[k])
|
|
activate(o_decal_box[k])
|
|
}
|
|
return
|
|
}
|
|
if exists(@ConLobbyMission@)
|
|
{
|
|
if (sender == @ConLobbyMission@)
|
|
{
|
|
int nFromLobbyMission = getmessage()
|
|
if nFromLobbyMission == -9999
|
|
{
|
|
mail(MAIL_REMOVE_ALL_BOTS, this)
|
|
}
|
|
if (nFromLobbyMission == -9998)
|
|
{ // game type or map changed
|
|
int old_game_type = cur_game_type
|
|
int old_team_val = cur_team_val
|
|
int counter
|
|
|
|
cur_game_type = callback($$GetLocalNetworkMissionParamater$$, game_type)
|
|
cur_team_val = callback($$CTCL_GetTeamParams$$, cur_team_count[0])
|
|
|
|
if (old_team_val != cur_team_val)
|
|
{
|
|
if cur_team_val
|
|
{
|
|
for k = 0; k < nRosterCount; k++
|
|
{
|
|
o_team[k].list_size = cur_team_val
|
|
for counter = 0; counter < cur_team_val; counter++
|
|
{
|
|
o_team[k].list_item[counter] = conv$(counter+1)
|
|
}
|
|
|
|
if o_team[k].nselected >= cur_team_val
|
|
{
|
|
o_team[k].nselected = cur_team_val - 1
|
|
}
|
|
|
|
initialize(o_team[k])
|
|
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for k = 0; k < nRosterCount; k++
|
|
{
|
|
if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
}
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
if (sender == o_mech_variant[k])
|
|
{
|
|
if (USE_ALLOWED_MECHS)
|
|
last_count = stock_array[allowed_mechs[o_mech_variant[k].nselected]]
|
|
else
|
|
last_count = stock_array[o_mech_variant[k].nselected]
|
|
#if USE_O_MECH_VARIANT2
|
|
o_mech_variant2[k].list_size = 0
|
|
do
|
|
{
|
|
o_mech_variant2[k].list_item[o_mech_variant2[k].list_size] = mech2[last_count]
|
|
o_mech_variant2[k].list_size++
|
|
last_count++
|
|
if (last_count == $$m_MechCount$$)
|
|
break
|
|
}
|
|
while (stock_id[last_count] != 1)
|
|
initialize(o_mech_variant2[k])
|
|
o_mech_variant2[k].nselected = 0
|
|
#endif // USE_O_MECH_VARIANT2
|
|
break
|
|
}
|
|
if (sender == o_skins[k])
|
|
{
|
|
if !cur_team_val
|
|
{
|
|
o_decal[k].nselected = o_skins[k].nselected
|
|
initialize(o_decal[k])
|
|
}
|
|
break
|
|
}
|
|
if (sender == o_team[k])
|
|
{
|
|
if cur_team_val
|
|
{
|
|
o_decal[k].nselected = team_camo[o_team[k].nselected]
|
|
initialize(o_decal[k])
|
|
}
|
|
break
|
|
}
|
|
if (sender == o_BotList[k])
|
|
{
|
|
if (o_BotList[k].nselected != m_naLastSelected[k])
|
|
{
|
|
if (o_BotList[k].nselected == 1) && (k < MAXTESLA_P)
|
|
{
|
|
#ifdef DEMO_CODE
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
m_naLastSelected[k] = o_BotList[k].nselected
|
|
#else // !DEMO_CODE
|
|
if (nVritual)
|
|
{
|
|
mLauncherConnection = 1
|
|
mConnection2 = 1
|
|
mApplType = _EAT_MW4
|
|
mApplState = _EAS_Launched
|
|
mGameState = _EGS_Idle
|
|
mGameTime = -1
|
|
mGameIsServer = 2
|
|
}
|
|
else
|
|
{
|
|
mLauncherConnection = callback($$CTCL_Get$$, _CTCL_GetTeslaInfo, k, mConnection2, mApplType, mApplState, mGameState, mGameTime, mGameIsServer)
|
|
}
|
|
if (mLauncherConnection == 1) && (mConnection2 == 1) && (mApplType == _EAT_MW4) && (mGameState == _EGS_Idle)
|
|
{
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
m_naLastSelected[k] = o_BotList[k].nselected
|
|
}
|
|
else
|
|
{
|
|
o_BotList[k].nselected = m_naLastSelected[k]
|
|
}
|
|
#endif // DEMO_CODE
|
|
}
|
|
else
|
|
{
|
|
// 5.04 Bot allowed
|
|
if ((MAXTESLA_P <= k) || (2 <= o_BotList[k].nselected)) && (((3 < cur_game_type) && (cur_game_type < 15)) || (18 < cur_game_type))))
|
|
o_BotList[k].nselected = m_naLastSelected[k]
|
|
else
|
|
{
|
|
mail(MAIL_PLAYER_TYPE_CHANGED, k, this)
|
|
m_naLastSelected[k] = o_BotList[k].nselected
|
|
}
|
|
}
|
|
}
|
|
break
|
|
}
|
|
}
|
|
#if USE_O_BACK
|
|
if ((sender == o_back) && (o_back.state == 2))
|
|
{
|
|
callback($$SetShellCommand$$, DisconnectLobbyCommand)
|
|
}
|
|
#endif // USE_O_BACK
|
|
if (sender == o_launch_button) && (1 <= nLaunchState)
|
|
{
|
|
focus(this)
|
|
|
|
if (nLaunchState == 1)
|
|
{
|
|
play press,1
|
|
nLaunchState = 2 // preparing loading
|
|
|
|
int nTemp
|
|
int nTemp2
|
|
int nTempMech
|
|
int nTeamOrSkin
|
|
int nDecal
|
|
|
|
mail(-7777, @ConLobbyMission@)
|
|
int nPrintOut
|
|
if (@ConLobbyMission@o_game_options[12].state == 2)
|
|
nPrintOut = 1
|
|
else
|
|
nPrintOut = 0
|
|
int nMissionReview
|
|
if (@ConLobbyMission@o_game_options[13].state == 2)
|
|
nMissionReview = 1
|
|
else
|
|
nMissionReview = 0
|
|
|
|
callback($$CTCL_DoMission$$, 0, team_camo[0], TEAM_DECAL[0], ffa_decal[0], nPrintOut, nMissionReview) // prepare to add player...
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
if (0 < o_BotList[k].nselected)
|
|
{
|
|
if cur_team_val > 0
|
|
{
|
|
nTeamOrSkin = o_team[k].nselected
|
|
nDecal = o_decal[k].nselected
|
|
}
|
|
else
|
|
{
|
|
nTeamOrSkin = o_skins[k].nselected
|
|
nDecal = o_decal[k].nselected
|
|
}
|
|
#if USE_O_MECH_VARIANT2
|
|
if (USE_ALLOWED_MECHS)
|
|
nTempMech = stock_array[allowed_mechs[o_mech_variant[k].nselected]] + o_mech_variant2[k].nselected
|
|
else
|
|
nTempMech = stock_array[o_mech_variant[k].nselected] + o_mech_variant2[k].nselected
|
|
#else // USE_O_MECH_VARIANT2
|
|
if (USE_ALLOWED_MECHS)
|
|
nTempMech = stock_array[allowed_mechs[o_mech_variant[k].nselected]] // + o_mech_variant2[k].nselected
|
|
else
|
|
nTempMech = stock_array[o_mech_variant[k].nselected] // + o_mech_variant2[k].nselected
|
|
#endif // USE_O_MECH_VARIANT2
|
|
if (k < MAXTESLA_P) && (o_BotList[k].nselected == 1)
|
|
{ // tesla
|
|
callback($$CTCL_AddPlayer$$, k, o_Editbox[k].boxValue, nTempMech, mech[nTempMech], nTeamOrSkin, nDecal)
|
|
}
|
|
else
|
|
{ // bot
|
|
nTemp = o_BotList[k].nselected
|
|
if (k < MAXTESLA_P)
|
|
nTemp--
|
|
nTemp = -nTemp
|
|
if cur_team_val > 0
|
|
{
|
|
nTeamOrSkin = o_team[k].nselected
|
|
nDecal = o_decal[k].nselected
|
|
}
|
|
else
|
|
{
|
|
nTeamorSkin = 36
|
|
nDecal = 17
|
|
}
|
|
callback($$CTCL_AddPlayer$$, nTemp, null_string, nTempMech, mech[nTempMech], nTeamOrSkin, nDecal)
|
|
}
|
|
}
|
|
}
|
|
if (0 < o_cam_list.nselected)
|
|
{
|
|
nTemp2 = -1
|
|
k = MAXTESLA_P + o_cam_list.nselected - 1
|
|
callback($$CTCL_AddPlayer$$, k, null_string, nTemp2, null_string, nTemp2, nTemp2)
|
|
}
|
|
nTemp = callback($$CTCL_DoMission$$, 1)
|
|
if nTemp == 0
|
|
{
|
|
// do loading started...
|
|
nLaunchState = 3 // loading
|
|
}
|
|
else
|
|
{
|
|
o_error_string.text = "Loading aborted : internal error(" conv$(nTemp) ")..."
|
|
nLaunchState = 0
|
|
nInterErrorCount = 15
|
|
}
|
|
mail(MAIL_CHANGE_LAUNCH_STATE, this)
|
|
}
|
|
if (nLaunchState == 4)
|
|
{
|
|
play launchSound,1
|
|
|
|
nLaunchState = 5
|
|
mail(MAIL_CHANGE_LAUNCH_STATE, this)
|
|
|
|
callback($$CTCL_DoMission$$, 2)
|
|
}
|
|
}
|
|
|
|
focus(this)
|
|
}
|
|
GUI_CHAR
|
|
{
|
|
int key = getchar()
|
|
|
|
if key == char(" ") //enter is pressed to select the current lit item
|
|
{
|
|
mail(MAIL_PROCESS_TABEVENT, -1, +1, this)
|
|
}
|
|
}
|
|
GUI_EXECUTE
|
|
{
|
|
if exists(@ConLobbyMission@) && (nInitialRookieMission == 1)
|
|
{
|
|
nInitialRookieMission = 0
|
|
mail(MAIL_SET_ROOKIE_MISSION, this)
|
|
return
|
|
}
|
|
if (0 < nInterErrorCount)
|
|
{
|
|
nInterErrorCount--
|
|
return
|
|
}
|
|
int nReprintState = o_reprint.state
|
|
int nReprintStateNew
|
|
if (callback($$CTCL_DoReprint$$, 0))
|
|
nReprintStateNew = 0
|
|
else
|
|
nReprintStateNew = 3
|
|
if (nReprintStateNew != nReprintState)
|
|
{
|
|
o_reprint.state = nReprintStateNew
|
|
// Initialize(o_reprint)
|
|
}
|
|
if (1 < nLaunchState)
|
|
{
|
|
int n = callback($$CTCL_GetMissionState$$, nLaunchState)
|
|
if (n != 0) // 0 - progressing
|
|
{
|
|
if (n < 0)
|
|
{ // error
|
|
if (nLaunchState == 3)
|
|
{ // loading error...
|
|
o_error_string.text = "Loading aborted : error(" conv$(n) ")..."
|
|
}
|
|
if (nLaunchState == 5)
|
|
{ // launching error...
|
|
o_error_string.text = "Launching aborted : error(" conv$(n) ")..."
|
|
}
|
|
nLaunchState = 0
|
|
mail(MAIL_CHANGE_LAUNCH_STATE, this)
|
|
}
|
|
else
|
|
{
|
|
if (nLaunchState == 3)
|
|
{ // loaded...
|
|
nLaunchState = 4
|
|
o_recall.state = 0
|
|
// initialize(o_recall)
|
|
mail(MAIL_RECORD_MISSION, this)
|
|
mail(MAIL_CHANGE_LAUNCH_STATE, this)
|
|
}
|
|
if (nLaunchState == 5)
|
|
{ // launched...
|
|
nLaunchState = 0
|
|
mail(MAIL_CHANGE_LAUNCH_STATE, this)
|
|
mail(MAIL_RESET_AFTER_LAUNCH, this) // reset
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
nLaunchState = 0
|
|
|
|
if nLaunchState == 0 && ($$networkScenarioCount$$ <= 0)
|
|
{
|
|
o_error_string.text = "map is not initiated..."
|
|
nLaunchState = -1
|
|
}
|
|
|
|
int total_teams = 0
|
|
int team_count[8]
|
|
int team_1[16]
|
|
int team_2[16]
|
|
int team_3[16]
|
|
int team_4[16]
|
|
int team_5[16]
|
|
int team_6[16]
|
|
int team_7[16]
|
|
int team_8[16]
|
|
int nTempValue
|
|
|
|
for k = 0; k < 8; k++
|
|
team_count[k] = 0
|
|
int nTeslaPlayer = 0
|
|
int nTempPlayerCount = 0
|
|
|
|
int nOldState
|
|
int nNewState
|
|
|
|
string processing
|
|
|
|
int nErrTeslaCon = -1
|
|
int nErrTeslaName = -1
|
|
int nCurTeslaErr
|
|
string timeString
|
|
string timeTemp
|
|
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
nOldState = o_status[k].state
|
|
nNewState = nOldState
|
|
nCurTeslaErr = 0
|
|
if (k < MAXTESLA_P)
|
|
{
|
|
if (nVritual)
|
|
{
|
|
mLauncherConnection = 1
|
|
mConnection2 = 1
|
|
mApplType = _EAT_MW4
|
|
mApplState = _EAS_Launched
|
|
mGameState = _EGS_Idle
|
|
mGameTime = -1
|
|
mGameIsServer = 2
|
|
}
|
|
else
|
|
{
|
|
mLauncherConnection = callback($$CTCL_Get$$, _CTCL_GetTeslaInfo, k, mConnection2, mApplType, mApplState, mGameState, mGameTime, mGameIsServer)
|
|
}
|
|
|
|
if !((mLauncherConnection == 1) && (mConnection2 == 1) && (mApplType == _EAT_MW4) && (mGameState == _EGS_Idle))
|
|
{
|
|
if (o_BotList[k].nselected == 1)
|
|
{
|
|
if (nErrTeslaCon == -1)
|
|
{
|
|
nErrTeslaCon = k
|
|
}
|
|
nCurTeslaErr = 1
|
|
//m_naLastSelected[k] = 0
|
|
//o_BotList[k].nselected = 0
|
|
//deactivate(o_Editbox[k])
|
|
//activate(o_print_text[k])
|
|
}
|
|
}
|
|
if (mLauncherConnection == 1)
|
|
{
|
|
if (mConnection2 == 1)
|
|
{
|
|
if (mGameState == _EGS_None)
|
|
{
|
|
o_print_text[k].text = "" // unknown temporary - program loading/quitting...
|
|
}
|
|
if (mGameState == _EGS_Idle)
|
|
{
|
|
o_print_text[k].text = "Idle"
|
|
}
|
|
if (mGameState == _EGS_Preparing)
|
|
{
|
|
o_print_text[k].text = "Preparing..."
|
|
}
|
|
if (mGameState == _EGS_Running)
|
|
{
|
|
if (mGameTime < 0) // time indetermined - i.e starting...
|
|
{
|
|
if (mGameIsServer == 1)
|
|
o_print_text[k].text = "Starting..."
|
|
else
|
|
o_print_text[k].text = "Waiting..."
|
|
}
|
|
else
|
|
{
|
|
// Writing out the time to each pod status
|
|
timeString = conv$(mGameTime / 60)
|
|
timeTemp = conv$(mGameTime % 60)
|
|
if length$(timeTemp) == 1
|
|
timeString = timeString ":0" timeTemp
|
|
else
|
|
timeString = timeString ":" timeTemp
|
|
if (mGameIsServer == 1)
|
|
timeString = timeString "(server)"
|
|
o_print_text[k].text = timeString
|
|
}
|
|
}
|
|
if (mGameState == _EGS_Closing)
|
|
{
|
|
o_print_text[k].text = "Closing..."
|
|
}
|
|
if (mGameState == _EGS_Idle)
|
|
{
|
|
if (mApplType == _EAT_MW4)
|
|
nNewState = 1
|
|
else
|
|
nNewState = 0
|
|
}
|
|
else
|
|
{
|
|
nNewState = 3
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (mConnection2 == -1)
|
|
{
|
|
o_print_text[k].text = "Connecting..."
|
|
nNewState = 0
|
|
}
|
|
else
|
|
{
|
|
o_print_text[k].text = "Not Ready..."
|
|
nNewState = 3
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (mLauncherConnection == -1)
|
|
{
|
|
//o_print_text[k].text = "Connecting..."
|
|
processing = o_print_text[k].text
|
|
if equal$(processing, ".")
|
|
processing = ".."
|
|
else
|
|
{
|
|
if equal$(processing, "..")
|
|
processing = "..."
|
|
else
|
|
{
|
|
if equal$(processing, "...")
|
|
processing = "...."
|
|
else
|
|
{
|
|
if equal$(processing, "....")
|
|
processing = "....."
|
|
else
|
|
{
|
|
processing = "."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
o_print_text[k].text = processing
|
|
nNewState = 3 // 0
|
|
}
|
|
else
|
|
{
|
|
o_print_text[k].text = "" // !ready"
|
|
nNewState = 3
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
o_print_text[k].text = ""
|
|
if (o_BotList[k].nselected == 0)
|
|
nNewState = 1
|
|
else
|
|
nNewState = 4
|
|
}
|
|
if (o_BotList[k].nselected != 0)
|
|
{
|
|
if (o_BotList[k].nselected == 1) && (k < MAXTESLA_P)
|
|
{
|
|
if (callback($$CTCL_IsValidName$$, o_EditBox[k].boxValue))
|
|
{
|
|
nNewState = 2
|
|
}
|
|
else
|
|
{
|
|
if (nErrTeslaName == -1)
|
|
nErrTeslaName = k
|
|
nNewState = 1
|
|
}
|
|
if nCurTeslaErr
|
|
nNewState = 3
|
|
nTeslaPlayer++
|
|
}
|
|
else
|
|
{
|
|
nNewState = 4
|
|
}
|
|
nTempPlayerCount++
|
|
}
|
|
if (nNewState != nOldState)
|
|
{
|
|
o_status[k].state = nNewState
|
|
//mail(0, o_status[k])
|
|
}
|
|
if cur_team_val && (o_BotList[k].nselected != 0)
|
|
{
|
|
team_2[team_count[o_team[k].nselected]] = k
|
|
team_count[o_team[k].nselected]++
|
|
if (team_count[o_team[k].nselected] == 1)
|
|
total_teams++
|
|
}
|
|
}
|
|
if 0 < o_cam_list.nselected
|
|
{
|
|
nTeslaPlayer++
|
|
nTempPlayerCount++
|
|
if (nVritual)
|
|
{
|
|
mLauncherConnection = 1
|
|
mConnection2 = 1
|
|
mApplType = _EAT_MW4
|
|
mApplState = _EAS_Launched
|
|
mGameState = _EGS_Idle
|
|
mGameTime = -1
|
|
mGameIsServer = 2
|
|
}
|
|
else
|
|
{
|
|
k = MAXTESLA_P + o_cam_list.nselected - 1
|
|
mLauncherConnection = callback($$CTCL_Get$$, _CTCL_GetTeslaInfo, k, mConnection2, mApplType, mApplState, mGameState, mGameTime, mGameIsServer)
|
|
}
|
|
if (mLauncherConnection == 1)
|
|
{
|
|
if (mConnection2 == 1)
|
|
{
|
|
if (mGameState == _EGS_None)
|
|
{
|
|
o_cam_print_text.text = "" // unknown temporary - program loading/quitting...
|
|
}
|
|
if (mGameState == _EGS_Idle)
|
|
{
|
|
o_cam_print_text.text = "Idle"
|
|
}
|
|
if (mGameState == _EGS_Preparing)
|
|
{
|
|
o_cam_print_text.text = "Preparing..."
|
|
}
|
|
if (mGameState == _EGS_Running)
|
|
{
|
|
if (mGameTime < 0) // time indetermined - i.e starting...
|
|
{
|
|
if (mGameIsServer == 1)
|
|
o_cam_print_text.text = "Starting..."
|
|
else
|
|
o_cam_print_text.text = "Waiting..."
|
|
}
|
|
else
|
|
{
|
|
timeString = conv$(mGameTime / 60)
|
|
timeTemp = conv$(mGameTime % 60)
|
|
if length$(timeTemp) == 1
|
|
timeString = timeString ":0" timeTemp
|
|
else
|
|
timeString = timeString ":" timeTemp
|
|
if (mGameIsServer == 1)
|
|
timeString = timeString "(server)"
|
|
o_cam_print_text.text = timeString
|
|
}
|
|
}
|
|
if (mGameState == _EGS_Closing)
|
|
{
|
|
o_cam_print_text.text = "Closing..."
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (mConnection2 == -1)
|
|
{
|
|
o_cam_print_text.text = "Connecting..."
|
|
}
|
|
else
|
|
{
|
|
o_cam_print_text.text = "Not Ready..."
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (mLauncherConnection == -1)
|
|
{
|
|
o_cam_print_text.text = "Connecting..."
|
|
processing = o_cam_print_text.text
|
|
if equal$(processing, ".")
|
|
processing = ".."
|
|
else
|
|
{
|
|
if equal$(processing, "..")
|
|
processing = "..."
|
|
else
|
|
{
|
|
if equal$(processing, "...")
|
|
processing = "...."
|
|
else
|
|
{
|
|
if equal$(processing, "....")
|
|
processing = "....."
|
|
else
|
|
{
|
|
processing = "."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
o_cam_print_text.text = processing
|
|
}
|
|
else
|
|
{
|
|
o_cam_print_text.text = "!" // !ready"
|
|
}
|
|
}
|
|
if ((mLauncherConnection == 1) && (mConnection2 == 1) && (mApplType == _EAT_MW4) && (mGameState == _EGS_Idle))
|
|
{
|
|
o_cam_status.state = 2
|
|
}
|
|
else
|
|
{
|
|
if (mLauncherConnection == 1)
|
|
{
|
|
if (mConnection2 == 1)
|
|
o_cam_status.state = 0
|
|
else
|
|
o_cam_status.state = 1
|
|
}
|
|
else
|
|
{
|
|
o_cam_status.state = 3
|
|
}
|
|
if (nErrTeslaCon == -1)
|
|
{
|
|
nErrTeslaCon = k
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
o_cam_print_text.text = ""
|
|
}
|
|
|
|
if nLaunchState == 0 && (nTeslaPlayer <= 0)
|
|
{
|
|
o_error_string.text = "No Pilots Listed"
|
|
nLaunchState = -4
|
|
}
|
|
if nLaunchState == 0 && (nErrTeslaCon != -1)
|
|
{
|
|
if (MAXTESLA_P <= nErrTeslaCon)
|
|
o_error_string.text = "Cameraship error: " TESLA_PREFIX m_aTeslaName[nErrTeslaCon] TESLA_POSTFIX
|
|
else
|
|
o_error_string.text = "Tesla error: " TESLA_PREFIX m_aTeslaName[nErrTeslaCon] TESLA_POSTFIX
|
|
nLaunchState = -5
|
|
}
|
|
if nLaunchState == 0 && (nErrTeslaName != -1)
|
|
{
|
|
o_error_string.text = "Valid player name required: " TESLA_PREFIX m_aTeslaName[nErrTeslaName] TESLA_POSTFIX
|
|
nLaunchState = -6
|
|
}
|
|
|
|
|
|
if nLaunchState == 0 && (cur_team_val > 0)
|
|
{
|
|
if total_teams > cur_team_val
|
|
{
|
|
nLaunchState = -2
|
|
o_error_string.text = "Total team count exceeds - fatal error " conv$(total_teams) " > " conv$(cur_team_val)
|
|
}
|
|
else
|
|
{
|
|
for k = 0; k < cur_team_val; k++
|
|
{
|
|
nTempValue = cur_team_count[k]
|
|
if nTempValue > MAX_TEAMMATE_COUNT
|
|
nTempValue = MAX_TEAMMATE_COUNT
|
|
if team_count[k] > nTempValue
|
|
{
|
|
if (nLaunchState == 0)
|
|
{
|
|
o_error_string.text = "Team Count Exceed : " conv$(k + 1) "(" conv$(nTempValue) ")"
|
|
nLaunchState = -3
|
|
}
|
|
else
|
|
{
|
|
o_error_string.text = o_error_string.text ", " conv$(k + 1) "(" conv$(nTempValue) ")"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// MSL 5.06
|
|
// RT 07/19/26: raised cap from 16 to 17 to allow 16 pilots + 1 cameraship
|
|
if nLaunchState == 0 && (nTempPlayerCount > 17)
|
|
{
|
|
o_error_string.text = "Too many player/bots"
|
|
nLaunchState = -7
|
|
}
|
|
if (nLaunchState == 0)
|
|
{
|
|
int k2
|
|
nErrTeslaName = -1
|
|
for (k = 0; (nErrTeslaName == -1) && (k < nRosterCount); k++)
|
|
{
|
|
if ((k < MAXTESLA_P) && (o_BotList[k].nselected == 1))
|
|
{
|
|
for (k2 = 0; (nErrTeslaName == -1) && (k2 < nRosterCount); k2++)
|
|
{
|
|
if ((k2 != k) && (k2 < MAXTESLA_P) && (o_BotList[k2].nselected == 1))
|
|
{
|
|
if equal$(o_Editbox[k].boxValue, o_Editbox[k2].boxValue)
|
|
{
|
|
nErrTeslaName = k2
|
|
|
|
o_error_string.text = "Duplicated player names: " TESLA_PREFIX m_aTeslaName[k] TESLA_POSTFIX " == " TESLA_PREFIX m_aTeslaName[k2] TESLA_POSTFIX
|
|
nLaunchState = -7
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (nLaunchState == 0)
|
|
{
|
|
o_error_string.text = ""
|
|
nLaunchState = 1
|
|
}
|
|
mail(MAIL_CHANGE_LAUNCH_STATE, this)
|
|
}
|
|
}
|
|
|
|
background
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int last_error_count = 0
|
|
int denied_parameter = 0
|
|
int last_error = 0
|
|
int request_resent = 0
|
|
|
|
location = 0,0,-3
|
|
pane p_background = GPATH "btfconsole.tga"
|
|
int waiting_to_init = 1
|
|
|
|
// Denied Error String array
|
|
string denied_error[13]
|
|
denied_error[0] = ""
|
|
denied_error[1] = localize$(IDS_MP_LOBBY_BUILD_ERROR_UNK)
|
|
denied_error[2] = localize$(IDS_MP_LOBBY_BUILD_ERROR_CAMERA)
|
|
denied_error[3] = localize$(IDS_MP_LOBBY_BUILD_ERROR_CUSTOM)
|
|
denied_error[4] = localize$(IDS_MP_LOBBY_BUILD_ERROR_TEAM)
|
|
denied_error[5] = localize$(IDS_MP_LOBBY_BUILD_ERROR_WEIGHT_MIN)
|
|
denied_error[6] = localize$(IDS_MP_LOBBY_BUILD_ERROR_WEIGHT_MAX)
|
|
denied_error[7] = localize$(IDS_MP_LOBBY_BUILD_ERROR_CHASSIS)
|
|
denied_error[8] = localize$(IDS_MP_LOBBY_BUILD_ERROR_BEAM)
|
|
denied_error[9] = localize$(IDS_MP_LOBBY_BUILD_ERROR_PROJECTILE)
|
|
denied_error[10] = localize$(IDS_MP_LOBBY_BUILD_ERROR_MISSILE)
|
|
denied_error[11] = localize$(IDS_MP_LOBBY_BUILD_ERROR_SUBSYS)
|
|
denied_error[12] = localize$(IDS_MP_LOBBY_BUILD_ERROR_WEIGHT_TOTALMAX)
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
render P_background, 0,0
|
|
// render p_temp,0,0
|
|
|
|
setpencolor(255,255,255,255)
|
|
print3d_margins = 0, 0 to getresx(), getresy()
|
|
print3d_attributes = gFont3d, 0xffeeeeee,1,0,1,0,0,just_left
|
|
|
|
print3d_position = TESLA_STATUS_X,HEADER_TITLE_Y
|
|
print3d "" // localize$(IDS_MP_LOBBY_STATUS)
|
|
|
|
print3d_position = BOT_LIST_X,HEADER_TITLE_Y
|
|
print3d localize$(IDS_MP_LOBBY_PLAYER)
|
|
|
|
print3d_position = MECH_LIST_X,HEADER_TITLE_Y
|
|
print3d localize$(IDS_IA_MECH)
|
|
|
|
if cur_team_val
|
|
{
|
|
print3d_position = TEAM_X-37,HEADER_TITLE_Y
|
|
print3d localize$(IDS_MP_LOBBY_NORMAL_TEAM)
|
|
}
|
|
else
|
|
{
|
|
print3d_position = SKIN_X-39,HEADER_TITLE_Y
|
|
print3d "Camo"
|
|
}
|
|
|
|
print3d_position = DECAL_LIST_X,HEADER_TITLE_Y
|
|
print3d "Unit"
|
|
|
|
drawline TESLA_STATUS_X, DIVIDER_Y1 to ROSTER_LINE_START_X, DIVIDER_Y1
|
|
drawline TESLA_STATUS_X, DIVIDER_Y2 to ROSTER_LINE_START_X, DIVIDER_Y2
|
|
}
|
|
}
|
|
|
|
display_num_of_players
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 0,0,255
|
|
|
|
int text_size = 1 // 100% for bitmap
|
|
framerate = 10
|
|
}
|
|
GUI_DRAW
|
|
{
|
|
int num_of_players = 0
|
|
for (k = 0; k < nRosterCount; k++)
|
|
{
|
|
if (o_BotList[k].nselected != 0)
|
|
num_of_players++
|
|
}
|
|
|
|
print3d_attributes = gFont3d, 0xffffffff,text_size,0,1,0,0,just_left
|
|
lprint3d_position = 0, 0
|
|
|
|
string str
|
|
if (num_of_players == 0)
|
|
str = "No player is selected"
|
|
if (num_of_players == 1)
|
|
str = "1 player"
|
|
if (num_of_players > 1)
|
|
str = conv$(num_of_players) " Players"
|
|
if (o_cam_list.nselected != 0)
|
|
str = str " with cameraship"
|
|
print3d str
|
|
}
|
|
}
|
|
|
|
s_print_text
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
string text
|
|
font3d text_font
|
|
int text_color
|
|
int id
|
|
}
|
|
|
|
|
|
GUI_DRAW
|
|
{
|
|
int n_color
|
|
if (id == -1)
|
|
n_color = packcolor(255,255,255,255)
|
|
else
|
|
n_color = name_color[id]
|
|
|
|
print3d_attributes = text_font, n_color,1,0,1,0,0,just_left,1
|
|
lprint3d_margins = 0, 0 to 130, 50
|
|
lprint3d_position = 0, 0
|
|
|
|
if length$(text) > 0
|
|
{
|
|
print3d text //conv$(cur_team_val)
|
|
}
|
|
}
|
|
}
|
|
|
|
skin_box
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int nLastState = -1
|
|
int id = 0
|
|
pane p_pane
|
|
int state = 3
|
|
|
|
string letters[37]
|
|
letters[0] = "0"
|
|
letters[1] = "1"
|
|
letters[2] = "2"
|
|
letters[3] = "3"
|
|
letters[4] = "4"
|
|
letters[5] = "5"
|
|
letters[6] = "6"
|
|
letters[7] = "7"
|
|
letters[8] = "8"
|
|
letters[9] = "9"
|
|
letters[10] = "A"
|
|
letters[11] = "B"
|
|
letters[12] = "C"
|
|
letters[13] = "D"
|
|
letters[14] = "E"
|
|
letters[15] = "F"
|
|
letters[16] = "G"
|
|
letters[17] = "H"
|
|
letters[18] = "I"
|
|
letters[19] = "J"
|
|
letters[20] = "K"
|
|
letters[21] = "L"
|
|
letters[22] = "M"
|
|
letters[23] = "N"
|
|
letters[24] = "O"
|
|
letters[25] = "P"
|
|
letters[26] = "Q"
|
|
letters[27] = "R"
|
|
letters[28] = "S"
|
|
letters[29] = "T"
|
|
letters[30] = "U"
|
|
letters[31] = "V"
|
|
letters[32] = "W"
|
|
letters[33] = "X"
|
|
letters[34] = "Y"
|
|
letters[35] = "Z"
|
|
letters[36] = "_" // MSL Bot color
|
|
|
|
string decals[21] //JPP Add Decal here
|
|
decals[0] = "03"
|
|
decals[1] = "04"
|
|
decals[2] = "02"
|
|
decals[3] = "05"
|
|
decals[4] = "06"
|
|
decals[5] = "09"
|
|
decals[6] = "50"
|
|
decals[7] = "10"
|
|
decals[8] = "11"
|
|
decals[9] = "12"
|
|
decals[10] = "16"
|
|
decals[11] = "20"
|
|
decals[12] = "21"
|
|
decals[13] = "22"
|
|
decals[14] = "24"
|
|
decals[15] = "27"
|
|
decals[16] = "48"
|
|
decals[17] = "49"
|
|
decals[18] = "47"
|
|
decals[19] = "46"
|
|
decals[20] = "00" // MSL Bot color
|
|
|
|
framerate = 10
|
|
}
|
|
GUI_DRAW
|
|
{
|
|
if cur_team_val
|
|
{
|
|
state = team_camo[o_team[id].nselected]
|
|
}
|
|
else
|
|
{
|
|
if ((id < MAXTESLA_P) && (o_BotList[id].nselected == 1))
|
|
{
|
|
state = o_skins[id].nselected // MSL Player color
|
|
}
|
|
else
|
|
{
|
|
state = 36 // MSL Bot color
|
|
}
|
|
}
|
|
if (state != nLastState)
|
|
{
|
|
nLastState = state
|
|
p_pane = "Content\\ShellScripts\\Graphics\\Multiplayer\\LobbySkins\\skin" letters[state] "4.tga"
|
|
}
|
|
render p_pane, SKIN_BOX_X-35,location.Y
|
|
|
|
}
|
|
}
|
|
|
|
decal_box
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int nLastdState = -1
|
|
int id = 0
|
|
pane d_pane
|
|
int dstate = 3
|
|
|
|
string letters[37]
|
|
letters[0] = "0"
|
|
letters[1] = "1"
|
|
letters[2] = "2"
|
|
letters[3] = "3"
|
|
letters[4] = "4"
|
|
letters[5] = "5"
|
|
letters[6] = "6"
|
|
letters[7] = "7"
|
|
letters[8] = "8"
|
|
letters[9] = "9"
|
|
letters[10] = "A"
|
|
letters[11] = "B"
|
|
letters[12] = "C"
|
|
letters[13] = "D"
|
|
letters[14] = "E"
|
|
letters[15] = "F"
|
|
letters[16] = "G"
|
|
letters[17] = "H"
|
|
letters[18] = "I"
|
|
letters[19] = "J"
|
|
letters[20] = "K"
|
|
letters[21] = "L"
|
|
letters[22] = "M"
|
|
letters[23] = "N"
|
|
letters[24] = "O"
|
|
letters[25] = "P"
|
|
letters[26] = "Q"
|
|
letters[27] = "R"
|
|
letters[28] = "S"
|
|
letters[29] = "T"
|
|
letters[30] = "U"
|
|
letters[31] = "V"
|
|
letters[32] = "W"
|
|
letters[33] = "X"
|
|
letters[34] = "Y"
|
|
letters[35] = "Z"
|
|
letters[36] = "_" // MSL Bot color
|
|
|
|
string decals[21] //JPP Decal add here
|
|
decals[0] = "03"
|
|
decals[1] = "04"
|
|
decals[2] = "02"
|
|
decals[3] = "05"
|
|
decals[4] = "06"
|
|
decals[5] = "09"
|
|
decals[6] = "50"
|
|
decals[7] = "10"
|
|
decals[8] = "11"
|
|
decals[9] = "12"
|
|
decals[10] = "16"
|
|
decals[11] = "20"
|
|
decals[12] = "21"
|
|
decals[13] = "22"
|
|
decals[14] = "24"
|
|
decals[15] = "27"
|
|
decals[16] = "48"
|
|
decals[17] = "49"
|
|
decals[18] = "47"
|
|
decals[19] = "46"
|
|
decals[20] = "00" // MSL Bot color
|
|
|
|
framerate = 10
|
|
}
|
|
GUI_DRAW
|
|
{
|
|
if cur_team_val
|
|
{
|
|
dstate = o_decal[id].nselected
|
|
}
|
|
else
|
|
{
|
|
if ((id < MAXTESLA_P) && (o_BotList[id].nselected == 1))
|
|
{
|
|
dstate = o_decal[id].nselected // MSL Player color
|
|
}
|
|
else
|
|
{
|
|
dstate = 20 // MSL Bot color jpp decal change for bot
|
|
}
|
|
}
|
|
if (dstate != nLastdState)
|
|
{
|
|
if (dstate < 0) || (dstate > 20)
|
|
dstate = 20
|
|
nLastdState = dstate
|
|
d_pane = "Content\\ShellScripts\\Graphics\\Multiplayer\\LobbyDecals\\decal_" decals[dstate] ".tga"
|
|
}
|
|
render d_pane, DECAL_BOX_X+5,location.y
|
|
|
|
}
|
|
}
|
|
|
|
status_control
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int id = 0
|
|
pane p_pane
|
|
bitmap b_states
|
|
string file
|
|
int total_states
|
|
int n_last_pane_state = -1
|
|
int state = 0
|
|
int buttonsize
|
|
int toggle
|
|
int textsize = 1
|
|
int textcolor = 0xffffffff
|
|
int theight = 8
|
|
int twidth = 8
|
|
string text
|
|
|
|
int dropped_player = FALSE
|
|
int dropped_bot = FALSE
|
|
int adding_bot = TRUE
|
|
int last_selection = 1000
|
|
|
|
sound btnRolloverSound = SPATH "sfx_button7.wav"
|
|
sound btnPressedSound = SPATH "sfx_button5.wav"
|
|
}
|
|
|
|
REGION_ENTERED
|
|
{
|
|
play btnRolloverSound, 1
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
b_states = file
|
|
buttonsize = getheight(b_states)/total_states
|
|
p_pane = getwidth(b_states), buttonsize, true, volatile
|
|
alphamode (p_pane) = am_alpha_alphainvalpha
|
|
|
|
blit b_states(0,buttonsize*state to getwidth(b_states), buttonsize*(state+1)), 0,0 on p_pane
|
|
update(p_pane)
|
|
region = 0,0 to getwidth(b_states),buttonsize
|
|
last_selection = 1000
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
if (o_status_droplist.m_nStatusID == id) && (o_status_droplist.m_nListType != -999) && (o_status_droplist.m_nListIndex != -1) && last_selection != o_status_droplist.nselected
|
|
{
|
|
int nListType = o_status_droplist.m_nListType
|
|
o_status_droplist.m_nListType = -999
|
|
|
|
deactivate(o_status_droplist)
|
|
|
|
if o_status_droplist.nselected == 0
|
|
{
|
|
nTeslaIndex = id
|
|
if (id == -1)
|
|
{
|
|
nTeslaIndex = MAXTESLA_P + o_cam_list.nselected - 1
|
|
}
|
|
if (nTeslaIndex == o_status_droplist.m_nListIndex)
|
|
{
|
|
mLauncherConnection = callback($$CTCL_Get$$, _CTCL_GetTeslaInfo, nTeslaIndex, mConnection2, mApplType, mApplState, mGameState, mGameTime, mGameIsServer)
|
|
|
|
if (nListType == 0)
|
|
{ // Load
|
|
if (mLauncherConnection == 1) && (mConnection2 != 1) && (mApplType == _EAT_None) // && (mApplState == _EAS_Launched) && (mGameState == _EGS_Idle)
|
|
{
|
|
play launchSound,1
|
|
callback($$CTCL_Set$$, _CTCL_OrderAppl, nTeslaIndex, _CTCL_Order_Launch)
|
|
}
|
|
}
|
|
if (nListType == 1)
|
|
{ // KILL
|
|
if (mConnection2 == 1) && (mApplType != _EAT_None) && (mApplState == _EAS_Launched) && (mGameState == _EGS_Idle)
|
|
{
|
|
play launchSound,1
|
|
callback($$CTCL_Set$$, _CTCL_OrderAppl, nTeslaIndex, _CTCL_Order_Terminate)
|
|
}
|
|
}
|
|
if (nListType == 2)
|
|
{ // KILL
|
|
if (mConnection2 == 1) && (mApplType != _EAT_None) && (mApplState == _EAS_Launched) && (mGameState == _EGS_Running) && (mGameIsServer == 1)
|
|
{
|
|
play launchSound,1
|
|
callback($$CTCL_Set$$, _CTCL_OrderAppl, nTeslaIndex, _CTCL_Order_EndMission)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if o_status_droplist.nselected == 2 || o_status_droplist.nselected == 3
|
|
{
|
|
nTeslaIndex = id
|
|
if (id == -1)
|
|
{
|
|
nTeslaIndex = MAXTESLA_P + o_cam_list.nselected - 1
|
|
}
|
|
if (nTeslaIndex == o_status_droplist.m_nListIndex)
|
|
{
|
|
mLauncherConnection = callback($$CTCL_Get$$, _CTCL_GetTeslaInfo, nTeslaIndex, mConnection2, mApplType, mApplState, mGameState, mGameTime, mGameIsServer)
|
|
|
|
if (nListType == 0)
|
|
{ // Shutdown or Reboot
|
|
if (mLauncherConnection == 1) && (mConnection2 != 1) && (mApplType == _EAT_None) // && (mApplState == _EAS_Launched) && (mGameState == _EGS_Idle)
|
|
{
|
|
play launchSound,1
|
|
if o_status_droplist.nselected == 2
|
|
callback($$CTCL_Set$$, _CTCL_OrderAppl, nTeslaIndex, _CTCL_Order_Shutdown)
|
|
else
|
|
callback($$CTCL_Set$$, _CTCL_OrderAppl, nTeslaIndex, _CTCL_Order_Reboot)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 5.02 Disabled for Release Version
|
|
// if o_status_droplist.nselected == 4
|
|
// {
|
|
// nTeslaIndex = id
|
|
// if (id == -1)
|
|
// {
|
|
// nTeslaIndex = MAXTESLA_P + o_cam_list.nselected - 1
|
|
// }
|
|
// if (nTeslaIndex == o_status_droplist.m_nListIndex)
|
|
// {
|
|
// mLauncherConnection = callback($$CTCL_Get$$, _CTCL_GetTeslaInfo, nTeslaIndex, mConnection2, mApplType, mApplState, mGameState, mGameTime, mGameIsServer)
|
|
//
|
|
// if (nListType == 0)
|
|
// { // Unload
|
|
// if (mLauncherConnection == 1) && (mConnection2 != 1) && (mApplType == _EAT_None) // && (mApplState == _EAS_Launched) && (mGameState == _EGS_Idle)
|
|
// {
|
|
// play launchSound,1
|
|
// callback($$CTCL_Set$$, _CTCL_OrderAppl, nTeslaIndex, _CTCL_Order_Unload)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if (mouse.left == BUTTON_PRESSED) && (((0 <= id) && (id < MAXTESLA_P)) || ((id == -1) && (0 < o_cam_list.nselected)))
|
|
{
|
|
nTeslaIndex = id
|
|
if (id == -1)
|
|
{
|
|
nTeslaIndex = MAXTESLA_P + o_cam_list.nselected - 1
|
|
}
|
|
if (nVritual)
|
|
{
|
|
if (0)
|
|
{ // load test
|
|
mLauncherConnection = 1
|
|
mConnection2 = 0
|
|
mApplType = _EAT_None
|
|
mApplState = _EAS_None
|
|
mGameState = _EGS_None
|
|
mGameTime = -1
|
|
mGameIsServer = 2
|
|
}
|
|
else
|
|
{ // kill test
|
|
mConnection2 = 1
|
|
mApplType = _EAT_MW4
|
|
mApplState = _EAS_Launched
|
|
mGameState = _EGS_Idle
|
|
mGameTime = -1
|
|
mGameIsServer = 2
|
|
}
|
|
}
|
|
else
|
|
{
|
|
mLauncherConnection = callback($$CTCL_Get$$, _CTCL_GetTeslaInfo, nTeslaIndex, mConnection2, mApplType, mApplState, mGameState, mGameTime, mGameIsServer)
|
|
}
|
|
if ((mLauncherConnection == 1) && (mConnection2 == 0) && (mApplType == _EAT_None)) // && (mApplState == _EAS_None) && (mGameState == _EGS_None) // (mConnection2 == 0)
|
|
{ // can load
|
|
o_status_droplist.column[0].list_item[0] = "Load"
|
|
o_status_droplist.column[0].list_item[1] = ""
|
|
o_status_droplist.column[0].list_item[2] = "Shutdown"
|
|
o_status_droplist.column[0].list_item[3] = "Reboot"
|
|
// 5.02 Disabled for Release Version
|
|
// o_status_droplist.column[0].list_item[4] = "Unload"
|
|
o_status_droplist.column[0].list_item[4] = "Cancel"
|
|
o_status_droplist.list_size = 5
|
|
o_status_droplist.max_displayed = 105
|
|
o_status_droplist.m_nListType = 0 // load
|
|
}
|
|
if ((mConnection2 == 1) && (mApplType != _EAT_None) && (mApplState == _EAS_Launched) && (mGameState == _EGS_Idle))
|
|
{ // can kill
|
|
o_status_droplist.column[0].list_item[0] = "Kill"
|
|
o_status_droplist.column[0].list_item[1] = "Cancel"
|
|
o_status_droplist.list_size = 2
|
|
o_status_droplist.max_displayed = 42
|
|
o_status_droplist.m_nListType = 1 // kill
|
|
}
|
|
if ((mConnection2 == 1) && (mApplType != _EAT_None) && (mApplState == _EAS_Launched) && (mGameState == _EGS_Running) && (mGameIsServer == 1))
|
|
{ // can End Mission
|
|
o_status_droplist.column[0].list_item[0] = "End Mission"
|
|
o_status_droplist.column[0].list_item[1] = "Cancel"
|
|
o_status_droplist.list_size = 2
|
|
o_status_droplist.max_displayed = 42
|
|
o_status_droplist.m_nListType = 2 // End Mission
|
|
}
|
|
if (o_status_droplist.m_nListType != -999)
|
|
{
|
|
o_status_droplist.location = location.x + getwidth(b_states), location.y, 10000
|
|
o_status_droplist.nselected = 1000
|
|
last_selection = 1000
|
|
o_status_droplist.m_nStatusID = id
|
|
o_status_droplist.m_nListIndex = nTeslaIndex
|
|
|
|
initialize (o_status_droplist)
|
|
activate(o_status_droplist)
|
|
}
|
|
focus(this)
|
|
}
|
|
}
|
|
|
|
GUI_UNFOCUS
|
|
{
|
|
// deactivate(parent.o_status_droplist)
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
if (state != n_last_pane_state)
|
|
{
|
|
n_last_pane_state = state
|
|
blit b_states(0,buttonsize*state to getwidth(b_states), buttonsize*(state+1)), 0,0 on p_pane
|
|
update(p_pane)
|
|
}
|
|
render p_pane, location
|
|
}
|
|
}
|
|
|
|
roster_list_scroll_controls
|
|
{
|
|
//////scrollable lobby controls
|
|
GUI_CREATE
|
|
{
|
|
location = ROSTER_START_X,ROSTER_START_Y,10
|
|
|
|
int arrowHeight = 10
|
|
int buttonWidth = 16
|
|
int itemHeight = ROSTER_HEIGHT
|
|
int num_displayed = ROSTER_DISPLAY_COUNT
|
|
int list_size = 0
|
|
int itemWidth = 0
|
|
int column_header_height
|
|
|
|
int first_delay = 30 //time delay value n/60; for the buttons
|
|
int second_delay = 5 //time delay value n/60; for the buttons
|
|
position mouse_capture //used to grab the mouse position and detect whether the mouse has been moved
|
|
|
|
int backColor = packcolor (0, 0, 0, 150) //CAN BE INITIALIZED
|
|
int controlColor = packcolor (0, 0, 0, 255) //CAN BE INITIALIZED
|
|
int boxTextColor = packcolor (0, 0, 0, 255) //CAN BE INITIALIZED
|
|
int selectedColor = packcolor (255,255,255,255) //CAN BE INITIALIZED
|
|
int SelectedHighlightColor = packcolor (51, 55, 115, 255) //CAN BE INITIALIZED
|
|
int framehighlightColor = packcolor (200,200,230,255) //CAN BE INITIALIZED
|
|
int ItemHighlightColor = packcolor (255,255,255,255) //CAN BE INITIALIZED
|
|
int boxhighlightColor = packcolor (51, 55, 115, 255) //CAN BE INITIALIZED
|
|
int boxTextSelectedColor = packcolor (255,255,255,255) //CAN BE INITIALIZED
|
|
int labelTextColor = packcolor (255,255,255,255) //CAN BE INITIALIZED
|
|
int gutterColor = packcolor (0, 0, 0, 255) //CAN BE INITIALIZED
|
|
int borderColor = packcolor (255, 255, 255, 255) //CAN BE INITIALIZED
|
|
int headercolor = packcolor (68, 68, 85, 255)
|
|
int headerbordercolor = packcolor (255, 255, 255, 255)
|
|
int headerpressedcolor = packcolor (68, 68, 85, 255)
|
|
int headertextcolor = packcolor (255, 255, 255, 255)
|
|
int facecolor = packcolor (187, 187, 204, 255)
|
|
int shadowcolor = packcolor (119, 119, 119, 255)
|
|
|
|
|
|
//CREATE CHILDREN BUTTONS--THEY MUST EXIST FOR THE DROPBOX TO WORK!!
|
|
object o_uparrow_lobby = updown_arrow
|
|
object o_downarrow_lobby = updown_arrow
|
|
o_downarrow_lobby.up = false // identifies this as the arrow down button
|
|
object o_thumbslide_lobby = thumbslide
|
|
object o_thumbregiontop_lobby = thumbregion
|
|
object o_thumbregionbot_lobby = thumbregion
|
|
|
|
o_uparrow_lobby.location = location.x + 1, location.y + 1, location.z+5
|
|
o_downarrow_lobby.location = location.x + 1, location.y+(itemHeight*num_displayed)-arrowHeight + 1, location.z+5
|
|
|
|
o_thumbslide_lobby.location = location.x + 1, location.y+arrowHeight+1+1, location.z+4
|
|
|
|
o_thumbregiontop_lobby.location = location.x,location.y+itemHeight+arrowHeight,location.z+3
|
|
o_thumbregionbot_lobby.location = location.x,(o_thumbslide_lobby.location.y+o_thumbslide_lobby.handleheight),location.z+3
|
|
|
|
initialize (o_uparrow_lobby)
|
|
initialize (o_downarrow_lobby)
|
|
|
|
if list_size > num_displayed
|
|
{
|
|
o_thumbslide_lobby.handleheight = ((itemHeight*num_displayed)-(arrowHeight*2)-2) / ((list_size)/num_displayed)
|
|
o_thumbslide_lobby.region = 0,-2 to buttonwidth,o_thumbslide_lobby.handleheight+2
|
|
o_uparrow_lobby.region = 0,0 to buttonwidth,arrowHeight
|
|
o_downarrow_lobby.region = 0,0 to buttonwidth,arrowHeight
|
|
if o_thumbslide_lobby.handleheight < 15
|
|
{
|
|
o_thumbslide_lobby.handleheight = 15
|
|
o_thumbslide_lobby.region = 0,-2 to buttonwidth,o_downarrow_lobby.handleheight+2
|
|
}
|
|
}
|
|
else
|
|
{
|
|
o_thumbslide_lobby.handleheight = ((itemHeight*num_displayed)-(arrowHeight*2)-2)
|
|
o_downarrow_lobby.region = 0,0 to 0,0
|
|
o_uparrow_lobby.region = 0,0 to 0,0
|
|
o_downarrow_lobby.region = 0,0 to 0,0
|
|
}
|
|
deactivate(o_thumbslide_lobby)
|
|
deactivate(o_downarrow_lobby)
|
|
deactivate(o_uparrow_lobby)
|
|
deactivate(o_thumbregiontop_lobby)
|
|
deactivate(o_thumbregionbot_lobby)
|
|
|
|
framerate = 20
|
|
mail(-1,this)
|
|
}
|
|
|
|
|
|
GUI_MAILBOX // MAILBOX IS USED TO HANDLE MESSAGES FROM THE BUTTON OBJECTS; IT DOES A LOT OF THE WORK!
|
|
{
|
|
int old_ROSTER_top = ROSTER_top_of_list
|
|
int old_ROSTER_bottom = ROSTER_top_of_list + num_displayed
|
|
|
|
// up button pressed
|
|
if (sender == o_uparrow_lobby)
|
|
{
|
|
if (ROSTER_top_of_list > 0)
|
|
ROSTER_top_of_list--
|
|
else
|
|
return
|
|
|
|
// tell the thumbslider to reposition itself
|
|
mail(0, o_thumbslide_lobby)
|
|
}
|
|
// down button pressed
|
|
if (sender == o_downarrow_lobby)
|
|
{
|
|
if (ROSTER_top_of_list < list_size - num_displayed)
|
|
ROSTER_top_of_list++
|
|
else
|
|
return
|
|
|
|
// tell the thumbslider to reposition itself
|
|
mail(0 , o_thumbslide_lobby)
|
|
}
|
|
if (sender == o_thumbslide_lobby)
|
|
{
|
|
if getmessage() < (location.y+arrowHeight+1)
|
|
o_thumbslide_lobby.location.y = location.y+arrowHeight+1
|
|
if getmessage() > (location.y+(itemHeight*(num_displayed))-arrowHeight-(o_thumbslide_lobby.handleheight))-1
|
|
o_thumbslide_lobby.location.y = (location.y+(itemHeight*(num_displayed))-arrowHeight-1-o_thumbslide_lobby.handleheight)
|
|
|
|
//1.) find out how many pixels from the top of the thumbslider region
|
|
//2.) calc total pixels to move thumbslider/calc num of items-num being drawn (to prevent any empty spaces)
|
|
//3.) find top item by taking the total area of pixels/num of pixels for one step (or scroll)
|
|
|
|
float tmp = (o_thumbslide_lobby.location.y) - (location.y+arrowHeight+1)
|
|
|
|
if(list_size-num_displayed) > 0
|
|
{
|
|
o_thumbslide_lobby.step_height = ((itemHeight*num_displayed)-(arrowHeight*2)-(o_thumbslide_lobby.handleheight)-2) / (list_size-num_displayed)
|
|
float tmp_ROSTER_top_of_list = tmp/o_thumbslide_lobby.step_height
|
|
ROSTER_top_of_list = tmp_ROSTER_top_of_list
|
|
if ROSTER_top_of_list > list_size-num_displayed
|
|
{
|
|
ROSTER_top_of_list = list_size-num_displayed
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if (sender == o_thumbregiontop_lobby)
|
|
{
|
|
if (ROSTER_top_of_list-(num_displayed-1) >= 0)
|
|
{
|
|
ROSTER_top_of_list = ROSTER_top_of_list-(num_displayed-1)
|
|
}
|
|
else
|
|
{
|
|
ROSTER_top_of_list = 0
|
|
}
|
|
// tell the thumbslider to reposition itself
|
|
mail(0, o_thumbslide_lobby)
|
|
}
|
|
|
|
if (sender == o_thumbregionbot_lobby)
|
|
{
|
|
if (ROSTER_top_of_list+(num_displayed-1) < list_size-num_displayed)
|
|
{
|
|
ROSTER_top_of_list = ROSTER_top_of_list+(num_displayed-1)
|
|
}
|
|
else
|
|
{
|
|
ROSTER_top_of_list = list_size-num_displayed
|
|
}
|
|
// tell the thumbslider to reposition itself
|
|
mail(0 , o_thumbslide_lobby)
|
|
}
|
|
|
|
int nDY = (old_ROSTER_top - ROSTER_top_of_list) * ROSTER_HEIGHT
|
|
for int x = 0; x < nRosterCount; x++
|
|
{
|
|
o_status[x].location.y = o_status[x].location.y + nDY
|
|
|
|
o_BotList[x].location.y = o_BotList[x].location.y + nDY
|
|
initialize(o_BotList[x])
|
|
o_Editbox[x].location.y = o_Editbox[x].location.y + nDY
|
|
o_print_text[x].location.y = o_print_text[x].location.y + nDY
|
|
|
|
o_mech_variant[x].location.y = o_mech_variant[x].location.y + nDY
|
|
initialize(o_mech_variant[x])
|
|
#if USE_O_MECH_VARIANT2
|
|
o_mech_variant2[x].location.y = o_mech_variant2[x].location.y + nDY
|
|
initialize(o_mech_variant2[x])
|
|
#endif // USE_O_MECH_VARIANT2
|
|
o_mech_rand[x].location.y = o_mech_rand[x].location.y + nDY
|
|
initialize(o_mech_rand[x])
|
|
|
|
o_team[x].location.y = o_team[x].location.y + nDY
|
|
initialize(o_team[x])
|
|
o_skins[x].location.y = o_skins[x].location.y + nDY
|
|
initialize(o_skins[x])
|
|
o_decal[x].location.y = o_decal[x].location.y + nDY
|
|
initialize(o_decal[x])
|
|
o_skin_box[x].location.y = o_skin_box[x].location.y + nDY
|
|
o_decal_box[x].location.y = o_decal_box[x].location.y + nDY
|
|
}
|
|
|
|
int loopito
|
|
int new_ROSTER_bottom = ROSTER_top_of_list + num_displayed
|
|
|
|
for loopito = 0;loopito < nRosterCount; loopito++
|
|
{
|
|
if (loopito < old_ROSTER_top) || (old_ROSTER_bottom <= loopito)
|
|
{
|
|
if !((loopito < ROSTER_top_of_list) || (new_ROSTER_bottom <= loopito))
|
|
{ // out -> in // no change out -> out
|
|
mail(MAIL_ROSTER_LIST_CHANGED, loopito, parent)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (loopito < ROSTER_top_of_list) || (new_ROSTER_bottom <= loopito)
|
|
{ // in -> out // no change in -> in
|
|
mail(MAIL_ROSTER_LIST_CHANGED, loopito, parent)
|
|
}
|
|
else
|
|
{
|
|
mail(MAIL_ROSTER_LIST_MAXDISPLAY, loopito, parent)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
if list_size > num_displayed
|
|
{
|
|
activate(o_thumbslide_lobby)
|
|
activate(o_downarrow_lobby)
|
|
activate(o_uparrow_lobby)
|
|
activate(o_thumbregiontop_lobby)
|
|
activate(o_thumbregionbot_lobby)
|
|
|
|
o_thumbslide_lobby.handleheight = ((itemHeight*num_displayed)-(arrowHeight*2)-2) / (list_size/num_displayed)
|
|
o_thumbslide_lobby.region = 0,-2 to buttonwidth,o_thumbslide_lobby.handleheight+2
|
|
o_uparrow_lobby.region = 0,0 to buttonwidth,arrowHeight
|
|
o_downarrow_lobby.region = 0,0 to buttonwidth,arrowHeight
|
|
if o_thumbslide_lobby.handleheight < 15
|
|
{
|
|
o_thumbslide_lobby.handleheight = 15
|
|
o_thumbslide_lobby.region = 0,-2 to buttonwidth,o_downarrow_lobby.handleheight+2
|
|
}
|
|
|
|
// if thumbslider overruns end of list, move it up to correct location
|
|
if (o_thumbslide_lobby.location.y + o_thumbslide_lobby.handleheight) > o_downarrow_lobby.location.y
|
|
{
|
|
o_thumbslide_lobby.location.y = o_downarrow_lobby.location.y - o_thumbslide_lobby.handleheight - 1
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ROSTER_top_of_list = 0
|
|
deactivate(o_thumbslide_lobby)
|
|
deactivate(o_downarrow_lobby)
|
|
deactivate(o_uparrow_lobby)
|
|
deactivate(o_thumbregiontop_lobby)
|
|
deactivate(o_thumbregionbot_lobby)
|
|
|
|
o_thumbslide_lobby.location = location.x, location.y+arrowHeight+1, location.z+4
|
|
o_thumbslide_lobby.handleheight = ((itemHeight*num_displayed)-(arrowHeight*2)-2)
|
|
o_thumbslide_lobby.region = 0,0 to 0,0
|
|
o_downarrow_lobby.region = 0,0 to 0,0
|
|
o_uparrow_lobby.region = 0,0 to 0,0
|
|
o_downarrow_lobby.region = 0,0 to 0,0
|
|
}
|
|
|
|
|
|
//resize negative space thumbslider regions ALWAYS
|
|
o_thumbregiontop_lobby.region = 0,0 to buttonWidth, (o_thumbslide_lobby.location.y-o_thumbregiontop_lobby.location.y)
|
|
o_thumbregionbot_lobby.location.y = (o_thumbslide_lobby.location.y+o_thumbslide_lobby.handleheight)
|
|
o_thumbregionbot_lobby.region = 0,0 to buttonWidth, (o_thumbslide_lobby.location.y-3)-(o_thumbslide_lobby.location.y+o_thumbslide_lobby.handleheight))
|
|
}
|
|
}
|
|
|
|
updown_arrow
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int up = true //this object is used for either the up or down arrow; this is the flag so it knows
|
|
int timeToMove //created to store a delay value for button presses
|
|
float offsety //keeps arrow in center
|
|
float offsetx
|
|
|
|
// pane p_arrowup // if you choose to us bitmaps for the arrows
|
|
// pane p_arrowdown
|
|
int use_bitmap = false
|
|
framerate = 10
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
offsety = ((parent.arrowHeight-6)/2)+1
|
|
offsetx = ((parent.buttonWidth-12)/2)+1
|
|
}
|
|
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if (mouse.left == BUTTON_PRESSED)
|
|
{
|
|
timeToMove = gettime()+parent.first_delay //if delay = 25,25/60 of a second to wait after first click; gettime() takes the current clock value
|
|
mail( 0 ) //sends 0 (the value is not important in this case) to parent to do what's necessary to move the thumbslider
|
|
}
|
|
|
|
if (mouse.left == BUTTON_HELD)
|
|
{
|
|
if gettime() > timeToMove
|
|
{
|
|
// notify parent object (the one running s_listbox)
|
|
mail( 0 ) //sends 0 (the value is not important in this case) to parent to do what's necessary to move the thumbslider
|
|
timeToMove = gettime()+parent.second_delay //if delay = 5, 5/60 of a second to wait after mouse button has been held down
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
// draw background
|
|
setpencolor(parent.faceColor)
|
|
drawrect location.x, location.y to location.x+parent.buttonWidth, location.y+parent.arrowHeight
|
|
|
|
// draw border
|
|
setpencolor(parent.borderColor)
|
|
drawline location.x, location.y to location.x + parent.buttonWidth, location.y
|
|
drawline location.x, location.y to location.x, location.y + parent.arrowheight
|
|
setpencolor(parent.shadowcolor)
|
|
drawline location.x + parent.buttonWidth, location.y to location.x + parent.buttonWidth, location.y
|
|
drawline location.x, location.y + parent.arrowheight to location.x + parent.buttonWidth, location.y + parent.arrowheight
|
|
|
|
setpencolor(parent.ControlColor)
|
|
if up == true
|
|
{
|
|
if use_bitmap
|
|
{
|
|
render p_arrow, location.x,location.y // if you decide to use a graphic for each arrow, here's where they need to be
|
|
}
|
|
else
|
|
{
|
|
drawline location.x+5+offsetx,location.y-1+offsety to location.x+6+offsetx,location.y-1+offsety
|
|
drawline location.x+4+offsetx,location.y+offsety to location.x+7+offsetx,location.y+offsety
|
|
drawline location.x+3+offsetx,location.y+1+offsety to location.x+8+offsetx,location.y+1+offsety
|
|
drawline location.x+2+offsetx,location.y+2+offsety to location.x+9+offsetx,location.y+2+offsety
|
|
drawline location.x+1+offsetx,location.y+3+offsety to location.x+10+offsetx,location.y+3+offsety
|
|
drawline location.x+offsetx,location.y+4+offsety to location.x+11+offsetx,location.y+4+offsety
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if use_bitmap
|
|
{
|
|
render p_arrow, location.x,location.y // if you decide to use a graphic for each arrow, here's where they need to be
|
|
}
|
|
else
|
|
{
|
|
drawline location.x+offsetx,location.y+offsety to location.x+11+offsetx,location.y+offsety
|
|
drawline location.x+1+offsetx,location.y+1+offsety to location.x+10+offsetx,location.y+1+offsety
|
|
drawline location.x+2+offsetx,location.y+2+offsety to location.x+9+offsetx,location.y+2+offsety
|
|
drawline location.x+3+offsetx,location.y+3+offsety to location.x+8+offsetx,location.y+3+offsety
|
|
drawline location.x+4+offsetx,location.y+4+offsety to location.x+7+offsetx,location.y+4+offsety
|
|
drawline location.x+5+offsetx,location.y+5+offsety to location.x+6+offsetx,location.y+5+offsety
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
thumbslide // resizing handle
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
float handleheight // this is very important for calculating behaviours
|
|
float step_height // float for the math part of thumbslider
|
|
float result // float to get the finished valuse to add to location
|
|
int thumb_pressed = false // was this slider pressed with left mouse button variable
|
|
int mouse_loc
|
|
int use_bitmap
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
// the list top may have changed, recompute location
|
|
if parent.list_size <= parent.num_displayed //if the list doesn't go past the max_diplayed, there is no need to slide
|
|
{
|
|
location.y = (parent.location.y+parent.arrowHeight+1)
|
|
}
|
|
else
|
|
{
|
|
if ROSTER_top_of_list == parent.list_size-parent.num_displayed //if we are at the bottm of the list box, make sure that it's lined up against the down button correctly
|
|
{
|
|
location.y = parent.location.y+(parent.itemHeight*(parent.num_displayed))-parent.arrowHeight-handleheight-1
|
|
}
|
|
else //position formula = 1.) calc the size of the thumslider area/calc num of steps to slide = the pixel height of a single step 2.) calc the location of the very top of thumbslider 3.) add to the location the result of ROSTER_top_of_list times the step height
|
|
{
|
|
step_height = ((parent.itemHeight*parent.num_displayed)-(parent.arrowHeight*2)-(handleheight)-2) / (parent.list_size-parent.num_displayed)
|
|
location.y = sender.location.y+parent.arrowHeight+1
|
|
result = (ROSTER_top_of_list * step_height)
|
|
location.y += result
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if (mouse.left == BUTTON_PRESSED) // this keeps a glitch from happening when using the thumbregions
|
|
{
|
|
focus(this)
|
|
thumb_pressed = true //now we can know that the user wanted to drag the thumbslider
|
|
mouse_loc = mouse.y - location.y
|
|
}
|
|
else
|
|
if thumb_pressed
|
|
{
|
|
if (mouse.left == BUTTON_HELD) // this drags the thumbslider as long as the button is held
|
|
{
|
|
location.y = mouse.y - mouse_loc //-(handleheight/2)
|
|
mail (location.y)
|
|
always_in_region = true
|
|
}
|
|
else // if anything else but held, release the thumbslider
|
|
{
|
|
always_in_region = false
|
|
thumb_pressed = false
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
setpencolor(parent.gutterColor)
|
|
drawrect parent.location.x+parent.itemwidth+1, parent.location.y-parent.column_header_height to parent.location.x+parent.itemwidth+parent.buttonWidth+1, parent.location.y+(parent.itemHeight*(parent.num_displayed))
|
|
|
|
setpencolor(parent.bordercolor)
|
|
drawframe parent.location.x+parent.itemwidth+1, parent.location.y-parent.column_header_height to parent.location.x+parent.itemwidth+parent.buttonWidth+1, parent.location.y+(parent.itemHeight*(parent.num_displayed))
|
|
|
|
if use_bitmap
|
|
{
|
|
render p_thumbslider, location.x+offsetx,location.y
|
|
}
|
|
else
|
|
{
|
|
setpencolor(parent.facecolor)
|
|
drawrect location.x + 2, location.y + 1 to (location.x + parent.buttonWidth) - 1, (location.y + handleheight) - 1
|
|
|
|
setpencolor(parent.borderColor)
|
|
drawline location.x + 2, location.y + 1 to (location.x + parent.buttonWidth) - 1, location.y + 1
|
|
drawline location.x + 2, location.y + 1 to location.x + 2, location.y + handleheight - 1
|
|
|
|
setpencolor(parent.shadowcolor)
|
|
drawline location.x + 2, location.y + handleheight - 1 to (location.x + parent.buttonWidth) - 1, location.y + handleheight - 1
|
|
drawline (location.x + parent.buttonWidth) - 1, location.y + 1 to (location.x + parent.buttonWidth) - 1, location.y + handleheight - 1
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
thumbregion
|
|
{
|
|
//script for scalable invisible regions for the thumbslider negative space
|
|
GUI_CREATE
|
|
{
|
|
int timeToMove //created to store a delay value for button presses
|
|
}
|
|
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if (mouse.left == BUTTON_PRESSED)
|
|
{
|
|
timeToMove = gettime()+parent.first_delay //if delay = 25, 25/60 of a second to wait after first click; gettime() takes the current clock value
|
|
mail( 0 ) //sends 0 (the value is not important in this case) to parent to do what's necessary to move the thumbslider
|
|
}
|
|
|
|
if (mouse.left == BUTTON_HELD)
|
|
{
|
|
if gettime() > timeToMove
|
|
{
|
|
// notify parent object (the one running s_droplistbox)
|
|
mail( 0 ) //sends 0 (the value is not important in this case) to parent to do what's necessary to move the thumbslider
|
|
timeToMove = gettime()+parent.second_delay //if delay = 25, 5/60 of a second to wait after mouse button has been held down
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tabs
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int tabsx = 466
|
|
int tabsy = 50
|
|
|
|
int total_buttons
|
|
total_buttons = 2 // MSL
|
|
|
|
int i
|
|
object o_radiobutton[2] // MSL
|
|
for(i = 0; i < total_buttons; i++)
|
|
{
|
|
o_radiobutton[i] = s_multistatepanetoggle
|
|
o_radiobutton[i].location = tabsx + (i * 101),tabsy, 10
|
|
o_radiobutton[i].file = GPATH "3state_tabs_98x26.tga"
|
|
o_radiobutton[i].total_states = 3
|
|
}
|
|
o_radiobutton[0].text = localize$(IDS_MP_LOBBY_MISSION)
|
|
o_radiobutton[1].text = localize$(IDS_MP_LOBBY_MAP)
|
|
// MSL o_radiobutton[2].text = localize$(IDS_MP_LOBBY_SERVER)
|
|
|
|
for(i = 0; i < total_buttons; i++)
|
|
{
|
|
initialize(o_radiobutton[i])
|
|
}
|
|
|
|
mail(2, o_radiobutton[0])
|
|
|
|
int on_tab = 0
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
setpencolor(0x66000000)
|
|
drawrect tabsx + 2, tabsy + 2 to tabsx + 98, tabsy + 24 // tab 1
|
|
drawrect tabsx + 101, tabsy + 2 to tabsx + 199, tabsy + 24 // tab 2
|
|
// drawrect tabsx + 202, tabsy + 2 to tabsx + 300, tabsy + 24 // tab 3
|
|
drawrect tabsx + 2, tabsy + 26 to tabsx + 301, tabsy + 387 + TABS_Y_DIFFER // total..
|
|
|
|
setpencolor (0xffffffff)
|
|
drawline tabsx + 2, tabsy + 26 to tabsx + 2, tabsy + 387 + TABS_Y_DIFFER // left
|
|
drawline tabsx + 98, tabsy + 26 to tabsx + 105, tabsy + 26 // tab1 rigbt bottom
|
|
// drawline tabsx + 199, tabsy + 26 to tabsx + 206, tabsy + 26 // tab2 rigbt bottom
|
|
drawline tabsx + 199, tabsy + 26 to tabsx + 300, tabsy + 26 // tab2 rigbt bottom
|
|
|
|
setpencolor (0xffbbbbcc)
|
|
drawline tabsx + 3, tabsy + 26 to tabsx + 3, tabsy + 386 + TABS_Y_DIFFER // left 2
|
|
drawline tabsx + 300, tabsy + 26 to tabsx + 300, tabsy + 386 + TABS_Y_DIFFER // right
|
|
drawline tabsx + 3, tabsy + 386 + TABS_Y_DIFFER to tabsx + 300, tabsy + 386 + TABS_Y_DIFFER // bottom
|
|
drawline tabsx + 98, tabsy + 27 to tabsx + 105, tabsy + 27 // tab1 rigbt bottom 2
|
|
// drawline tabsx + 199, tabsy + 27 to tabsx + 206, tabsy + 27 // tab2 rigbt bottom 2
|
|
drawline tabsx + 199, tabsy + 27 to tabsx + 300, tabsy + 27 // tab2 rigbt bottom 2
|
|
|
|
setpencolor (0xffbbbbcc)
|
|
drawline tabsx + 3, tabsy + 26 to tabsx + 3, tabsy + 386 + TABS_Y_DIFFER // left 2
|
|
drawline tabsx + 300, tabsy + 26 to tabsx + 300, tabsy + 386 + TABS_Y_DIFFER// right
|
|
drawline tabsx + 3, tabsy + 386 + TABS_Y_DIFFER to tabsx + 300, tabsy + 386 + TABS_Y_DIFFER
|
|
drawline tabsx + 98, tabsy + 27 to tabsx + 105, tabsy + 27 // tab1 rigbt bottom 2
|
|
|
|
setpencolor (0xff777777)
|
|
drawline tabsx + 301, tabsy + 26 to tabsx + 301, tabsy + 387 + TABS_Y_DIFFER // right 2
|
|
drawline tabsx + 2, tabsy + 387 + TABS_Y_DIFFER to tabsx + 301, tabsy + 387 + TABS_Y_DIFFER // bottom 2
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
int i
|
|
for(i = 0; i < total_buttons; i++)
|
|
{
|
|
if (sender != o_radioButton[i])
|
|
{
|
|
// turn off every button but the one just received
|
|
mail(1, o_radioButton[i])
|
|
}
|
|
}
|
|
|
|
if sender == o_radiobutton[0]
|
|
{
|
|
script_continue @conlobbymission@
|
|
|
|
if on_tab == 1
|
|
{
|
|
script_pause @hostlobbymap@,2
|
|
}
|
|
if on_tab == 2
|
|
{
|
|
script_pause @HostLobbyserver@,2
|
|
}
|
|
|
|
on_tab = 0
|
|
}
|
|
|
|
if sender == o_radiobutton[1]
|
|
{
|
|
script_continue @hostlobbymap@
|
|
|
|
if on_tab == 0
|
|
{
|
|
script_pause @conlobbymission@,2
|
|
}
|
|
if on_tab == 2
|
|
{
|
|
script_pause @HostLobbyserver@,2
|
|
}
|
|
on_tab = 1
|
|
}
|
|
|
|
// if sender == o_radiobutton[2]
|
|
// {
|
|
// script_continue @HostLobbyserver@
|
|
//
|
|
// if on_tab == 0
|
|
// {
|
|
// script_pause @conlobbymission@,2
|
|
// }
|
|
// if on_tab == 1
|
|
// {
|
|
// script_pause @hostlobbymap@,2
|
|
// }
|
|
//
|
|
// on_tab = 2
|
|
// }
|
|
}
|
|
}
|
|
|
|
mech_randomizer
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int id
|
|
location = 0,0,10
|
|
region = 0,0 to 0,0
|
|
int itemWidth = 0
|
|
int itemHeight = 0
|
|
|
|
sound btnRolloverSound = SPATH "sfx_button7.wav"
|
|
sound btnPressedSound = SPATH "sfx_button5.wav"
|
|
}
|
|
GUI_INIT
|
|
{
|
|
region = 0, 0 to itemWidth, itemHeight
|
|
}
|
|
REGION_ENTERED
|
|
{
|
|
play btnRolloverSound, 1
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if mouse.left == BUTTON_CLICKED
|
|
{
|
|
mail(1, this)
|
|
}
|
|
}
|
|
RBUTTON_UPDATE
|
|
{
|
|
if mouse.right == BUTTON_CLICKED
|
|
{
|
|
mail(2, this)
|
|
}
|
|
}
|
|
GUI_MAILBOX
|
|
{
|
|
if (sender == this)
|
|
{
|
|
int nWhichButton = getmessage()
|
|
|
|
play btnPressedSound, 1
|
|
|
|
if (nWhichButton == 1) // left button
|
|
{
|
|
last_mech = random(0, MAX_ALLOWED_MECHS - 1)
|
|
}
|
|
else // right button
|
|
{
|
|
int pick_mech = 0
|
|
//pick_mech = random(0, 3) // Fab4
|
|
// MechCorps Highlight: Super6 - expand right-click random range to 6
|
|
pick_mech = random(0, 5)
|
|
|
|
// MSL
|
|
// MechCorps Highlight: Super6 - added Archer (0) and Warhammer (5) to right-click mech pool
|
|
if pick_mech = 0
|
|
last_mech = ROOKIEMECH1 // Archer
|
|
if pick_mech = 1
|
|
last_mech = ROOKIEMECH2 // Loki
|
|
if pick_mech = 2
|
|
last_mech = ROOKIEMECH3 // Madcat
|
|
if pick_mech = 3
|
|
last_mech = ROOKIEMECH4 // Thor
|
|
if pick_mech = 4
|
|
last_mech = ROOKIEMECH5 // Vulture
|
|
if pick_mech = 5
|
|
last_mech = ROOKIEMECH6 // Warhammer
|
|
}
|
|
if (USE_ALLOWED_MECHS)
|
|
{
|
|
// last_mech = random(0, MAX_ALLOWED_MECHS - 1)
|
|
stock_mech_selected = allowed_mechs[last_mech]
|
|
}
|
|
else
|
|
{
|
|
// last_mech = random(0, variant_step - 1)
|
|
stock_mech_selected = last_mech
|
|
}
|
|
last_count = stock_array[stock_mech_selected]
|
|
#if USE_O_MECH_VARIANT2
|
|
o_mech_variant2[id].list_size = 0
|
|
do
|
|
{
|
|
o_mech_variant2[id].list_item[o_mech_variant2[id].list_size] = mech2[last_count]
|
|
o_mech_variant2[id].list_size++
|
|
last_count++
|
|
if (last_count == $$m_MechCount$$)
|
|
break
|
|
}
|
|
while(stock_id[last_count] != 1)
|
|
|
|
if (nWhichButton == 2) // right button
|
|
variant_mech_selected = 0
|
|
else
|
|
variant_mech_selected = random(0, o_mech_variant2[id].list_size - 1)
|
|
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
o_mech_variant[id].nselected = last_mech
|
|
|
|
#if USE_O_MECH_VARIANT2
|
|
o_mech_variant2[id].nselected = variant_mech_selected
|
|
#endif // USE_O_MECH_VARIANT2
|
|
|
|
initialize(o_mech_variant[id])
|
|
if (ROSTER_top_of_list <= id) && (id < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
activate(o_mech_variant[id])
|
|
else
|
|
deactivate(o_mech_variant[id])
|
|
#if USE_O_MECH_VARIANT2
|
|
initialize(o_mech_variant2[id])
|
|
if (ROSTER_top_of_list <= id) && (id < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)
|
|
activate(o_mech_variant2[id])
|
|
else
|
|
deactivate(o_mech_variant2[id])
|
|
#endif // USE_O_MECH_VARIANT2
|
|
}
|
|
}
|
|
GUI_DRAW
|
|
{
|
|
setpencolor(255,255,255,255)
|
|
print3d_margins = 0, 0 to getresx(), getresy()
|
|
print3d_attributes = gFont3d, 0xffeeeeee,1,0,1,0,0,just_left
|
|
|
|
print3d_position = location.x, location.y + (VAR_LIST_HEIGHT - getprint3dheight("text")) / 2
|
|
print3d "@"
|
|
}
|
|
}
|
|
|
|
generic_region
|
|
{
|
|
LBUTTON_UPDATE
|
|
{
|
|
mail(0)
|
|
}
|
|
}
|
|
|
|
s_error_string
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
string text
|
|
font3d text_font = FPATH localize$(IDS_F_ML_LABEL)
|
|
int text_color = packcolor(255,255,255,255)
|
|
framerate = 20
|
|
int width = 100
|
|
int height = 20
|
|
}
|
|
GUI_DRAW
|
|
{
|
|
if length$(text) > 0
|
|
{
|
|
print3d_margins = location.x,location.y to location.x+width, location.y+height
|
|
print3d_attributes = text_font, text_color, 1, 0, 1, 0, 0, just_left
|
|
print3d_position = location.x + (width - getprint3dwidth(text) - 2), location.y + (height - getprint3dheight("text")) / 2
|
|
print3d text
|
|
}
|
|
}
|
|
} |