Files
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
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.
2026-06-24 21:28:16 -05:00

2189 lines
62 KiB
Plaintext

#include "Content\\ShellScripts\\stddefs.h"
#include "Content\\ShellScripts\\ScriptStrings.h"
#include "Content\\ShellScripts\\listboxes.script"
#include "Content\\ShellScripts\\mc_listboxes.script"
#include "Content\\ShellScripts\\common_shell.script"
#include "Content\\ShellScripts\\buttons.script"
#include "Content\\ShellScripts\\SpinBox.script"
#include "Content\\ShellScripts\\c_Pane.script"
#include "Content\\ShellScripts\\c_MoviePlayer.script"
#include "Content\\ShellScripts\\c_Text.script"
#include "Content\\ShellScripts\\c_InfoPoint.script"
#include "Content\\ShellScripts\\c_InfoRegion.script"
#include "Content\\ShellScripts\\c_StatLines.script"
#include "Content\\ShellScripts\\c_MissionRegion.script"
#include "Content\\ShellScripts\\ShellFunctionHeaders.hpp"
#include "Content\\ShellScripts\\c_rollover.script"
#define nMSG_UPDATEMISSDESC 110005
main
{
GUI_CREATE
{
object oRollover = s_HelpRegion
oRollover.location = 12,500,nZ_HELPREGION
oRollover.nWidth = 575
oRollover.nHeight = 90
initialize(oRollover)
activate(oRollover)
callback($$Shell_CallbackHandler$$, ShellInitIAScreen)
int i
sound launchSound = SPATH "sfx_mech_explode.WAV"
sound btnTriggeredSound = SPATH "sfx_button5.wav"
int MAX_MCCB_ITEMS = 23
int MAX_MCCB_COLUMNS = 2
object screen = o_InstantAction
focus(screen)
}
}
o_InstantAction
{
GUI_CREATE
{
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Local Variables
int i
int k
int nComMechID
int nComResID
int only_once = true
string szComMechName
int mission_id
@SHELL@bkg = GPATH "IA_BACKGROUND.tga"
//Text
object oIATitle = s_Text
oIATitle.location = 20 ,20,nZ_TEXT
oIATitle.nFontID = IDS_F_CM_TITLE
oIATitle.nResID = IDS_IA_TITLE
oIATitle.cTextColor = 0xFFff7200
oIATitle.nJustify = 1
oIATitle.nLayoutWidth = 185
oIATitle.nLayoutHeight = 40
initialize(oIATitle)
//Buttons
object o_MechLab_button = s_multistatepane
o_MechLab_button.file = WPATH "button_reg_200x27m_4state.tga"
o_MechLab_button.text = localize$(IDS_CM_MB_TITLE)
o_MechLab_button.nRollover = 1
o_MechLab_button.nHelpID = IDS_GN_HELP_MECHBAY_BUTTON
o_MechLab_button.total_states = 4
o_MechLab_button.location = 597, 492, 20
initialize (o_MechLab_button)
object o_mainmenu_button = s_multistatepane
o_mainmenu_button.file = WPATH "button_reg_200x27m_4state.tga"
o_mainmenu_button.text = localize$(IDS_GN_MAINMENU)
o_mainmenu_button.nRollover = 1
o_mainmenu_button.nHelpID = IDS_GN_HELP_MAINMENU_BUTTON
o_mainmenu_button.total_states = 4
o_mainmenu_button.location = 597, 522, 20
initialize (o_mainmenu_button)
object o_launch_button = s_multistatepane
o_launch_button.file = WPATH "button_main_200x41m_4state.tga"
o_launch_button.text = localize$(IDS_GN_LAUNCH)
o_launch_button.nRollover = 1
o_launch_button.nHelpID = IDS_GN_HELP_LAUNCH_BUTTON
o_launch_button.total_states = 4
o_launch_button.location = 597, 552, 20
initialize (o_launch_button)
//Lance Commander Info
int LanceComX = 9
int LanceComY = 61
object oLCTitle = s_Text
oLCTitle.location = LanceComX ,LanceComY,nZ_TEXT
oLCTitle.nFontID = IDS_F_CM_LANCEMATE
oLCTitle.nResID = IDS_CM_LANCE_COMMANDER
oLCTitle.cTextColor = cWhite
oLCTitle.nJustify = 3
oLCTitle.nLayoutWidth = 199
oLCTitle.nLayoutHeight = 19
initialize(oLCTitle)
object oLCName = s_Text
oLCName.location = LanceComX + 55,LanceComY + 19,nZ_TEXT
oLCName.nFontID = IDS_F_CM_LANCEMATE
oLCName.cTextColor = cWhite
oLCName.nLayoutWidth = 136
oLCName.nLayoutHeight = 17
object oLMMechIcon = s_Pane
oLMMechIcon.location = LanceComX + 146,LanceComY + 42,nZ_PANE
oLMMechIcon.szBitmap = GPATH "CM_MechIcon.tga"
oLMMechIcon.nFrames = 22
oLMMechIcon.nMode = 0
oLMMechIcon.fVolatile = 1
oLMMechIcon.fRegion = 1
oLMMechIcon.nHelpID = IDS_HELP_CM_M_ICON
int nComID = 0
int nMech_selected
int nMech_count = $$m_mechCount$$ + 1
string szMechName[$$m_mechCount$$]
string szMechName2[$$m_mechCount$$]
int stock_id[$$m_mechCount$$]
int stock_array[$$m_mechCount$$ + 1]
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
callback($$Shell_CallbackHandler$$, ShellDataGetMechs, szMechName[], stock_id[])
int variant_step = 0
int stock_len = 0
for (k = 0; k < $$m_mechCount$$; k++)
{
if (stock_id[k] == 1)
{
szMechName2[k] = localize$(IDS_MP_LOBBY_STOCK)
stock_len = length$(szMechName[k]) + 1
stock_array[variant_step] = k
variant_step++
}
else
{
szMechName2[k] = right$(szMechName[k], length$(szMechName[k]) - stock_len)
}
}
stock_array[variant_step] = k
//ResId For the Mech's Name
$$m_listBoxSize$$ = nMech_count
object oMechList = s_droplistbox
oMechList.location = LanceComX + 3, LanceComY + 74,location.z + nZ_DROPDOWN + 150
oMechList.nRollover = 1
oMechList.nHelpID = IDS_HELP_CM_M_LIST
oMechList.itemWidth = 138 - 15
oMechList.itemHeight = 16
oMechList.max_displayed = 8
oMechList.arrowHeight = 15
$$m_listBoxSize$$ = nMech_count
object oMechList2 = s_droplistbox
oMechList2.location = LanceComX + 3, LanceComY + 94,location.z + nZ_DROPDOWN + 139
oMechList2.nRollover = 1
oMechList2.nHelpID = IDS_HELP_CM_M_LIST
oMechList2.itemWidth = 138 - 15
oMechList2.itemHeight = 16
oMechList2.max_displayed = 8
oMechList2.arrowHeight = 15
for k = 0; k < $$m_mechCount$$; k++
{
if (stock_id[k] == 1)
{
oMechList.list_item[stock_size] = szMechName[k]
stock_size++
}
}
oMechList.list_size = stock_size
initialize (oMechList)
//Stat lines
int stats_num = 4
int mech_stats[4]
object oMechStats[stats_num]
int s
//LanceMate entries variables
int nPilotCount = 3
int nLanceX = 10
int nLanceY = 174
int nLanceOffsetY = 105
object oLance[3]
//
//Drop downs
//
int DT_X = 620
int DT_Y = 10
int DD_X = 620
int DD_Y = 20
int DT_Y_Offset = 39
int DD_Y_Offset = 40
int D_W = 155
int D_H = 19
//Drop Title
object oDAction = s_droplistbox
oDAction.location = DD_X,DD_Y,nZ_DROPDOWN +150
oDAction.itemWidth = D_W
oDAction.itemHeight = D_H
oDAction.list_size = 4
oDAction.max_displayed = 10
oDAction.arrowHeight = 15
oDAction.label = localize$(IDS_IA_ACTION_TITLE)
oDAction.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDAction.nselected = 0
oDAction.nRollover = 1
oDAction.nHelpID = IDS_HELP_IA_ACTION_DROP
oDAction.list_item[0] = localize$(IDS_IA_MISSION)
oDAction.list_item[1] = localize$(IDS_IA_TRAINING)
oDAction.list_item[2] = localize$(IDS_IA_WAVE)
oDAction.list_item[3] = localize$(IDS_IA_MASTERS)
initialize (oDAction)
//
//Controls Based On Action Type
//
object oTrain = s_Train
initialize(oTrain)
deactivate(oTrain)
object oMission = s_Mission
initialize(oMission)
object oWave = s_Wave
initialize(oWave)
deactivate(oWave)
activate(oMission)
object oMaster = s_Master
initialize(oMaster)
deactivate(oMaster)
//The map\mission name
object oMapName = s_Text
oMapName.location = 218,10,nZ_TEXT
oMapName.nFontID = IDS_F_GEN_SCREEN_TITLE
oMapName.cTextColor = cWhite
oMapName.nJustify = 3
oMapName.nLayoutWidth = 417
oMapName.nLayoutHeight = 30
//Draws the map
string map_name = "CM_00_MM_00.tga"
object oMissMap = s_Pane
oMissMap.nFrames = 1
oMissMap.nCurrFrame = 0
oMissMap.nMode = 0
oMissMap.fVolatile = 0
int does_have_map = 0
initialize(this)
framerate = 5
}
GUI_INIT
{
oMissMap.szBitmap = MAPPATH map_name
oMissMap.location = 220,12,nZ_PANE
oMissMap.nScaleX = 150
oMissMap.nScaleY = 150
oMissMap.nHelpID = IDS_HELP_CM_MISSION_MAP
initialize(oMissMap)
//Lance Commander info
mail(nMSG_INITLCPILOTINFO,this)
mail(nMSG_INITLCMECHINFO,this)
mail(nMSG_INITLCMECHSTATS,this)
//LanceMate entries
mail(nMSG_INITLANCE,this)
mail(nMSG_UPDATEIADATA,this)
}
GUI_DRAW
{
render @SHELL@bkg,@SHELL@location
}
GUI_MAILBOX
{
//Stupid hack
int lance_id = @Shell@LanceMateID - 1
if lance_id < 0
{
lance_id = 0
}
switch (sender)
{
case o_mainmenu_button:
{
play btnTriggeredSound,1
unfocus
@SHELL@currentScreen = @SHELL@lastScreen[@SHELL@lastScreenDepth]
@SHELL@lastScreenDepth--
}
break
case o_mechlab_button:
{
play btnTriggeredSound,1
unfocus
callback($$Shell_CallbackHandler$$, ShellInitMechLabScreen)
@SHELL@lastScreenDepth++
@SHELL@lastScreen[@SHELL@lastScreenDepth] = INSTANT_SCREEN
@SHELL@currentScreen = MECHBAY_SCREEN
}
break
case o_launch_button:
if (only_once)
{
play launchSound,1
script_end "mouse.script"
//Buggles Dave heres the training stuff
if(oDAction.nSelected == 1)
{
callback($$Shell_CallbackHandler$$, ShellIATrainingSetPlayerMech)
}
else
if(oDAction.nSelected == 3)
{
mech_selected = oMechList.nSelected
string mech_name = oMechList.list_item[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAMasterSetPlayerMech, mech_selected, mech_name)
}
else
{
stock_mech_selected = oMechList.nselected
variant_mech_selected = oMechList2.nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
string mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech_name)
}
callback($$SetShellCommand$$, StartSinglePlayerGameCommand)
@SHELL@currentScreen = LAUNCHGAME
@SHELL@lastScreenDepth--
unfocus
only_once = false
}
break
case oMechList:
{
last_count = stock_array[oMechList.nselected]
oMechList2.list_size = 0
do
{
oMechList2.list_item[oMechList2.list_size] = szMechName2[last_count]
oMechList2.list_size++
last_count++
if (last_count == $$m_MechCount$$)
break
}
while (stock_id[last_count] != 1)
initialize(oMechList2)
oMechList2.nselected = 0
string skin_name = "OPS"
stock_mech_selected = oMechList.nselected
variant_mech_selected = oMechList2.nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
string mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech_name, skin_name)
mail(nMSG_INITLCMECHINFO,this)
mail(nMSG_INITLCMECHSTATS,this)
}
break
case oMechList2:
{
string skin_name = "OPS"
stock_mech_selected = oMechList.nselected
variant_mech_selected = oMechList2.nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
string mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellSetMech, mech_selected, mech_name, skin_name)
mail(nMSG_INITLCMECHINFO,this)
mail(nMSG_INITLCMECHSTATS,this)
}
break
case oDAction:
{
callback($$Shell_CallbackHandler$$, ShellIASetMissionType, oDAction.nSelected)
if(oDAction.nSelected == 0)
{
mail(nMSG_UPDATEIADATA,this)
mail(nMSG_INITLCMECHINFO,this)
o_MechLab_button.state = 0
initialize(o_MechLab_button)
deactivate(oTrain)
deactivate(oWave)
deactivate(oMaster)
activate(oMission)
}
if(oDAction.nSelected == 1)
{
mail(nMSG_UPDATEIADATA,this)
mail(nMSG_INITLCMECHINFO,this)
o_MechLab_button.state = 3
initialize(o_MechLab_button)
deactivate(oMission)
deactivate(oWave)
deactivate(oMaster)
activate(oTrain)
}
if(oDAction.nSelected == 2)
{
mail(nMSG_UPDATEIADATA,this)
mail(nMSG_INITLCMECHINFO,this)
o_MechLab_button.state = 0
initialize(o_MechLab_button)
nPilotCount = 3
mail(nMSG_INITLANCE,this)
deactivate(oTrain)
deactivate(oMission)
deactivate(oMaster)
activate(oWave)
}
if(oDAction.nSelected == 3)
{
mail(nMSG_UPDATEIADATA,this)
mail(nMSG_INITLCMECHINFO,this)
o_MechLab_button.state = 0
initialize(o_MechLab_button)
deactivate(oTrain)
deactivate(oMission)
deactivate(oWave)
activate(oMaster)
}
mail(nMSG_UPDATEIADATA, this)
}
break
}
switch(getmessage())
{
case nMSG_INITLANCE:
{
for(i = 0; i < nPilotCount; i++)
{
oLance[i] = s_LanceEntry
oLance[i].location = nLanceX,(nLanceY + (i * nLanceOffsetY)),5 - i
oLance[i].nId = i
initialize(oLance[i])
}
}
break
case nMSG_INITLANCEMECHS:
{
for(i = 0; i < nPilotCount; i++)
{
mail(nMSG_INITENTRYMECHS,oLance[i])
}
}
break
case nMSG_INITLANCEPILOTS:
{
for(i = 0; i < nPilotCount; i++)
{
mail(nMSG_INITENTRYPILOTS,oLance[i])
}
}
break
case nMSG_INITLCPILOTINFO:
{
string pilot_name
callback($$Shell_CallbackHandler$$, ShellGetPilotName, pilot_name)
oLCName.szText = pilot_name
initialize(oLCName)
}
break
case nMSG_INITLCMECHSTATS:
{
if(oDAction.nSelected == 3)
{
mech_selected = oMechList.nselected
callback($$Shell_CallbackHandler$$, ShellGetMasterMechBars, mech_selected, mech_stats[], nComMechID)
}
else
if(oDAction.nSelected == 1)
{
callback($$Shell_CallbackHandler$$, ShellGetTrainingMechBars, mech_stats[])
}
else
{
stock_mech_selected = oMechList.nselected
variant_mech_selected = oMechList2.nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
string mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAGetMechBars, mech_name, mech_selected, mech_stats[],nComMechID)
}
for s = 0; s < stats_num; s++
{
oMechStats[s] = s_statlines
oMechStats[s].nPixelWidth = 74
oMechStats[s].location = LanceComX + 68,LanceComY + 41 + (s * 8), 10
oMechStats[s].stat_val = mech_stats[s]
if(s == 0)
{
oMechstats[s].nHelpID = IDS_HELP_CM_M_F
}
else
if(s == 1)
{
oMechstats[s].nHelpID = IDS_HELP_CM_M_A
}
else
if(s == 2)
{
oMechstats[s].nHelpID = IDS_HELP_CM_M_S
}
else
if(s == 3)
{
oMechstats[s].nHelpID = IDS_HELP_CM_M_H
}
initialize(oMechStats[s])
}
oLMMechIcon.nCurrFrame = nComMechID
initialize(oLMMechIcon)
}
break
case nMSG_INITLCMECHINFO:
{
int status_array[$$m_mechCount$$]
//BUGBUG DAVE Changes mech list based on Master trials
if(oDAction.nSelected == 3)
{
int num_stock_mechs
callback($$Shell_CallbackHandler$$, ShellIAGetStockMechs, szMechName[], num_stock_mechs)
oMechList.list_size = num_stock_mechs
for ( k = 0; k < $$m_mechCount$$; k++)
{
oMechList.list_item[k] = szMechName[k]
}
initialize (oMechList)
}
else
{
callback($$Shell_CallbackHandler$$, ShellDataGetMechs, szMechName[], stock_id[])
int variant_step = 0
int stock_len = 0
for (k = 0; k < $$m_mechCount$$; k++)
{
if (stock_id[k] == 1)
{
szMechName2[k] = localize$(IDS_MP_LOBBY_STOCK)
stock_len = length$(szMechName[k]) + 1
stock_array[variant_step] = k
variant_step++
}
else
{
szMechName2[k] = right$(szMechName[k], length$(szMechName[k]) - stock_len)
}
}
stock_array[variant_step] = k
stock_size = 0
for k = 0; k < $$m_mechCount$$; k++
{
if (stock_id[k] == 1)
{
oMechList.list_item[stock_size] = szMechName[k]
stock_size++
}
}
oMechList.list_size = stock_size
initialize (oMechList)
}
}
break
case nMSG_UPDATEIADATA:
{
int change_time
if(oDAction.nSelected == 1)
{
mission_id = oTrain.mission_id
oMapName.szText = oTrain.oDMission.list_item[oTrain.nMission]
}
if(oDAction.nSelected == 0)
{
mission_id = oMission.mission_id
oMapName.szText = oMission.oDMission.list_item[oMission.nMission]
}
if(oDAction.nSelected == 2)
{
mission_id = oWave.mission_id
oMapName.szText = oWave.oDMission.list_item[oWave.nMission]
}
if(oDAction.nSelected == 3)
{
// We don't need to initialize the map name for master trials yet. It will be set when the master trial timer reaches 60
mission_id = oMaster.mission_id
oMapName.szText = ""
}
initialize(oMapName)
callback($$Shell_CallbackHandler$$, ShellIAGetMissionMapInfo,mission_id, map_name, does_have_map, nPilotCount, change_time)
if(change_time == 0)
{
deactivate(oMission.oDTime)
deactivate(oWave.oDTime)
}
else
{
if(oDAction.nSelected == 0)
{
activate(oMission.oDTime)
}
if(oDAction.nSelected == 2)
{
activate(oWave.oDTime)
}
}
if(does_have_map)
{
oMissMap.szBitmap = MAPPATH map_name
initialize(oMissMap)
activate(oMissMap)
}
else
{
deactivate(oMissMap)
}
oMissMap.region = 0,0 to 384,384
if(oDAction.nSelected != 2)
{
for(i = 0; i < 3; i++)
{
deactivate(oLance[i])
}
mail(nMSG_INITLANCE,this)
}
}
break
}
}
GUI_DESTROY
{
unfocus
}
}
s_LanceEntry
{
GUI_CREATE
{
int k
int nId
int nSelectedPilot
int nMechID = 21
string szName
int mech_count = $$m_mechCount$$
mech_count++ //This is for the extra space needed at the beginning
string pilot_names[30]
int name_count = 3 //Total number of pilots in the list
//Stat lines
int stats_num = 4
int s
int mech_stats[4]
int p_stat
//Mech Area Offsets
int nMechIX = 146 //I denotes Icon
int nMechIY = 28 //T denotes Text
int nMechTX = 3
int nMechTY = 61
int nMechW = 84
int nMechH = 60
//Lance Area OffSets
int nLanceIX = 3
int nLanceTX = 55
int nLanceY = 4
int nLanceIY = 4
//Lance Entry Locals
int nWidth = 195
int nHeight = 70
object oLEBackground = s_Pane
oLEBackground.szBitmap = GPATH "IA_LanceEntry.tga"
oLEBackground.nFrames = 1
oLEBackground.nCurrFrame = 0
oLEBackground.nMode = 0
oLEBackground.fVolatile = 0
oLEBackground.fRegion = 0
object oPilotList = s_droplistbox
oPilotList.nRollover = 1
oPilotList.nHelpID = IDS_HELP_CM_P_LIST
oPilotList.itemWidth = 140 - 15
oPilotList.itemHeight = 17
oPilotList.max_displayed = 8
oPilotList.arrowHeight = 15
object oLanceID = s_Text
oLanceID.nFontID = IDS_F_LOAD_TITLE
oLanceID.cTextColor = cWhite
oLanceID.nJustify = 3
oLanceID.nLayoutWidth = 48
oLanceID.nLayoutHeight = 48
object oMechIcon = s_Pane
oMechIcon.szBitmap = GPATH "CM_MechIcon.tga"
oMechIcon.nFrames = 22
oMechIcon.nMode = 0
oMechIcon.fVolatile = 1
oMechIcon.fRegion = 1
oMechIcon.nHelpID = IDS_HELP_CM_M_ICON
string szMechName[mech_count]
string szMechName2[mech_count]
int stock_id[mech_count]
int stock_array[mech_count + 1]
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
$$m_listBoxSize$$ = mech_count
object oMechList = s_droplistbox
oMechList.nRollover = 1
oMechList.nHelpID = IDS_HELP_CM_M_LIST
oMechList.itemWidth = 139 - 15
oMechList.itemHeight = 16
oMechList.max_displayed = 8
oMechList.arrowHeight = 15
$$m_listBoxSize$$ = mech_count
object oMechList2 = s_droplistbox
oMechList2.nRollover = 1
oMechList2.nHelpID = IDS_HELP_CM_M_LIST
oMechList2.itemWidth = 139 - 15
oMechList2.itemHeight = 16
oMechList2.max_displayed = 7
oMechList2.arrowHeight = 15
object oPilotstats[stats_num]
object oMechstats[stats_num]
}
GUI_INIT
{
s = nId + 1
oLanceID.szText = conv$(s)
oLanceID.location = location.x + nLanceIX,location.y + nLanceIY,nZ_TEXT
initialize(oLanceID)
oLEBackground.location = location
initialize(oLEBackground)
mail(nMSG_INITENTRYPILOTS,this)
mail(nMSG_INITENTRYMECHS,this)
}
GUI_DEACTIVATE
{
deactivate(oLEBackground)
deactivate(oLanceID)
deactivate(oPilotList)
deactivate(oMechIcon)
deactivate(oMechList)
deactivate(oMechList2)
for(int i=0;i<4;i++)
{
deactivate(oPilotstats[i])
deactivate(oMechstats[i])
}
}
GUI_MAILBOX
{
if (getmessage() == nMSG_INITENTRYPILOTS)
{
//Pilot info
//Pilot List Callback
oPilotList.location = location.x + nLanceTX, location.y + nLanceY,location.z + nZ_DROPDOWN + 100 + ((0-nID) * 30)
oPilotList.list_size = 4//name_count
oPilotList.list_item[0] = " "
oPilotList.list_item[1] = localize$(IDS_OM_NORMAL)
oPilotList.list_item[2] = localize$(IDS_OM_VETERAN)
oPilotList.list_item[3] = localize$(IDS_OM_EXPERT)
initialize (oPilotList)
if (oPilotList.nSelected == 0)
{
p_stat = 0
}
if (oPilotList.nSelected == 1)
{
p_stat = 10
}
if (oPilotList.nSelected == 2)
{
p_stat = 50
}
if (oPilotList.nSelected == 3)
{
p_stat = 100
}
//Pilot stats
for s = 0; s < stats_num; s++
{
oPilotstats[s] = s_statlines
oPilotstats[s].nPixelWidth = 33
oPilotstats[s].location = location.x + 64,location.y + 25 + (s * 8), 10
oPilotStats[s].stat_val = p_stat
if(s == 0)
{
oPilotStats[s].nHelpID = IDS_HELP_CM_P_GUN
}
else
if(s == 1)
{
oPilotStats[s].nHelpID = IDS_HELP_CM_P_PILOT
}
else
if(s == 2)
{
oPilotStats[s].nHelpID = IDS_HELP_CM_P_SENSOR
}
else
if(s == 3)
{
oPilotStats[s].nHelpID = IDS_HELP_CM_P_BLIND
}
initialize(oPilotstats[s])
}
}
else
if (getmessage() == nMSG_INITENTRYMECHS)
{
//Mech Info
callback($$Shell_CallbackHandler$$, ShellIAGetMechsWithEmpty, szMechName[], stock_id[])
int variant_step = 0
int stock_len = 0
for (k = 0; k < mech_count; k++)
{
if (stock_id[k] == 1)
{
szMechName2[k] = localize$(IDS_MP_LOBBY_STOCK)
stock_len = length$(szMechName[k]) + 1
stock_array[variant_step] = k
variant_step++
}
else
{
szMechName2[k] = right$(szMechName[k], length$(szMechName[k]) - stock_len)
}
}
stock_array[variant_step] = k
oMechList.location = location.x + nMechTX, location.y + nMechTY,location.z + nZ_DROPDOWN + 100 + ((0-nID) * 30) - 10
oMechList2.location = location.x + nMechTX, location.y + nMechTY + 20,location.z + nZ_DROPDOWN + 100 + ((0-nID) * 30) - 20
stock_size = 0
for k = 0; k < mech_count; k++
{
if (stock_id[k] == 1)
{
oMechList.list_item[stock_size] = szMechName[k]
stock_size++
}
}
oMechList.list_size = stock_size
initialize (oMechList)
initialize (oMechList2)
//Mech Stats
//BUGBUG Dave Need an Instant action version Of this callback
stock_mech_selected = oMechList.nselected
variant_mech_selected = oMechList2.nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
if(mech_selected >= 0)
{
string mech_name = szMechName[mech_selected]
mech_selected--
callback($$Shell_CallbackHandler$$, ShellIAGetMechBars, mech_name, mech_selected, mech_stats[],nMechID)
for s = 0; s < stats_num; s++
{
oMechstats[s] = s_statlines
oMechstats[s].nPixelWidth = 33
oMechstats[s].location = location.x + 111,location.y + 28 + (s * 8), 10
oMechStats[s].stat_val = 20 + (10*s)
oMechStats[s].stat_val = 10
oMechStats[s].stat_val = mech_stats[s]
if(s == 0)
{
oMechstats[s].nHelpID = IDS_HELP_CM_M_F
}
else
if(s == 1)
{
oMechstats[s].nHelpID = IDS_HELP_CM_M_A
}
else
if(s == 2)
{
oMechstats[s].nHelpID = IDS_HELP_CM_M_S
}
else
if(s == 3)
{
oMechstats[s].nHelpID = IDS_HELP_CM_M_H
}
initialize(oMechstats[s])
}
oMechIcon.location = location.x + nMechIX,location.y + nMechIY,nZ_PANE
oMechIcon.nCurrFrame = nMechID
}
else
{
oMechIcon.location = location.x + nMechIX,location.y + nMechIY,nZ_PANE
oMechIcon.nCurrFrame = 21
}
initialize(oMechIcon)
}
else
if (sender == oPilotList)
{
callback($$Shell_CallbackHandler$$, ShellIASetLancemate, nID, oPilotList.nSelected)
if(oMechList.nSelected == 0)
{
oMechList.nSelected = 1
last_count = stock_array[oMechList.nselected]
oMechList2.list_size = 0
do
{
oMechList2.list_item[oMechList2.list_size] = szMechName2[last_count]
oMechList2.list_size++
last_count++
if (last_count == mech_count)
break
}
while (stock_id[last_count] != 1)
initialize(oMechList2)
oMechList2.nselected = 0
nMechID = 1
callback($$Shell_CallbackHandler$$, ShellIASetLancemateMech, nID, oMechList.nSelected)
mail(nMSG_INITLANCEMECHS)
}
if(oPilotList.nselected == 0)
{
oMechList.nSelected = 0
oMechList2.list_size = 0
oMechList2.list_item[0] = ""
oMechList2.nSelected = 0
initialize(oMechList2)
nMechID = 21
callback($$Shell_CallbackHandler$$, ShellIASetLancemateMech, nID, oMechList.nSelected)
mail(nMSG_INITLANCEMECHS)
mail(nMSG_INITENTRYMECHS, this)
}
mail(nMSG_INITLANCEPILOTS)
}
else
if (sender == oMechList)
{
if (oPilotList.nselected == 0)
{
oPilotList.nSelected = 1
callback($$Shell_CallbackHandler$$, ShellIASetLancemate, nID, oPilotList.nSelected)
mail(nMSG_INITLANCEPILOTS)
}
if (oMechList.nselected == 0)
{
oMechList.nSelected = 0
oPilotList.nSelected = 0
callback($$Shell_CallbackHandler$$, ShellIASetLancemate, nID, oPilotList.nSelected)
mail(nMSG_INITLANCEPILOTS)
mail(nMSG_INITENTRYPILOTS, this)
}
oMechList2.list_size = 0
if (oMechList.nselected != 0)
{
last_count = stock_array[oMechList.nselected]
do
{
oMechList2.list_item[oMechList2.list_size] = szMechName2[last_count]
oMechList2.list_size++
last_count++
if (last_count == mech_count)
break
}
while (stock_id[last_count] != 1)
}
else
{
oMechList2.list_size = 0
oMechList2.list_item[0] = ""
}
initialize(oMechList2)
oMechList2.nselected = 0
stock_mech_selected = oMechList.nselected
variant_mech_selected = oMechList2.nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIASetLancemateMech, nID, mech_selected, mech_name)
mail(nMSG_INITENTRYMECHS, this)
mail(nMSG_INITLANCEMECHS)
}
else
if (sender == oMechList2)
{
if (oPilotList.nselected == 0)
{
oPilotList.nSelected = 1
callback($$Shell_CallbackHandler$$, ShellIASetLancemate, nID, oPilotList.nSelected)
mail(nMSG_INITLANCEPILOTS)
}
if (oMechList.nselected == 0)
{
oPilotList.nSelected = 0
callback($$Shell_CallbackHandler$$, ShellIASetLancemate, nID, oPilotList.nSelected)
mail(nMSG_INITLANCEPILOTS)
mail(nMSG_INITENTRYPILOTS, this)
}
stock_mech_selected = oMechList.nselected
variant_mech_selected = oMechList2.nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIASetLancemateMech, nID, mech_selected, mech_name)
mail(nMSG_INITENTRYMECHS, this)
mail(nMSG_INITLANCEMECHS)
}
}
}
s_Train
{
GUI_CREATE
{
//Mission Drop
int num_missions
int mission_id
string TMissions[$$m_iaMissionCount$$]
int nMission = 0
$$m_listBoxSize$$ = $$m_iaMissionCount$$
object oDMission = s_droplistbox
oDMission.location = parent.DD_X,parent.DD_Y + parent.DD_Y_Offset,nZ_DROPDOWN + 140
oDMission.itemWidth = parent.D_W
oDMission.itemHeight = parent.D_H
oDMission.max_displayed = 10
oDMission.arrowHeight = 15
oDMission.label = localize$(IDS_IA_MAPDROP_TITLE)
oDMission.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDMission.nRollover = 1
oDMission.nHelpID = IDS_HELP_IA_MISSION_DROP
oDMission.nSelected = 0
callback($$Shell_CallbackHandler$$, ShellIAGetTrainingMissions, TMissions[], num_missions)
callback($$Shell_CallbackHandler$$, ShellIASetTrainingMission, nMission, mission_id)
for(int i=0;i< num_missions;i++)
{
oDMission.list_item[i] = TMissions[i]
}
oDMission.list_size = num_missions
initialize (oDMission)
///////////////////
object oMechList = s_droplistbox
oMechList.location = parent.LanceComX + 3, parent.LanceComY + 74, nZ_TEXT
oMechList.nRollover = 1
oMechList.nHelpID = IDS_HELP_CM_M_LIST
oMechList.itemWidth = 138 - 15
oMechList.itemHeight = 16
oMechList.max_displayed = 1
oMechList.arrowHeight = 15
oMechList.nSelected = 0
oMechList.list_size = 1
oMechList.list_item[0] = "Shadow Cat"
object oLMMechIcon = s_Pane
oLMMechIcon.location = parent.LanceComX + 146,parent.LanceComY + 42,nZ_PANE
oLMMechIcon.szBitmap = GPATH "CM_MechIcon.tga"
oLMMechIcon.nFrames = 22
oLMMechIcon.nMode = 0
oLMMechIcon.fVolatile = 1
oLMMechIcon.fRegion = 1
oLMMechIcon.nHelpID = IDS_HELP_CM_M_ICON
oLMMechIcon.nCurrFrame = 16
deactivate(oMechList.o_dropbutton)
deactivate(oMechList.o_uparrow)
deactivate(oMechList.o_downarrow)
deactivate(oMechList.o_thumbslider)
deactivate(oMechList.o_thumbregiontop)
deactivate(oMechList.o_thumbregionbot)
deactivate(oLMMechIcon)
initialize (oMechList)
initialize (oLMMechIcon)
}
GUI_ACTIVATE
{
callback($$Shell_CallbackHandler$$, ShellIASetTrainingMission,nMission, mission_id)
parent.oMechList.nSelected = 0
parent.oLMMechIcon.nCurrFrame = 16
activate(oLMMechIcon)
deactivate(parent.oLMMechIcon)
activate(oDMission)
activate(oMechList)
deactivate(parent.oMechList)
deactivate(parent.oMechList2)
mail(nMSG_INITLCMECHSTATS)
}
GUI_DEACTIVATE
{
deactivate(oMechList)
deactivate(oLMMechIcon)
deactivate(oDMission)
activate(parent.oMechList)
activate(parent.oMechList2)
activate(parent.oLMMechIcon)
}
GUI_MAILBOX
{
switch (sender)
{
case oDMission:
{
nMission = oDMission.nSelected
callback($$Shell_CallbackHandler$$, ShellIASetTrainingMission,nMission, mission_id)
mail(nMSG_UPDATEIADATA)
}
break
}
}
}
s_Mission
{
GUI_CREATE
{
// Misson Description Text
string szMR_Rollover
object oMissionDesc = s_Text
oMissionDesc.nFontID = IDS_F_CM_TITLE
oMissionDesc.cTextColor = cWhite
oMissionDesc.nJustify = 0
oMissionDesc.nLayoutWidth = 570
oMissionDesc.nLayoutHeight = 88
initialize(oMissionDesc)
//Drop Downs
//Mission Drop
int num_missions
int mission_id
string MMissions[$$m_iaMissionCount$$]
int nMission = 0
$$m_listBoxSize$$ = $$m_iaMissionCount$$
object oDMission = s_droplistbox
oDMission.location = parent.DD_X,parent.DD_Y + parent.DD_Y_Offset,nZ_DROPDOWN + 140
oDMission.itemWidth = parent.D_W
oDMission.itemHeight = parent.D_H
oDMission.max_displayed = 10
oDMission.arrowHeight = 15
oDMission.label = localize$(IDS_IA_MAPDROP_TITLE)
oDMission.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDMission.nRollover = 1
oDMission.nHelpID = IDS_HELP_IA_MISSION_DROP
oDMission.nSelected = 0
callback($$Shell_CallbackHandler$$, ShellDataGetMissionNames, MMissions[], num_missions)
callback($$Shell_CallbackHandler$$, ShellSetIAMissionName, MMissions[nMission], nMission, mission_id)
for(int i=0;i< num_missions;i++)
{
oDMission.list_item[i] = MMissions[i]
}
oDMission.list_size = num_missions
initialize (oDMission)
///////////////////
int nTime = 0
int nDiff = 0
object oDTime = s_droplistbox
oDTime.location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * 2),nZ_DROPDOWN + 130
oDTime.itemWidth = parent.D_W
oDTime.itemHeight = parent.D_H
oDTime.list_size = 2
oDTime.max_displayed = 10
oDTime.arrowHeight = 15
oDTime.label = localize$(IDS_IA_TIME_TITLE)
oDTime.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDTime.nRollover = 1
oDTime.nHelpID = IDS_HELP_IA_TIME_DROP
oDTime.list_item[0] = localize$(IDS_CM_DAY)
oDTime.list_item[1] = localize$(IDS_CM_NIGHT)
object oDDiff = s_droplistbox
oDDiff.location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * 3),nZ_DROPDOWN + 120
oDDiff.itemWidth = parent.D_W
oDDiff.itemHeight = parent.D_H
oDDiff.list_size = 4
oDDiff.max_displayed = 10
oDDiff.arrowHeight = 15
oDDiff.label = localize$(IDS_IA_DIFF_TITLE)
oDDiff.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDDiff.nRollover = 1
oDDiff.nHelpID = IDS_HELP_IA_DIFF_DROP
oDDiff.list_item[0] = localize$(IDS_RS_RECRUIT)
oDDiff.list_item[1] = localize$(IDS_RS_REGULAR)
oDDiff.list_item[2] = localize$(IDS_RS_VETERAN)
oDDiff.list_item[3] = localize$(IDS_RS_ELITE)
}
GUI_INIT
{
//Set selected value for DropDowns
callback($$Shell_CallbackHandler$$, ShellGetTimeOfDay, nTime)
callback($$Shell_CallbackHandler$$, ShellIAGetDifficulty, nDiff)
oDTime.nSelected = nTime
initialize (oDTime)
oDDiff.nSelected = nDiff
initialize (oDDiff)
mail(nMSG_UPDATEMISSDESC,this)
}
GUI_ACTIVATE
{
callback($$Shell_CallbackHandler$$, ShellSetIAMissionName, MMissions[nMission], nMission, mission_id)
parent.last_mech = 0
parent.last_count = 0
parent.stock_mech_selected = 0
parent.variant_mech_selected = 0
callback($$Shell_CallbackHandler$$, ShellGetLastPlayerMech, parent.last_mech)
while (parent.last_mech >= parent.stock_array[parent.stock_mech_selected])
{
parent.stock_mech_selected++
}
parent.stock_mech_selected--
parent.last_count = parent.stock_array[parent.stock_mech_selected]
parent.variant_mech_selected = parent.last_mech - parent.last_count
int count = 0
do
{
parent.oMechList2.list_item[count] = parent.szMechName2[parent.last_count]
count++
parent.last_count++
if (parent.last_count == $$m_MechCount$$)
break
}
while (parent.stock_id[parent.last_count] != 1)
parent.oMechList2.list_size = count
parent.oMechList.nselected = parent.stock_mech_selected
parent.oMechList2.nselected = parent.variant_mech_selected
initialize(parent.oMechList)
initialize(parent.oMechList2)
activate(oDTime)
activate(oDDiff)
activate(oMissionDesc)
activate(oDMission)
mail(nMSG_INITLCMECHSTATS)
}
GUI_DEACTIVATE
{
deactivate(oDTime)
deactivate(oDDiff)
deactivate(oMissionDesc)
deactivate(oDMission)
}
GUI_MAILBOX
{
switch (sender)
{
case oDMission:
{
nMission = oDMission.nSelected
callback($$Shell_CallbackHandler$$, ShellSetIAMissionName, MMissions[nMission], nMission, mission_id)
mail(nMSG_UPDATEIADATA)
mail(nMSG_UPDATEMISSDESC,this)
oDTime.nSelected = 0
initialize (oDTime)
callback($$Shell_CallbackHandler$$, ShellSetTime,nTime)
}
break
case oDTime:
{
nTime = oDTime.nSelected
callback($$Shell_CallbackHandler$$, ShellSetTime,nTime)
}
break
case oDDiff:
{
nDiff = oDDiff.nSelected
callback($$Shell_CallbackHandler$$, ShellIASetDifficulty,nDiff)
}
break
}
switch (getmessage() == nMSG_UPDATEMISSDESC)
{
int success = callback($$Shell_CallbackHandler$$,ShellIAGetMissionRegionDATA,mission_id,szMR_Rollover)
if (success)
{
oMissionDesc.location = 220,location.y + 400,20
oMissionDesc.szText = szMR_Rollover
initialize(oMissionDesc)
activate(oMissionDesc)
}
else
{
deactivate(oMissionDesc)
}
}
}
}
s_Wave
{
GUI_CREATE
{
//DropDowns
int nTime = 0
int nDiff = 0
int nLives = 0
int nWaves = 0
//Mission Drop
int num_missions
int mission_id
string WMissions[$$m_iaMissionCount$$]
int nMission = 0
$$m_listBoxSize$$ = $$m_iaMissionCount$$
object oDMission = s_droplistbox
oDMission.location = parent.DD_X,parent.DD_Y + parent.DD_Y_Offset,nZ_DROPDOWN + 140
oDMission.itemWidth = parent.D_W
oDMission.itemHeight = parent.D_H
oDMission.max_displayed = 10
oDMission.arrowHeight = 15
oDMission.label = localize$(IDS_IA_MAPDROP_TITLE)
oDMission.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDMission.nRollover = 1
oDMission.nHelpID = IDS_HELP_IA_MISSION_DROP
oDMission.nSelected = 0
callback($$Shell_CallbackHandler$$, ShellIAGetWaveMissions, WMissions[], num_missions)
callback($$Shell_CallbackHandler$$, ShellIASetWaveMission, nMission, mission_id)
for(int i=0;i< num_missions;i++)
{
oDMission.list_item[i] = WMissions[i]
}
oDMission.list_size = num_missions
initialize (oDMission)
///////////////////////////////////
object oDTime = s_droplistbox
oDTime.location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * 2),nZ_DROPDOWN + 120
oDTime.itemWidth = parent.D_W
oDTime.itemHeight = parent.D_H
oDTime.list_size = 2
oDTime.max_displayed = 10
oDTime.arrowHeight = 15
oDTime.label = localize$(IDS_IA_TIME_TITLE)
oDTime.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDTime.nRollover = 1
oDTime.nHelpID = IDS_HELP_IA_TIME_DROP
oDTime.list_item[0] = localize$(IDS_CM_DAY)
oDTime.list_item[1] = localize$(IDS_CM_NIGHT)
object oDDiff = s_droplistbox
oDDiff.location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * 3),nZ_DROPDOWN + 115
oDDiff.itemWidth = parent.D_W
oDDiff.itemHeight = parent.D_H
oDDiff.list_size = 4
oDDiff.max_displayed = 10
oDDiff.arrowHeight = 15
oDDiff.label = localize$(IDS_IA_DIFF_TITLE)
oDDiff.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDDiff.nRollover = 1
oDDiff.nHelpID = IDS_HELP_IA_DIFF_DROP
oDDiff.list_item[0] = localize$(IDS_RS_RECRUIT)
oDDiff.list_item[1] = localize$(IDS_RS_REGULAR)
oDDiff.list_item[2] = localize$(IDS_RS_VETERAN)
oDDiff.list_item[3] = localize$(IDS_RS_ELITE)
object oDLives = s_droplistbox
oDLives.location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * 4),nZ_DROPDOWN + 110
oDLives.itemWidth = parent.D_W
oDLives.itemHeight = parent.D_H
oDLives.list_size = 6
oDLives.max_displayed = 10
oDLives.arrowHeight = 15
oDLives.label = localize$(IDS_IA_PLAYERS)
oDLives.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDLives.nRollover = 1
oDLives.nHelpID = IDS_HELP_IA_LIVES_DROP
oDLives.list_item[0] = "1"
oDLives.list_item[1] = "2"
oDLives.list_item[2] = "3"
oDLives.list_item[3] = "4"
oDLives.list_item[4] = "5"
oDLives.list_item[5] = localize$(IDS_IA_UNLIMITED)
object oDWaves = s_droplistbox
oDWaves.location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * 5),nZ_DROPDOWN + 105
oDWaves.itemWidth = parent.D_W
oDWaves.itemHeight = parent.D_H
oDWaves.list_size = 6
oDWaves.max_displayed = 10
oDWaves.arrowHeight = 15
oDWaves.label = localize$(IDS_IA_WAVE_TITLE)
oDWaves.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDWaves.nRollover = 1
oDWaves.nHelpID = IDS_HELP_IA_WAVES_DROP
oDWaves.list_item[0] = "1"
oDWaves.list_item[1] = "2"
oDWaves.list_item[2] = "3"
oDWaves.list_item[3] = "4"
oDWaves.list_item[4] = "5"
oDWaves.list_item[5] = localize$(IDS_IA_UNLIMITED)
object oEnemyTitle = s_Text
oEnemyTitle.location = parent.DT_X,parent.DT_Y + (parent.DT_Y_Offset * 6),nZ_DROPDOWN+100
oEnemyTitle.nFontID = IDS_F_CM_LANCEMATE
oEnemyTitle.nResID = IDS_IA_ENEMY_TITLE1
oEnemyTitle.cTextColor = cWhite
oEnemyTitle.nJustify = 3
initialize(oEnemyTitle)
//
//Chassis Drop Down
//
int E
int j
int nEnemyMax = 4
object oDEnemy[nEnemyMax]
object oDEnemy2[nEnemyMax]
int nEnemy[nEnemyMax]
int nEnemy2[nEnemyMax]
int num_mechs = $$m_mechCount$$ + 1
string szMechName[num_mechs]
string szMechName2[num_mechs]
int stock_id[num_mechs]
int stock_array[num_mechs + 1]
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( E=0;E<nEnemyMax;E++)
{
i = E + 1
$$m_listBoxSize$$ = num_mechs
oDEnemy[E] = s_droplistbox
oDEnemy[E].location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * (6+E)) + 19 * (E + 1) - 6,nZ_DROPDOWN + 100 - (20*E)
oDEnemy[E].itemWidth = parent.D_W
oDEnemy[E].itemHeight = parent.D_H
oDEnemy[E].max_displayed = 7 - (E / (nEnemyMax - 1))
oDEnemy[E].arrowHeight = 15
oDEnemy[E].nRollover = 1
oDEnemy[E].nHelpID = IDS_HELP_IA_ENEMIES_DROP
oDEnemy[E].label = localize$(IDS_IA_MECH) " "conv$(i)
oDEnemy[E].offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
i = E + 1
$$m_listBoxSize$$ = num_mechs
oDEnemy2[E] = s_droplistbox
oDEnemy2[E].location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * (6+E)) + 19 * (E + 1) + 16,nZ_DROPDOWN + 100 - (20*E) - 11
oDEnemy2[E].itemWidth = parent.D_W
oDEnemy2[E].itemHeight = parent.D_H
oDEnemy2[E].max_displayed = 6 - (E / (nEnemyMax - 1))
oDEnemy2[E].arrowHeight = 15
oDEnemy2[E].nRollover = 1
oDEnemy2[E].nHelpID = IDS_HELP_IA_ENEMIES_DROP
}
initialize(this)
}
GUI_INIT
{
int j
int k
//Set selected value for DropDowns
callback($$Shell_CallbackHandler$$, ShellGetTimeOfDay, nTime)
callback($$Shell_CallbackHandler$$, ShellIAGetMechsWithEmpty, szMechName[], stock_id[])
callback($$Shell_CallbackHandler$$, ShellIAGetDifficulty, nDiff)
callback($$Shell_CallbackHandler$$, ShellIAGetWavePlayerRespawns, nLives)
callback($$Shell_CallbackHandler$$, ShellIAGetEnemyWaveCount, nWaves)
oDTime.nSelected = nTime
initialize (oDTime)
oDDiff.nSelected = nDiff
initialize (oDDiff)
oDLives.nSelected = nLives
initialize (oDLives)
oDWaves.nSelected = nWaves
initialize (oDWaves)
int variant_step = 0
int stock_len = 0
for (k = 0; k < num_mechs; k++)
{
if (stock_id[k] == 1)
{
szMechName2[k] = localize$(IDS_MP_LOBBY_STOCK)
stock_len = length$(szMechName[k]) + 1
stock_array[variant_step] = k
variant_step++
}
else
{
szMechName2[k] = right$(szMechName[k], length$(szMechName[k]) - stock_len)
}
}
stock_array[variant_step] = k
for ( E=0;E<nEnemyMax;E++)
{
stock_size = 0
for k = 0; k < num_mechs; k++
{
if (stock_id[k] == 1)
{
oDEnemy[E].list_item[stock_size] = szMechName[k]
stock_size++
}
}
nEnemy[E] = 0
oDEnemy[E].list_size = stock_size
oDEnemy[E].nselected = nEnemy[E]
initialize (oDEnemy[E])
nEnemy2[E] = 0
oDEnemy2[E].list_size = 0
oDEnemy2[E].nselected = nEnemy[E]
initialize (oDEnemy2[E])
}
}
GUI_ACTIVATE
{
callback($$Shell_CallbackHandler$$, ShellIASetWaveMission, nMission, mission_id)
parent.last_mech = 0
parent.last_count = 0
parent.stock_mech_selected = 0
parent.variant_mech_selected = 0
callback($$Shell_CallbackHandler$$, ShellGetLastPlayerMech, parent.last_mech)
while (parent.last_mech >= parent.stock_array[parent.stock_mech_selected])
{
parent.stock_mech_selected++
}
parent.stock_mech_selected--
parent.last_count = parent.stock_array[parent.stock_mech_selected]
parent.variant_mech_selected = parent.last_mech - parent.last_count
int count = 0
do
{
parent.oMechList2.list_item[count] = parent.szMechName2[parent.last_count]
count++
parent.last_count++
if (parent.last_count == $$m_mechCount$$)
break
}
while (parent.stock_id[parent.last_count] != 1)
parent.oMechList2.list_size = count
parent.oMechList.nselected = parent.stock_mech_selected
parent.oMechList2.nselected = parent.variant_mech_selected
initialize(parent.oMechList)
initialize(parent.oMechList2)
activate(oDTime)
activate(oDDiff)
activate(oDLives)
activate(oEnemyTitle)
activate(oDWaves)
activate(oDMission)
for( E=0;E<nEnemyMax;E++)
{
activate(oDEnemy[E])
activate(oDEnemy2[E])
}
mail(nMSG_INITLCMECHSTATS)
}
GUI_DEACTIVATE
{
deactivate(oDTime)
deactivate(oDDiff)
deactivate(oDLives)
deactivate(oEnemyTitle)
deactivate(oDWaves)
deactivate(oDMission)
for( E=0;E<nEnemyMax;E++)
{
deactivate(oDEnemy[E])
deactivate(oDEnemy2[E])
}
}
GUI_MAILBOX
{
switch (sender)
{
case oDMission:
{
nMission = oDMission.nSelected
callback($$Shell_CallbackHandler$$, ShellIASetWaveMission, nMission, mission_id)
mail(nMSG_UPDATEIADATA)
oDTime.nSelected = 0
initialize (oDTime)
callback($$Shell_CallbackHandler$$, ShellSetTime,nTime)
}
break
case oDTime:
{
nTime = oDTime.nSelected
callback($$Shell_CallbackHandler$$, ShellSetTime,nTime)
}
break
case oDDiff:
{
nDiff = oDDiff.nSelected
callback($$Shell_CallbackHandler$$, ShellIASetDifficulty,nDiff)
}
break
case oDLives:
{
nLives = oDLives.nSelected
callback($$Shell_CallbackHandler$$, ShellIASetWavePlayerRespawns,nLives)
}
break
case oDWaves:
{
nWaves = oDWaves.nSelected
callback($$Shell_CallbackHandler$$, ShellIASetEnemyWaveCount,nWaves)
}
break
case oDEnemy[0]:
{
oDEnemy2[0].list_size = 0
oDEnemy2[0].list_item[0] = ""
if (oDEnemy[0].nselected != 0)
{
last_count = stock_array[oDEnemy[0].nselected]
do
{
oDEnemy2[0].list_item[oDEnemy2[0].list_size] = szMechName2[last_count]
oDEnemy2[0].list_size++
last_count++
if (last_count == num_mechs)
break
}
while (stock_id[last_count] != 1)
}
initialize(oDEnemy2[0])
oDEnemy2[0].nselected = 0
int id = 0
stock_mech_selected = oDEnemy[0].nselected
variant_mech_selected = oDEnemy2[0].nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String enemy_mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAAddMechToEnemyInWave,id,mech_selected,enemy_mech_name)
}
break
case oDEnemy[1]:
{
oDEnemy2[1].list_size = 0
oDEnemy2[1].list_item[0] = ""
if (oDEnemy[1].nselected != 0)
{
last_count = stock_array[oDEnemy[1].nselected]
do
{
oDEnemy2[1].list_item[oDEnemy2[1].list_size] = szMechName2[last_count]
oDEnemy2[1].list_size++
last_count++
if (last_count == num_mechs)
break
}
while (stock_id[last_count] != 1)
}
initialize(oDEnemy2[1])
oDEnemy2[1].nselected = 0
int id = 1
stock_mech_selected = oDEnemy[1].nselected
variant_mech_selected = oDEnemy2[1].nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String enemy_mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAAddMechToEnemyInWave,id,mech_selected,enemy_mech_name)
}
break
case oDEnemy[2]:
{
oDEnemy2[2].list_size = 0
oDEnemy2[2].list_item[0] = ""
if (oDEnemy[2].nselected != 0)
{
last_count = stock_array[oDEnemy[2].nselected]
do
{
oDEnemy2[2].list_item[oDEnemy2[2].list_size] = szMechName2[last_count]
oDEnemy2[2].list_size++
last_count++
if (last_count == num_mechs)
break
}
while (stock_id[last_count] != 1)
}
initialize(oDEnemy2[2])
oDEnemy2[2].nselected = 0
int id = 2
stock_mech_selected = oDEnemy[2].nselected
variant_mech_selected = oDEnemy2[2].nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String enemy_mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAAddMechToEnemyInWave,id,mech_selected,enemy_mech_name)
}
break
case oDEnemy[3]:
{
oDEnemy2[3].list_size = 0
oDEnemy2[3].list_item[0] = ""
if (oDEnemy[3].nselected != 0)
{
last_count = stock_array[oDEnemy[3].nselected]
do
{
oDEnemy2[3].list_item[oDEnemy2[3].list_size] = szMechName2[last_count]
oDEnemy2[3].list_size++
last_count++
if (last_count == num_mechs)
break
}
while (stock_id[last_count] != 1)
}
initialize(oDEnemy2[3])
oDEnemy2[3].nselected = 0
int id = 3
stock_mech_selected = oDEnemy[3].nselected
variant_mech_selected = oDEnemy2[3].nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String enemy_mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAAddMechToEnemyInWave,id,mech_selected,enemy_mech_name)
}
break
case oDEnemy2[0]:
{
int id = 0
stock_mech_selected = oDEnemy[0].nselected
variant_mech_selected = oDEnemy2[0].nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String enemy_mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAAddMechToEnemyInWave,id,mech_selected,enemy_mech_name)
}
break
case oDEnemy2[1]:
{
int id = 1
stock_mech_selected = oDEnemy[1].nselected
variant_mech_selected = oDEnemy2[1].nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String enemy_mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAAddMechToEnemyInWave,id,mech_selected,enemy_mech_name)
}
break
case oDEnemy2[2]:
{
int id = 2
stock_mech_selected = oDEnemy[2].nselected
variant_mech_selected = oDEnemy2[2].nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String enemy_mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAAddMechToEnemyInWave,id,mech_selected,enemy_mech_name)
}
break
case oDEnemy2[3]:
{
int id = 3
stock_mech_selected = oDEnemy[3].nselected
variant_mech_selected = oDEnemy2[3].nselected
mech_selected = stock_array[stock_mech_selected] + variant_mech_selected
String enemy_mech_name = szMechName[mech_selected]
callback($$Shell_CallbackHandler$$, ShellIAAddMechToEnemyInWave,id,mech_selected,enemy_mech_name)
}
break
}
}
}
s_Master
{
GUI_CREATE
{
//DropDowns
int nTime = 0
int nDiff = 0
int nLives = 0
int nWaves = 0
int nDiffOn = 0
string map_name
object oMissionDesc = s_Text
oMissionDesc.nFontID = IDS_F_CM_TITLE
oMissionDesc.cTextColor = cWhite
oMissionDesc.nJustify = 0
oMissionDesc.nLayoutWidth = 570
oMissionDesc.nLayoutHeight = 88
oMissionDesc.location = 220,location.y + 400,20
oMissionDesc.szText = localize$(IDS_IA_MASTERS_DESC)
initialize(oMissionDesc)
object oCover = s_InfoRegion
oCover.location = parent.DD_X,parent.DD_Y+ (parent.DD_Y_Offset * 3),195
oCover.nWidth = 180
oCover.nHeight = 200
oCover.nHelpID = IDS_IA_MASTERS_DESC
initialize(oCover)
object oCover1 = s_InfoRegion
oCover1.location = parent.DD_X,parent.DD_Y+ (parent.DD_Y_Offset * 1),205
oCover1.nWidth = 180
oCover1.nHeight = 25
oCover1.nHelpID = IDS_IA_MASTERS_DESC
initialize(oCover1)
object oCover2 = s_InfoRegion
oCover2.location = parent.LanceComX + 3,parent.LanceComY + 72,250
oCover2.nWidth = 155
oCover2.nHeight = 20
oCover2.nHelpID = IDS_IA_MASTERS_DESC
initialize(oCover2)
//Mission Drop
int num_missions
int mission_id
string MTMissions[$$m_iaMissionCount$$]
int nMission = 0
$$m_listBoxSize$$ = $$m_iaMissionCount$$
object oDMission = s_droplistbox
oDMission.location = parent.DD_X,parent.DD_Y + parent.DD_Y_Offset,nZ_DROPDOWN + 140
oDMission.itemWidth = parent.D_W + 15
oDMission.itemHeight = parent.D_H
oDMission.max_displayed = 10
oDMission.arrowHeight = 15
oDMission.label = localize$(IDS_IA_MAPDROP_TITLE)
oDMission.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDMission.nRollover = 1
oDMission.nHelpID = IDS_HELP_IA_MISSION_DROP
oDMission.nSelected = 0
callback($$Shell_CallbackHandler$$, ShellIAGetMasterTrialMissions, MTMissions[], num_missions)
for(int i=0;i< num_missions;i++)
{
oDMission.list_item[i] = MTMissions[i]
}
oDMission.list_size = num_missions
initialize (oDMission)
/////////////////////////////
object oDTime = s_droplistbox
oDTime.location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * 3),nZ_DROPDOWN + 130
oDTime.itemWidth = parent.D_W + 15
oDTime.itemHeight = parent.D_H
oDTime.list_size = 2
oDTime.max_displayed = 10
oDTime.arrowHeight = 15
oDTime.region = 0,0 to 0,0
oDTime.label = localize$(IDS_IA_TIME_TITLE)
oDTime.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDTime.nRollover = 1
oDTime.nHelpID = IDS_HELP_IA_TIME_DROP
oDTime.list_item[0] = localize$(IDS_CM_DAY)
oDTime.list_item[1] = localize$(IDS_CM_NIGHT)
object oDDiff = s_droplistbox
oDDiff.location = parent.DD_X,parent.DD_Y + (parent.DD_Y_Offset * 2),200
oDDiff.itemWidth = parent.D_W
oDDiff.itemHeight = parent.D_H
oDDiff.list_size = 4
oDDiff.max_displayed = 10
oDDiff.arrowHeight = 15
oDDiff.label = localize$(IDS_IA_DIFF_TITLE)
oDDiff.offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
oDDiff.region = 0,0 to 0,0
oDDiff.nRollover = 1
oDDiff.nHelpID = IDS_HELP_IA_MASTERDIFF
oDDiff.list_item[0] = localize$(IDS_RS_RECRUIT)
oDDiff.list_item[1] = localize$(IDS_RS_REGULAR)
oDDiff.list_item[2] = localize$(IDS_RS_VETERAN)
oDDiff.list_item[3] = localize$(IDS_RS_ELITE)
object oEnemyTitle = s_Text
oEnemyTitle.location = parent.DT_X,parent.DT_Y + (parent.DT_Y_Offset * 4) + 20,nZ_DROPDOWN+100
oEnemyTitle.nFontID = IDS_F_CM_LANCEMATE
oEnemyTitle.nResID = IDS_IA_ENEMY_TITLE1
oEnemyTitle.cTextColor = cWhite
oEnemyTitle.nJustify = 3
initialize(oEnemyTitle)
//
//Chassis Drop Down
//
int E
int j
int nEnemyMax = 4
object oDEnemy[nEnemyMax]
int nEnemy[nEnemyMax]
int num_mechs = $$m_mechCount$$
string szMechName[num_mechs]
for( E=0;E<nEnemyMax;E++)
{
$$m_listBoxSize$$ = num_mechs
oDEnemy[E] = s_droplistbox
oDEnemy[E].location = parent.DD_X,parent.DD_Y + ((parent.DD_Y_Offset * (5+E)) ) + 5,80
oDEnemy[E].itemWidth = parent.D_W + 15
oDEnemy[E].itemHeight = parent.D_H
oDEnemy[E].max_displayed = 10
oDEnemy[E].arrowHeight = 15
oDEnemy[E].region = 0,0 to 0,0
oDEnemy[E].label = localize$(IDS_IA_MECH) conv$(E)
oDEnemy[E].offsetLabel = 0,-15 //CAN BE INITIALIZED offsetLabel of text from button = 0,-25
}
int nFrame = 0
framerate = 20
initialize(this)
}
GUI_INIT
{
int j
//BUGBUG DAVE MAster Trials get mech
callback($$Shell_CallbackHandler$$, ShellIAGetStockMechs, szMechName[], num_mechs)
//Dave
for( E=0; E < 3; E++) // only 3 enemies in master trials
{
oDEnemy[E].list_size = num_mechs
for (j = 0; j < num_mechs; j++)
{
oDEnemy[E].list_item[j] = szMechName[j]
}
nEnemy[E] = 0
oDEnemy[E].nSelected = nEnemy[E]
initialize (oDEnemy[E])
deactivate(oDEnemy[E].o_dropbutton)
}
deactivate(oDDiff.o_dropbutton)
}
GUI_EXECUTE
{
nFrame++
if (nFrame <= 40)
{
oDMission.nSelected = (random(1,num_missions + 1)) - 1
initialize (oDMission)
}
if (nFrame <= 55)
{
parent.oMechList.nSelected = (random(1,num_mechs + 1)) - 1
initialize (parent.oMechList)
}
if (nFrame <= 21)
{
oDTime.nSelected = (random(1,3)) - 1
initialize (oDTime)
}
for( E=0; E < 3; E++) // only 3 opponents in Master Trials
{
if (nFrame <= (17*E) + 15)
{
oDEnemy[E].nSelected = (random(1,num_mechs + 1)) - 1
if(oDEnemy[E].nSelected < 0)
{
oDEnemy[E].nSelected = 0
}
if(oDEnemy[E].nSelected > 20)
{
oDEnemy[E].nSelected = 20
}
initialize (oDEnemy[E])
}
}
Deactivate(oDEnemy[3])
if (nFrame == 60)
{
framerate = 0
callback($$Shell_CallbackHandler$$, ShellIASetMasterTrial, oDMission.nSelected, mission_id, oDEnemy[0].nSelected, oDEnemy[1].nSelected, oDEnemy[2].nSelected, oDTime.nSelected, map_name)
nDiffOn = 1
initialize(oDDiff)
activate(oDDiff)
parent.oMapName.szText = oDMission.list_item[oDMission.nSelected]
initialize(parent.oMapName)
parent.oMissMap.szBitmap = MAPPATH map_name
initialize(parent.oMissMap)
activate(oMissMap)
parent.o_launch_button.state = 0
initialize(parent.o_launch_button)
//Dave bad here
string mech_name = parent.oMechList.list_item[parent.oMechList.nSelected]
callback($$Shell_CallbackHandler$$, ShellIAMasterSetPlayerMech, parent.oMechList.nSelected, mech_name)
mail(nMSG_INITLCMECHSTATS)
mail(nMSG_INITLCMECHINFO)
}
}
GUI_MAILBOX
{
switch (sender)
{
case oDDiff:
{
if(nDiffOn)
{
nDiff = oDDiff.nSelected
callback($$Shell_CallbackHandler$$, ShellSetMasterTrialsDifficulty, oDDiff.nSelected)
}
}
break
}
}
GUI_ACTIVATE
{
nFrame = 0
framerate = 20
activate(oCover)
activate(oCover1)
activate(oCover2)
activate(oDTime)
activate(oEnemyTitle)
activate(oDMission)
activate(oMissionDesc)
for( E=0;E<nEnemyMax;E++)
{
activate(oDEnemy[E])
deactivate(oDEnemy[E].o_dropbutton)
}
deactivate(oDTime.o_dropbutton)
parent.oMechList.itemWidth = 138
deactivate(parent.oMechList.o_dropbutton)
oDMission.itemWidth = parent.D_W + 15
deactivate(oDMission.o_dropbutton)
parent.o_launch_button.state = 3
initialize(parent.o_launch_button)
parent.oMechList.nSelected = 0
deactivate(parent.oMechList2)
mail(nMSG_INITLCMECHSTATS)
}
GUI_DEACTIVATE
{
deactivate(oCover)
deactivate(oCover1)
deactivate(oCover2)
deactivate(oDTime)
deactivate(oDDiff)
deactivate(oEnemyTitle)
deactivate(oDMission)
deactivate(oMissionDesc)
for( E=0;E<nEnemyMax;E++)
{
deactivate(oDEnemy[E])
}
parent.oMechList.itemWidth = 138 - 15
initialize(parent.oMechList)
activate(parent.oMechList2)
parent.o_launch_button.state = 0
initialize(parent.o_launch_button)
}
}