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.
245 lines
6.1 KiB
Plaintext
245 lines
6.1 KiB
Plaintext
#include "Content\\ShellScripts\\stddefs.h"
|
|
#include "Content\\ShellScripts\\ScriptStrings.h"
|
|
#include "Content\\ShellScripts\\callsign.h"
|
|
#include "Content\\ShellScripts\\buttons.script"
|
|
#include "Content\\ShellScripts\\slider.script"
|
|
#include "Content\\ShellScripts\\spinbox.script"
|
|
#include "Content\\ShellScripts\\editbox.script"
|
|
#include "Content\\ShellScripts\\ErrorScreen.script"
|
|
|
|
main
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
// maximum number of spin box item
|
|
int max_spin_items = 10
|
|
|
|
// use the whole region
|
|
location = 0, 0, 0
|
|
region = 0, 0 to getresx(), getresy()
|
|
|
|
setresource("ScriptStrings.dll")
|
|
|
|
object screen = o_ComputerPlayer
|
|
}
|
|
}
|
|
|
|
o_ComputerPlayer
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
Font3d gFont3d = szPATH_FONTS localize$(IDS_F_DIALOG_TITLE)
|
|
|
|
pane gFrame = GPATH "dialog_500x300m.tga"
|
|
|
|
// Initialize the OK and Cancel buttons
|
|
int iloop
|
|
object mbutton[2]
|
|
for(iloop = 0; iloop < 2; iloop++)
|
|
{
|
|
mbutton[iloop] = s_multistatepane
|
|
mbutton[iloop].file = WPATH "button_reg_138x23m_3state.tga"
|
|
mbutton[iloop].total_states = 3
|
|
mbutton[iloop].twidth = 100
|
|
mbutton[iloop].id = iloop
|
|
}
|
|
mbutton[0].text = localize$(IDS_RS_B_OK)
|
|
mbutton[0].location = 200, 380, 10
|
|
mbutton[1].text = localize$(IDS_RS_B_CANCEL)
|
|
mbutton[1].location = 460, 380, 10
|
|
for(iloop = 0; iloop < 2; iloop++)
|
|
{
|
|
initialize(mbutton[iloop])
|
|
}
|
|
|
|
framerate = 30
|
|
|
|
object o_callsigns = callsigns
|
|
int bot_number = random(0, NUM_CALLSIGNS - 1)
|
|
|
|
// Initialize the spin box
|
|
object mSpinbox = s_spinbox
|
|
mSpinBox.location = 200, 210, 10
|
|
mSpinBox.itemWidth = 70
|
|
mSpinBox.itemHeight = 20
|
|
mSpinBox.list_size = 10
|
|
mSpinBox.boxFont3D = szPATH_FONTS localize$(IDS_F_GEN_SPINBOX)
|
|
mSpinBox.labelFont3D = szPATH_FONTS localize$(IDS_F_GEN_LABEL)
|
|
mSpinBox.label = localize$(IDS_MP_BOT_SKILL)
|
|
mSpinBox.offsetLabel = 0, -18
|
|
mSpinBox.prevent_rollover = true
|
|
mSpinBox.numeric_spinbox = true
|
|
mSpinBox.numeric_spinbox_min = 0
|
|
mSpinBox.numeric_spinbox_max = 9
|
|
mSpinBox.nselected = o_callsigns.levels[bot_number]
|
|
initialize(mSpinBox)
|
|
|
|
// Initialize the slider
|
|
object mSlider = s_slider
|
|
mSlider.location = 300, 218, 10
|
|
mSlider.itemWidth = 300
|
|
mSlider.itemHeight = 5
|
|
mSlider.handleHeight = 20
|
|
mSlider.handleWidth = 10
|
|
mSlider.labelFont3D = szPATH_FONTS localize$(IDS_F_BOT_SLIDER)
|
|
mSlider.labelTextColor = 0xffffffff
|
|
mSlider.filledColor = 0xffffffff
|
|
mSlider.slider_min_val = -1
|
|
mSlider.slider_max_val = 8
|
|
mSlider.is_vertical = false
|
|
mSlider.nselected = o_callsigns.levels[bot_number]
|
|
mSlider.o_slider_handle.location.x = (mSlider.nselected * mSlider.itemwidth / (mSlider.slider_max_val - mSlider.slider_min_val)) + mSlider.location.x
|
|
initialize(mSlider)
|
|
|
|
// Initialize the edit box
|
|
object mEditbox = s_editbox
|
|
mEditBox.location = 200, 300, 10
|
|
mEditBox.boxWidth = 400
|
|
mEditBox.boxHeight = 20
|
|
mEditBox.boxFont3D = szPATH_FONTS localize$(IDS_F_GEN_EDITBOX)
|
|
mEditBox.labelFont3D = szPATH_FONTS localize$(IDS_F_GEN_LABEL)
|
|
mEditBox.label = localize$(IDS_MP_BOT_NAME)
|
|
mEditBox.boxTextOffset = 5, 3
|
|
mEditBox.offset = 0, -15
|
|
mEditBox.boxtextlimit = 16
|
|
mEditBox.Auto_Update = false
|
|
mEditBox.boxValue = o_callsigns.names[bot_number]
|
|
mEditBox.disable_forward_slash = true
|
|
mEditBox.disable_quotes = true
|
|
initialize(mEditBox)
|
|
focus(mEditBox)
|
|
|
|
sound btnTriggeredSound = SPATH "sfx_button5.wav"
|
|
|
|
// variables for fading in and out
|
|
int alpha_val = 5
|
|
int fadeout = false
|
|
|
|
object errorScreen
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
// Handle fading in and fading out
|
|
if fadeout == true
|
|
{
|
|
// Fading out(Exiting)
|
|
if alpha_val > 0
|
|
{
|
|
alpha_val = alpha_val - 5
|
|
if alpha_val <= 0
|
|
{
|
|
alpha_val = 0
|
|
unfocus
|
|
script_end "ComputerPlayer.script"
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// Fading in(Entering)
|
|
if alpha_val < 150
|
|
{
|
|
alpha_val += 5
|
|
if alpha_val >= 150
|
|
{
|
|
alpha_val = 150
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
// fade in or fade out
|
|
setpencolor(0, 0, 0, alpha_val)
|
|
drawrect 0, 0 to getresx(), getresy()
|
|
|
|
// Redraw the frame if we are not fading out(exiting)
|
|
if (fadeout == false)
|
|
{
|
|
color (gframe) = packcolor(255, 255, 255, alpha_val)
|
|
render gframe, 150, 150
|
|
|
|
// Header
|
|
print3d_attributes = gFont3d,0xffffffff,1,0,1,0,0,just_center
|
|
print3d_margins = 150, 150 to 650, 180
|
|
print3d_position = 150, 155
|
|
print3d localize$(IDS_MP_LOBBY_ADD_BOT)
|
|
}
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
// Handle return from error screen
|
|
if (sender == errorScreen)
|
|
{
|
|
focus(mEditBox)
|
|
}
|
|
|
|
// Handle spin box value changed
|
|
if (sender == mSpinBox)
|
|
{
|
|
mSlider.nselected = mSpinBox.nselected
|
|
mSlider.o_slider_handle.location.x = (mSlider.nselected * mSlider.itemwidth / (mSlider.slider_max_val - mSlider.slider_min_val)) + mSlider.location.x
|
|
}
|
|
|
|
// Handle slider box value changed
|
|
if (sender == mSlider)
|
|
{
|
|
mSpinBox.nselected = mSlider.nselected
|
|
}
|
|
|
|
// Handle the OK Request from button or edit box
|
|
if ((sender == mEditBox) || (sender == mbutton[0]))
|
|
{
|
|
play btnTriggeredSound,1
|
|
|
|
if (equal$(mEditBox.boxValue, ""))
|
|
{
|
|
errorScreen = o_ErrorScreen
|
|
errorScreen.error_message = localize$(IDS_MP_BOT_ERROR)
|
|
initialize(errorScreen)
|
|
activate(errorScreen)
|
|
return
|
|
}
|
|
|
|
if (exists(@NetLobby@))
|
|
mail(1, @NetLobby@)
|
|
|
|
// Tell this script to fade out and deactivate all its objects
|
|
fadeout = true
|
|
for(iloop = 0; iloop < 2; iloop++)
|
|
{
|
|
deactivate(mbutton[iloop])
|
|
}
|
|
deactivate(mSpinBox)
|
|
deactivate(mSlider)
|
|
deactivate(mEditBox)
|
|
}
|
|
|
|
// Handle the Cancel Request
|
|
if (sender == mbutton[1])
|
|
{
|
|
play btnTriggeredSound,1
|
|
|
|
if (exists(@NetLobby@))
|
|
mail(-1, @NetLobby@)
|
|
|
|
// Tell this script to fade out and deactivate all its objects
|
|
fadeout = true
|
|
for(iloop = 0; iloop < 2; iloop++)
|
|
{
|
|
deactivate(mbutton[iloop])
|
|
}
|
|
deactivate(mSpinBox)
|
|
deactivate(mSlider)
|
|
deactivate(mEditBox)
|
|
}
|
|
}
|
|
|
|
GUI_DESTROY
|
|
{
|
|
unfocus
|
|
}
|
|
} |