Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
5447 lines
158 KiB
Plaintext
5447 lines
158 KiB
Plaintext
// 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\\lobby_listbox.script"
|
|
#include "Content\\ShellScripts\\Multiplayer\\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\\"
|
|
|
|
#include "Content\\ShellScripts\\callsign.h"
|
|
|
|
#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
|
|
|
|
main
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
//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)
|
|
|
|
// 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
|
|
o_frame.screen_name = localize$(IDS_MP_LOBBY_GAME_LOBBY)
|
|
initialize(o_frame)
|
|
|
|
//do not delete
|
|
int team_val
|
|
int skin_id ///////VERY IMPORTANT FOR NEW SKIN INTERFACE
|
|
int skin_ids[17]
|
|
int update_skin = false
|
|
int hide_this_player[17]
|
|
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
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
/////////BOT STATUS BUTTON LISTBOX
|
|
////////////////////////////////////////////////////////////////////////////
|
|
object o_bot_status_droplist = s_mc_listbox
|
|
o_bot_status_droplist.location = 100,100,200
|
|
o_bot_status_droplist.boxFont3d = FPATH localize$(IDS_F_ML_LABEL) //MUST BE INITIALIZED
|
|
o_bot_status_droplist.itemWidth = 100 //MUST BE INITIALIZED
|
|
o_bot_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_bot_status_droplist.itemHeight_padding = 4//10
|
|
o_bot_status_droplist.list_size = 2 //MAX_MCCB_ITEMS
|
|
o_bot_status_droplist.NUM_OF_COLUMNS = 1
|
|
o_bot_status_droplist.column_header_height = 0 //MUST BE INITIALIZED
|
|
o_bot_status_droplist.max_displayed = 40//30 // max number of itemheight's. maz_displayed*itemheight = height of listbox //MUST BE INITIALIZED
|
|
o_bot_status_droplist.uniform_item_height = 0
|
|
|
|
o_bot_status_droplist.backColor = packcolor (0, 0, 0, 255) //CAN BE INITIALIZED
|
|
|
|
o_bot_status_droplist.label = "" //CAN BE INITIALIZED
|
|
o_bot_status_droplist.labelFont3d = FPATH localize$(IDS_F_ML_LABEL) //CAN BE INITIALIZED
|
|
o_bot_status_droplist.offsetLabel = 0,-18 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
|
|
o_bot_status_droplist.buttonwidth = 16 //CAN BE INITIALIZED
|
|
o_bot_status_droplist.first_delay = 10 //time delay value n/60; for the buttons
|
|
o_bot_status_droplist.second_delay = 1 //time delay value n/60; for the buttons
|
|
o_bot_status_droplist.column[0].location.x = 3
|
|
o_bot_status_droplist.column[0].fontcolor = packcolor (255,255,255,255)
|
|
o_bot_status_droplist.column[0].fontAlignment = just_left
|
|
o_bot_status_droplist.nselected = 3
|
|
|
|
int greatest_x = 0
|
|
int greatest_y = 0
|
|
int k
|
|
for k = 0; k < o_bot_status_droplist.list_size; k++
|
|
{
|
|
if exists(o_bot_status_droplist.column[0].list_icon[k])
|
|
{
|
|
if getwidth(o_bot_status_droplist.column[0].list_icon[k]) > greatest_x
|
|
greatest_x = getwidth(o_bot_status_droplist.column[0].list_icon[k])
|
|
|
|
if getheight(o_bot_status_droplist.column[0].list_icon[k]) > greatest_y
|
|
greatest_y = getheight(o_bot_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_bot_status_droplist.list_order[k] = k
|
|
}
|
|
|
|
o_bot_status_droplist.column[0].list_item[0] = localize$(IDS_MP_LOBBY_KICK_OUT)
|
|
o_bot_status_droplist.column[0].list_item[1] = localize$(IDS_MP_LOBBY_CANCEL)
|
|
|
|
initialize (o_bot_status_droplist)
|
|
deactivate (o_bot_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 = FPATH localize$(IDS_F_ML_LABEL) //MUST BE INITIALIZED
|
|
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 = FPATH localize$(IDS_F_ML_LABEL) //CAN BE INITIALIZED
|
|
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)
|
|
|
|
$$m_maxChatCount$$ = 17
|
|
|
|
//this list is for printing your opponent's selection
|
|
// MSL ADD MECH
|
|
string mechlist[55]
|
|
mechlist[0] = localize$(DNL_ARCTICWOLF)
|
|
mechlist[1] = localize$(DNL_ARES)
|
|
mechlist[2] = localize$(DNL_ARGUS)
|
|
mechlist[3] = localize$(DNL_ATLAS)
|
|
mechlist[4] = localize$(DNL_AWESOME)
|
|
mechlist[5] = localize$(DNL_BLACKKNIGHT)
|
|
mechlist[6] = localize$(DNL_BLACKLANNER)
|
|
mechlist[7] = localize$(DNL_BRIGAND)
|
|
mechlist[8] = localize$(DNL_BUSHWACKER)
|
|
mechlist[9] = localize$(DNL_CATAPULT)
|
|
mechlist[10] = localize$(DNL_CAULDRONBORN)
|
|
mechlist[11] = localize$(DNL_CHIMERA)
|
|
mechlist[12] = localize$(DNL_COMMANDO)
|
|
mechlist[13] = localize$(DNL_COUGAR)
|
|
mechlist[14] = localize$(DNL_CYCLOPS)
|
|
mechlist[15] = localize$(DNL_DAISHI)
|
|
// mechlist[16] = localize$(DNL_DASHER)
|
|
mechlist[16] = localize$(DNL_DEIMOS)
|
|
mechlist[17] = localize$(DNL_DRAGON)
|
|
mechlist[18] = localize$(DNL_FAFNIR)
|
|
mechlist[19] = localize$(DNL_FLEA)
|
|
mechlist[20] = localize$(DNL_GLADIATOR)
|
|
mechlist[21] = localize$(DNL_GRIZZLY)
|
|
mechlist[22] = localize$(DNL_HAUPTMANN)
|
|
mechlist[23] = localize$(DNL_HELLHOUND)
|
|
mechlist[24] = localize$(DNL_HELLSPAWN)
|
|
mechlist[25] = localize$(DNL_HIGHLANDER)
|
|
mechlist[26] = localize$(DNL_HOLLANDERII)
|
|
mechlist[27] = localize$(DNL_HUNCHBACK)
|
|
mechlist[28] = localize$(DNL_KODIAK)
|
|
mechlist[29] = localize$(DNL_LOKI)
|
|
mechlist[30] = localize$(DNL_LONGBOW)
|
|
mechlist[31] = localize$(DNL_MADCAT)
|
|
mechlist[32] = localize$(DNL_MADCAT2)
|
|
mechlist[33] = localize$(DNL_MASAKARI)
|
|
mechlist[34] = localize$(DNL_MAULER)
|
|
mechlist[35] = localize$(DNL_NOVACAT)
|
|
mechlist[36] = localize$(DNL_OSIRIS)
|
|
mechlist[37] = localize$(DNL_OWENS)
|
|
mechlist[38] = localize$(DNL_PUMA)
|
|
mechlist[39] = localize$(DNL_RAVEN)
|
|
// mechlist[41] = localize$(DNL_RIFLEMAN)
|
|
mechlist[40] = localize$(DNL_RYOKEN)
|
|
mechlist[41] = localize$(DNL_SHADOWCAT)
|
|
mechlist[42] = localize$(DNL_SOLITAIRE)
|
|
mechlist[43] = localize$(DNL_SUNDER)
|
|
mechlist[44] = localize$(DNL_TEMPLAR)
|
|
mechlist[45] = localize$(DNL_THANATOS)
|
|
mechlist[46] = localize$(DNL_THOR)
|
|
mechlist[47] = localize$(DNL_ULLER)
|
|
mechlist[48] = localize$(DNL_UZIEL)
|
|
mechlist[49] = localize$(DNL_VICTOR)
|
|
mechlist[50] = localize$(DNL_VULTURE)
|
|
mechlist[51] = localize$(DNL_WOLFHOUND)
|
|
mechlist[52] = localize$(DNL_ZEUS)
|
|
mechlist[53] = localize$(IDS_MP_LOBBY_CAMERA)
|
|
mechlist[54] = localize$(IDS_MP_LOBBY_NONE)
|
|
|
|
//this is your list of mechs to choose from
|
|
string mech[$$m_mechCount$$]
|
|
int stock_id[$$m_mechCount$$]
|
|
int stock_array[$$m_mechCount$$ + 1]
|
|
callback($$Shell_CallbackHandler$$, ShellDataGetMechs ,mech[], stock_id[])
|
|
|
|
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)
|
|
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
|
|
|
|
string teamstring[9]
|
|
teamstring[0] = "1"
|
|
teamstring[1] = "2"
|
|
teamstring[2] = "3"
|
|
teamstring[3] = "4"
|
|
teamstring[4] = "5"
|
|
teamstring[5] = "6"
|
|
teamstring[6] = "7"
|
|
teamstring[7] = "8"
|
|
teamstring[8] = localize$(IDS_MP_LOBBY_DASH)
|
|
|
|
font3d gFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
pane droplist_button = WPATH "DropList_arrowdown.tga"
|
|
alphamode (droplist_button) = am_alpha_oneone
|
|
|
|
pane droplist_button_glow = WPATH "iagdroplistbuttonglow.tga"
|
|
alphamode (droplist_button_glow) = am_alpha_oneone
|
|
|
|
pane down_arrow = WPATH "iagndownarrow.tga"
|
|
alphamode (down_arrow) = am_alpha_oneone
|
|
int hipoint
|
|
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 hosting = false
|
|
int valid_player
|
|
int sender_is_me
|
|
string return_destination
|
|
int player_indentification[17]
|
|
int team_legal_to_join[9] // needed for dropdowns on team selections
|
|
team_legal_to_join[8] = TRUE
|
|
int update_team = 0
|
|
|
|
int min_ton_allteams = 0
|
|
int max_ton_allteams = 15
|
|
int total_max_ton_allteams = 15
|
|
|
|
int night_parameter = NIGHT_TIME_PARAMETER
|
|
int dedicated_server = DEDICATED_SERVER_PARAMETER
|
|
int team_allowed = TEAM_ALLOWED_PARAMETER
|
|
int num_of_teams = TEAM_COUNT_PARAMETER
|
|
int min_tonnage = TEAM_MIN_TONNAGE
|
|
int max_tonnage = TEAM_MAX_TONNAGE
|
|
int total_max_tonnage = TEAM_TOTAL_MAX_TONNAGE
|
|
int team_param = TEAM_PARAMETER
|
|
int team_max_plyrs = TEAM_MAX_PLAYERS
|
|
int teamskin = TEAM_SKIN
|
|
|
|
int server_recycle = SERVER_RECYCLE_PARAMETER
|
|
|
|
int dedicated_server_flag = FALSE
|
|
|
|
int max_players = 0
|
|
int num_of_players = 0
|
|
int player_num = 0
|
|
// int num_of_teams = 8
|
|
int mech_button_prev = -1
|
|
int nselected_prev
|
|
int mech_id
|
|
int My_ID = Callback($$MyPlayerId$$)
|
|
int name_color[17]
|
|
int lupe
|
|
int cal_val
|
|
|
|
for lupe = 0; lupe <17;lupe++
|
|
{
|
|
name_color[lupe]= packcolor(255,255,255,255)
|
|
}
|
|
|
|
object o_mechbay_button = s_multistatepane
|
|
o_mechbay_button.total_states = 4
|
|
o_mechbay_button.textsize = 1
|
|
o_mechbay_button.text = localize$(DNL_MECHLAB_CAPS)
|
|
o_mechbay_button.file = WPATH "button_reg_200x27m_4state.tga"
|
|
o_mechbay_button.location = 570, 465, o_frame.location.z + 1
|
|
initialize(o_mechbay_button)
|
|
activate(o_mechbay_button)
|
|
|
|
//player_indentification[x]: 0 = empty; 1 = you; 2 = other player; 3 = bot
|
|
|
|
object o_time_to_launch = time_to_launch
|
|
o_time_to_launch.location = 468,30,10
|
|
|
|
object o_time_remaining = time_remaining
|
|
o_time_remaining.location = 468,445,10 //240,36,10
|
|
|
|
if exists(@netserver@)
|
|
{
|
|
|
|
hosting = true
|
|
callback($$InitNetworkScenarios$$)
|
|
|
|
object o_display_num_of_players = display_num_of_players
|
|
o_display_num_of_players.location = 467,30,10
|
|
|
|
object o_lancemate_button = s_multistatepane
|
|
o_lancemate_button.total_states = 3
|
|
o_lancemate_button.textsize = 1
|
|
o_lancemate_button.text = localize$(IDS_MP_LOBBY_ADD_BOT)
|
|
o_lancemate_button.file = WPATH "button_reg_186x21m_3state.tga"
|
|
o_lancemate_button.location = 270, 439, 5//o_frame.location.z + 1
|
|
initialize(o_lancemate_button)
|
|
activate(o_lancemate_button)
|
|
|
|
object o_team_selection = s_droplistbox
|
|
o_team_selection.location = 345,36,400
|
|
o_team_selection.list_size = 9
|
|
o_team_selection.label = localize$(IDS_MP_LOBBY_TEAM)
|
|
o_team_selection.itemWidth = 90
|
|
o_team_selection.max_displayed = 16
|
|
o_team_selection.boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_team_selection.itemHeight = 18
|
|
o_team_selection.labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_team_selection.offsetLabel = -50,3
|
|
o_team_selection.arrowHeight = 15
|
|
|
|
o_team_selection.list_item[0] = "1"
|
|
o_team_selection.list_item[1] = "2"
|
|
o_team_selection.list_item[2] = "3"
|
|
o_team_selection.list_item[3] = "4"
|
|
o_team_selection.list_item[4] = "5"
|
|
o_team_selection.list_item[5] = "6"
|
|
o_team_selection.list_item[6] = "7"
|
|
o_team_selection.list_item[7] = "8"
|
|
o_team_selection.list_item[8] = localize$(IDS_MP_LOBBY_ALL_TEAMS)
|
|
|
|
deactivate(o_team_selection)
|
|
initialize(o_team_selection)
|
|
|
|
object o_min_tonnage = s_droplistbox
|
|
o_min_tonnage.location = 80,57,400
|
|
o_min_tonnage.list_size = 16
|
|
o_min_tonnage.label = localize$(IDS_MP_LOBBY_MIN)
|
|
o_min_tonnage.itemWidth = 40
|
|
o_min_tonnage.max_displayed = 16
|
|
o_min_tonnage.boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_min_tonnage.itemHeight = 18
|
|
o_min_tonnage.labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_min_tonnage.offsetLabel = -40,3
|
|
o_min_tonnage.arrowHeight = 16
|
|
|
|
o_min_tonnage.list_item[0] = "25"
|
|
o_min_tonnage.list_item[1] = "30"
|
|
o_min_tonnage.list_item[2] = "35"
|
|
o_min_tonnage.list_item[3] = "40"
|
|
o_min_tonnage.list_item[4] = "45"
|
|
o_min_tonnage.list_item[5] = "50"
|
|
o_min_tonnage.list_item[6] = "55"
|
|
o_min_tonnage.list_item[7] = "60"
|
|
o_min_tonnage.list_item[8] = "65"
|
|
o_min_tonnage.list_item[9] = "70"
|
|
o_min_tonnage.list_item[10] = "75"
|
|
o_min_tonnage.list_item[11] = "80"
|
|
o_min_tonnage.list_item[12] = "85"
|
|
o_min_tonnage.list_item[13] = "90"
|
|
o_min_tonnage.list_item[14] = "95"
|
|
o_min_tonnage.list_item[15] = "100"
|
|
|
|
deactivate(o_min_tonnage)
|
|
initialize(o_min_tonnage)
|
|
|
|
object o_max_tonnage = s_droplistbox
|
|
o_max_tonnage.location = 205,57,400
|
|
o_max_tonnage.list_size = 16
|
|
o_max_tonnage.label = localize$(IDS_MP_LOBBY_MAX)
|
|
o_max_tonnage.itemWidth = 40
|
|
o_max_tonnage.max_displayed = 16
|
|
o_max_tonnage.boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_max_tonnage.itemHeight = 18
|
|
o_max_tonnage.labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_max_tonnage.offsetLabel = -40,3
|
|
o_max_tonnage.arrowHeight = 16
|
|
|
|
o_max_tonnage.list_item[0] = "25"
|
|
o_max_tonnage.list_item[1] = "30"
|
|
o_max_tonnage.list_item[2] = "35"
|
|
o_max_tonnage.list_item[3] = "40"
|
|
o_max_tonnage.list_item[4] = "45"
|
|
o_max_tonnage.list_item[5] = "50"
|
|
o_max_tonnage.list_item[6] = "55"
|
|
o_max_tonnage.list_item[7] = "60"
|
|
o_max_tonnage.list_item[8] = "65"
|
|
o_max_tonnage.list_item[9] = "70"
|
|
o_max_tonnage.list_item[10] = "75"
|
|
o_max_tonnage.list_item[11] = "80"
|
|
o_max_tonnage.list_item[12] = "85"
|
|
o_max_tonnage.list_item[13] = "90"
|
|
o_max_tonnage.list_item[14] = "95"
|
|
o_max_tonnage.list_item[15] = "100"
|
|
o_max_tonnage.nselected = 15
|
|
|
|
deactivate(o_max_tonnage)
|
|
initialize(o_max_tonnage)
|
|
|
|
object o_total_max_tonnage = s_droplistbox
|
|
o_total_max_tonnage.location = 385,57,380
|
|
o_total_max_tonnage.list_size = 16
|
|
o_total_max_tonnage.label = localize$(IDS_MP_LOBBY_TOTALTEAMMAX)
|
|
o_total_max_tonnage.itemWidth = 50
|
|
o_total_max_tonnage.max_displayed = 16
|
|
o_total_max_tonnage.boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_total_max_tonnage.itemHeight = 18
|
|
o_total_max_tonnage.labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_total_max_tonnage.offsetLabel = -90,3
|
|
o_total_max_tonnage.arrowHeight = 16
|
|
|
|
o_total_max_tonnage.list_item[0] = "100"
|
|
o_total_max_tonnage.list_item[1] = "200"
|
|
o_total_max_tonnage.list_item[2] = "300"
|
|
o_total_max_tonnage.list_item[3] = "400"
|
|
o_total_max_tonnage.list_item[4] = "500"
|
|
o_total_max_tonnage.list_item[5] = "600"
|
|
o_total_max_tonnage.list_item[6] = "700"
|
|
o_total_max_tonnage.list_item[7] = "800"
|
|
o_total_max_tonnage.list_item[8] = "900"
|
|
o_total_max_tonnage.list_item[9] = "1000"
|
|
o_total_max_tonnage.list_item[10] = "1100"
|
|
o_total_max_tonnage.list_item[11] = "1200"
|
|
o_total_max_tonnage.list_item[12] = "1300"
|
|
o_total_max_tonnage.list_item[13] = "1400"
|
|
o_total_max_tonnage.list_item[14] = "1500"
|
|
o_total_max_tonnage.list_item[15] = "1600"
|
|
o_total_max_tonnage.nselected = 15
|
|
|
|
deactivate(o_total_max_tonnage)
|
|
initialize(o_total_max_tonnage)
|
|
|
|
object o_launch_button = s_multistatepane
|
|
o_launch_button.total_states = 3
|
|
o_launch_button.textsize = 1
|
|
o_launch_button.text = localize$(IDS_MP_LOBBY_LAUNCH)
|
|
o_launch_button.file = WPATH "button_main_200x41_3state.tga"
|
|
o_launch_button.location = 570, 525, o_frame.location.z + 1
|
|
initialize(o_launch_button)
|
|
|
|
object o_pickteam_button = generic_region
|
|
o_pickteam_button.location = 570, 525, o_frame.location.z + 10
|
|
o_pickteam_button.region = 0,0 to getwidth(o_launch_button.p_pane),getheight(o_launch_button.p_pane)
|
|
deactivate(o_pickteam_button)
|
|
|
|
if callback($$GetLocalNetworkMissionParamater$$, dedicated_server) == 1
|
|
{
|
|
dedicated_server_flag = TRUE
|
|
player_num = -1
|
|
if callback($$GetLocalNetworkMissionParamater$$, server_recycle)
|
|
{
|
|
o_mechbay_button.state = 3
|
|
initialize(o_mechbay_button)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
player_num = 0
|
|
My_ID = 1
|
|
}
|
|
|
|
//}
|
|
// player_indentification[player_num] = 1
|
|
}
|
|
else
|
|
{
|
|
object o_display_num_of_players = display_num_of_players
|
|
o_display_num_of_players.location = 325,30,10
|
|
|
|
object o_allow_join_timer = allow_join_timer
|
|
o_allow_join_timer.location = 467,36,10
|
|
|
|
object o_cover_tonnage_control = cover_buttons
|
|
o_cover_tonnage_control.location = 0,0,900
|
|
o_cover_tonnage_control.region = 27,52 to 460,77
|
|
|
|
object o_min_tonnage = s_droplistbox
|
|
o_min_tonnage.location = 85,57,400
|
|
o_min_tonnage.list_size = 16
|
|
o_min_tonnage.label = localize$(IDS_MP_LOBBY_MIN)
|
|
o_min_tonnage.itemWidth = 40
|
|
o_min_tonnage.max_displayed = 16
|
|
o_min_tonnage.boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_min_tonnage.itemHeight = 18
|
|
o_min_tonnage.labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_min_tonnage.offsetLabel = -40,3
|
|
o_min_tonnage.arrowHeight = 15
|
|
|
|
o_min_tonnage.backColor = packcolor (0, 0, 0, 128)
|
|
o_min_tonnage.boxTextColor = packcolor (255, 255, 255, 255)
|
|
o_min_tonnage.boxTextSelectedColor = packcolor (125, 125, 125, 0)
|
|
o_min_tonnage.frameHighlightColor = packcolor (255, 255, 255, 0)
|
|
o_min_tonnage.boxhighlightColor = packcolor (50, 120, 255, 0)
|
|
o_min_tonnage.ItemHighlightColor = packcolor (0, 0, 0, 0)
|
|
o_min_tonnage.selectedColor = packcolor (120, 120, 255, 0)
|
|
o_min_tonnage.labelTextColor = packcolor (255, 255, 255, 255)
|
|
o_min_tonnage.borderColor = packcolor (255, 255, 255, 0)
|
|
|
|
alphamode(o_min_tonnage.o_dropbutton.p_droparrow) = am_alpha_alphainvalpha
|
|
color (o_min_tonnage.o_dropbutton.p_droparrow) = 255,255,255,0
|
|
|
|
o_min_tonnage.facecolor = packcolor (187, 187, 204, 0)
|
|
o_min_tonnage.shadowcolor= packcolor (119, 119, 119, 0)
|
|
o_min_tonnage.controlbackColor = packcolor (255, 255, 255, 128)
|
|
|
|
o_min_tonnage.list_item[0] = "25"
|
|
o_min_tonnage.list_item[1] = "30"
|
|
o_min_tonnage.list_item[2] = "35"
|
|
o_min_tonnage.list_item[3] = "40"
|
|
o_min_tonnage.list_item[4] = "45"
|
|
o_min_tonnage.list_item[5] = "50"
|
|
o_min_tonnage.list_item[6] = "55"
|
|
o_min_tonnage.list_item[7] = "60"
|
|
o_min_tonnage.list_item[8] = "65"
|
|
o_min_tonnage.list_item[9] = "70"
|
|
o_min_tonnage.list_item[10] = "75"
|
|
o_min_tonnage.list_item[11] = "80"
|
|
o_min_tonnage.list_item[12] = "85"
|
|
o_min_tonnage.list_item[13] = "90"
|
|
o_min_tonnage.list_item[14] = "95"
|
|
o_min_tonnage.list_item[15] = "100"
|
|
|
|
deactivate(o_min_tonnage)
|
|
initialize(o_min_tonnage)
|
|
|
|
object o_max_tonnage = s_droplistbox
|
|
o_max_tonnage.location = 215,57,400
|
|
o_max_tonnage.list_size = 16
|
|
o_max_tonnage.label = localize$(IDS_MP_LOBBY_MAX)
|
|
o_max_tonnage.itemWidth = 40
|
|
o_max_tonnage.max_displayed = 16
|
|
o_max_tonnage.boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_max_tonnage.itemHeight = 18
|
|
o_max_tonnage.labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_max_tonnage.offsetLabel = -40,3
|
|
o_max_tonnage.arrowHeight = 15
|
|
|
|
o_max_tonnage.backColor = packcolor (0, 0, 0, 128)
|
|
o_max_tonnage.boxTextColor = packcolor (255, 255, 255, 255)
|
|
o_max_tonnage.boxTextSelectedColor = packcolor (125, 125, 125, 0)
|
|
o_max_tonnage.frameHighlightColor = packcolor (255, 255, 255, 0)
|
|
o_max_tonnage.boxhighlightColor = packcolor (50, 120, 255, 0)
|
|
o_max_tonnage.ItemHighlightColor = packcolor (0, 0, 0, 0)
|
|
o_max_tonnage.selectedColor = packcolor (120, 120, 255, 0)
|
|
o_max_tonnage.labelTextColor = packcolor (255, 255, 255, 255)
|
|
o_max_tonnage.borderColor = packcolor (255, 255, 255, 0)
|
|
|
|
o_max_tonnage.facecolor = packcolor (187, 187, 204, 0)
|
|
o_max_tonnage.shadowcolor= packcolor (119, 119, 119, 0)
|
|
o_max_tonnage.controlbackColor = packcolor (255, 255, 255, 128)
|
|
|
|
alphamode(o_max_tonnage.o_dropbutton.p_droparrow) = am_alpha_alphainvalpha
|
|
color (o_max_tonnage.o_dropbutton.p_droparrow) = 255,255,255,0
|
|
|
|
o_max_tonnage.list_item[0] = "25"
|
|
o_max_tonnage.list_item[1] = "30"
|
|
o_max_tonnage.list_item[2] = "35"
|
|
o_max_tonnage.list_item[3] = "40"
|
|
o_max_tonnage.list_item[4] = "45"
|
|
o_max_tonnage.list_item[5] = "50"
|
|
o_max_tonnage.list_item[6] = "55"
|
|
o_max_tonnage.list_item[7] = "60"
|
|
o_max_tonnage.list_item[8] = "65"
|
|
o_max_tonnage.list_item[9] = "70"
|
|
o_max_tonnage.list_item[10] = "75"
|
|
o_max_tonnage.list_item[11] = "80"
|
|
o_max_tonnage.list_item[12] = "85"
|
|
o_max_tonnage.list_item[13] = "90"
|
|
o_max_tonnage.list_item[14] = "95"
|
|
o_max_tonnage.list_item[15] = "100"
|
|
o_max_tonnage.nselected = 15
|
|
|
|
deactivate(o_max_tonnage)
|
|
initialize(o_max_tonnage)
|
|
|
|
object o_total_max_tonnage = s_droplistbox
|
|
o_total_max_tonnage.location = 385,57,380
|
|
o_total_max_tonnage.list_size = 16
|
|
o_total_max_tonnage.label = localize$(IDS_MP_LOBBY_TOTALTEAMMAX)
|
|
o_total_max_tonnage.itemWidth = 50
|
|
o_total_max_tonnage.max_displayed = 16
|
|
o_total_max_tonnage.boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_total_max_tonnage.itemHeight = 18
|
|
o_total_max_tonnage.labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_total_max_tonnage.offsetLabel = -90,3
|
|
o_total_max_tonnage.arrowHeight = 15
|
|
|
|
o_total_max_tonnage.backColor = packcolor (0, 0, 0, 128)
|
|
o_total_max_tonnage.boxTextColor = packcolor (255, 255, 255, 255)
|
|
o_total_max_tonnage.boxTextSelectedColor = packcolor (125, 125, 125, 0)
|
|
o_total_max_tonnage.frameHighlightColor = packcolor (255, 255, 255, 0)
|
|
o_total_max_tonnage.boxhighlightColor = packcolor (50, 120, 255, 0)
|
|
o_total_max_tonnage.ItemHighlightColor = packcolor (0, 0, 0, 0)
|
|
o_total_max_tonnage.selectedColor = packcolor (120, 120, 255, 0)
|
|
o_total_max_tonnage.labelTextColor = packcolor (255, 255, 255, 255)
|
|
o_total_max_tonnage.borderColor = packcolor (255, 255, 255, 0)
|
|
|
|
o_total_max_tonnage.facecolor = packcolor (187, 187, 204, 0)
|
|
o_total_max_tonnage.shadowcolor= packcolor (119, 119, 119, 0)
|
|
o_total_max_tonnage.controlbackColor = packcolor (255, 255, 255, 128)
|
|
|
|
alphamode(o_total_max_tonnage.o_dropbutton.p_droparrow) = am_alpha_alphainvalpha
|
|
color (o_total_max_tonnage.o_dropbutton.p_droparrow) = 255,255,255,0
|
|
|
|
o_total_max_tonnage.list_item[0] = "100"
|
|
o_total_max_tonnage.list_item[1] = "200"
|
|
o_total_max_tonnage.list_item[2] = "300"
|
|
o_total_max_tonnage.list_item[3] = "400"
|
|
o_total_max_tonnage.list_item[4] = "500"
|
|
o_total_max_tonnage.list_item[5] = "600"
|
|
o_total_max_tonnage.list_item[6] = "700"
|
|
o_total_max_tonnage.list_item[7] = "800"
|
|
o_total_max_tonnage.list_item[8] = "900"
|
|
o_total_max_tonnage.list_item[9] = "1000"
|
|
o_total_max_tonnage.list_item[10] = "1100"
|
|
o_total_max_tonnage.list_item[11] = "1200"
|
|
o_total_max_tonnage.list_item[12] = "1300"
|
|
o_total_max_tonnage.list_item[13] = "1400"
|
|
o_total_max_tonnage.list_item[14] = "1500"
|
|
o_total_max_tonnage.list_item[15] = "1600"
|
|
o_total_max_tonnage.nselected = 15
|
|
|
|
deactivate(o_total_max_tonnage)
|
|
initialize(o_total_max_tonnage)
|
|
|
|
object o_ready_button = s_multistatepane
|
|
o_ready_button.total_states = 3
|
|
o_ready_button.textsize = 1
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
o_ready_button.file = WPATH "button_main_200x41_3state.tga"
|
|
o_ready_button.location = 570, 525, o_frame.location.z + 1
|
|
initialize(o_ready_button)
|
|
|
|
object o_pickteam_button = generic_region
|
|
o_pickteam_button.location = 570, 525, o_frame.location.z + 10
|
|
o_pickteam_button.region = 0,0 to getwidth(o_ready_button.p_pane),getheight(o_ready_button.p_pane)
|
|
deactivate(o_pickteam_button)
|
|
|
|
int valid
|
|
int count = 0
|
|
|
|
My_ID = Callback($$MyPlayerId$$)
|
|
for(int tool=0;tool<255;tool++)
|
|
{
|
|
valid = callback($$IsPlayerConnectionValid$$,tool)
|
|
|
|
if (valid)
|
|
{
|
|
if My_ID == tool
|
|
{
|
|
player_num = count
|
|
break
|
|
}
|
|
count++
|
|
}
|
|
|
|
}
|
|
|
|
// player_indentification[player_num] = 2
|
|
|
|
}
|
|
|
|
|
|
|
|
object o_block_controls[17]
|
|
object o_print_name[17]
|
|
object o_mech_button[17]
|
|
object o_mech_variant[17]
|
|
object o_mech_variant2[17]
|
|
object o_skins[17]
|
|
object o_skin_box[17]
|
|
object o_team[17]
|
|
object o_status[17]
|
|
int roster_posy[17]
|
|
int coolbaby
|
|
|
|
int stock_size = 0
|
|
int last_mech = 0
|
|
int last_count = 0
|
|
int mech_selected = 0
|
|
int stock_mech_selected = 0
|
|
int variant_mech_selected = 0
|
|
|
|
for int x = 0; x < 17; x++
|
|
{
|
|
// callback($$kldc08$$,x)
|
|
roster_posy[x] = 124+(x*44)//84+(x*44)
|
|
|
|
o_print_name[x] = s_print_text
|
|
o_print_name[x].location = 40,roster_posy[x],5
|
|
o_print_name[x].id = x
|
|
o_print_name[x].text_font = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_print_name[x].text_color = packcolor(255,255,255,255)
|
|
|
|
MAX_ITEMS = $$m_mechCount$$
|
|
o_mech_variant[x] = s_droplistbox_mech
|
|
MAX_ITEMS = 60
|
|
o_mech_variant[x].location = 180,roster_posy[x],10*((35-x)+1)
|
|
o_mech_variant[x].label = ""
|
|
o_mech_variant[x].itemWidth = 119
|
|
if x < 6
|
|
{
|
|
o_mech_variant[x].max_displayed = 16
|
|
}
|
|
else
|
|
{
|
|
o_mech_variant[x].max_displayed = (16-x)+6
|
|
}
|
|
o_mech_variant[x].boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
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 // jcem - 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, 255, 255)
|
|
o_mech_variant[x].borderColor = packcolor (255, 255, 255, 255)
|
|
o_mech_variant[x].itemHeight = 18
|
|
o_mech_variant[x].labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_mech_variant[x].offsetLabel = 0,0
|
|
o_mech_variant[x].arrowHeight = 15
|
|
|
|
stock_size = 0
|
|
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
|
|
|
|
MAX_ITEMS = $$m_mechCount$$
|
|
o_mech_variant2[x] = s_droplistbox_mech
|
|
MAX_ITEMS = 60
|
|
o_mech_variant2[x].location = 180,roster_posy[x] + 20,10*((35-x)+1) - 4
|
|
o_mech_variant2[x].label = ""
|
|
o_mech_variant2[x].itemWidth = 119
|
|
if x < 6
|
|
{
|
|
o_mech_variant2[x].max_displayed = 16
|
|
}
|
|
else
|
|
{
|
|
o_mech_variant2[x].max_displayed = (16-x)+6
|
|
}
|
|
o_mech_variant2[x].boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
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 // jcem - 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 = 18
|
|
o_mech_variant2[x].labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_mech_variant2[x].offsetLabel = 0,0
|
|
o_mech_variant2[x].arrowHeight = 15
|
|
|
|
if exists(@netclient@) || ((x == 0) && (callback($$GetLocalNetworkMissionParamater$$, dedicated_server) == 0))
|
|
{
|
|
last_mech = 0
|
|
last_count = 0
|
|
stock_mech_selected = 0
|
|
variant_mech_selected = 0
|
|
callback($$Shell_CallbackHandler$$, ShellGetLastPlayerMech, last_mech)
|
|
|
|
while (last_mech >= stock_array[stock_mech_selected])
|
|
{
|
|
stock_mech_selected++
|
|
}
|
|
stock_mech_selected--
|
|
last_count = stock_array[stock_mech_selected]
|
|
variant_mech_selected = last_mech - last_count
|
|
|
|
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 = stock_mech_selected
|
|
o_mech_variant2[x].nselected = variant_mech_selected
|
|
}
|
|
else
|
|
{
|
|
o_mech_variant[x].nselected = 1
|
|
}
|
|
|
|
initialize(o_mech_variant[x])
|
|
deactivate(o_mech_variant[x])
|
|
initialize(o_mech_variant2[x])
|
|
deactivate(o_mech_variant2[x])
|
|
|
|
//------------------------------------------------------------------------------------------------------------
|
|
|
|
o_skins[x] = s_droplistbox_skins
|
|
o_skins[x].location = 330,roster_posy[x],5*((25-x)+1)
|
|
o_skins[x].list_size = 36
|
|
o_skins[x].label = ""
|
|
o_skins[x].itemWidth = 30
|
|
o_skins[x].max_displayed = 16
|
|
o_skins[x].boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_skins[x].itemHeight = 18
|
|
o_skins[x].labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_skins[x].offsetLabel = 0,0
|
|
o_skins[x].arrowHeight = 15
|
|
o_skins[x].id = x
|
|
|
|
// from here - added by jcem
|
|
o_skins[x].frameHighlightColor = FRAME_HIGHLIGHT_COLOR
|
|
// to here - added by jcem
|
|
|
|
for coolbaby = 0;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])
|
|
deactivate(o_skins[x])
|
|
|
|
o_skin_box[x] = skin_box
|
|
o_skin_box[x].location = 375,roster_posy[x],5
|
|
o_skin_box[x].id = x
|
|
|
|
deactivate(o_skin_box[x])
|
|
mail(0,o_skin_box[x])
|
|
|
|
//-----------------------------------------------------------------------------------------------------
|
|
|
|
o_team[x] = s_droplistbox_lobby
|
|
o_team[x].location = 333,roster_posy[x]+20,5*((25-x)+1)
|
|
o_team[x].list_size = 9
|
|
o_team[x].label = ""
|
|
o_team[x].itemWidth = 20
|
|
o_team[x].max_displayed = 16
|
|
o_team[x].boxFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_team[x].itemHeight = 18
|
|
o_team[x].labelFont3d = FPATH localize$(IDS_F_ML_LABEL)
|
|
o_team[x].offsetLabel = 0,0
|
|
o_team[x].arrowHeight = 15
|
|
o_team[x].id = x
|
|
|
|
// from here - added by jcem
|
|
o_team[x].frameHighlightColor = FRAME_HIGHLIGHT_COLOR
|
|
// to here - added by jcem
|
|
|
|
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].list_item[8] = localize$(IDS_MP_LOBBY_DASH)
|
|
|
|
o_team[x].nselected = 0//8
|
|
|
|
initialize(o_team[x])
|
|
deactivate(o_team[x])
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------------------
|
|
|
|
o_status[x] = status_control
|
|
o_status[x].location = 422,roster_posy[x]+10,5
|
|
o_status[x].file = GPATH "multiplayer\\5state_lobby_status.tga"
|
|
o_status[x].total_states = 5
|
|
|
|
// if player_indentification[x] == 0
|
|
// o_status[x].state = 0
|
|
// else
|
|
// o_status[x].state = 1
|
|
//
|
|
// if player_indentification[x] == 3
|
|
// o_status[x].state = 4
|
|
|
|
o_status[x].id = x
|
|
|
|
|
|
initialize (o_status[x])
|
|
if (hosting == false && x != player_num) or (hosting == true && x == 0 && player_num != -1)
|
|
o_status[x].region = 0,0 to 0,0
|
|
deactivate (o_status[x])
|
|
}
|
|
|
|
|
|
// object o_back = genericbutton
|
|
// o_back.location = 570,490,10
|
|
// o_back.region = 0,0 to 765-570,517-490
|
|
|
|
object o_back = s_multistatepane
|
|
o_back.total_states = 3
|
|
o_back.textsize = 1
|
|
o_back.text = localize$(IDS_MP_LOBBY_DISCONNECT)
|
|
o_back.file = WPATH "button_reg_200x27m_3state.tga"
|
|
o_back.location = 570, 495, o_frame.location.z + 1
|
|
initialize(o_back)
|
|
|
|
object o_ready = genericbutton
|
|
o_ready.location = 570,525,10
|
|
o_ready.region = 0,0 to 765-570,40
|
|
//---------------------------------------------------
|
|
if hosting == TRUE
|
|
{
|
|
object o_lock_server = s_checkbox
|
|
o_lock_server.file = WPATH "checkbox_15x15_3state.tga"
|
|
o_lock_server.total_states = 3
|
|
o_lock_server.location = 468,445,10
|
|
o_lock_server.text = localize$(IDS_MP_LOBBY_LOCK_SERVER)
|
|
|
|
// Since we are server we can just get the local variable
|
|
int lock = CLOSED_GAME_PARAMETER
|
|
int lock_val = callback($$GetLocalNetworkMissionParamater$$, lock)
|
|
if (lock_val == TRUE)
|
|
o_lock_server.state = 2
|
|
else
|
|
o_lock_server.state = 0
|
|
|
|
initialize(o_lock_server)
|
|
}
|
|
|
|
//---------------------------------------------------
|
|
position chassis_list_locy[16]
|
|
chassis_list_locy[0] = 190,roster_posy[0],150
|
|
chassis_list_locy[1] = 190,roster_posy[1],150
|
|
chassis_list_locy[2] = 190,roster_posy[2],150
|
|
chassis_list_locy[3] = 190,roster_posy[3],150
|
|
chassis_list_locy[4] = 190,roster_posy[4],150
|
|
chassis_list_locy[5] = 190,roster_posy[5],150
|
|
chassis_list_locy[6] = 190,roster_posy[6],150
|
|
chassis_list_locy[7] = 190,roster_posy[7],150
|
|
chassis_list_locy[8] = 190,roster_posy[8],150
|
|
chassis_list_locy[9] = 190,roster_posy[9],150
|
|
chassis_list_locy[10] = 190,roster_posy[10],150
|
|
chassis_list_locy[11] = 190,roster_posy[10],150
|
|
chassis_list_locy[12] = 190,roster_posy[10],150
|
|
chassis_list_locy[13] = 190,roster_posy[10],150
|
|
chassis_list_locy[14] = 190,roster_posy[10],150
|
|
chassis_list_locy[15] = 190,roster_posy[10],150
|
|
|
|
|
|
|
|
//---------------------------------------------------
|
|
|
|
object o_chat_box = s_mc_listbox
|
|
o_chat_box.location = 35,467,1
|
|
o_chat_box.boxFont3d = FPATH localize$(IDS_F_CHAT_BOX) //MUST BE INITIALIZED
|
|
o_chat_box.itemWidth = 526 - 16 //MUST BE INITIALIZED
|
|
o_chat_box.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_chat_box.itemHeight_padding = 4//10
|
|
o_chat_box.list_size = 0 //MAX_MCCB_ITEMS
|
|
o_chat_box.NUM_OF_COLUMNS = 1
|
|
o_chat_box.column_header_height = 0 //MUST BE INITIALIZED
|
|
o_chat_box.max_displayed = 529-463//30 // max number of itemheight's. maz_displayed*itemheight = height of listbox //MUST BE INITIALIZED
|
|
o_chat_box.uniform_item_height = 0
|
|
o_chat_box.SelectedHighlightColor = packcolor (51, 55, 115, 0) //CAN BE INITIALIZED
|
|
o_chat_box.boxhighlightColor = packcolor (0,0,0,0) //CAN BE INITIALIZED
|
|
o_chat_box.selectedColor = packcolor (255,255,255,0) //CAN BE INITIALIZED
|
|
o_chat_box.backColor = packcolor (0, 0, 0, 255) //CAN BE INITIALIZED
|
|
o_chat_box.itemhighlightcolor = packcolor (255,255,255,255)
|
|
o_chat_box.label = localize$(IDS_MP_LOBBY_CHAT) //CAN BE INITIALIZED
|
|
o_chat_box.labelFont3d = FPATH localize$(IDS_F_ML_LABEL) //CAN BE INITIALIZED
|
|
o_chat_box.offsetLabel = 0,-18 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
|
|
o_chat_box.buttonwidth = 16 //CAN BE INITIALIZED
|
|
o_chat_box.first_delay = 10 //time delay value n/60; for the buttons
|
|
o_chat_box.second_delay = 1 //time delay value n/60; for the buttons
|
|
o_chat_box.column[0].location.x = 3
|
|
o_chat_box.column[0].fontcolor = packcolor (255,255,255,255)
|
|
o_chat_box.column[0].fontAlignment = just_left
|
|
|
|
for k = 0; k < o_chat_box.list_size; k++
|
|
{
|
|
if exists(o_chat_box.column[0].list_icon[k])
|
|
{
|
|
if getwidth(o_chat_box.column[0].list_icon[k]) > greatest_x
|
|
greatest_x = getwidth(o_chat_box.column[0].list_icon[k])
|
|
|
|
if getheight(o_chat_box.column[0].list_icon[k]) > greatest_y
|
|
greatest_y = getheight(o_chat_box.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 x = 0;x < MAX_MCCB_ITEMS; x++
|
|
{
|
|
o_chat_box.list_order[x] = x
|
|
o_chat_box.column[0].list_item[x] = ""
|
|
}
|
|
|
|
initialize (o_chat_box)
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
object o_chat_entry = s_editbox
|
|
o_chat_entry.location = 35,543,20
|
|
o_chat_entry.boxValue = "" //CAN BE INITIALIZED holds the contents of the edit box
|
|
o_chat_entry.boxWidth = 528 //MUST BE INTIALIZED width of the edit field of the box
|
|
o_chat_entry.boxHeight = 20 //MUST BE INTIALIZED height of the edit field of the box//
|
|
o_chat_entry.boxtextlimit = 100
|
|
o_chat_entry.boxFont3d = FPATH localize$(IDS_F_CHAT_ENTRY) //MUST BE INTIALIZED
|
|
o_chat_entry.boxTextOffset = 3,3 //CAN BE INITIALIZED
|
|
o_chat_entry.labelFont3d = FPATH localize$(IDS_F_ML_LABEL) //MUST BE INTIALIZED
|
|
o_chat_entry.offset = -190,0 //CAN BE INITIALIZED offset of text from button
|
|
o_chat_entry.Auto_Update = FALSE
|
|
o_chat_entry.keyboard_sound = TRUE
|
|
enableIME(true, o_chat_entry)
|
|
initialize (o_chat_entry)
|
|
|
|
|
|
framerate = 30
|
|
int i
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
object o_tabs = tabs
|
|
o_tabs.location = 0, 0, 5
|
|
initialize(o_tabs)
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//Is vehicle OK?------------------------------------------------------------
|
|
object o_skin = jstandard_droplist
|
|
o_skin.num_options = 5
|
|
o_skin.dlwidth = 200
|
|
o_skin.location = 801,345,10
|
|
o_skin.optiontext[0] = "Ops"
|
|
o_skin.optiontext[1] = "Desert"
|
|
o_skin.optiontext[2] = "Arctic"
|
|
o_skin.optiontext[3] = "Plains"
|
|
o_skin.optiontext[4] = "Swamp"
|
|
initialize (o_skin)
|
|
deactivate (o_skin)
|
|
|
|
string team_decal_full_name[256]
|
|
string pilot_decal_full_name[256]
|
|
|
|
object o_teamdecal = jstandard_droplist
|
|
o_teamdecal.num_options = callback($$GetDecalCount$$)
|
|
o_teamdecal.dlwidth = 200
|
|
o_teamdecal.location = 801,360,10
|
|
callback($$GetDecalNames$$, o_teamdecal.optiontext[], team_decal_full_name[])
|
|
initialize (o_teamdecal)
|
|
deactivate (o_teamdecal)
|
|
|
|
object o_pilotdecal = jstandard_droplist
|
|
o_pilotdecal.num_options = callback($$GetDecalCount$$)
|
|
o_pilotdecal.dlwidth = 200
|
|
o_pilotdecal.location = 801,380,10
|
|
callback($$GetDecalNames$$, o_pilotdecal.optiontext[], pilot_decal_full_name[])
|
|
initialize (o_pilotdecal)
|
|
deactivate (o_pilotdecal)
|
|
|
|
string temp_skin_name = "Ops"
|
|
|
|
object o_background = background
|
|
|
|
object o_update_names
|
|
|
|
for x = 0; x < 17; x++
|
|
{
|
|
o_block_controls[x] = block_controls
|
|
o_block_controls[x].location = 73,roster_posy[x],5
|
|
o_block_controls[x].ID = x
|
|
}
|
|
|
|
if callback($$GetLocalNetworkMissionParamater$$, dedicated_server) == 0
|
|
{
|
|
callback($$SetTeamDecal$$, team_decal_full_name[o_teamdecal.sel_option])
|
|
callback($$SetPilotDecal$$, pilot_decal_full_name[o_pilotdecal.sel_option])
|
|
|
|
stock_mech_selected = o_mech_variant[player_num].nselected
|
|
variant_mech_selected = o_mech_variant2[player_num].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech[mech_selected], o_skin.optiontext[o_skin.sel_option])
|
|
callback($$SendVehicleRequest$$)
|
|
mail(-1, o_background)
|
|
}
|
|
|
|
o_update_names = update_names
|
|
|
|
script_run SCRIPTPATH "hostlobbymap.script", 0x1000
|
|
script_pause @hostlobbymap@,2
|
|
script_run SCRIPTPATH "hostlobbymission.script", 0x1000
|
|
// script_pause @hostlobbymission@,2
|
|
script_run SCRIPTPATH "hostlobbyserver.script", 0x1000
|
|
script_pause @hostlobbyserver@,2
|
|
|
|
if hosting
|
|
{
|
|
int setitup
|
|
|
|
min_ton_allteams = 0
|
|
max_ton_allteams = 15
|
|
total_max_ton_allteams = 15
|
|
|
|
for int updating = 0; updating < 8; updating++
|
|
{
|
|
cal_val = callback($$GetLocalNetworkMissionParamater$$, team_param, updating, total_max_tonnage)
|
|
if cal_val > 1600
|
|
{
|
|
cal_val = 1600
|
|
callback($$SetNetworkMissionParamater$$, team_param, updating, total_max_tonnage, cal_val)
|
|
}
|
|
|
|
if updating == 0
|
|
o_total_max_tonnage.nselected = (cal_val)/100-1
|
|
|
|
cal_val = callback($$GetLocalNetworkMissionParamater$$, team_param, updating, min_tonnage)
|
|
if cal_val < 25
|
|
{
|
|
cal_val = 25
|
|
callback($$SetNetworkMissionParamater$$, team_param, updating, min_tonnage, cal_val)
|
|
}
|
|
|
|
if updating == 0
|
|
o_min_tonnage.nselected = (cal_val-25)/5
|
|
|
|
cal_val = callback($$GetLocalNetworkMissionParamater$$, team_param, updating, max_tonnage)
|
|
|
|
if cal_val > 100
|
|
{
|
|
cal_val = 100
|
|
callback($$SetNetworkMissionParamater$$, team_param, updating, max_tonnage, cal_val)
|
|
}
|
|
|
|
if updating == 0
|
|
o_max_tonnage.nselected = (cal_val-25)/5
|
|
|
|
}
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
// if exists(@dedicated@)
|
|
// {
|
|
// dedicated_server_flag = TRUE
|
|
// script_end "dedicated.script"
|
|
// }
|
|
}
|
|
|
|
//// this is for scrolling the roster list
|
|
object o_roster_list_scroll_controls = roster_list_scroll_controls
|
|
|
|
focus(this)
|
|
|
|
// mdm - for error dialog
|
|
object o_error
|
|
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
|
|
|
|
}
|
|
|
|
GUI_DESTROY
|
|
{
|
|
focus(NULL)
|
|
script_end "hostlobbymap.script"
|
|
script_end "hostlobbymission.script"
|
|
script_end "hostlobbyserver.script"
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
for (k = 0; k < 17; k++)
|
|
{
|
|
if (sender == o_mech_variant[k])
|
|
{
|
|
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 sender == o_pickteam_button
|
|
{
|
|
script_run scriptpath "lobbyerror_noteam.script",0x1400
|
|
}
|
|
|
|
if exists(o_team_selection)
|
|
{
|
|
if (sender == o_team_selection)
|
|
{
|
|
if o_team_selection.nselected == o_team_selection.list_size-1
|
|
{
|
|
o_min_tonnage.nselected = min_ton_allteams
|
|
o_max_tonnage.nselected = max_ton_allteams
|
|
o_total_max_tonnage.nselected = total_max_ton_allteams
|
|
}
|
|
else
|
|
{
|
|
cal_val = callback($$GetLocalNetworkMissionParamater$$, team_param, o_team_selection.nselected, total_max_tonnage)
|
|
if cal_val <= 1600
|
|
{
|
|
o_total_max_tonnage.nselected = cal_val/100 -1
|
|
}
|
|
else
|
|
o_total_max_tonnage.nselected = 15
|
|
|
|
cal_val = callback($$GetLocalNetworkMissionParamater$$, team_param, o_team_selection.nselected, min_tonnage)
|
|
if cal_val < 25
|
|
{
|
|
o_min_tonnage.nselected = 0
|
|
}
|
|
else
|
|
o_min_tonnage.nselected = (cal_val-25)/5
|
|
|
|
cal_val = callback($$GetLocalNetworkMissionParamater$$, team_param, o_team_selection.nselected, max_tonnage)
|
|
if cal_val <= 100
|
|
o_max_tonnage.nselected = (cal_val-25)/5
|
|
else
|
|
{
|
|
o_max_tonnage.nselected = 15
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (sender == o_min_tonnage)
|
|
{
|
|
o_background.submitted = 1
|
|
for (int a=0; a<16; a++)
|
|
o_update_names.host_bot_last_val[a] = -1
|
|
|
|
if (o_min_tonnage.nselected > o_max_tonnage.nselected)
|
|
o_min_tonnage.nselected = o_max_tonnage.nselected
|
|
|
|
if o_team_selection.nselected == o_team_selection.list_size-1
|
|
{
|
|
int temp_min = 25 + (5*o_min_tonnage.nselected)
|
|
|
|
for int loza = 0; loza <8; loza++
|
|
{
|
|
callback($$SetNetworkMissionParamater$$, team_param, loza, min_tonnage, temp_min)
|
|
}
|
|
|
|
min_ton_allteams = o_min_tonnage.nselected
|
|
}
|
|
else
|
|
{
|
|
int temp_min = makeint(o_min_tonnage.list_item[o_min_tonnage.nselected])
|
|
callback($$SetNetworkMissionParamater$$, team_param, o_team_selection.nselected, min_tonnage, temp_min)
|
|
}
|
|
}
|
|
|
|
if (sender == o_max_tonnage)
|
|
{
|
|
o_background.submitted = 1
|
|
for (int a=0; a<16; a++)
|
|
o_update_names.host_bot_last_val[a] = -1
|
|
|
|
if (o_max_tonnage.nselected < o_min_tonnage.nselected)
|
|
o_max_tonnage.nselected = o_min_tonnage.nselected
|
|
|
|
if o_team_selection.nselected == o_team_selection.list_size-1
|
|
{
|
|
int temp_max = 25 + (5*o_max_tonnage.nselected)
|
|
|
|
for int loza = 0; loza <8; loza++
|
|
{
|
|
callback($$SetNetworkMissionParamater$$, team_param, loza, max_tonnage, temp_max)
|
|
}
|
|
|
|
max_ton_allteams = o_max_tonnage.nselected
|
|
}
|
|
else
|
|
{
|
|
int temp_max = makeint(o_max_tonnage.list_item[o_max_tonnage.nselected])
|
|
callback($$SetNetworkMissionParamater$$, team_param, o_team_selection.nselected, max_tonnage, temp_max)
|
|
}
|
|
}
|
|
|
|
if (sender == o_total_max_tonnage)
|
|
{
|
|
o_background.submitted = 1
|
|
for (int a=0; a<16; a++)
|
|
o_update_names.host_bot_last_val[a] = -1
|
|
|
|
if o_team_selection.nselected == o_team_selection.list_size-1
|
|
{
|
|
int temp_max = 100*(1+o_total_max_tonnage.nselected)
|
|
|
|
for int loza = 0; loza <8; loza++
|
|
{
|
|
callback($$SetNetworkMissionParamater$$, team_param, loza, total_max_tonnage, temp_max)
|
|
}
|
|
|
|
total_max_ton_allteams = o_total_max_tonnage.nselected
|
|
}
|
|
else
|
|
{
|
|
int temp_max = makeint(o_total_max_tonnage.list_item[o_total_max_tonnage.nselected])
|
|
callback($$SetNetworkMissionParamater$$, team_param, o_team_selection.nselected, total_max_tonnage, temp_max)
|
|
}
|
|
}
|
|
}
|
|
|
|
if exists(@netserver@)
|
|
{
|
|
if (getmessage() == 2000) OR (sender == o_lancemate_button)
|
|
{
|
|
int game_type = RULE_TYPE_PARAMETER
|
|
int rule_type = callback($$GetLocalNetworkMissionParamater$$, game_type)
|
|
if ((rule_type == 0) || (rule_type == 1) || (rule_type == 2) || (rule_type == 3) || (rule_type >= 13))
|
|
{
|
|
script_run "Content\\ShellScripts\\ComputerPlayer.script", 0x1600
|
|
}
|
|
else
|
|
{
|
|
o_error = o_ErrorScreen
|
|
o_error.error_message = localize$(IDS_MP_LOBBY_ERROR_BOTS_NOT_ALLOWED)
|
|
initialize(o_error)
|
|
activate(o_error)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if exists(@HostLobbyMission@)
|
|
{
|
|
if sender == @HostLobbyMission@
|
|
{
|
|
if o_team_selection.nselected == o_team_selection.list_size-1
|
|
{
|
|
o_min_tonnage.nselected = min_ton_allteams
|
|
o_max_tonnage.nselected = max_ton_allteams
|
|
o_total_max_tonnage.nselected = total_max_ton_allteams
|
|
}
|
|
else
|
|
{
|
|
cal_val = callback($$GetLocalNetworkMissionParamater$$, team_param, o_team_selection.nselected, total_max_tonnage)
|
|
if cal_val <= 1600
|
|
{
|
|
o_total_max_tonnage.nselected = cal_val/100 -1
|
|
}
|
|
else
|
|
o_total_max_tonnage.nselected = 15
|
|
|
|
cal_val = callback($$GetLocalNetworkMissionParamater$$, team_param, o_team_selection.nselected, min_tonnage)
|
|
if cal_val < 25
|
|
{
|
|
o_min_tonnage.nselected = 0
|
|
}
|
|
else
|
|
o_min_tonnage.nselected = (cal_val-25)/5
|
|
|
|
cal_val = callback($$GetLocalNetworkMissionParamater$$, team_param, o_team_selection.nselected, max_tonnage)
|
|
if cal_val <= 100
|
|
o_max_tonnage.nselected = (cal_val-25)/5
|
|
else
|
|
{
|
|
o_max_tonnage.nselected = 15
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (exists(@ComputerPlayer@))
|
|
{
|
|
if ((sender == @ComputerPlayer@screen) && (getmessage() == 1))
|
|
{
|
|
string name = @ComputerPlayer@screen.mEditBox.boxValue
|
|
int level = @ComputerPlayer@screen.mSpinBox.nselected
|
|
string clan = localize$(IDS_MP_LOBBY_BOT_LEVEL) conv$(level)
|
|
int bot_id
|
|
|
|
bot_id = callback($$AddBot$$, level, name, clan)
|
|
if (bot_id == -1)
|
|
{
|
|
o_error = o_ErrorScreen
|
|
o_error.error_message = localize$(IDS_MP_LOBBY_ERROR_GAME_FULL)
|
|
initialize(o_error)
|
|
activate(o_error)
|
|
}
|
|
}
|
|
}
|
|
|
|
if (sender == o_mechbay_button)
|
|
{
|
|
unfocus
|
|
if exists(@netserver@)
|
|
{
|
|
@NetServer@currentScreen = MECHBAY_SCREEN
|
|
}
|
|
else
|
|
{
|
|
@NetClient@currentScreen = MECHBAY_SCREEN
|
|
}
|
|
|
|
for (int a=0; a<16; a++)
|
|
{
|
|
if o_update_names.host_bot_from_file[a] == 1
|
|
callback($$RemoveBot$$, a)
|
|
}
|
|
}
|
|
|
|
if (sender == o_back)
|
|
{
|
|
callback($$SetShellCommand$$, DISCONNECT_LOBBY_COMMAND)
|
|
}
|
|
|
|
if hosting
|
|
{
|
|
// if host changes the team for the player; might not make design
|
|
//for int change_team = 1; change_team < 16;change_team++
|
|
//{/
|
|
// if sender == o_team[change_team]
|
|
// kjlkj
|
|
// callback($$RequestTeam$$, getmessage())
|
|
//}
|
|
|
|
if sender == o_lock_server
|
|
{
|
|
int lock = CLOSED_GAME_PARAMETER
|
|
int lock_val
|
|
|
|
// crashes when used
|
|
if o_lock_server.state == 2
|
|
{
|
|
lock_val = 1
|
|
}
|
|
else
|
|
{
|
|
lock_val = 0
|
|
}
|
|
callback($$SetNetworkMissionParamater$$, lock, lock_val)
|
|
}
|
|
|
|
if (sender == o_launch_button)
|
|
{
|
|
|
|
////////---------------------------------------------------------------
|
|
////////Make sure num of lives and kill limit are set
|
|
|
|
int temp_num
|
|
|
|
if makeint(@HostLobbyMission@o_game_options[6].boxvalue) > 0
|
|
{
|
|
temp_num = makeint(@HostLobbyMission@o_game_options[6].boxvalue)
|
|
}
|
|
else
|
|
{
|
|
temp_num = 1
|
|
@HostLobbyMission@o_game_options[6].boxvalue = "1"
|
|
initialize(@HostLobbyMission@o_game_options[6])
|
|
}
|
|
|
|
callback($$SetNetworkMissionParamater$$, @HostLobbyMission@frag_limit, temp_num)
|
|
|
|
if makeint(@HostLobbyMission@o_game_options[7].boxvalue) > 0
|
|
{
|
|
temp_num = makeint(@HostLobbyMission@o_game_options[7].boxvalue) - 1
|
|
}
|
|
else
|
|
{
|
|
temp_num = 0
|
|
@HostLobbyMission@o_game_options[7].boxvalue = "1"
|
|
initialize(@HostLobbyMission@o_game_options[7])
|
|
}
|
|
|
|
callback($$SetNetworkMissionParamater$$, @HostLobbyMission@num_of_lives, temp_num)
|
|
|
|
|
|
focus(this)
|
|
play launchSound,1
|
|
|
|
script_end "mouse.script"
|
|
|
|
string need_time_of_day
|
|
if callback($$GetLocalNetworkMissionParamater$$, night_parameter) == 1
|
|
need_time_of_day = localize$(IDS_MP_LOBBY_NEED_TIME_NIGHT)
|
|
else
|
|
need_time_of_day = localize$(IDS_MP_LOBBY_NEED_TIME_DAY)
|
|
|
|
callback($$Shell_CallbackHandler$$, night_parameter, need_time_of_day)
|
|
|
|
callback($$SetShellCommand$$, START_NETWORK_GAME_COMMAND)
|
|
|
|
script_end
|
|
}
|
|
}
|
|
|
|
if sender == o_chat_entry
|
|
{
|
|
int out_going_count = 0
|
|
|
|
for int loopit = 0; loopit < 255; loopit++
|
|
{
|
|
valid_player = callback($$IsPlayerConnectionValid$$,loopit)
|
|
|
|
if (valid_player)
|
|
{
|
|
$$m_outgiongChatToPlayer$$[out_going_count] = loopit
|
|
|
|
out_going_count++
|
|
}
|
|
}
|
|
$$m_outgoingChatToPlayerCount$$ = out_going_count
|
|
|
|
$$m_outgoingChat$$ = o_chat_entry.boxvalue
|
|
sender_is_me = true
|
|
callback($$SendChat$$)
|
|
o_chat_entry.boxvalue = ""
|
|
initialize(o_chat_entry)
|
|
sender_is_me = true
|
|
}
|
|
|
|
|
|
if exists(@netclient@)
|
|
{
|
|
if sender == o_ready_button
|
|
{
|
|
if o_status[player_num].state != 2
|
|
{
|
|
string temp_name3
|
|
int number3 = 1
|
|
int launched3 = callback($$GetPlayerConnectionLaunched$$,number3,temp_name3)
|
|
|
|
if (launched3)
|
|
{
|
|
int seconds_to_go = 0
|
|
callback($$GetTimeToLaunchLock$$,seconds_to_go)
|
|
int join3 = JOIN_IN_PROGRESS_PARAMETER
|
|
int join4 = JOIN_IN_PROGRESS_CUTOFF_PARAMETER
|
|
if ((callback($$GetServerNetworkMissionParamater$$, join3) == FALSE) || ((callback($$GetServerNetworkMissionParamater$$, join4) == TRUE) && (seconds_to_go == 0)))
|
|
{
|
|
o_status[player_num].state = 1
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
o_mechbay_button.state = 0
|
|
}
|
|
else
|
|
{
|
|
o_status[player_num].state = 2
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_WAITING)
|
|
callback($$SetClientReady$$)
|
|
o_mechbay_button.state = 3
|
|
}
|
|
}
|
|
else
|
|
{
|
|
o_status[player_num].state = 2
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_WAITING)
|
|
callback($$SetClientReady$$)
|
|
o_mechbay_button.state = 3
|
|
}
|
|
}
|
|
else
|
|
{
|
|
o_status[player_num].state = 1
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
o_mechbay_button.state = 0
|
|
}
|
|
}
|
|
}
|
|
|
|
if getmessage() > -1
|
|
{
|
|
}
|
|
focus(this)
|
|
}
|
|
|
|
GUI_CHAR
|
|
{
|
|
play 2 // plays o_chat_entry's sound effect of typing
|
|
|
|
if getchar() > 0
|
|
o_chat_entry.boxValue = o_chat_entry.boxValue chr$(getchar())
|
|
|
|
focus(o_chat_entry)
|
|
o_chat_entry.highlight = false
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
|
|
if ( exists(@netserver@) )
|
|
{
|
|
if ( (@NetServer@NoErrorDialog == 1) && ( callback( $$CheckGUNAdvertise$$ ) == 2 ) )
|
|
{
|
|
// mdm - this only happens once per error occurance. It is
|
|
// possible that this call will happen more than once if the
|
|
// GUN server goes down, comes back up, and sometime later it
|
|
// goes down again.
|
|
o_error = o_ErrorScreen
|
|
o_error.error_message = localize$(IDS_MP_LOBBY_ERROR_ADVERTISING_GAME)
|
|
initialize(o_error)
|
|
activate(o_error)
|
|
@NetServer@NoErrorDialog = 0
|
|
}
|
|
else
|
|
{
|
|
if ( callback( $$CheckGUNAdvertise$$ ) == 3 )
|
|
{
|
|
// successful registration - reset NoErrorDialog so error will show
|
|
// up if something happens to GUN server in the future.
|
|
@NetServer@NoErrorDialog = 0
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if callback($$GetServerNetworkMissionParamater$$, dedicated_server) == 1
|
|
dedicated_server_flag = TRUE
|
|
}
|
|
|
|
|
|
if $$m_currentChatCount$$ > 0
|
|
{
|
|
string temp_val = $$m_chatFrom$$[$$m_currentChatCount$$-1] ":> " $$m_chatArray$$[$$m_currentChatCount$$-1]
|
|
if equal$(temp_val,o_chat_box.column[0].list_item[$$m_currentChatCount$$-1])
|
|
{
|
|
}
|
|
else
|
|
{
|
|
o_chat_box.list_size = $$m_currentChatCount$$
|
|
|
|
for x = 0;x < $$m_currentChatCount$$; x++
|
|
{
|
|
o_chat_box.column[0].list_item[x] = $$m_chatFrom$$[x] ":> " $$m_chatArray$$[x]
|
|
}
|
|
|
|
if (o_chat_box.o_thumbslider.thumb_pressed == false)
|
|
{
|
|
play 3
|
|
o_chat_box.reset_location = 2
|
|
}
|
|
else
|
|
{
|
|
o_chat_box.reset_location = 1
|
|
}
|
|
|
|
initialize (o_chat_box)
|
|
}
|
|
}
|
|
|
|
if sender_is_me == TRUE //&& focused == o_chat_box
|
|
{
|
|
focus(o_chat_entry)
|
|
sender_is_me = FALSE
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
background
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int submitted = 0
|
|
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 "MULTIPlayer.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)
|
|
|
|
// Chasis String array
|
|
// MSL ADD MECH
|
|
string chassis_names[54]
|
|
chassis_names[0] = localize$(DNL_ARCTICWOLF)
|
|
chassis_names[1] = localize$(DNL_ARES)
|
|
chassis_names[2] = localize$(DNL_ARGUS)
|
|
chassis_names[3] = localize$(DNL_ATLAS)
|
|
chassis_names[4] = localize$(DNL_AWESOME)
|
|
chassis_names[5] = localize$(DNL_BLACKKNIGHT)
|
|
chassis_names[6] = localize$(DNL_BLACKLANNER)
|
|
chassis_names[7] = localize$(DNL_BRIGAND)
|
|
chassis_names[8] = localize$(DNL_BUSHWACKER)
|
|
chassis_names[9] = localize$(DNL_CATAPULT)
|
|
chassis_names[10] = localize$(DNL_CAULDRONBORN)
|
|
chassis_names[11] = localize$(DNL_CHIMERA)
|
|
chassis_names[12] = localize$(DNL_COMMANDO)
|
|
chassis_names[13] = localize$(DNL_COUGAR)
|
|
chassis_names[14] = localize$(DNL_CYCLOPS)
|
|
chassis_names[15] = localize$(DNL_DAISHI)
|
|
// chassis_names[16] = localize$(DNL_DASHER)
|
|
chassis_names[16] = localize$(DNL_DEIMOS)
|
|
chassis_names[17] = localize$(DNL_DRAGON)
|
|
chassis_names[18] = localize$(DNL_FAFNIR)
|
|
chassis_names[19] = localize$(DNL_FLEA)
|
|
chassis_names[20] = localize$(DNL_GLADIATOR)
|
|
chassis_names[21] = localize$(DNL_GRIZZLY)
|
|
chassis_names[22] = localize$(DNL_HAUPTMANN)
|
|
chassis_names[23] = localize$(DNL_HELLHOUND)
|
|
chassis_names[24] = localize$(DNL_HELLSPAWN)
|
|
chassis_names[25] = localize$(DNL_HIGHLANDER)
|
|
chassis_names[26] = localize$(DNL_HOLLANDERII)
|
|
chassis_names[27] = localize$(DNL_HUNCHBACK)
|
|
chassis_names[28] = localize$(DNL_KODIAK)
|
|
chassis_names[29] = localize$(DNL_LOKI)
|
|
chassis_names[30] = localize$(DNL_LONGBOW)
|
|
chassis_names[31] = localize$(DNL_MADCAT)
|
|
chassis_names[32] = localize$(DNL_MADCAT2)
|
|
chassis_names[33] = localize$(DNL_MASAKARI)
|
|
chassis_names[34] = localize$(DNL_MAULER)
|
|
chassis_names[35] = localize$(DNL_NOVACAT)
|
|
chassis_names[36] = localize$(DNL_OSIRIS)
|
|
chassis_names[37] = localize$(DNL_OWENS)
|
|
chassis_names[38] = localize$(DNL_PUMA)
|
|
chassis_names[39] = localize$(DNL_RAVEN)
|
|
// chassis_names[41] = localize$(DNL_RIFLEMAN)
|
|
chassis_names[40] = localize$(DNL_RYOKEN)
|
|
chassis_names[41] = localize$(DNL_SHADOWCAT)
|
|
chassis_names[42] = localize$(DNL_SOLITAIRE)
|
|
chassis_names[43] = localize$(DNL_SUNDER)
|
|
chassis_names[44] = localize$(DNL_TEMPLAR)
|
|
chassis_names[45] = localize$(DNL_THANATOS)
|
|
chassis_names[46] = localize$(DNL_THOR)
|
|
chassis_names[47] = localize$(DNL_ULLER)
|
|
chassis_names[48] = localize$(DNL_UZIEL)
|
|
chassis_names[49] = localize$(DNL_VICTOR)
|
|
chassis_names[50] = localize$(DNL_VULTURE)
|
|
chassis_names[51] = localize$(DNL_WOLFHOUND)
|
|
chassis_names[52] = localize$(DNL_ZEUS)
|
|
chassis_names[53] = localize$(IDS_MP_LOBBY_CAMERA)
|
|
|
|
|
|
object build_weapons = build_weapon_names
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
if (getmessage() == -100)
|
|
{
|
|
int bot_last_error_count = callback($$GetBotVehicleRejectionReasonCount$$) - 1
|
|
int bot_denied_parameter = 0
|
|
int bot_last_error = callback($$GetBotVehicleRejectionReason$$, bot_last_error_count, bot_denied_parameter)
|
|
|
|
if (bot_last_error != NO_TEAM_BUILDERROR)
|
|
{
|
|
o_error = o_ErrorScreen
|
|
o_error.error_message = denied_error[bot_last_error]
|
|
initialize(o_error)
|
|
activate(o_error)
|
|
}
|
|
}
|
|
|
|
if (getmessage() == -1)
|
|
{
|
|
submitted = 1
|
|
}
|
|
|
|
if (getmessage() == 1)
|
|
{
|
|
submitted = 0
|
|
|
|
if last_error != 0
|
|
{
|
|
o_error = o_ErrorScreen
|
|
|
|
if (last_error == CHASIS_BUILDERROR)
|
|
{
|
|
o_error.error_message = denied_error[last_error] "\n\n" chassis_names[denied_parameter]
|
|
}
|
|
else
|
|
{
|
|
if ((last_error >= BEAM_BUILDERROR) && (last_error <= SUBSYTEM_BUILDERROR))
|
|
{
|
|
o_error.error_message = denied_error[last_error] "\n\n" build_weapons.weapon_names[denied_parameter]
|
|
}
|
|
else
|
|
o_error.error_message = denied_error[last_error]
|
|
}
|
|
initialize(o_error)
|
|
activate(o_error)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
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 = 39,88
|
|
print3d localize$(IDS_MP_LOBBY_PLAYER)
|
|
|
|
print3d_position = 179,88
|
|
print3d localize$(IDS_IA_MECH)
|
|
|
|
if team_val
|
|
{
|
|
print3d_position = 324,88
|
|
print3d localize$(IDS_MP_LOBBY_NORMAL_TEAM)
|
|
}
|
|
else
|
|
{
|
|
print3d_position = 324,88
|
|
print3d "Skin"
|
|
}
|
|
|
|
print3d_position = 406,88
|
|
print3d localize$(IDS_MP_LOBBY_STATUS)
|
|
|
|
drawline 39,107 to 458,107
|
|
|
|
if hosting
|
|
{
|
|
if callback($$GetLocalNetworkMissionParamater$$, dedicated_server) == 1
|
|
{
|
|
int dont_allow_launch = FALSE
|
|
for (i = 0; i < 16; i++)
|
|
{
|
|
if (callback($$GetBotValid$$, i) == TRUE)
|
|
{
|
|
if (callback($$GetBotVehicleAccepted$$, i) == FALSE)
|
|
{
|
|
dont_allow_launch = TRUE
|
|
break
|
|
}
|
|
}
|
|
}
|
|
if (dont_allow_launch )
|
|
{
|
|
deactivate(o_launch_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_DENIED)
|
|
}
|
|
else
|
|
{
|
|
if ($$networkScenarioCount$$ != 0)
|
|
activate(o_launch_button)
|
|
else
|
|
{
|
|
// Remove bots from previous nfo file
|
|
for int b=0; b<255; b++
|
|
{
|
|
if o_update_names.host_bot_from_file[b]
|
|
{
|
|
callback($$RemoveBot$$, b)
|
|
o_update_names.host_bot_last_val[b] = -1
|
|
o_update_names.host_bot_last_player_num[b] = -1
|
|
o_update_names.host_bot_last_skin[b] = 0
|
|
o_update_names.host_bot_from_file[b] = 0
|
|
}
|
|
}
|
|
deactivate(o_launch_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_DENIED)
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (waiting_to_init == 1)
|
|
{
|
|
waiting_to_init = 0
|
|
// My_ID = Callback($$MyPlayerId$$)
|
|
// initialize(parent)
|
|
}
|
|
|
|
int vehicle_request_status = callback($$NetClientVehicleAccepted$$)
|
|
|
|
if vehicle_request_status == VEHICLE_NOTSENT
|
|
{
|
|
deactivate(o_launch_button)
|
|
o_status[0].state = 0
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_BEING_APPROVED)
|
|
|
|
callback($$SetTeamDecal$$, team_decal_full_name[o_teamdecal.sel_option])
|
|
callback($$SetPilotDecal$$, pilot_decal_full_name[o_pilotdecal.sel_option])
|
|
|
|
stock_mech_selected = o_mech_variant[player_num].nselected
|
|
variant_mech_selected = o_mech_variant2[player_num].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech[mech_selected], o_skin.optiontext[o_skin.sel_option])
|
|
callback($$SendVehicleRequest$$)
|
|
mail(-1, this)
|
|
}
|
|
|
|
if vehicle_request_status == VEHICLE_ACCEPTED
|
|
{
|
|
o_status[0].state = 2
|
|
int dont_allow_launch = FALSE
|
|
for (i = 0; i < 16; i++)
|
|
{
|
|
if (callback($$GetBotValid$$, i) == TRUE)
|
|
{
|
|
if (callback($$GetBotVehicleAccepted$$, i) == FALSE)
|
|
{
|
|
dont_allow_launch = TRUE
|
|
break
|
|
}
|
|
}
|
|
}
|
|
if (dont_allow_launch)
|
|
{
|
|
if team_val == TRUE //if its a team game
|
|
{
|
|
if (block_launch_or_ready == TRUE) // and the player hasn't picked a team
|
|
{
|
|
if ($$networkScenarioCount$$ != 0)
|
|
activate(o_launch_button)
|
|
else
|
|
{
|
|
deactivate(o_launch_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_DENIED)
|
|
}
|
|
|
|
o_launch_button.state = 3
|
|
activate(o_pickteam_button)
|
|
}
|
|
else
|
|
{
|
|
o_launch_button.state = 0
|
|
deactivate(o_pickteam_button)
|
|
|
|
deactivate(o_launch_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_DENIED)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
deactivate(o_launch_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_DENIED)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if ($$networkScenarioCount$$ != 0)
|
|
activate(o_launch_button)
|
|
else
|
|
{
|
|
deactivate(o_launch_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_DENIED)
|
|
}
|
|
|
|
if team_val == TRUE //if its a team game
|
|
{
|
|
if (block_launch_or_ready == TRUE) // and the player hasn't picked a team
|
|
{
|
|
o_launch_button.state = 3
|
|
activate(o_pickteam_button)
|
|
}
|
|
else
|
|
{
|
|
o_launch_button.state = 0
|
|
deactivate(o_pickteam_button)
|
|
}
|
|
}
|
|
}
|
|
|
|
request_resent = 0
|
|
}
|
|
if vehicle_request_status == VEHICLE_DENIED
|
|
{
|
|
o_status[0].state = 0
|
|
last_error_count = callback($$GetVehicleRejectionReasonCount$$) - 1
|
|
last_error = callback($$GetVehicleRejectionReason$$, last_error_count, denied_parameter)
|
|
|
|
if (last_error == UNKNOWN_BUILDERROR)
|
|
{
|
|
if (!request_resent)
|
|
{
|
|
deactivate(o_launch_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_BEING_APPROVED)
|
|
|
|
callback($$SetTeamDecal$$, team_decal_full_name[o_teamdecal.sel_option])
|
|
callback($$SetPilotDecal$$, pilot_decal_full_name[o_pilotdecal.sel_option])
|
|
|
|
stock_mech_selected = o_mech_variant[player_num].nselected
|
|
variant_mech_selected = o_mech_variant2[player_num].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech[mech_selected], o_skin.optiontext[o_skin.sel_option])
|
|
callback($$SendVehicleRequest$$)
|
|
mail(-1, this)
|
|
}
|
|
|
|
request_resent = 1
|
|
}
|
|
else
|
|
{
|
|
if (last_error == NO_TEAM_BUILDERROR)
|
|
{
|
|
activate(o_launch_button)
|
|
o_launch_button.state = 3
|
|
activate(o_pickteam_button)
|
|
submitted = 0
|
|
}
|
|
else
|
|
{
|
|
if (submitted == 1)
|
|
mail(1, this)
|
|
|
|
deactivate(o_launch_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_DENIED)
|
|
}
|
|
|
|
request_resent = 0
|
|
}
|
|
}
|
|
if vehicle_request_status == VEHICLE_SUBMITTED
|
|
{
|
|
deactivate(o_launch_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_BEING_APPROVED)
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
int connected_to_server = callback($$NetConnectedToServer$$)
|
|
int vehicle_request_status = callback($$NetClientVehicleAccepted$$)
|
|
|
|
if connected_to_server == 0
|
|
{
|
|
deactivate(o_ready_button)
|
|
o_status[player_num].state = 0
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
o_mechbay_button.state = 0
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_WAITING_FOR_SERVER)
|
|
}
|
|
else
|
|
{
|
|
if vehicle_request_status == VEHICLE_NOTSENT
|
|
{
|
|
deactivate(o_ready_button)
|
|
if (o_status[player_num].state != 0)
|
|
{
|
|
o_status[player_num].state = 0
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
}
|
|
|
|
o_mechbay_button.state = 0
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_BEING_APPROVED)
|
|
|
|
callback($$SetTeamDecal$$, team_decal_full_name[o_teamdecal.sel_option])
|
|
callback($$SetPilotDecal$$, pilot_decal_full_name[o_pilotdecal.sel_option])
|
|
|
|
stock_mech_selected = o_mech_variant[player_num].nselected
|
|
variant_mech_selected = o_mech_variant2[player_num].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech[mech_selected], o_skin.optiontext[o_skin.sel_option])
|
|
callback($$SendVehicleRequest$$)
|
|
mail(-1, this)
|
|
}
|
|
if vehicle_request_status == VEHICLE_ACCEPTED
|
|
{
|
|
activate(o_ready_button)
|
|
string temp_name2
|
|
int number = 1
|
|
int launched2 = callback($$GetPlayerConnectionLaunched$$,number,temp_name2)
|
|
|
|
if (launched2)
|
|
{
|
|
int seconds_to_go = 0
|
|
callback($$GetTimeToLaunchLock$$,seconds_to_go)
|
|
int join3 = JOIN_IN_PROGRESS_PARAMETER
|
|
int join4 = JOIN_IN_PROGRESS_CUTOFF_PARAMETER
|
|
if ((callback($$GetServerNetworkMissionParamater$$, join3) == FALSE) || ((callback($$GetServerNetworkMissionParamater$$, join4) == TRUE) && (seconds_to_go == 0)))
|
|
{
|
|
if (o_status[player_num].state != 1)
|
|
{
|
|
o_status[player_num].state = 1
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
}
|
|
|
|
o_mechbay_button.state = 0
|
|
}
|
|
else
|
|
{
|
|
if (o_status[player_num].state == 0)
|
|
o_status[player_num].state = 1
|
|
}
|
|
|
|
if team_val == TRUE //if its a team game
|
|
{
|
|
if (block_launch_or_ready == TRUE) // and the player hasn't picked a team
|
|
{
|
|
o_ready_button.state = 3
|
|
activate(o_pickteam_button)
|
|
}
|
|
else
|
|
{
|
|
o_ready_button.state = 0
|
|
deactivate(o_pickteam_button)
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (o_status[player_num].state == 0)
|
|
o_status[player_num].state = 1
|
|
|
|
if (block_launch_or_ready == TRUE) && team_val == TRUE
|
|
{
|
|
o_ready_button.state = 3
|
|
activate(o_pickteam_button)
|
|
if (o_status[player_num].state != 0)
|
|
{
|
|
o_status[player_num].state = 0
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
}
|
|
|
|
o_mechbay_button.state = 0
|
|
}
|
|
else
|
|
{
|
|
o_ready_button.state = 0
|
|
deactivate(o_pickteam_button)
|
|
}
|
|
}
|
|
|
|
request_resent = 0
|
|
}
|
|
if vehicle_request_status == VEHICLE_DENIED
|
|
{
|
|
last_error_count = callback($$GetVehicleRejectionReasonCount$$) - 1
|
|
last_error = callback($$GetVehicleRejectionReason$$, last_error_count, denied_parameter)
|
|
|
|
if (last_error == UNKNOWN_BUILDERROR)
|
|
{
|
|
if (!request_resent)
|
|
{
|
|
deactivate(o_ready_button)
|
|
if (o_status[player_num].state != 0)
|
|
{
|
|
o_status[player_num].state = 0
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
}
|
|
|
|
o_mechbay_button.state = 0
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_BEING_APPROVED)
|
|
|
|
callback($$SetTeamDecal$$, team_decal_full_name[o_teamdecal.sel_option])
|
|
callback($$SetPilotDecal$$, pilot_decal_full_name[o_pilotdecal.sel_option])
|
|
|
|
stock_mech_selected = o_mech_variant[player_num].nselected
|
|
variant_mech_selected = o_mech_variant2[player_num].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech[mech_selected], o_skin.optiontext[o_skin.sel_option])
|
|
callback($$SendVehicleRequest$$)
|
|
mail(-1, this)
|
|
}
|
|
|
|
request_resent = 1
|
|
}
|
|
else
|
|
{
|
|
if (last_error == NO_TEAM_BUILDERROR)
|
|
{
|
|
activate(o_ready_button)
|
|
o_ready_button.state = 3
|
|
activate(o_pickteam_button)
|
|
if (o_status[player_num].state != 0)
|
|
{
|
|
o_status[player_num].state = 0
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
}
|
|
|
|
o_mechbay_button.state = 0
|
|
}
|
|
else
|
|
{
|
|
if (submitted == 1)
|
|
mail(1, this)
|
|
|
|
deactivate(o_ready_button)
|
|
if (o_status[player_num].state != 0)
|
|
{
|
|
o_status[player_num].state = 0
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
}
|
|
|
|
o_mechbay_button.state = 0
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_DENIED)
|
|
}
|
|
|
|
request_resent = 0
|
|
}
|
|
}
|
|
if vehicle_request_status == VEHICLE_SUBMITTED
|
|
{
|
|
deactivate(o_ready_button)
|
|
|
|
print3d_position = 585, 540
|
|
print3d localize$(IDS_MP_LOBBY_VEHICLE_BEING_APPROVED)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
cover_buttons
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 509,77,300
|
|
region = 0,0 to 766-509,155-77
|
|
}
|
|
}
|
|
|
|
display_num_of_players
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 0,0,255
|
|
|
|
int text_size = 1 // 100% for bitmap
|
|
framerate = 10
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
if (max_players == 0)
|
|
{
|
|
int parameter = MAX_PLAYERS_PARAMETER
|
|
if exists(@netserver@)
|
|
{
|
|
max_players = callback($$GetLocalNetworkMissionParamater$$, parameter)
|
|
}
|
|
else
|
|
{
|
|
max_players = callback($$GetServerNetworkMissionParamater$$, parameter)
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
print3d_attributes = gFont3d, 0xffffffff,text_size,0,1,0,0,just_left
|
|
lprint3d_position = 0, 0
|
|
print3d localize$(IDS_MP_LOBBY_PLAYERS) ": " conv$(num_of_players) "/" conv$(max_players)
|
|
}
|
|
}
|
|
|
|
allow_join_timer
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 0,0,255
|
|
int seconds_to_go = 100
|
|
int display_min
|
|
int sec_tap
|
|
string display_sec
|
|
int launched4 = FALSE
|
|
int join_in_prog_param = JOIN_IN_PROGRESS_PARAMETER
|
|
int parametery = JOIN_IN_PROGRESS_CUTOFF_PARAMETER
|
|
|
|
int text_size = 1 // 100% for bitmap
|
|
framerate = 10
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
callback($$GetTimeToLaunchLock$$,seconds_to_go)
|
|
|
|
display_min = seconds_to_go/60
|
|
sec_tap = seconds_to_go - (display_min*60)
|
|
if sec_tap < 10
|
|
display_sec = "0" conv$(sec_tap)
|
|
else
|
|
display_sec = conv$(sec_tap)
|
|
|
|
string temp_name4
|
|
int number4 = 1
|
|
launched4 = callback($$GetPlayerConnectionLaunched$$,number4,temp_name4)
|
|
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
if launched4 == TRUE
|
|
{
|
|
if callback($$GetServerNetworkMissionParamater$$, join_in_prog_param) == TRUE
|
|
{
|
|
if callback($$GetServerNetworkMissionParamater$$, parametery) == TRUE
|
|
{
|
|
print3d_attributes = gFont3d, 0xffffffff,text_size,0,1,0,0,just_left
|
|
lprint3d_position = 0, 0
|
|
|
|
if (seconds_to_go)
|
|
print3d localize$(IDS_MP_LOBBY_TIME_TO_JOIN) ": " conv$(display_min) ":" display_sec
|
|
else
|
|
print3d localize$(IDS_MP_LOBBY_PLEASE_WAIT)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
print3d_attributes = gFont3d, 0xffffffff,text_size,0,1,0,0,just_left
|
|
lprint3d_position = 0, 0
|
|
|
|
print3d localize$(IDS_MP_LOBBY_PLEASE_WAIT)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
time_to_launch
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 0,0,255
|
|
int seconds_to_go = 100
|
|
int display_min
|
|
int sec_tap
|
|
string display_sec
|
|
int launched4 = FALSE
|
|
int server_recycle = SERVER_RECYCLE_PARAMETER
|
|
|
|
int text_size = 1 // 100% for bitmap
|
|
framerate = 10
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
callback($$GetTimeToLaunch$$,seconds_to_go)
|
|
display_min = seconds_to_go/60
|
|
sec_tap = seconds_to_go - (display_min*60)
|
|
if sec_tap < 10
|
|
display_sec = "0" conv$(sec_tap)
|
|
else
|
|
display_sec = conv$(sec_tap)
|
|
|
|
string temp_name4
|
|
int number4 = 1
|
|
launched4 = callback($$GetPlayerConnectionLaunched$$,number4,temp_name4)
|
|
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
if hosting
|
|
{
|
|
if launched4 == FALSE && callback($$GetLocalNetworkMissionParamater$$, dedicated_server) == TRUE && callback($$GetLocalNetworkMissionParamater$$, server_recycle)
|
|
{
|
|
print3d_attributes = gFont3d, 0xffffffff,text_size,0,1,0,0,just_left
|
|
lprint3d_position = 120, 0
|
|
|
|
print3d localize$(IDS_MP_LOBBY_TIME_TO_LAUNCH) ": " conv$(display_min) ":" display_sec
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if launched4 == FALSE && callback($$GetServerNetworkMissionParamater$$, dedicated_server) == TRUE
|
|
{
|
|
print3d_attributes = gFont3d, 0xffffffff,text_size,0,1,0,0,just_left
|
|
lprint3d_position = 120, 0
|
|
|
|
print3d localize$(IDS_MP_LOBBY_TIME_TO_LAUNCH) ": " conv$(display_min) ":" display_sec
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
time_remaining
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 0,0,255
|
|
int seconds_to_go = 100
|
|
int display_min
|
|
int sec_tap
|
|
string display_sec
|
|
int launched4 = FALSE
|
|
|
|
int text_size = 1 // 100% for bitmap
|
|
framerate = 10
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
callback($$GetTimeToGameEnd$$,seconds_to_go)
|
|
display_min = seconds_to_go/60
|
|
sec_tap = seconds_to_go - (display_min*60)
|
|
if sec_tap < 10
|
|
display_sec = "0" conv$(sec_tap)
|
|
else
|
|
display_sec = conv$(sec_tap)
|
|
|
|
string temp_name4
|
|
int number4 = 1
|
|
launched4 = callback($$GetPlayerConnectionLaunched$$,number4,temp_name4)
|
|
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
if hosting == FALSE //launched4 == TRUE
|
|
{
|
|
print3d_attributes = gFont3d, 0xffffffff,text_size,0,1,0,0,just_left
|
|
lprint3d_position = 0, 0
|
|
|
|
if seconds_to_go > 0
|
|
print3d localize$(IDS_MP_LOBBY_TIME_REMAINING) ": " conv$(display_min) ":" display_sec //
|
|
else
|
|
{
|
|
print3d_attributes = gFont3d, 0x77ffffff,text_size,0,1,0,0,just_left
|
|
print3d localize$(IDS_MP_LOBBY_TIME_REMAINING) ": " localize$(IDS_MP_LOBBY_NO_MISSION_LAUNCHED)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
standard_button
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int logicstate = 0 //
|
|
int listdown = false //
|
|
framerate = 20
|
|
int over_me = false
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if (mouse.left == BUTTON_PRESSED)
|
|
{
|
|
listdown = true
|
|
play press,1
|
|
}
|
|
else
|
|
if (mouse.left == BUTTON_CLICKED)
|
|
{
|
|
listdown = false
|
|
logicstate = !logicstate // logicstate = the opposite of its current value (on/off)
|
|
mail(logicstate) // send this state to GOS Script's mailbox
|
|
}
|
|
}
|
|
|
|
REGION_ENTERED
|
|
{
|
|
hipoint++
|
|
over_me = true
|
|
|
|
|
|
}
|
|
|
|
REGION_EXITED
|
|
{
|
|
hipoint--
|
|
over_me = false
|
|
if (logicstate && hipoint = 0)
|
|
{
|
|
listdown = false
|
|
logicstate = 0 // logicstate = the opposite of its current value (on/off)
|
|
mail(logicstate) // send this state to GOS Script's mailbox
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
netparam_droplist
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 0,0,5
|
|
object dropbutton = standard_button
|
|
|
|
int initilized = false
|
|
|
|
int option_count = 256
|
|
string optiontext[option_count]
|
|
int optionvalue[option_count]
|
|
int parameter_id
|
|
|
|
int blink = false
|
|
int num_options // number of options = 0
|
|
int dlwidth = 200 // width of box?
|
|
int dlheight = 15 // height of text
|
|
int sel_option = 0 // selected option value?
|
|
int last_sel = -1
|
|
int dropped= 0 // whether the list is showing or not variable
|
|
int over_me = false
|
|
int disabled = false
|
|
int default_option
|
|
framerate = 20
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
dropbutton.location = location
|
|
dropbutton.region = 0,0 to dlwidth,dlheight
|
|
}
|
|
|
|
REGION_ENTERED
|
|
{
|
|
hipoint++
|
|
over_me = true
|
|
|
|
}
|
|
|
|
REGION_EXITED
|
|
{
|
|
hipoint--
|
|
if over_me
|
|
{
|
|
dropped = 0
|
|
location.z = 10
|
|
|
|
region = 0,0 to 0,0
|
|
dropbutton.logicstate = 0 // resets logic state
|
|
over_me = false
|
|
}
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if (mouse.left == BUTTON_CLICKED && dropped = 1) // if left mouse button is pressed while the list is dropped
|
|
{
|
|
play press,1
|
|
sel_option = (mouse.y - (location.y+dlheight+1)) / dlheight
|
|
|
|
dropped = 0
|
|
location.z = 10
|
|
|
|
region = 0,0 to 0,0
|
|
dropbutton.logicstate = 0 // resets logic state
|
|
mail(sel_option) // sends the selected option to mailbox
|
|
}
|
|
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
if (sender == dropbutton) // if passed by the dropbutton object
|
|
{
|
|
if (getmessage()) // if message is true
|
|
{
|
|
dropped = 1
|
|
location.z = 15
|
|
region = 0,dlheight to dlwidth, (dlheight*(1+num_options)) // increase region to accomodate bo
|
|
}
|
|
else // if message is false
|
|
{
|
|
dropped = 0 // turn off list
|
|
location.z = 10
|
|
region = 0,0 to 0,0 // reduce region
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
blink = !blink
|
|
|
|
// set up the first frame value from the sim
|
|
if (initilized == false)
|
|
{
|
|
|
|
initilized = true
|
|
|
|
sel_option = -1
|
|
int value = callback($$GetLocalNetworkMissionParamater$$, parameter_id)
|
|
|
|
for (i = 0; i < num_options; i++)
|
|
{
|
|
if (optionvalue[i] == value)
|
|
{
|
|
sel_option = i
|
|
}
|
|
}
|
|
|
|
if (sel_option == -1)
|
|
sel_option = default_option
|
|
|
|
callback($$SetNetworkMissionParamater$$, parameter_id, optionvalue[sel_option])
|
|
mail(sel_option)
|
|
}
|
|
|
|
|
|
if (last_sel != sel_option)
|
|
{
|
|
callback($$SetNetworkMissionParamater$$, parameter_id, optionvalue[sel_option])
|
|
|
|
last_sel = sel_option
|
|
|
|
mail(sel_option)
|
|
}
|
|
|
|
|
|
int new_value = callback($$GetLocalNetworkMissionParamater$$, parameter_id)
|
|
if (new_value != optionvalue[sel_option])
|
|
{
|
|
for (i = 0; i < num_options; i++)
|
|
{
|
|
if (optionvalue[i] == new_value)
|
|
{
|
|
sel_option = i
|
|
last_sel = sel_option
|
|
callback($$SetNetworkMissionParamater$$, parameter_id, optionvalue[sel_option])
|
|
mail(sel_option)
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
if dropbutton.over_me
|
|
{
|
|
setpencolor(0x66000000)
|
|
drawrect location.x-1, location.y-1 to location.x+dlwidth, location.y+dlheight+1
|
|
}
|
|
|
|
|
|
if disabled == false
|
|
{
|
|
|
|
setpencolor(0x66000000) // set color to white
|
|
drawrect location.x, location.y to location.x+dlwidth, location.y+dlheight+1 // draw box
|
|
setpencolor(0xff00ff00)
|
|
|
|
print3d_margins = 0,0 to 800,600 // big margins
|
|
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0 // what attributes?
|
|
print3d_position = location.x+2,location.y+2 // print here
|
|
print3d optiontext[sel_option] // print the currently selected option
|
|
|
|
// drawframe location.x-1,location.y-1 to location.x+dlwidth, location.y+dlheight+1 // draw frame on list box
|
|
render droplist_button, location.x-8,location.y-8
|
|
|
|
if dropbutton.over_me
|
|
{
|
|
render droplist_button_glow, location.x-8,location.y-8
|
|
}
|
|
if (dropped) // if dropped = 1
|
|
{
|
|
|
|
setpencolor(0xee000000) // set color to white
|
|
drawrect location.x-1, location.y+(dlheight)+2 to location.x+dlwidth, location.y+((num_options+1)*dlheight)+3 // variable size box
|
|
for(int z= 0; z < num_options;z++) // loop to draw list of names
|
|
{
|
|
print3d_position = location.x+2, location.y+((z+1)*dlheight)+4 // set position using loop val z
|
|
if mouse.y > location.y+(dlheight*(z+1)) && mouse.y < location.y+(dlheight*(z+2))+1
|
|
{
|
|
setpencolor(0x660000ff)
|
|
// setpencolor(0x77005500)
|
|
drawrect location.x, location.y+(dlheight*(z+1))+2 to location.x+dlwidth, location.y+(dlheight*(z+1))+dlheight+2
|
|
}
|
|
|
|
if (sel_option = z) // if z = selected option then
|
|
print3d_attributes = gFont3d,0x66ffffff,1,0,1,0,0 // set color to selected color
|
|
else
|
|
print3d_attributes = gFont3d,0xffffffff,1,0,1,0,0 // set color to unselected color
|
|
print3d optiontext[z]
|
|
}
|
|
setpencolor(0xffffffff)
|
|
// setpencolor(0xff00ff00)
|
|
drawframe location.x-1,location.y+dlheight+1 to location.x+dlwidth, location.y+(dlheight*(1+num_options))+3 //draw frame on list box
|
|
if blink
|
|
{
|
|
render down_arrow, (location.x+dlwidth-16),location.y
|
|
render down_arrow, (location.x+dlwidth-16),location.y
|
|
|
|
}
|
|
}
|
|
render down_arrow, (location.x+dlwidth-16),location.y
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
genericbutton
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 525,281,10
|
|
region = 0,0 to 696-525,314-281
|
|
|
|
|
|
sound btnRolloverSound = SPATH "sfx_button7.wav"
|
|
sound btnPressedSound = SPATH "sfx_button5.wav"
|
|
}
|
|
|
|
REGION_ENTERED
|
|
{
|
|
play btnRolloverSound, 1
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if mouse.left == BUTTON_CLICKED
|
|
{
|
|
|
|
mail (-1)
|
|
play btnPressedSound, 1
|
|
}
|
|
}
|
|
}
|
|
|
|
s_print_text
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
string text
|
|
font3d text_font
|
|
int text_color
|
|
int id
|
|
}
|
|
|
|
|
|
GUI_DRAW
|
|
{
|
|
if hide_this_player[id] == FALSE
|
|
{
|
|
|
|
print3d_attributes = text_font, name_color[id],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$(team_val)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
mech_button
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
pane p_pane = GPATH "Multiplayer\\mechicon.tga"
|
|
alphamode(p_pane) = am_alpha_alphainvalpha
|
|
region = p_pane
|
|
|
|
int id
|
|
int current_mech
|
|
|
|
sound btnRolloverSound = SPATH "sfx_button7.wav"
|
|
sound btnPressedSound = SPATH "sfx_button5.wav"
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
current_mech = 0// $$kldai05$$[id]
|
|
}
|
|
|
|
REGION_ENTERED
|
|
{
|
|
play btnRolloverSound, 1
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if mouse.left == BUTTON_PRESSED
|
|
{
|
|
mail (id)
|
|
play btnPressedSound, 1
|
|
}
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
render p_pane,location
|
|
}
|
|
}
|
|
|
|
skin_box
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
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] = "0"
|
|
|
|
framerate = 10
|
|
|
|
// mail(0,this)
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
if team_val == TRUE
|
|
{
|
|
if hosting
|
|
state = callback($$GetLocalNetworkMissionParamater$$, team_param, o_team[id].nselected, teamskin)
|
|
else
|
|
state = callback($$GetServerNetworkMissionParamater$$, team_param, o_team[id].nselected, teamskin)
|
|
|
|
p_pane = "Content\\ShellScripts\\Graphics\\Multiplayer\\LobbySkins\\skin" letters[state] "4.tga"
|
|
}
|
|
else
|
|
{
|
|
if o_skins[id].nselected > -1
|
|
{
|
|
state = o_skins[id].nselected
|
|
|
|
p_pane = "Content\\ShellScripts\\Graphics\\Multiplayer\\LobbySkins\\skin" letters[state] "4.tga"
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
if team_val == TRUE
|
|
{
|
|
if hosting
|
|
{
|
|
if o_team[id].nselected < o_team[id].list_size-1
|
|
if state != callback($$GetLocalNetworkMissionParamater$$, team_param, o_team[id].nselected, teamskin) //uses Jerry's value for the skins
|
|
mail(0,this)
|
|
}
|
|
else
|
|
{
|
|
if o_team[id].nselected < o_team[id].list_size-1
|
|
if state != callback($$GetServerNetworkMissionParamater$$, team_param, o_team[id].nselected, teamskin) //uses Jerry's value for the skins
|
|
mail(0,this)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if state != o_skins[id].nselected
|
|
mail(0,this)
|
|
}
|
|
}
|
|
|
|
|
|
GUI_DRAW
|
|
{
|
|
if hide_this_player[id] == FALSE && exists(p_pane) && id < num_of_players
|
|
{
|
|
if team_val == TRUE
|
|
{
|
|
if o_team[id].nselected < o_team[id].list_size-1
|
|
render p_pane, location
|
|
}
|
|
else
|
|
{
|
|
render p_pane, location
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
status_control
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int id = 0
|
|
pane p_pane
|
|
bitmap b_states
|
|
string file
|
|
int total_states
|
|
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
|
|
|
|
sound btnRolloverSound = SPATH "sfx_button7.wav"
|
|
sound btnPressedSound = SPATH "sfx_button5.wav"
|
|
}
|
|
|
|
GUI_FOCUS
|
|
{
|
|
parent.mech_button_prev = -1
|
|
}
|
|
|
|
REGION_ENTERED
|
|
{
|
|
play btnRolloverSound, 1
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
if hosting && player_num == id
|
|
{
|
|
state = 2
|
|
}
|
|
|
|
if hosting == false && player_num == id
|
|
{
|
|
state = 1
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
blit b_states(0,buttonsize*state to getwidth(b_states), buttonsize*(state+1)), 0,0 on p_pane
|
|
update(p_pane)
|
|
}
|
|
|
|
GUI_UNFOCUS
|
|
{
|
|
// deactivate(parent.o_bot_status_droplist)
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
focus(this)
|
|
|
|
// if state is 0, the control is deactivated
|
|
// if (state == 0) && id == num_of_players
|
|
// {
|
|
// mail(2000, this)
|
|
// return
|
|
// }
|
|
|
|
if (mouse.left == BUTTON_CLICKED)
|
|
{
|
|
if state == total_states
|
|
{
|
|
state = 0
|
|
}
|
|
|
|
if hosting == false && state == 3
|
|
{
|
|
state = 2
|
|
}
|
|
|
|
if hosting == true
|
|
{
|
|
// Kills the bot
|
|
if o_block_controls[id].i_am_a_bot == TRUE
|
|
{
|
|
o_bot_status_droplist.location = location.x+getwidth(b_states),location.y,255
|
|
o_bot_status_droplist.nselected = 3
|
|
last_selection = 3
|
|
|
|
initialize (o_bot_status_droplist)
|
|
activate(o_bot_status_droplist)
|
|
focus(this)
|
|
dropped_bot = TRUE
|
|
}
|
|
else
|
|
{
|
|
if id == num_of_players //if empty slot control, prepare to add bot
|
|
{
|
|
o_add_bot_droplist.location = location.x+getwidth(b_states),location.y,255
|
|
o_add_bot_droplist.nselected = 3
|
|
last_selection = 3
|
|
|
|
initialize (o_add_bot_droplist)
|
|
activate(o_add_bot_droplist)
|
|
focus(this)
|
|
adding_bot = TRUE
|
|
}
|
|
else //if player, prepare to boot
|
|
{
|
|
o_bot_status_droplist.location = location.x+getwidth(b_states),location.y,255
|
|
o_bot_status_droplist.nselected = 3
|
|
last_selection = 3
|
|
|
|
initialize (o_bot_status_droplist)
|
|
activate(o_bot_status_droplist)
|
|
focus(this)
|
|
dropped_player = TRUE
|
|
}
|
|
}
|
|
|
|
if player_num != id
|
|
{
|
|
if state == 1 or state == 2
|
|
{
|
|
state = 3
|
|
}
|
|
else
|
|
if state == 3
|
|
{
|
|
state = 4
|
|
}
|
|
else
|
|
if state == 4
|
|
{
|
|
state = 0
|
|
}
|
|
else
|
|
if state == 0
|
|
{
|
|
state = 3
|
|
}
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
if state != 2
|
|
{
|
|
string temp_name3
|
|
int number3 = 1
|
|
int launched3 = callback($$GetPlayerConnectionLaunched$$,number3,temp_name3)
|
|
|
|
if (launched3)
|
|
{
|
|
int seconds_to_go = 0
|
|
callback($$GetTimeToLaunchLock$$,seconds_to_go)
|
|
int join3 = JOIN_IN_PROGRESS_PARAMETER
|
|
int join4 = JOIN_IN_PROGRESS_CUTOFF_PARAMETER
|
|
if ((callback($$GetServerNetworkMissionParamater$$, join3) == FALSE) || ((callback($$GetServerNetworkMissionParamater$$, join4) == TRUE) && (seconds_to_go == 0)))
|
|
{
|
|
state = 1
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
|
|
o_mechbay_button.state = 0
|
|
}
|
|
else
|
|
{
|
|
state = 2
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_WAITING)
|
|
callback($$SetClientReady$$)
|
|
o_mechbay_button.state = 3
|
|
}
|
|
}
|
|
else
|
|
{
|
|
state = 2
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_WAITING)
|
|
callback($$SetClientReady$$)
|
|
o_mechbay_button.state = 3
|
|
}
|
|
}
|
|
else
|
|
{
|
|
state = 1
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
|
|
o_mechbay_button.state = 0
|
|
}
|
|
}
|
|
|
|
blit b_states(0,buttonsize*state to getwidth(b_states), buttonsize*(state+1)), 0,0 on p_pane
|
|
update(p_pane)
|
|
mail(id)
|
|
|
|
if hosting == TRUE
|
|
{
|
|
if state == 0
|
|
{
|
|
player_indentification[id] = 0 // this is empty
|
|
}
|
|
else
|
|
if state == 1
|
|
{
|
|
if player_num != id
|
|
player_indentification[id] = 2 // this is opponent
|
|
else
|
|
player_indentification[id] = 1 // this is me
|
|
}
|
|
else
|
|
if state == 3
|
|
{
|
|
player_indentification[id] = 4 // this is banned
|
|
}
|
|
else
|
|
if state == 4
|
|
{
|
|
player_indentification[id] = 3 // this is AI
|
|
}
|
|
}
|
|
|
|
play btnPressedSound, 1
|
|
}
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
if (dropped_bot)
|
|
{
|
|
if last_selection != o_bot_status_droplist.nselected
|
|
{
|
|
deactivate(o_bot_status_droplist)
|
|
if o_bot_status_droplist.nselected == 0
|
|
{
|
|
callback($$RemoveBot$$,parent.o_block_controls[id].bot_number)
|
|
}
|
|
o_bot_status_droplist.nselected = 3
|
|
dropped_bot = false
|
|
}
|
|
|
|
}
|
|
|
|
if (dropped_player)
|
|
{
|
|
if last_selection != o_bot_status_droplist.nselected
|
|
{
|
|
deactivate(o_bot_status_droplist)
|
|
if o_bot_status_droplist.nselected == 0
|
|
{
|
|
callback($$KickPlayer$$,parent.o_block_controls[id].player_number)
|
|
}
|
|
o_bot_status_droplist.nselected = 3
|
|
dropped_player = false
|
|
}
|
|
}
|
|
|
|
if (adding_bot)
|
|
{
|
|
if last_selection != o_add_bot_droplist.nselected
|
|
{
|
|
deactivate(o_add_bot_droplist)
|
|
if o_add_bot_droplist.nselected == 0
|
|
{
|
|
mail(2000)
|
|
}
|
|
o_add_bot_droplist.nselected = 3
|
|
adding_bot = false
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
if hide_this_player[id] == FALSE
|
|
{
|
|
render p_pane, location
|
|
}
|
|
}
|
|
}
|
|
|
|
jstandard_button
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int logicstate = 0 //
|
|
int listdown = false //
|
|
framerate = 20
|
|
int over_me = false
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if (mouse.left == BUTTON_PRESSED)
|
|
{
|
|
listdown = true
|
|
play press,1
|
|
}
|
|
else
|
|
if (mouse.left == BUTTON_CLICKED)
|
|
{
|
|
listdown = false
|
|
logicstate = !logicstate // logicstate = the opposite of its current value (on/off)
|
|
mail(logicstate) // send this state to GOS Script's mailbox
|
|
}
|
|
}
|
|
|
|
REGION_ENTERED
|
|
{
|
|
// hipoint++
|
|
over_me = true
|
|
|
|
|
|
}
|
|
|
|
REGION_EXITED
|
|
{
|
|
// hipoint--
|
|
over_me = false
|
|
if (logicstate)
|
|
{
|
|
listdown = false
|
|
logicstate = 0 // logicstate = the opposite of its current value (on/off)
|
|
mail(logicstate) // send this state to GOS Script's mailbox
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
jstandard_droplist
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 350,260,5
|
|
object dropbutton = jstandard_button
|
|
|
|
string optiontext[256]
|
|
|
|
int blink = false
|
|
int num_options // number of options = 0
|
|
int dlwidth = 120 // width of box?
|
|
int dlheight = 14 // height of text
|
|
int sel_option = 0 // selected option value?
|
|
int dropped= 0 // whether the list is showing or not variable
|
|
int over_me = false
|
|
int disabled = false
|
|
framerate = 20
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
dropbutton.location = location
|
|
dropbutton.region = 0,0 to dlwidth,dlheight
|
|
}
|
|
|
|
REGION_ENTERED
|
|
{
|
|
hipoint++
|
|
over_me = true
|
|
|
|
}
|
|
|
|
REGION_EXITED
|
|
{
|
|
hipoint--
|
|
if over_me
|
|
{
|
|
dropped = 0
|
|
location.z = 10
|
|
|
|
region = 0,0 to 0,0
|
|
dropbutton.logicstate = 0 // resets logic state
|
|
over_me = false
|
|
}
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if (mouse.left == BUTTON_CLICKED && dropped = 1) // if left mouse button is pressed while the list is dropped
|
|
{
|
|
play press,1
|
|
sel_option = (mouse.y - (location.y+dlheight+1)) / dlheight
|
|
dropped = 0
|
|
location.z = 10
|
|
|
|
region = 0,0 to 0,0
|
|
dropbutton.logicstate = 0 // resets logic state
|
|
mail(sel_option) // sends the selected option to mailbox
|
|
}
|
|
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
if (sender == dropbutton) // if passed by the dropbutton object
|
|
{
|
|
if (getmessage()) // if message is true
|
|
{
|
|
dropped = 1
|
|
location.z = 15
|
|
region = 0,dlheight to dlwidth, (dlheight*(1+num_options)) // increase region to accomodate bo
|
|
}
|
|
else // if message is false
|
|
{
|
|
dropped = 0 // turn off list
|
|
location.z = 10
|
|
region = 0,0 to 0,0 // reduce region
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
blink = !blink
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
if dropbutton.over_me
|
|
{
|
|
setpencolor(0x66000000)
|
|
drawrect location.x-1, location.y-1 to location.x+dlwidth, location.y+dlheight+1
|
|
}
|
|
|
|
|
|
if disabled == false
|
|
{
|
|
|
|
setpencolor(0x66000000) // set color to white
|
|
drawrect location.x, location.y to location.x+dlwidth, location.y+dlheight+1 // draw box
|
|
setpencolor(0xffffffff)
|
|
// setpencolor(0xff00ff00)
|
|
|
|
print3d_margins = 0,0 to 800,600 // big margins
|
|
print3d_attributes = gFont3d, 0xffffffff, 1,0,1,0,0 // what attributes?
|
|
print3d_position = location.x+2,location.y+2 // print here
|
|
print3d optiontext[sel_option] // print the currently selected option
|
|
|
|
// drawframe location.x-1,location.y-1 to location.x+dlwidth, location.y+dlheight+1 // draw frame on list box
|
|
render droplist_button, location.x-8,location.y-8
|
|
|
|
if dropbutton.over_me
|
|
{
|
|
render droplist_button_glow, location.x-8,location.y-8
|
|
}
|
|
if (dropped) // if dropped = 1
|
|
{
|
|
|
|
setpencolor(0xee000000) // set color to white
|
|
drawrect location.x-1, location.y+(dlheight)+2 to location.x+dlwidth, location.y+((num_options+1)*dlheight)+3 // variable size box
|
|
for(int z= 0; z < num_options;z++) // loop to draw list of names
|
|
{
|
|
print3d_position = location.x+2, location.y+((z+1)*dlheight)+4 // set position using loop val z
|
|
if mouse.y > location.y+(dlheight*(z+1)) && mouse.y < location.y+(dlheight*(z+2))+1
|
|
{
|
|
setpencolor(0x660000ff)
|
|
// setpencolor(0x77005500)
|
|
drawrect location.x, location.y+(dlheight*(z+1))+2 to location.x+dlwidth, location.y+(dlheight*(z+1))+dlheight+2
|
|
}
|
|
|
|
if (sel_option = z) // if z = selected option then
|
|
print3d_attributes = gFont3d,0x66ffffff,1,0,1,0,0 // set color to selected color
|
|
// print3d_attributes = gFont3d,0x77ffff00,1,0,1,0,0 // set color to selected color
|
|
else
|
|
print3d_attributes = gFont3d,0xffffffff,1,0,1,0,0 // set color to unselected color
|
|
// print3d_attributes = gFont3d,0xffffff00,1,0,1,0,0 // set color to unselected color
|
|
print3d optiontext[z]
|
|
}
|
|
setpencolor(0xffffffff)
|
|
// setpencolor(0xff00ff00)
|
|
drawframe location.x-1,location.y+dlheight+1 to location.x+dlwidth, location.y+(dlheight*(1+num_options))+3 //draw frame on list box
|
|
if blink
|
|
{
|
|
render down_arrow, (location.x+dlwidth-16),location.y
|
|
render down_arrow, (location.x+dlwidth-16),location.y
|
|
|
|
}
|
|
}
|
|
render down_arrow, (location.x+dlwidth-16),location.y
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
block_controls
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
// region = 0,0 to 360,18
|
|
int id
|
|
int prev = -1
|
|
int prev_player_num = -1
|
|
int team_play
|
|
int prev_i_am_a_bot = 0
|
|
int i_am_a_bot = 0
|
|
int bot_number
|
|
int player_number
|
|
|
|
framerate = 20
|
|
}
|
|
|
|
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
if hosting == true
|
|
{
|
|
if prev_player_num != player_num
|
|
{
|
|
|
|
if id == player_num && dedicated_server_flag == false
|
|
{
|
|
|
|
activate(o_mech_variant[id])
|
|
activate(o_mech_variant2[id])
|
|
activate(o_skin_box[id])
|
|
team_play = callback($$GetLocalNetworkMissionParamater$$, team_allowed)
|
|
if team_play == TRUE
|
|
{
|
|
if hide_this_player[id] == FALSE
|
|
{
|
|
deactivate(o_skins[id])
|
|
activate(o_team[id])
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if hide_this_player[id] == FALSE
|
|
{
|
|
deactivate(o_team[id])
|
|
activate(o_skins[id])
|
|
}
|
|
}
|
|
|
|
if hide_this_player[id] == FALSE
|
|
activate(o_status[id])
|
|
}
|
|
else
|
|
{
|
|
// region = 0,0 to 360,18
|
|
|
|
deactivate (o_mech_variant[id])
|
|
deactivate (o_mech_variant2[id])
|
|
// deactivate(o_team[id])
|
|
|
|
// if hosting == false
|
|
// deactivate(o_status[id])
|
|
//////////////////Added so you can kick people out
|
|
o_status[id].region = 0,0 to getwidth(o_status[id].b_states),o_status[id].buttonsize
|
|
// o_status[id].region = 0,0 to 0,0
|
|
}
|
|
|
|
// prev = player_indentification[id]
|
|
prev_player_num = player_num
|
|
mail(-1,o_roster_list_scroll_controls)
|
|
}
|
|
|
|
if (prev_i_am_a_bot != i_am_a_bot)
|
|
{
|
|
if (i_am_a_bot)
|
|
{
|
|
// region = 0,0 to 0,0
|
|
|
|
activate(o_mech_variant[id])
|
|
activate(o_mech_variant2[id])
|
|
activate(o_skin_box[id])
|
|
team_play = callback($$GetLocalNetworkMissionParamater$$, team_allowed)
|
|
|
|
////////////////////Added so you can kick the bot out
|
|
o_status[id].region = 0,0 to getwidth(o_status[id].b_states),o_status[id].buttonsize
|
|
// o_status[id].region = 0,0 to 0,0
|
|
activate(o_status[id])
|
|
|
|
}
|
|
else
|
|
{
|
|
deactivate (o_mech_variant[id])
|
|
deactivate (o_mech_variant2[id])
|
|
// deactivate(o_team[id])
|
|
// o_status[id].region = 0,0 to 0,0
|
|
}
|
|
|
|
prev_i_am_a_bot = i_am_a_bot
|
|
mail(-1,o_roster_list_scroll_controls)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if prev_player_num != player_num
|
|
{
|
|
if id == player_num
|
|
{
|
|
activate(o_mech_variant[id])
|
|
activate(o_mech_variant2[id])
|
|
activate(o_skin_box[id])
|
|
team_play = callback($$GetServerNetworkMissionParamater$$, team_allowed)
|
|
if team_play == TRUE
|
|
{
|
|
if hide_this_player[id] == FALSE && o_mechbay_button.state != 3
|
|
{
|
|
deactivate(o_skins[id])
|
|
activate(o_team[id])
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if hide_this_player[id] == FALSE && o_mechbay_button.state != 3
|
|
{
|
|
deactivate(o_team[id])
|
|
activate(o_skins[id])
|
|
}
|
|
}
|
|
|
|
if hide_this_player[id] == FALSE
|
|
activate(o_status[id])
|
|
|
|
// make sure the region is correct
|
|
o_status[id].region = 0,0 to getwidth(o_status[id].b_states),o_status[id].buttonsize
|
|
}
|
|
else
|
|
{
|
|
deactivate (o_mech_variant[id])
|
|
deactivate (o_mech_variant2[id])
|
|
o_status[id].region = 0,0 to 0,0
|
|
}
|
|
|
|
prev_player_num = player_num
|
|
mail(-1,o_roster_list_scroll_controls)
|
|
}
|
|
else
|
|
{
|
|
if id == player_num
|
|
{
|
|
if (o_status[id].state == 2)
|
|
{
|
|
deactivate(o_mech_variant[id])
|
|
deactivate(o_mech_variant2[id])
|
|
deactivate(o_team[id])
|
|
}
|
|
else
|
|
{
|
|
if hide_this_player[id] == FALSE
|
|
{
|
|
activate(o_mech_variant[id])
|
|
activate(o_mech_variant2[id])
|
|
activate(o_skin_box[id])
|
|
}
|
|
|
|
team_play = callback($$GetServerNetworkMissionParamater$$, team_allowed)
|
|
if team_play == TRUE
|
|
{
|
|
if hide_this_player[id] == FALSE && o_mechbay_button.state != 3
|
|
{
|
|
deactivate(o_skins[id])
|
|
activate(o_team[id])
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if hide_this_player[id] == FALSE && o_mechbay_button.state != 3
|
|
{
|
|
deactivate(o_team[id])
|
|
activate(o_skins[id])
|
|
}
|
|
}
|
|
|
|
if hide_this_player[id] == FALSE
|
|
activate(o_status[id])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
if hide_this_player[id] == FALSE
|
|
{
|
|
if hosting
|
|
{
|
|
print3d_attributes = screen_font, name_color[id],1,0,1,0,0,just_left,1
|
|
team_play = callback($$GetLocalNetworkMissionParamater$$, team_allowed)
|
|
|
|
if (id != player_num && (!i_am_a_bot))
|
|
{
|
|
if length$(o_print_name[id].text) > 0
|
|
{
|
|
print3d_margins = 180, location.y to 200+o_mech_variant[id].itemWidth,location.y+o_mech_variant[id].itemHeight
|
|
print3d_position = 185,location.y+2
|
|
print3d mechlist[o_mech_variant[id].nselected]
|
|
|
|
print3d_margins = 70, location.y+22 to 300,location.y+44
|
|
print3d_position = 75,location.y+24
|
|
print3d faction_name[id]
|
|
}
|
|
|
|
print3d_margins = 333, location.y to 368+o_mech_variant[id].itemWidth,location.y+o_mech_variant[id].itemHeight
|
|
|
|
if team_play == TRUE
|
|
{
|
|
print3d_position = 338,location.y+2
|
|
if length$(o_print_name[id].text) > 0 && o_team[id].nselected > -1
|
|
print3d teamstring[o_team[id].nselected]
|
|
}
|
|
else
|
|
{
|
|
print3d_position = 335,location.y+2
|
|
if length$(o_print_name[id].text) > 0
|
|
{
|
|
if skin_ids[id] < 37
|
|
print3d skin_ids[id]
|
|
else
|
|
{
|
|
print3d " "
|
|
//o_skins[id].nselected = 3
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
print3d_margins = 70, location.y+22 to 300,location.y+44
|
|
print3d_position = 75,location.y+24
|
|
print3d faction_name[id]
|
|
|
|
print3d_margins = 333, location.y to 368+o_mech_variant[id].itemWidth,location.y+8+o_mech_variant[id].itemHeight
|
|
print3d_position = 335,location.y+2
|
|
if length$(o_print_name[id].text) > 0
|
|
print3d skin_ids[id]
|
|
}
|
|
}
|
|
else
|
|
{
|
|
print3d_attributes = screen_font, name_color[id],1,0,1,0,0,just_left,1
|
|
team_play = callback($$GetServerNetworkMissionParamater$$, team_allowed)
|
|
|
|
if ((id != player_num) || (id == player_num && o_status[id].state == 2))
|
|
{
|
|
if length$(o_print_name[id].text) > 0
|
|
{
|
|
print3d_margins = 180, location.y to 200+o_mech_variant[id].itemWidth,location.y+o_mech_variant[id].itemHeight
|
|
print3d_position = 185,location.y+2
|
|
|
|
if (id != player_num)
|
|
{
|
|
// MSL ADD MECH
|
|
if o_mech_variant[id].nselected > -1 && o_mech_variant[id].nselected < 54
|
|
print3d mechlist[o_mech_variant[id].nselected]
|
|
}
|
|
else
|
|
{
|
|
// MSL ADD MECH
|
|
if o_mech_variant[id].nselected > -1 && o_mech_variant[id].nselected < 54
|
|
print3d o_mech_variant[id].list_item[o_mech_variant[id].nselected]
|
|
}
|
|
|
|
print3d_margins = 70, location.y+22 to 300,location.y+44
|
|
print3d_position = 75,location.y+24
|
|
print3d faction_name[id]
|
|
}
|
|
|
|
print3d_margins = 333, location.y to 368+o_mech_variant[id].itemWidth,location.y+o_mech_variant[id].itemHeight
|
|
|
|
if team_play == TRUE
|
|
{
|
|
print3d_position = 338,location.y+2
|
|
if length$(o_print_name[id].text) > 0 && o_team[id].nselected > -1
|
|
print3d teamstring[o_team[id].nselected]
|
|
}
|
|
else
|
|
{
|
|
print3d_position = 335,location.y+2
|
|
if length$(o_print_name[id].text) > 0
|
|
{
|
|
if skin_ids[id] < 37
|
|
print3d skin_ids[id]
|
|
else
|
|
{
|
|
print3d " "
|
|
//o_skins[id].nselected = 3
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
print3d_margins = 70, location.y+22 to 300,location.y+44
|
|
print3d_position = 75,location.y+24
|
|
print3d faction_name[id]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
update_names
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int loopmaster
|
|
int host_last_num = -1
|
|
int host_last_val = -1
|
|
int host_last_val2 = -1
|
|
int host_last_status = 0
|
|
int host_last_ready = 0
|
|
int host_last_team = -1
|
|
int host_last_skin = -1
|
|
int host_last_teams_num
|
|
int host_bot_last_val[256]
|
|
int host_bot_last_val2[256]
|
|
int host_bot_last_skin[256]
|
|
int host_bot_last_player_num[256]
|
|
int host_bot_from_file[256]
|
|
for (int i = 0; i < 256; i++)
|
|
{
|
|
host_bot_last_val[i] = -1
|
|
host_bot_last_val2[i] = -1
|
|
host_bot_last_player_num[i] = -1
|
|
host_bot_last_skin[i] = 0
|
|
host_bot_from_file[i] = 0
|
|
}
|
|
int team_roster_count[9]
|
|
|
|
if dedicated_server_flag == false
|
|
{
|
|
host_last_num = player_num
|
|
host_last_val = o_mech_variant[player_num].nSelected
|
|
host_last_val2 = o_mech_variant2[player_num].nSelected
|
|
host_last_status = o_status[player_num].state
|
|
}
|
|
|
|
framerate = 5
|
|
|
|
object o_error
|
|
|
|
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)
|
|
|
|
int team_request_through = 0
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
// used to prevent user from launching team game without people being on teams
|
|
block_launch_or_ready = FALSE
|
|
|
|
int valid_player
|
|
int a
|
|
string temp_name
|
|
string temp_faction
|
|
int valid_count = 1
|
|
|
|
int team
|
|
int ready
|
|
int chasis
|
|
int launched
|
|
|
|
int teams
|
|
|
|
int return_value = 0
|
|
int accepted = 0
|
|
|
|
num_of_players = 0 //reset the number to recalc # of players
|
|
|
|
for int loopit = 0;loopit <8; loopit++
|
|
{
|
|
team_roster_count[loopit] = 0
|
|
}
|
|
|
|
if hosting
|
|
{
|
|
team_val = callback($$GetLocalNetworkMissionParamater$$, team_allowed)
|
|
teams = callback($$GetLocalNetworkMissionParamater$$, num_of_teams)
|
|
}
|
|
else
|
|
{
|
|
team_val = callback($$GetServerNetworkMissionParamater$$, team_allowed)
|
|
teams = callback($$GetServerNetworkMissionParamater$$, num_of_teams)
|
|
}
|
|
|
|
int updating_teams
|
|
int counter
|
|
|
|
int max_show
|
|
int min_show
|
|
int total_max_show
|
|
int pass_a_null
|
|
|
|
for(a=0;a<255;a++)
|
|
{
|
|
valid_player = callback($$IsPlayerConnectionValid$$,a)
|
|
|
|
if (dedicated_server_flag == TRUE && a == 1)
|
|
{
|
|
if hosting
|
|
{
|
|
if team_val == TRUE
|
|
{
|
|
activate(o_max_tonnage)
|
|
activate(o_min_tonnage)
|
|
activate(o_total_max_tonnage)
|
|
activate(o_team_selection)
|
|
}
|
|
else
|
|
{
|
|
deactivate(o_max_tonnage)
|
|
deactivate(o_min_tonnage)
|
|
deactivate(o_total_max_tonnage)
|
|
deactivate(o_team_selection)
|
|
}
|
|
|
|
}
|
|
}
|
|
else
|
|
if (valid_player) //Don't think I need this > && dedicated_server_flag = FALSE
|
|
{
|
|
// make sure even when player moves around list, the pleyer_num change appropriately
|
|
if a == Callback($$MyPlayerId$$)
|
|
player_num = (valid_count-1)
|
|
|
|
callback($$GetPlayerConnectionName$$,a,temp_name)
|
|
callback($$GetPlayerConnectionClan$$,a,faction_name[valid_count-1])
|
|
ready = callback($$GetPlayerConnectionReady$$,a,temp_name)
|
|
launched = callback($$GetPlayerConnectionLaunched$$,a,temp_name)
|
|
chasis = callback($$GetPlayerConnectionChasis$$,a,temp_name)
|
|
team = callback($$GetPlayerConnectionTeam$$,a,temp_name)
|
|
skin_id = callback($$GetPlayerConnectionSkin$$,a)
|
|
|
|
|
|
o_block_controls[valid_count-1].i_am_a_bot = 0
|
|
o_block_controls[valid_count-1].player_number = a
|
|
|
|
if valid_count-1 == player_num && ((dedicated_server_flag == false) || (hosting == false && dedicated_server_flag == TRUE)) //if your value on list matches the current, don't update from dev
|
|
{
|
|
if update_team == 0
|
|
o_team[valid_count-1].nselected = team
|
|
else
|
|
if o_team[valid_count-1].nselected == team
|
|
update_team = 1
|
|
|
|
if o_mech_variant[valid_count-1].nselected = 0
|
|
o_team[valid_count-1].nselected = 8
|
|
|
|
if update_skin
|
|
{
|
|
callback($$SelectSkin$$,o_skins[player_num].nSelected)
|
|
|
|
callback($$SetTeamDecal$$, team_decal_full_name[o_teamdecal.sel_option])
|
|
callback($$SetPilotDecal$$, pilot_decal_full_name[o_pilotdecal.sel_option])
|
|
stock_mech_selected = o_mech_variant[player_num].nselected
|
|
variant_mech_selected = o_mech_variant2[player_num].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech[mech_selected], o_skin.optiontext[o_skin.sel_option])
|
|
callback($$SendVehicleRequest$$)
|
|
mail(-1, o_background)
|
|
update_skin = false
|
|
}
|
|
else
|
|
{
|
|
if skin_id > -1 && skin_id < 37
|
|
{
|
|
o_skins[valid_count-1].nselected = skin_id
|
|
skin_ids[valid_count-1] = skin_id+1
|
|
}
|
|
|
|
if skin_id == 36
|
|
{
|
|
o_skins[valid_count-1].nselected = 3
|
|
callback($$SelectSkin$$,o_skins[valid_count-1].nselected)
|
|
|
|
callback($$SetTeamDecal$$, team_decal_full_name[o_teamdecal.sel_option])
|
|
callback($$SetPilotDecal$$, pilot_decal_full_name[o_pilotdecal.sel_option])
|
|
stock_mech_selected = o_mech_variant[player_num].nselected
|
|
variant_mech_selected = o_mech_variant2[player_num].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech[mech_selected], o_skin.optiontext[o_skin.sel_option])
|
|
callback($$SendVehicleRequest$$)
|
|
mail(-1, o_background)
|
|
}
|
|
}
|
|
|
|
if team_val == TRUE//and o_team[player_num].droppedflag == false
|
|
{
|
|
activate(o_max_tonnage)
|
|
activate(o_min_tonnage)
|
|
activate(o_total_max_tonnage)
|
|
|
|
|
|
if hosting
|
|
{
|
|
teams = callback($$GetLocalNetworkMissionParamater$$, num_of_teams)
|
|
}
|
|
else
|
|
{
|
|
teams = callback($$GetServerNetworkMissionParamater$$, num_of_teams)
|
|
}
|
|
|
|
// block launch or ready if no team selected
|
|
if o_team[valid_count-1].nselected >= teams && o_mech_variant[valid_count-1].nselected != 0
|
|
block_launch_or_ready = TRUE
|
|
|
|
if teams != host_last_teams_num
|
|
{
|
|
for updating_teams = 0; updating_teams < 16; updating_teams++
|
|
{
|
|
o_team[updating_teams].list_size = teams+1
|
|
if hosting
|
|
o_team_selection.list_size = teams+1
|
|
|
|
for counter = 0; counter < teams; counter++
|
|
{
|
|
o_team[updating_teams].list_item[counter] = conv$(counter+1)
|
|
if hosting
|
|
o_team_selection.list_item[counter] = conv$(counter+1)
|
|
}
|
|
|
|
o_team[updating_teams].list_item[counter] = localize$(IDS_MP_LOBBY_DASH)
|
|
|
|
if o_team[updating_teams].nselected > counter
|
|
o_team[updating_teams].nselected = counter
|
|
|
|
initialize(o_team[updating_teams])
|
|
|
|
if hosting
|
|
{
|
|
o_team_selection.list_item[counter] = localize$(IDS_MP_LOBBY_ALL_TEAMS)
|
|
|
|
// if o_team_selection.nselected > counter
|
|
// o_team_selection.nselected = counter
|
|
|
|
initialize(o_team_selection)
|
|
}
|
|
|
|
}
|
|
|
|
host_last_teams_num = teams
|
|
}
|
|
|
|
if hosting
|
|
{
|
|
activate(o_team_selection)
|
|
}
|
|
else // update tonnage display for client
|
|
{
|
|
if o_team[player_num].nselected < o_team[player_num].list_size-1
|
|
{
|
|
o_max_tonnage.nselected =0
|
|
o_min_tonnage.nselected = 0
|
|
o_total_max_tonnage.nselected =0
|
|
|
|
max_show = callback($$GetServerNetworkMissionParamater$$, team_param, o_team[player_num].nselected, max_tonnage)
|
|
min_show = callback($$GetServerNetworkMissionParamater$$, team_param, o_team[player_num].nselected, min_tonnage)
|
|
total_max_show = callback($$GetServerNetworkMissionParamater$$, team_param, o_team[player_num].nselected, total_max_tonnage)
|
|
|
|
if min_show < 25 or min_show > 100
|
|
min_show = 25
|
|
|
|
if max_show > 100 or max_show < 25
|
|
max_show = 100
|
|
|
|
if total_max_show > 1600 or total_max_show < 100
|
|
total_max_show = 1600
|
|
|
|
if (makeint(o_max_tonnage.list_item[0]) != max_show)
|
|
o_background.submitted = 1
|
|
if (makeint(o_min_tonnage.list_item[0]) != min_show)
|
|
o_background.submitted = 1
|
|
if (makeint(o_total_max_tonnage.list_item[0]) != total_max_show)
|
|
o_background.submitted = 1
|
|
|
|
o_max_tonnage.list_item[0] = conv$(max_show)
|
|
o_min_tonnage.list_item[0] = conv$(min_show)
|
|
o_total_max_tonnage.list_item[0] = conv$(total_max_show)
|
|
}
|
|
else
|
|
{
|
|
o_max_tonnage.nselected =0
|
|
o_min_tonnage.nselected = 0
|
|
o_total_max_tonnage.nselected = 0
|
|
|
|
o_max_tonnage.list_item[0] = "--"
|
|
o_min_tonnage.list_item[0] = "--"
|
|
o_total_max_tonnage.list_item[0] = "--"
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if team_val == FALSE
|
|
{
|
|
deactivate(o_team[player_num])
|
|
deactivate(o_max_tonnage)
|
|
deactivate(o_min_tonnage)
|
|
deactivate(o_total_max_tonnage)
|
|
if hide_this_player[player_num] == FALSE
|
|
{
|
|
if o_status[player_num].state != 2 or hosting == TRUE //prevents skins from showing when you are 'ready'
|
|
activate(o_skins[player_num])
|
|
else
|
|
deactivate(o_skins[player_num])
|
|
|
|
activate(o_skin_box[player_num])
|
|
}
|
|
|
|
if hosting
|
|
{
|
|
deactivate(o_team_selection)
|
|
o_launch_button.state = 0
|
|
deactivate(o_pickteam_button)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
deactivate(o_skins[player_num])
|
|
|
|
if hide_this_player[player_num] == FALSE
|
|
{
|
|
if (hosting == true) or ((hosting == false && o_mechbay_button.state != 3) && o_status[player_num].state == 0)
|
|
activate(o_team[player_num])
|
|
|
|
activate(o_skin_box[player_num])
|
|
}
|
|
}
|
|
|
|
if (player_num != host_last_num)
|
|
{
|
|
o_team[player_num].nSelected = host_last_team
|
|
o_skins[player_num].nSelected = host_last_skin
|
|
}
|
|
else
|
|
{
|
|
|
|
if ((o_team[player_num].nSelected == teams) && (team != teams))
|
|
{
|
|
int pass_a_null = 8
|
|
callback($$RequestTeam$$, pass_a_null)
|
|
team = 8
|
|
}
|
|
else
|
|
{
|
|
if (team_request_through)
|
|
{
|
|
if (team == o_team[player_num].nSelected)
|
|
{
|
|
callback($$SetTeamDecal$$, team_decal_full_name[o_teamdecal.sel_option])
|
|
callback($$SetPilotDecal$$, pilot_decal_full_name[o_pilotdecal.sel_option])
|
|
stock_mech_selected = o_mech_variant[player_num].nselected
|
|
variant_mech_selected = o_mech_variant2[player_num].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech[mech_selected], o_skin.optiontext[o_skin.sel_option])
|
|
callback($$SendVehicleRequest$$)
|
|
mail(-1, o_background)
|
|
team_request_through = 0
|
|
}
|
|
}
|
|
}
|
|
|
|
host_last_team = o_team[player_num].nSelected
|
|
host_last_skin = o_skins[player_num].nSelected
|
|
}
|
|
|
|
if (player_num != host_last_num)
|
|
{
|
|
o_mech_variant[player_num].nselected = host_last_val
|
|
o_mech_variant2[player_num].nselected = host_last_val2
|
|
}
|
|
else
|
|
{
|
|
if ((o_mech_variant[player_num].nselected != host_last_val) || (o_mech_variant2[player_num].nselected != host_last_val2))
|
|
{
|
|
callback($$SetTeamDecal$$, team_decal_full_name[o_teamdecal.sel_option])
|
|
callback($$SetPilotDecal$$, pilot_decal_full_name[o_pilotdecal.sel_option])
|
|
stock_mech_selected = o_mech_variant[player_num].nselected
|
|
variant_mech_selected = o_mech_variant2[player_num].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech[mech_selected], o_skin.optiontext[o_skin.sel_option])
|
|
callback($$SendVehicleRequest$$)
|
|
mail(-1, o_background)
|
|
host_last_val = o_mech_variant[player_num].nselected
|
|
host_last_val2 = o_mech_variant2[player_num].nselected
|
|
}
|
|
}
|
|
|
|
if (player_num != host_last_num)
|
|
{
|
|
if ((ready == 0) && (host_last_ready == 1) && (host_last_status == 2))
|
|
{
|
|
o_status[player_num].state = 1
|
|
host_last_status = o_status[player_num].state
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
o_mechbay_button.state = 0
|
|
}
|
|
|
|
o_status[player_num].state = host_last_status
|
|
}
|
|
else
|
|
{
|
|
if (hosting == false)
|
|
{
|
|
if ((ready == 1) && (o_status[player_num].state == 1))
|
|
{
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
callback($$SetClientUnready$$)
|
|
}
|
|
|
|
if ((ready == 0) && (host_last_ready == 1) && (host_last_status == 2))
|
|
{
|
|
o_status[player_num].state = 1
|
|
host_last_status = o_status[player_num].state
|
|
o_ready_button.text = localize$(IDS_MP_LOBBY_READY)
|
|
o_mechbay_button.state = 0
|
|
}
|
|
|
|
if host_last_status != o_status[player_num].state
|
|
{
|
|
host_last_status = o_status[player_num].state
|
|
}
|
|
}
|
|
}
|
|
|
|
host_last_ready = ready
|
|
|
|
host_last_num = player_num
|
|
|
|
name_color[valid_count-1] = packcolor(255,255,255,255)
|
|
|
|
num_of_players++
|
|
}
|
|
else
|
|
{
|
|
// fill it with Jerry's values
|
|
|
|
o_mech_variant[valid_count-1].nselected = chasis
|
|
o_team[valid_count-1].nselected = team
|
|
|
|
if hide_this_player[valid_count-1] == FALSE
|
|
{
|
|
deactivate(o_team[valid_count-1])
|
|
deactivate(o_skins[valid_count-1])
|
|
activate(o_skin_box[valid_count-1])
|
|
activate(o_status[valid_count-1])
|
|
}
|
|
|
|
if skin_id > -1 && skin_id < 37
|
|
{
|
|
o_skins[valid_count-1].nselected = skin_id
|
|
skin_ids[valid_count-1] = skin_id+1
|
|
}
|
|
|
|
|
|
if valid_count-1 == 0 && dedicated_server_flag == false
|
|
{
|
|
o_status[0].state = 2 //host is always ready
|
|
if (launched)
|
|
name_color[valid_count-1] = packcolor(255,255,255,100)
|
|
else
|
|
name_color[valid_count-1] = packcolor(255,255,255,255)
|
|
}
|
|
else
|
|
{
|
|
if (ready)
|
|
{
|
|
if (launched)
|
|
{
|
|
o_status[valid_count-1].state = 2
|
|
name_color[valid_count-1] = packcolor(255,255,255,100)
|
|
}
|
|
else
|
|
{
|
|
o_status[valid_count-1].state = 2
|
|
name_color[valid_count-1] = packcolor(255,255,255,255)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
o_status[valid_count-1].state = 1
|
|
name_color[valid_count-1] = packcolor(255,255,255,255)
|
|
}
|
|
}
|
|
}
|
|
|
|
num_of_players++
|
|
team_roster_count[team]++
|
|
o_print_name[valid_count-1].text = temp_name
|
|
|
|
mail(0,o_status[valid_count-1]) //makes the button change image
|
|
|
|
valid_count = valid_count + 1
|
|
|
|
}
|
|
}
|
|
|
|
// Update the Bots
|
|
int mech_index = 1
|
|
for(a=0;a<16;a++)
|
|
{
|
|
valid_player = callback($$GetBotValid$$,a)
|
|
if (valid_player)
|
|
{
|
|
callback($$GetBotName$$,a,temp_name)
|
|
callback($$GetBotClan$$,a,faction_name[valid_count-1])
|
|
ready = 1
|
|
launched = 0
|
|
chasis = callback($$GetBotChasis$$,a)
|
|
team = callback($$GetBotTeam$$,a)
|
|
skin_ids[valid_count-1] = 4
|
|
o_skins[valid_count-1].nselected = 3
|
|
|
|
o_block_controls[valid_count-1].i_am_a_bot = 1
|
|
o_block_controls[valid_count-1].bot_number = a
|
|
|
|
o_team[valid_count-1].nselected = team
|
|
|
|
if hosting
|
|
{
|
|
if ((host_bot_last_player_num[a] != valid_count-1) && (host_bot_last_player_num[a] != -1))
|
|
{
|
|
last_count = stock_array[host_bot_last_val[a]]
|
|
o_mech_variant2[valid_count-1].list_size = 0
|
|
do
|
|
{
|
|
o_mech_variant2[valid_count-1].list_item[o_mech_variant2[valid_count-1].list_size] = mech2[last_count]
|
|
o_mech_variant2[valid_count-1].list_size++
|
|
last_count++
|
|
if (last_count == $$m_MechCount$$)
|
|
break
|
|
}
|
|
while (stock_id[last_count] != 1)
|
|
initialize(o_mech_variant2[valid_count-1])
|
|
|
|
o_mech_variant[valid_count-1].nselected = host_bot_last_val[a]
|
|
if host_bot_last_val2[a] < 0
|
|
{
|
|
host_bot_last_val2[a] = 0
|
|
}
|
|
o_mech_variant2[valid_count-1].nselected = host_bot_last_val2[a]
|
|
o_skins[valid_count-1].nselected = host_bot_last_skin[a]
|
|
host_bot_last_skin[a] = 0
|
|
}
|
|
else
|
|
{
|
|
host_bot_last_skin[a] = o_skins[valid_count-1].nselected
|
|
|
|
if (o_mech_variant[valid_count-1].nselected == 0)
|
|
{
|
|
if (host_bot_last_val[a] == -1)
|
|
{
|
|
mech_index = 1
|
|
stock_mech_selected = 1
|
|
return_value = 0
|
|
accepted = 0
|
|
while (((return_value == 0) || (accepted == 0)) && (mech_index < $$m_MechCount$$))
|
|
{
|
|
variant_mech_selected = mech_index - stock_array[stock_mech_selected]
|
|
|
|
return_value = callback($$SetMechBot$$, a, mech_index, mech[mech_index])
|
|
|
|
accepted = callback($$GetBotVehicleAccepted$$, a)
|
|
|
|
if (!accepted)
|
|
{
|
|
int bot_last_error_count = callback($$GetBotVehicleRejectionReasonCount$$) - 1
|
|
int bot_denied_parameter = 0
|
|
int bot_last_error = callback($$GetBotVehicleRejectionReason$$, bot_last_error_count, bot_denied_parameter)
|
|
|
|
if (bot_last_error == NO_TEAM_BUILDERROR)
|
|
{
|
|
accepted = 1
|
|
}
|
|
else
|
|
{
|
|
if (mech_index == stock_array[stock_mech_selected])
|
|
stock_mech_selected++
|
|
mech_index++
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!accepted)
|
|
{
|
|
mail(-100, o_background)
|
|
stock_mech_selected = 1
|
|
variant_mech_selected = 0
|
|
}
|
|
|
|
last_count = stock_array[stock_mech_selected]
|
|
o_mech_variant2[valid_count-1].list_size = 0
|
|
do
|
|
{
|
|
o_mech_variant2[valid_count-1].list_item[o_mech_variant2[valid_count-1].list_size] = mech2[last_count]
|
|
o_mech_variant2[valid_count-1].list_size++
|
|
last_count++
|
|
if (last_count == $$m_MechCount$$)
|
|
break
|
|
}
|
|
while (stock_id[last_count] != 1)
|
|
initialize(o_mech_variant2[valid_count-1])
|
|
|
|
o_mech_variant[valid_count-1].nselected = stock_mech_selected
|
|
o_mech_variant2[valid_count-1].nselected = variant_mech_selected
|
|
host_bot_last_val[a] = o_mech_variant[valid_count-1].nselected
|
|
host_bot_last_val2[a] = o_mech_variant2[valid_count-1].nselected
|
|
}
|
|
else
|
|
{
|
|
last_count = stock_array[host_bot_last_val[a]]
|
|
o_mech_variant2[valid_count-1].list_size = 0
|
|
do
|
|
{
|
|
o_mech_variant2[valid_count-1].list_item[o_mech_variant2[valid_count-1].list_size] = mech2[last_count]
|
|
o_mech_variant2[valid_count-1].list_size++
|
|
last_count++
|
|
if (last_count == $$m_MechCount$$)
|
|
break
|
|
}
|
|
while (stock_id[last_count] != 1)
|
|
initialize(o_mech_variant2[valid_count-1])
|
|
|
|
o_mech_variant[valid_count-1].nselected = host_bot_last_val[a]
|
|
o_mech_variant2[valid_count-1].nselected = host_bot_last_val2[a]
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if ((o_mech_variant[valid_count-1].nselected != host_bot_last_val[a]) || (o_mech_variant2[valid_count-1].nselected != host_bot_last_val2[a]))
|
|
{
|
|
accepted = 0
|
|
stock_mech_selected = o_mech_variant[valid_count-1].nselected
|
|
variant_mech_selected = o_mech_variant2[valid_count-1].nselected
|
|
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
|
|
|
|
return_value = callback($$SetMechBot$$, a, mech_selected, mech[mech_selected])
|
|
accepted = callback($$GetBotVehicleAccepted$$, a)
|
|
if (return_value == true)
|
|
{
|
|
if (!accepted)
|
|
{
|
|
mail(-100, o_background)
|
|
}
|
|
|
|
host_bot_last_val[a] = o_mech_variant[valid_count-1].nselected
|
|
host_bot_last_val2[a] = o_mech_variant2[valid_count-1].nselected
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if team_val == TRUE//and o_team[valid_count-1].droppedflag == false
|
|
{
|
|
if hide_this_player[valid_count-1] == FALSE && hosting == true
|
|
{
|
|
deactivate(o_skins[valid_count-1])
|
|
activate(o_team[valid_count-1])
|
|
}
|
|
|
|
activate(o_max_tonnage)
|
|
activate(o_min_tonnage)
|
|
activate(o_total_max_tonnage)
|
|
|
|
if hosting
|
|
{
|
|
activate(o_team_selection)
|
|
}
|
|
else // update tonnage display for client
|
|
{
|
|
o_max_tonnage.nselected =0
|
|
o_min_tonnage.nselected = 0
|
|
o_total_max_tonnage.nselected = 0
|
|
|
|
int max_show = callback($$GetServerNetworkMissionParamater$$, team_param, o_team[valid_count-1].nselected, max_tonnage)
|
|
int min_show = callback($$GetServerNetworkMissionParamater$$, team_param, o_team[valid_count-1].nselected, min_tonnage)
|
|
int total_max_show = callback($$GetServerNetworkMissionParamater$$, team_param, o_team[valid_count-1].nselected, total_max_tonnage)
|
|
|
|
if min_show < 25 or min_show > 100
|
|
min_show = 25
|
|
|
|
if max_show > 100 or max_show < 25
|
|
max_show = 100
|
|
|
|
if total_max_show > 1600 or total_max_show < 100
|
|
total_max_show = 1600
|
|
|
|
o_max_tonnage.list_item[0] = conv$(max_show)
|
|
o_min_tonnage.list_item[0] = conv$(min_show)
|
|
o_total_max_tonnage.list_item[0] = conv$(total_max_show)
|
|
}
|
|
|
|
// block launch or ready if no team selected
|
|
if o_team[valid_count-1].nselected >= teams && o_mech_variant[valid_count-1].nselected != 0
|
|
block_launch_or_ready = TRUE
|
|
|
|
if teams != host_last_teams_num
|
|
{
|
|
for updating_teams = 0; updating_teams < 16; updating_teams++
|
|
{
|
|
o_team[updating_teams].list_size = teams+1
|
|
if hosting
|
|
o_team_selection.list_size = teams+1
|
|
|
|
for counter = 0; counter < teams; counter++
|
|
{
|
|
o_team[updating_teams].list_item[counter] = conv$(counter+1)
|
|
if hosting
|
|
o_team_selection.list_item[counter] = conv$(counter+1)
|
|
}
|
|
|
|
o_team[updating_teams].list_item[counter] = localize$(IDS_MP_LOBBY_DASH)
|
|
|
|
if o_team[updating_teams].nselected > counter
|
|
o_team[updating_teams].nselected = counter
|
|
|
|
initialize(o_team[updating_teams])
|
|
|
|
if hosting
|
|
{
|
|
o_team_selection.list_item[counter] = localize$(IDS_MP_LOBBY_ALL_TEAMS)
|
|
|
|
if o_team_selection.nselected > counter
|
|
o_team_selection.nselected = counter
|
|
|
|
initialize(o_team_selection)
|
|
}
|
|
|
|
}
|
|
|
|
host_last_teams_num = teams
|
|
}
|
|
|
|
if ((host_bot_last_player_num[a] != valid_count-1) && (host_bot_last_player_num[a] != -1))
|
|
{
|
|
o_team[valid_count-1].nSelected = team
|
|
}
|
|
}
|
|
|
|
if team_val == FALSE
|
|
{
|
|
deactivate(o_team[valid_count-1])
|
|
deactivate(o_max_tonnage)
|
|
deactivate(o_min_tonnage)
|
|
deactivate(o_total_max_tonnage)
|
|
deactivate(o_skins[valid_count-1])
|
|
|
|
if hosting
|
|
{
|
|
deactivate(o_team_selection)
|
|
}
|
|
|
|
o_launch_button.state = 0
|
|
deactivate(o_pickteam_button)
|
|
}
|
|
|
|
o_status[valid_count-1].state = 4
|
|
|
|
name_color[valid_count-1] = packcolor(255,255,255,255)
|
|
|
|
host_bot_last_player_num[a] = valid_count - 1
|
|
|
|
num_of_players++
|
|
|
|
}
|
|
else
|
|
{
|
|
// fill it with Jerry's values
|
|
|
|
o_mech_variant[valid_count-1].nselected = chasis
|
|
o_team[valid_count-1].nselected = team
|
|
deactivate(o_team[valid_count-1])
|
|
deactivate(o_skins[valid_count-1])
|
|
activate(o_skin_box[valid_count-1])
|
|
activate(o_status[valid_count-1])
|
|
|
|
if valid_count-1 == 0
|
|
{
|
|
o_status[0].state = 2 //host is always ready
|
|
if (launched)
|
|
name_color[valid_count-1] = packcolor(255,255,255,100)
|
|
else
|
|
name_color[valid_count-1] = packcolor(255,255,255,255)
|
|
}
|
|
else
|
|
{
|
|
o_status[valid_count-1].state = 4
|
|
}
|
|
num_of_players++
|
|
}
|
|
|
|
o_print_name[valid_count-1].text = temp_name
|
|
|
|
mail(0,o_status[valid_count-1]) //makes the button change image
|
|
|
|
team_roster_count[team]++
|
|
|
|
valid_count = valid_count + 1
|
|
|
|
}
|
|
else
|
|
{
|
|
host_bot_last_val[a] = -1
|
|
host_bot_last_val2[a] = -1
|
|
host_bot_last_player_num[a] = -1
|
|
host_bot_last_skin[a] = 0
|
|
host_bot_from_file[a] = 0
|
|
}
|
|
}
|
|
|
|
// Remove bots for open slots
|
|
if hosting
|
|
{
|
|
int parameter = MAX_BOTS_PARAMETER
|
|
int max_bots = callback($$GetLocalNetworkMissionParamater$$, parameter)
|
|
if num_of_players > max_bots
|
|
{
|
|
int bot_to_kick[16]
|
|
for a=0;a<16;a++
|
|
{
|
|
bot_to_kick[a] = a
|
|
}
|
|
int m
|
|
int n
|
|
int temp
|
|
for a=0;a<8;a++
|
|
{
|
|
m = random(0, 15)
|
|
n = random(0, 15)
|
|
temp = bot_to_kick[m]
|
|
bot_to_kick[m] = bot_to_kick[n]
|
|
bot_to_kick[n] = temp
|
|
}
|
|
for a=0;a<16;a++
|
|
{
|
|
if num_of_players > max_bots
|
|
{
|
|
if (callback($$GetBotValid$$, bot_to_kick[a]) == TRUE)
|
|
{
|
|
callback($$RemoveBot$$, bot_to_kick[a])
|
|
num_of_players--
|
|
valid_count--
|
|
}
|
|
}
|
|
else
|
|
{
|
|
a = 16
|
|
}
|
|
}
|
|
}
|
|
if num_of_players >= max_bots
|
|
{
|
|
o_lancemate_button.state = 3
|
|
}
|
|
else
|
|
{
|
|
o_lancemate_button.state = 0
|
|
}
|
|
}
|
|
|
|
int max_team_players
|
|
|
|
for int loopey = 0;loopey <8; loopey++
|
|
{
|
|
if hosting
|
|
max_team_players = callback($$GetLocalNetworkMissionParamater$$, team_param, loopey, team_max_plyrs)
|
|
else
|
|
max_team_players = callback($$GetServerNetworkMissionParamater$$, team_param, loopey, team_max_plyrs)
|
|
|
|
if team_roster_count[loopey] >= max_team_players
|
|
team_legal_to_join[loopey] = FALSE
|
|
else
|
|
team_legal_to_join[loopey] = TRUE
|
|
}
|
|
team_legal_to_join[8] = TRUE
|
|
|
|
// sets list size to scale slider
|
|
o_roster_list_scroll_controls.list_size = num_of_players
|
|
|
|
for int choke = (valid_count-1); choke < 16; choke++
|
|
{
|
|
o_block_controls[choke].i_am_a_bot = 0
|
|
|
|
o_print_name[choke].text = ""
|
|
faction_name[choke] = ""
|
|
o_mech_variant[choke].nselected = 0
|
|
o_team[choke].nselected = 8
|
|
o_skins[choke].nselected = 3
|
|
skin_ids[valid_count-1] = 4
|
|
//o_status[choke].state = 0
|
|
//mail(0,o_status[choke])
|
|
deactivate(o_status[choke])
|
|
deactivate(o_team[choke])
|
|
deactivate(o_skins[choke])
|
|
deactivate(o_skin_box[choke])
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//////scrollable lobby controls
|
|
roster_list_scroll_controls
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = 447,123,10
|
|
|
|
int arrowHeight = 10
|
|
int buttonWidth = 16
|
|
int itemHeight = 44
|
|
int num_displayed = 7
|
|
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, location.y, location.z+5
|
|
o_downarrow_lobby.location = location.x, location.y+(itemHeight*num_displayed)-arrowHeight, location.z+5
|
|
|
|
o_thumbslide_lobby.location = location.x, location.y+arrowHeight+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!
|
|
{
|
|
//up button pressed
|
|
if (sender == o_uparrow_lobby)
|
|
{
|
|
if (ROSTER_top_of_list > 0)
|
|
{
|
|
ROSTER_top_of_list--
|
|
|
|
|
|
}
|
|
|
|
// tell the thumbslider to reposition itself
|
|
mail(0, o_thumbslide_lobby)
|
|
}
|
|
|
|
if (sender == o_downarrow_lobby)
|
|
{
|
|
if (ROSTER_top_of_list < list_size-num_displayed)
|
|
{
|
|
ROSTER_top_of_list++
|
|
|
|
|
|
}
|
|
// 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 new_y
|
|
for int x = 0; x < 16; x++
|
|
{
|
|
new_y = location.y-(ROSTER_top_of_list*itemHeight)+(x*itemHeight)
|
|
o_print_name[x].location.y = new_y
|
|
o_block_controls[x].location.y = new_y
|
|
o_mech_variant[x].location.y = new_y
|
|
initialize(o_mech_variant[x])
|
|
o_mech_variant2[x].location.y = new_y + 20
|
|
initialize(o_mech_variant2[x])
|
|
o_team[x].location.y = new_y
|
|
initialize(o_team[x])
|
|
o_skins[x].location.y = new_y
|
|
initialize(o_skins[x])
|
|
o_skin_box[x].location.y = new_y
|
|
o_status[x].location.y = new_y
|
|
}
|
|
|
|
|
|
int loopito
|
|
for loopito = 0;loopito < 16; loopito++
|
|
{
|
|
if loopito < ROSTER_top_of_list or loopito > (ROSTER_top_of_list+(num_displayed-1))
|
|
{
|
|
hide_this_player[loopito] = TRUE
|
|
deactivate(o_mech_variant[loopito])
|
|
deactivate(o_mech_variant2[loopito])
|
|
// deactivate(o_team[loopito])
|
|
o_team[loopito].region = 0,0 to 0,0
|
|
o_skins[loopito].region = 0,0 to 0,0
|
|
}
|
|
else
|
|
{
|
|
hide_this_player[loopito] = FALSE
|
|
|
|
if loopito < ROSTER_top_of_list+4
|
|
{
|
|
o_mech_variant[loopito].max_displayed = 16
|
|
o_mech_variant2[loopito].max_displayed = 16
|
|
o_skins[loopito].max_displayed = 16
|
|
}
|
|
else
|
|
{
|
|
o_mech_variant[loopito].max_displayed = (16-(3*(loopito-(ROSTER_top_of_list+3))))
|
|
o_mech_variant2[loopito].max_displayed = (16-(3*(loopito-(ROSTER_top_of_list+3))))
|
|
o_skins[loopito].max_displayed = (16-(3*(loopito-(ROSTER_top_of_list+3))))
|
|
}
|
|
|
|
activate(o_skin_box[loopito])
|
|
|
|
if hosting
|
|
{
|
|
if loopito == player_num or o_block_controls[loopito].i_am_a_bot == TRUE
|
|
{
|
|
activate(o_mech_variant[loopito])
|
|
activate(o_mech_variant2[loopito])
|
|
if team_val == TRUE
|
|
{
|
|
deactivate(o_skins[loopito])
|
|
activate(o_team[loopito])
|
|
}
|
|
else
|
|
{
|
|
deactivate(o_team[loopito])
|
|
}
|
|
}
|
|
|
|
if loopito == player_num
|
|
activate(o_skins[loopito])
|
|
}
|
|
else
|
|
{
|
|
if (o_status[loopito] == 0)
|
|
{
|
|
if loopito == player_num
|
|
{
|
|
activate(o_mech_variant[loopito])
|
|
activate(o_mech_variant2[loopito])
|
|
if team_val == TRUE
|
|
{
|
|
deactivate(o_skins[loopito])
|
|
}
|
|
else
|
|
{
|
|
deactivate(o_team[loopito])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if hosting == TRUE
|
|
{
|
|
if dedicated_server_flag == FALSE
|
|
{
|
|
if loopito < num_of_players
|
|
{
|
|
activate(o_status[loopito])
|
|
activate(o_skin_box[loopito])
|
|
}
|
|
|
|
if loopito == num_of_players
|
|
{
|
|
deactivate(o_skins[loopito])
|
|
deactivate(o_skin_box[loopito])
|
|
deactivate(o_team[loopito])
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if loopito < num_of_players
|
|
activate(o_status[loopito])
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if loopito < num_of_players
|
|
activate(o_status[loopito])
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
//script for scalable invisible regions for the thumbslider negative space
|
|
thumbregion
|
|
{
|
|
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 = 3
|
|
int i
|
|
object o_radiobutton[3]
|
|
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)
|
|
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
|
|
drawrect tabsx + 101, tabsy + 2 to tabsx + 199, tabsy + 24
|
|
drawrect tabsx + 202, tabsy + 2 to tabsx + 300, tabsy + 24
|
|
drawrect tabsx + 2, tabsy + 26 to tabsx + 301, tabsy + 387
|
|
|
|
setpencolor (0xffffffff)
|
|
drawline tabsx + 2, tabsy + 26 to tabsx + 2, tabsy + 387
|
|
drawline tabsx + 98, tabsy + 26 to tabsx + 105, tabsy + 26
|
|
drawline tabsx + 199, tabsy + 26 to tabsx + 206, tabsy + 26
|
|
|
|
setpencolor (0xffbbbbcc)
|
|
drawline tabsx + 3, tabsy + 26 to tabsx + 3, tabsy + 386
|
|
drawline tabsx + 300, tabsy + 26 to tabsx + 300, tabsy + 386
|
|
drawline tabsx + 3, tabsy + 386 to tabsx + 300, tabsy + 386
|
|
drawline tabsx + 98, tabsy + 27 to tabsx + 105, tabsy + 27
|
|
drawline tabsx + 199, tabsy + 27 to tabsx + 206, tabsy + 27
|
|
|
|
setpencolor (0xff777777)
|
|
drawline tabsx + 301, tabsy + 26 to tabsx + 301, tabsy + 387
|
|
drawline tabsx + 2, tabsy + 387 to tabsx + 301, tabsy + 387
|
|
}
|
|
|
|
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 @hostlobbymission@
|
|
|
|
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 @hostlobbymission@,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 @hostlobbymission@,2
|
|
}
|
|
if on_tab == 1
|
|
{
|
|
script_pause @hostlobbymap@,2
|
|
}
|
|
|
|
on_tab = 2
|
|
}
|
|
}
|
|
}
|
|
|
|
generic_region
|
|
{
|
|
LBUTTON_UPDATE
|
|
{
|
|
mail(0)
|
|
}
|
|
} |