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.
981 lines
26 KiB
Plaintext
981 lines
26 KiB
Plaintext
#include "Content\\ShellScripts\\stddefs.h"
|
|
#include "Content\\ShellScripts\\common_shell.script"
|
|
#include "Content\\ShellScripts\\ScriptStrings.h"
|
|
#include "Content\\ShellScripts\\ShellFunctionheaders.hpp"
|
|
|
|
#include "Content\\ShellScripts\\listboxes.script"
|
|
#include "Content\\ShellScripts\\mc_listboxes_controls.script"
|
|
#include "Content\\ShellScripts\\buttons.script"
|
|
#include "Content\\ShellScripts\\c_Pane.script"
|
|
#include "Content\\ShellScripts\\c_Text.script"
|
|
#include "Content\\ShellScripts\\c_Toggles.script"
|
|
#include "Content\\ShellScripts\\Slider.script"
|
|
#include "Content\\ShellScripts\\c_OM_Slider.script"
|
|
#include "Content\\ShellScripts\\c_InfoRegion.script"
|
|
#include "content\\Shellscripts\\c_rollover.script"
|
|
|
|
main
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
sound btnTriggeredSound = SPATH "sfx_button5.wav"
|
|
|
|
int nCtlHandler = 0
|
|
int nKeyJoy = 0
|
|
|
|
int i
|
|
int XIndent = 37
|
|
int YIndent = 57
|
|
int TextX = 35
|
|
int TextX1 = TextX + 25
|
|
int TextY = 50
|
|
int TextYOff= 22
|
|
|
|
int TextW = 200
|
|
int TextH = 25
|
|
|
|
//Toggle holders
|
|
int nTInvert //= 0
|
|
int nTInvert1 //= 0
|
|
int nTForce = 0
|
|
int nTJoyShift //= 0
|
|
int nTJoyThrottle//= 0
|
|
int nTjoy //= 1
|
|
int nTMouse //= 0
|
|
int nJoySelected//= 0
|
|
int nMouseSlid
|
|
//Input holder variables
|
|
int nColumn
|
|
int nRow
|
|
int nKey
|
|
int nJoy
|
|
int nMapping
|
|
int nJoyShift = 0
|
|
int tempVal
|
|
int nJoyXAxis
|
|
int nMouseXAxis
|
|
int nJoyRudderAxis
|
|
string szMapping
|
|
|
|
object oRollover = s_HelpRegion
|
|
oRollover.nFontID = IDS_F_ROLLOVER_INFO
|
|
oRollover.cTextColor= 0xFFff7200
|
|
oRollover.location = 31,516,255
|
|
oRollover.nWidth = 538
|
|
oRollover.nHeight = 56
|
|
initialize(oRollover)
|
|
|
|
object oJoystickTitle = s_Text
|
|
oJoystickTitle.location = XIndent + TextX,YIndent + TextY + (0 * TextYOff),nZ_TEXT
|
|
oJoystickTitle.nFontID = IDS_F_OM_LABEL
|
|
oJoystickTitle.nResID = IDS_OM_C_JOYSTICK_TITLE
|
|
oJoystickTitle.cTextColor = cWhite
|
|
oJoystickTitle.nJustify = 0
|
|
initialize(oJoystickTitle)
|
|
|
|
object oInvertTitle = s_Text
|
|
oInvertTitle.location = XIndent + TextX1 + 25,YIndent + TextY + (2 * TextYOff),nZ_TEXT
|
|
oInvertTitle.nFontID = IDS_F_OM_LABEL
|
|
oInvertTitle.nResID = IDS_OM_C_INVERTY
|
|
oInvertTitle.cTextColor = cWhite
|
|
oInvertTitle.nJustify = 0
|
|
initialize(oInvertTitle)
|
|
|
|
object oForceTitle = s_Text
|
|
oForceTitle.location = XIndent + TextX1 + 25,YIndent + TextY + (3 * TextYOff),nZ_TEXT
|
|
oForceTitle.nFontID = IDS_F_OM_LABEL
|
|
oForceTitle.nResID = IDS_OM_C_FORCE
|
|
oForceTitle.cTextColor = cWhite
|
|
oForceTitle.nJustify = 0
|
|
initialize(oForceTitle)
|
|
|
|
object oJoyShiftTitle = s_Text
|
|
oJoyShiftTitle.location = XIndent + TextX1 + 25,YIndent + TextY + (4 * TextYOff),nZ_TEXT
|
|
oJoyShiftTitle.nFontID = IDS_F_OM_LABEL
|
|
oJoyShiftTitle.nResID = IDS_OM_JOYSHIFT_TITLE
|
|
oJoyShiftTitle.cTextColor = cWhite
|
|
oJoyShiftTitle.nJustify = 0
|
|
initialize(oJoyShiftTitle)
|
|
|
|
object oJoyThrottleTitle = s_Text
|
|
oJoyThrottleTitle.location = XIndent + TextX1 + 25,YIndent + TextY + (5 * TextYOff),nZ_TEXT
|
|
oJoyThrottleTitle.nFontID = IDS_F_OM_LABEL
|
|
oJoyThrottleTitle.nResID = IDS_OM_JOYTHROTTLE_TITLE
|
|
oJoyThrottleTitle.cTextColor = cWhite
|
|
oJoyThrottleTitle.nJustify = 0
|
|
initialize(oJoyThrottleTitle)
|
|
|
|
object oMouseTitle = s_Text
|
|
oMouseTitle.location = XIndent + TextX,YIndent + TextY + (10 * TextYOff),nZ_TEXT
|
|
oMouseTitle.nFontID = IDS_F_OM_LABEL
|
|
oMouseTitle.nResID = IDS_OM_C_MOUSE_TITLE
|
|
oMouseTitle.cTextColor = cWhite
|
|
oMouseTitle.nJustify = 0
|
|
initialize(oMouseTitle)
|
|
|
|
object oInvert1Title = s_Text
|
|
oInvert1Title.location = XIndent + TextX1 + 25,YIndent + TextY + (15 * TextYOff),nZ_TEXT
|
|
oInvert1Title.nFontID = IDS_F_OM_LABEL
|
|
oInvert1Title.nResID = IDS_OM_C_INVERTY
|
|
oInvert1Title.cTextColor = cWhite
|
|
oInvert1Title.nJustify = 0
|
|
initialize(oInvert1Title)
|
|
|
|
object oMouseSlidTitle = s_Text
|
|
oMouseSlidTitle.location = XIndent + TextX1,YIndent + TextY + (11* TextYOff),nZ_TEXT
|
|
oMouseSlidTitle.nFontID = IDS_F_OM_LABEL
|
|
oMouseSlidTitle.nResID = IDS_OM_C_MOUSESENSE
|
|
oMouseSlidTitle.cTextColor = cWhite
|
|
oMouseSlidTitle.nJustify = 0
|
|
oMouseSlidTitle.nLayoutWidth = TextW
|
|
oMouseSlidTitle.nLayoutHeight = TextH
|
|
initialize(oMouseSlidTitle)
|
|
|
|
object oJoyXTitle = s_Text
|
|
oJoyXTitle.location = XIndent + TextX1,YIndent + TextY + (6* TextYOff),nZ_TEXT
|
|
oJoyXTitle.nFontID = IDS_F_OM_LABEL
|
|
oJoyXTitle.nResID = IDS_OM_C_JOYX
|
|
oJoyXTitle.cTextColor = cWhite
|
|
oJoyXTitle.nJustify = 0
|
|
oJoyXTitle.nLayoutWidth = TextW
|
|
oJoyXTitle.nLayoutHeight = TextH
|
|
initialize(oJoyXTitle)
|
|
|
|
object oJoyZTitle = s_Text
|
|
oJoyZTitle.location = XIndent + TextX1,YIndent + TextY + (8* TextYOff),nZ_TEXT
|
|
oJoyZTitle.nFontID = IDS_F_OM_LABEL
|
|
oJoyZTitle.nResID = IDS_OM_C_JOYZ
|
|
oJoyZTitle.cTextColor = cWhite
|
|
oJoyZTitle.nJustify = 0
|
|
oJoyZTitle.nLayoutWidth = TextW
|
|
oJoyZTitle.nLayoutHeight = TextH
|
|
initialize(oJoyZTitle)
|
|
|
|
object oMouseXTitle = s_Text
|
|
oMouseXTitle.location = XIndent + TextX1,YIndent + TextY + (13* TextYOff),nZ_TEXT
|
|
oMouseXTitle.nFontID = IDS_F_OM_LABEL
|
|
oMouseXTitle.nResID = IDS_OM_C_MOUSEX
|
|
oMouseXTitle.cTextColor = cWhite
|
|
oMouseXTitle.nJustify = 0
|
|
oMouseXTitle.nLayoutWidth = TextW
|
|
oMouseXTitle.nLayoutHeight = TextH
|
|
initialize(oMouseXTitle)
|
|
|
|
//Info Regions
|
|
int IR_X = 35
|
|
int IR_Y = 2
|
|
int IR_Z = 35
|
|
int IR_W = 150
|
|
int IR_H = 18
|
|
|
|
object oInvertDesc = s_InfoRegion
|
|
oInvertDesc.location = oInvertTitle.location.x - IR_X,oInvertTitle.location.y - IR_Y,IR_Z
|
|
oInvertDesc.nWidth = IR_W
|
|
oInvertDesc.nHeight = IR_H
|
|
oInvertDesc.nHelpID = IDS_HELP_OM_C_INVERTJOY
|
|
initialize(oInvertDesc)
|
|
|
|
object oJoystickDesc = s_InfoRegion
|
|
oJoystickDesc.location = oJoystickTitle.location.x - IR_X,oJoystickTitle.location.y - IR_Y,IR_Z
|
|
oJoystickDesc.nWidth = IR_W
|
|
oJoystickDesc.nHeight = IR_H
|
|
oJoystickDesc.nHelpID = IDS_HELP_OM_C_JOYSTICK
|
|
initialize(oJoystickDesc)
|
|
|
|
object oMouseDesc = s_InfoRegion
|
|
oMouseDesc.location = oMouseTitle.location.x - IR_X,oMouseTitle.location.y - IR_Y,IR_Z
|
|
oMouseDesc.nWidth = IR_W
|
|
oMouseDesc.nHeight = IR_H
|
|
oMouseDesc.nHelpID = IDS_HELP_OM_C_MOUSE
|
|
initialize(oMouseDesc)
|
|
|
|
object oInvert1Desc = s_InfoRegion
|
|
oInvert1Desc.location = oInvert1Title.location.x - IR_X,oInvert1Title.location.y - IR_Y,IR_Z
|
|
oInvert1Desc.nWidth = IR_W
|
|
oInvert1Desc.nHeight = IR_H
|
|
oInvert1Desc.nHelpID = IDS_HELP_OM_C_INVERTMOUSE
|
|
initialize(oInvert1Desc)
|
|
|
|
object oForceDesc = s_InfoRegion
|
|
oForceDesc.location = oForceTitle.location.x - IR_X,oForceTitle.location.y - IR_Y,IR_Z
|
|
oForceDesc.nWidth = IR_W
|
|
oForceDesc.nHeight = IR_H
|
|
oForceDesc.nHelpID = IDS_HELP_OM_C_Force
|
|
initialize(oForceDesc)
|
|
|
|
object oJoyShiftDesc = s_InfoRegion
|
|
oJoyShiftDesc.location = oJoyShiftTitle.location.x - (2*IR_X),oJoyShiftTitle.location.y - IR_Y,IR_Z
|
|
oJoyShiftDesc.nWidth = IR_W + IR_X
|
|
oJoyShiftDesc.nHeight = IR_H
|
|
oJoyShiftDesc.nHelpID = IDS_HELP_OM_C_JOYSHIFT
|
|
initialize(oJoyShiftDesc)
|
|
|
|
object oJoyThrottleDesc = s_InfoRegion
|
|
oJoyThrottleDesc.location = oJoyThrottleTitle.location.x - (2*IR_X),oJoyThrottleTitle.location.y - IR_Y,IR_Z
|
|
oJoyThrottleDesc.nWidth = IR_W + IR_X
|
|
oJoyThrottleDesc.nHeight = IR_H
|
|
oJoyThrottleDesc.nHelpID = IDS_HELP_OM_C_JOYTHROTTLE
|
|
initialize(oJoyThrottleDesc)
|
|
|
|
object oMouseSlidDesc = s_InfoRegion
|
|
oMouseSlidDesc.location = oMouseSlidTitle.location.x - 15,oMouseSlidTitle.location.y - IR_Y,IR_Z
|
|
oMouseSlidDesc.nWidth = IR_W + 40
|
|
oMouseSlidDesc.nHeight = IR_H * 2
|
|
oMouseSlidDesc.nHelpID = IDS_HELP_OM_C_MOUSESENSE
|
|
initialize(oMouseSlidDesc)
|
|
|
|
object oJoyXDesc = s_InfoRegion
|
|
oJoyXDesc.location = oJoyXTitle.location.x - 15,oJoyXTitle.location.y - IR_Y,IR_Z
|
|
oJoyXDesc.nWidth = IR_W +40
|
|
oJoyXDesc.nHeight = IR_H *2
|
|
oJoyXDesc.nHelpID = IDS_HELP_OM_C_JOYX
|
|
initialize(oJoyXDesc)
|
|
|
|
object oJoyZDesc = s_InfoRegion
|
|
oJoyZDesc.location = oJoyZTitle.location.x - 15,oJoyZTitle.location.y - IR_Y,IR_Z
|
|
oJoyZDesc.nWidth = IR_W +40
|
|
oJoyZDesc.nHeight = IR_H *2
|
|
oJoyZDesc.nHelpID = IDS_HELP_OM_C_JOYZ
|
|
initialize(oJoyZDesc)
|
|
|
|
object oMouseXDesc = s_InfoRegion
|
|
oMouseXDesc.location = oMouseXTitle.location.x - 15,oMouseXTitle.location.y - IR_Y,IR_Z
|
|
oMouseXDesc.nWidth = IR_W +40
|
|
oMouseXDesc.nHeight = IR_H*2
|
|
oMouseXDesc.nHelpID = IDS_HELP_OM_C_MOUSEX
|
|
initialize(oMouseXDesc)
|
|
|
|
//Buttons
|
|
object oBDefault = s_multistatepane
|
|
oBDefault.file = WPATH "button_reg_200x27m_4state.tga"
|
|
oBDefault.text = localize$(IDS_GN_DEFAULT)
|
|
oBDefault.total_states = 4
|
|
oBDefault.nRollover = 1
|
|
oBDefault.nHelpID = IDS_HELP_OM_C_DEFAULT
|
|
oBDefault.location = XIndent + 243,YIndent + 371, nZ_BUTTON
|
|
initialize (oBDefault)
|
|
|
|
object oBReset = s_multistatepane
|
|
oBReset.file = WPATH "button_reg_200x27m_4state.tga"
|
|
oBReset.text = localize$(IDS_OM_C_RESET)
|
|
oBReset.total_states = 4
|
|
oBReset.nRollover = 1
|
|
oBReset.nHelpID = IDS_HELP_OM_C_RESET
|
|
oBReset.location = XIndent + 513,YIndent + 371, nZ_BUTTON
|
|
initialize (oBReset)
|
|
|
|
object oInvertToggle = s_multistatepanetoggle
|
|
oInvertToggle.location = oInvertTitle.location.x - 25,oInvertTitle.location.y,nZ_BUTTON
|
|
oInvertToggle.file = WPATH "checkbox_15x15_4state.tga"
|
|
oInvertToggle.total_states = 4
|
|
oInvertToggle.text = ""
|
|
initialize(oInvertToggle)
|
|
|
|
object oInvert1Toggle = s_multistatepanetoggle
|
|
oInvert1Toggle.location = oInvert1Title.location.x - 25,oInvert1Title.location.y,nZ_BUTTON
|
|
oInvert1Toggle.file = WPATH "checkbox_15x15_4state.tga"
|
|
oInvert1Toggle.total_states = 4
|
|
oInvert1Toggle.text = ""
|
|
initialize(oInvert1Toggle)
|
|
|
|
object oForceToggle = s_multistatepanetoggle
|
|
oForceToggle.location = oForceTitle.location.x - 25,oForceTitle.location.y,nZ_BUTTON
|
|
oForceToggle.file = WPATH "checkbox_15x15_4state.tga"
|
|
oForceToggle.total_states = 4
|
|
oForceToggle.text = ""
|
|
initialize(oForceToggle)
|
|
|
|
object oJoyShiftToggle = s_multistatepanetoggle
|
|
oJoyShiftToggle.location = oJoyShiftTitle.location.x - 25,oJoyShiftTitle.location.y,nZ_BUTTON
|
|
oJoyShiftToggle.file = WPATH "checkbox_15x15_4state.tga"
|
|
oJoyShiftToggle.total_states = 4
|
|
oJoyShiftToggle.text = ""
|
|
initialize(oJoyShiftToggle)
|
|
|
|
object oJoyThrottleToggle = s_multistatepanetoggle
|
|
oJoyThrottleToggle.location = oJoyThrottleTitle.location.x - 25,oJoyThrottleTitle.location.y,nZ_BUTTON
|
|
oJoyThrottleToggle.file = WPATH "checkbox_15x15_4state.tga"
|
|
oJoyThrottleToggle.total_states = 4
|
|
oJoyThrottleToggle.text = ""
|
|
initialize(oJoyThrottleToggle)
|
|
|
|
object oMouseToggle = s_multistatepanetoggle
|
|
oMouseToggle.location = oMouseTitle.location.x - 25,oMouseTitle.location.y,nZ_BUTTON
|
|
oMouseToggle.file = WPATH "checkbox_15x15_4state.tga"
|
|
oMouseToggle.total_states = 4
|
|
oMouseToggle.text = ""
|
|
initialize(oMouseToggle)
|
|
|
|
object oSMouseSlid = s_OMSlider
|
|
oSMouseSlid.location = oMouseSlidTitle.location.x, oMouseSlidTitle.location.y + 25,nZ_SLIDER
|
|
oSMouseSlid.nHelpId = IDS_HELP_OM_C_MOUSESENSE
|
|
|
|
//Dropdowns
|
|
object oCover = s_Cover
|
|
oCover.location = XIndent + TextX - 10,YIndent + TextY + (1 * TextYOff) - 5,250
|
|
oCover.nX = 210
|
|
oCover.nY = 9* TextYOff
|
|
initialize(oCover)
|
|
deactivate(oCover)
|
|
|
|
int nJoysticks
|
|
int list_size
|
|
string szJoyNames[10]
|
|
|
|
callback($$Shell_CallbackHandler$$,GetJoyStickNames,nJoysticks,szJoyNames[])
|
|
|
|
object oDJoys = s_droplistbox
|
|
if(nJoysticks == 0)
|
|
{
|
|
list_size = 1
|
|
szJoyNames[0] = localize$(IDS_OM_C_AXIS1)
|
|
szJoyNames[1] = localize$(IDS_OM_C_AXIS1)
|
|
activate(oCover)
|
|
}
|
|
else
|
|
{
|
|
list_size = nJoysticks
|
|
}
|
|
oDJoys.itemWidth = 175
|
|
oDJoys.itemHeight = 16
|
|
oDJoys.list_size = list_size
|
|
oDJoys.max_displayed = 6
|
|
oDJoys.arrowHeight = 15
|
|
oDJoys.nRollover = 1
|
|
oDJoys.nHelpID = IDS_HELP_OM_V_SCREEN
|
|
oDJoys.location = XIndent + TextX,YIndent + TextY + (1 * TextYOff),nZ_TEXT + 7
|
|
|
|
for(i=0;i < list_size;i++)
|
|
{
|
|
oDJoys.list_item[i] = szJoyNames[i]
|
|
}
|
|
|
|
object oDJoyXAxis = s_droplistbox
|
|
oDJoyXAxis.itemWidth = 150
|
|
oDJoyXAxis.itemHeight = 16
|
|
oDJoyXAxis.list_size = 3
|
|
oDJoyXAxis.max_displayed = 3
|
|
oDJoyXAxis.arrowHeight = 15
|
|
oDJoyXAxis.nRollover = 1
|
|
oDJoyXAxis.nHelpID = IDS_HELP_OM_C_JOYX
|
|
oDJoyXAxis.location = XIndent + TextX1,YIndent + TextY + (7* TextYOff) -6,nZ_TEXT + 10
|
|
|
|
oDJoyXAxis.list_item[0] = localize$(IDS_OM_C_AXIS1)
|
|
oDJoyXAxis.list_item[1] = localize$(IDS_OM_C_AXIS2)
|
|
oDJoyXAxis.list_item[2] = localize$(IDS_OM_C_AXIS3)
|
|
|
|
object oDJoyRudderAxis = s_droplistbox
|
|
oDJoyRudderAxis.itemWidth = 150
|
|
oDJoyRudderAxis.itemHeight = 16
|
|
oDJoyRudderAxis.list_size = 3
|
|
oDJoyRudderAxis.max_displayed = 6
|
|
oDJoyRudderAxis.arrowHeight = 15
|
|
oDJoyRudderAxis.nRollover = 1
|
|
oDJoyRudderAxis.nHelpID = IDS_HELP_OM_C_JOYZ
|
|
oDJoyRudderAxis.location = XIndent + TextX1,YIndent + TextY + (9* TextYOff)-6,nZ_TEXT + 5
|
|
|
|
oDJoyRudderAxis.list_item[0] = localize$(IDS_OM_C_AXIS1)
|
|
oDJoyRudderAxis.list_item[1] = localize$(IDS_OM_C_AXIS2)
|
|
oDJoyRudderAxis.list_item[2] = localize$(IDS_OM_C_AXIS3)
|
|
|
|
object oDMouseAxis = s_droplistbox
|
|
oDMouseAxis.itemWidth = 150
|
|
oDMouseAxis.itemHeight = 16
|
|
oDMouseAxis.list_size = 3
|
|
oDMouseAxis.max_displayed = 3
|
|
oDMouseAxis.arrowHeight = 15
|
|
oDMouseAxis.nRollover = 1
|
|
oDMouseAxis.nHelpID = IDS_HELP_OM_C_MOUSEX
|
|
oDMouseAxis.location = XIndent + TextX1,YIndent + TextY + (14* TextYOff)-6,nZ_TEXT + 100
|
|
|
|
oDMouseAxis.list_item[0] = localize$(IDS_OM_C_AXIS1)
|
|
oDMouseAxis.list_item[1] = localize$(IDS_OM_C_AXIS2)
|
|
oDMouseAxis.list_item[2] = localize$(IDS_OM_C_AXIS3)
|
|
|
|
//Controls List
|
|
int MAX_MCCB_COLUMNS = 4
|
|
int MAX_MCCB_ITEMS = 264
|
|
int nCommandCount = 63
|
|
string szCat[MAX_MCCB_ITEMS]
|
|
string szCommand[MAX_MCCB_ITEMS]
|
|
string szKey[MAX_MCCB_ITEMS]
|
|
string szJoy[MAX_MCCB_ITEMS]
|
|
string szMouse[MAX_MCCB_ITEMS]
|
|
|
|
object oLKeys = s_mc_listbox
|
|
oLKeys.location = XIndent + 243,YIndent + 65,nZ_LISTBOX
|
|
oLKeys.itemWidth = 450
|
|
oLKeys.itemHeight = 5
|
|
oLKeys.itemHeight_padding = 0
|
|
oLKeys.column_header_height = 20
|
|
oLKeys.max_displayed = 75
|
|
oLKeys.top_of_list = 0
|
|
oLKeys.buttonwidth = 16
|
|
oLKeys.first_delay = 10
|
|
oLKeys.nRollover = 1
|
|
oLKeys.nHelpID = IDS_HELP_OM_C_KEY_BUTTON
|
|
|
|
// Specify number of columns
|
|
oLKeys.num_of_columns = 4
|
|
|
|
oLKeys.column[0].location.x = 5
|
|
oLKeys.column[0].fontcolor = cWhite
|
|
oLKeys.column[0].fontAlignment = just_left
|
|
|
|
oLKeys.offsetx[1] = 5
|
|
oLKeys.column[1].location.x = 150
|
|
oLKeys.column[1].fontcolor = cWhite
|
|
oLKeys.column[1].fontAlignment = just_all
|
|
|
|
oLKeys.offsetx[2] = 5
|
|
oLKeys.column[2].location.x = 265
|
|
oLKeys.column[2].fontcolor = cWhite
|
|
oLKeys.column[2].fontAlignment = just_all
|
|
|
|
oLKeys.offsetx[3] = 5
|
|
oLKeys.column[3].location.x = 370
|
|
oLKeys.column[3].fontcolor = cWhite
|
|
oLKeys.column[3].fontAlignment = just_all
|
|
|
|
|
|
object oCtlHandler = s_InputHandler
|
|
object oJoyCatcher = s_InputHandler
|
|
|
|
object oJoyPoller = s_Poller
|
|
oJoyPoller.location = oJoyShiftTitle.location.x - 65,oJoyShiftTitle.location.y + 5,nZ_TEXT - 1
|
|
|
|
if(nJoysticks == 0)
|
|
{
|
|
|
|
|
|
|
|
deactivate(oCtlHandler)
|
|
deactivate(oJoyCatcher)
|
|
deactivate(oJoyPoller)
|
|
}
|
|
initialize(this)
|
|
|
|
}
|
|
GUI_INIT
|
|
{
|
|
callback($$Shell_CallbackHandler$$,GetMouseSensitivity,nMouseSlid)
|
|
oSMouseSlid.nSelected = nMouseSlid
|
|
initialize(oSMouseSlid)
|
|
|
|
callback($$Shell_CallbackHandler$$,ShellControlGetMapping,szCat[],szCommand[],szKey[],szJoy[],szMouse[],nCommandCount)
|
|
oLKeys.list_size = nCommandCount
|
|
// Now store the Key entries in the list box
|
|
for (i = 0; i < nCommandCount; i++)
|
|
{
|
|
oLKeys.column[0].list_item[i] = szCommand[i]
|
|
oLKeys.column[1].list_item[i] = szKey[i]
|
|
oLKeys.column[2].list_item[i] = szJoy[i]
|
|
oLKeys.column[3].list_item[i] = szMouse[i]
|
|
mail(i, this)
|
|
oLKeys.list_order[i] = i
|
|
}
|
|
initialize(oLKeys)
|
|
|
|
//Header Labels
|
|
oLKeys.column[0].o_header.s_text = localize$(IDS_OM_C_COMMAND)
|
|
oLKeys.column[0].o_header.n_just = just_all
|
|
oLKeys.column[1].o_header.s_text = localize$(IDS_OM_C_KEYBOARD_TITLE)
|
|
oLKeys.column[1].o_header.n_just = just_all
|
|
oLKeys.column[2].o_header.s_text = localize$(IDS_OM_C_MOUSE_TITLE)
|
|
oLKeys.column[2].o_header.n_just = just_all
|
|
oLKeys.column[3].o_header.s_text = localize$(IDS_OM_C_JOYSTICK_TITLE)
|
|
oLKeys.column[3].o_header.n_just = just_all
|
|
|
|
callback($$Shell_CallbackHandler$$,GetJoyStickInvert,nTInvert)
|
|
callback($$Shell_CallbackHandler$$,GetMouseInvert,nTInvert1)
|
|
callback($$Shell_CallbackHandler$$,GetForce,nTForce)
|
|
callback($$Shell_CallbackHandler$$,GetMouse,nTMouse)
|
|
callback($$Shell_CallbackHandler$$,GetJoyStickShift,nTJoyShift)
|
|
callback($$Shell_CallbackHandler$$,GetJoyStickThrottle,nTJoyThrottle)
|
|
|
|
//Add 1 for mail messages
|
|
nTInvert++
|
|
nTInvert1++
|
|
nTForce++
|
|
nTJoy++
|
|
nTMouse++
|
|
nTJoyShift++
|
|
nTJoyThrottle++
|
|
|
|
mail(nTInvert, oInvertToggle)
|
|
mail(nTInvert1, oInvert1Toggle)
|
|
mail(nTForce, oForceToggle)
|
|
mail(nTMouse, oMouseToggle)
|
|
mail(nTJoyShift, oJoyShiftToggle)
|
|
mail(nTJoyThrottle, oJoyThrottleToggle)
|
|
|
|
initialize(oJoyPoller)
|
|
|
|
callback($$Shell_CallbackHandler$$,GetJoyListSelected,nJoySelected)
|
|
if(nJoysticks == 0)
|
|
{
|
|
oDJoys.nSelected = 0
|
|
}
|
|
else
|
|
{
|
|
oDJoys.nSelected = nJoySelected
|
|
}
|
|
initialize(oDJoys)
|
|
|
|
callback($$Shell_CallbackHandler$$,GetJoyXAxis,nJoyXAxis)
|
|
oDJoyXAxis.nSelected = nJoyXAxis
|
|
initialize(oDJoyXAxis)
|
|
|
|
callback($$Shell_CallbackHandler$$,GetJoyRudderAxis,nJoyRudderAxis)
|
|
oDJoyRudderAxis.nSelected = nJoyRudderAxis
|
|
initialize(oDJoyRudderAxis)
|
|
|
|
callback($$Shell_CallbackHandler$$,GetMouseXAxis,nMouseXAxis)
|
|
oDMouseAxis.nSelected = nMouseXAxis
|
|
initialize(oDMouseAxis)
|
|
|
|
callback($$Shell_CallbackHandler$$,SaveSettings)
|
|
}
|
|
GUI_MAILBOX
|
|
{
|
|
switch(sender)
|
|
{
|
|
case oBDefault:
|
|
{
|
|
callback($$Shell_CallbackHandler$$,ShellControlSetDefault)
|
|
initialize(this)
|
|
}
|
|
break
|
|
case oBReset:
|
|
{
|
|
callback($$Shell_CallbackHandler$$,RestoreSetting)
|
|
initialize(this)
|
|
}
|
|
break
|
|
case oDJoys:
|
|
{
|
|
nJoySelected = oDJoys.nSelected
|
|
callback($$Shell_CallbackHandler$$,SetJoyListSelected,nJoySelected)
|
|
}
|
|
break
|
|
case oDJoyXAxis:
|
|
{
|
|
nJoyXAxis = oDJoyXAxis.nSelected
|
|
callback($$Shell_CallbackHandler$$,SetJoyXAxis,nJoyXAxis)
|
|
}
|
|
break
|
|
case oDJoyRudderAxis:
|
|
{
|
|
nJoyRudderAxis = oDJoyRudderAxis.nSelected
|
|
callback($$Shell_CallbackHandler$$,SetJoyRudderAxis,nJoyRudderAxis)
|
|
}
|
|
break
|
|
case oDMouseAxis:
|
|
{
|
|
nMouseXAxis = oDMouseAxis.nSelected
|
|
callback($$Shell_CallbackHandler$$,SetMouseXAxis,nMouseXAxis)
|
|
}
|
|
break
|
|
case oSMouseSlid:
|
|
{
|
|
nMouseSlid = oSMouseSlid.nSelected
|
|
}
|
|
break
|
|
case oInvertToggle:
|
|
{
|
|
if (nTInvert != 2)
|
|
{
|
|
nTInvert = 2
|
|
}
|
|
else
|
|
if (nTInvert == 2)
|
|
{
|
|
nTInvert = 1
|
|
}
|
|
mail(nTInvert, oInvertToggle)
|
|
tempVal = nTInvert - 1
|
|
callback($$Shell_CallbackHandler$$,SetJoyStickInvert,tempVal)
|
|
}
|
|
break
|
|
case oInvert1Toggle:
|
|
{
|
|
if (nTInvert1 != 2)
|
|
{
|
|
nTInvert1 = 2
|
|
}
|
|
else
|
|
if (nTInvert1 == 2)
|
|
{
|
|
nTInvert1 = 1
|
|
}
|
|
mail(nTInvert1, oInvert1Toggle)
|
|
tempVal = nTInvert1 - 1
|
|
callback($$Shell_CallbackHandler$$,SetMouseInvert, tempVal)
|
|
}
|
|
break
|
|
case oForceToggle:
|
|
{
|
|
if (nTForce != 2)
|
|
{
|
|
nTForce = 2
|
|
}
|
|
else
|
|
if (nTForce == 2)
|
|
{
|
|
nTForce = 1
|
|
}
|
|
mail(nTForce, oForceToggle)
|
|
tempVal = nTForce - 1
|
|
callback($$Shell_CallbackHandler$$,SetForce, tempVal)
|
|
}
|
|
break
|
|
case oJoyShiftToggle:
|
|
{
|
|
if (nTJoyShift != 2)
|
|
{
|
|
nTJoyShift = 2
|
|
}
|
|
else
|
|
if (nTJoyShift == 2)
|
|
{
|
|
nTJoyShift = 1
|
|
}
|
|
mail(nTJoyShift, oJoyShiftToggle)
|
|
tempVal = nTJoyShift - 1
|
|
callback($$Shell_CallbackHandler$$,SetJoyStickShift,tempVal)
|
|
initialize(oJoyPoller)
|
|
}
|
|
break
|
|
case oJoyThrottleToggle:
|
|
{
|
|
if (nTJoyThrottle != 2)
|
|
{
|
|
nTJoyThrottle = 2
|
|
}
|
|
else
|
|
if (nTJoyThrottle == 2)
|
|
{
|
|
nTJoyThrottle = 1
|
|
}
|
|
mail(nTJoyThrottle, oJoyThrottleToggle)
|
|
tempVal = nTJoyThrottle - 1
|
|
callback($$Shell_CallbackHandler$$,SetJoyStickThrottle,tempVal)
|
|
}
|
|
break
|
|
case oMouseToggle:
|
|
{
|
|
if (nTMouse != 2)
|
|
{
|
|
nTMouse = 2
|
|
}
|
|
else
|
|
if (nTMouse == 2)
|
|
{
|
|
nTMouse = 1
|
|
}
|
|
mail(nTMouse, oMouseToggle)
|
|
tempVal = nTMouse - 1
|
|
callback($$Shell_CallbackHandler$$,SetMouse,tempVal)
|
|
}
|
|
break
|
|
case oJoyCatcher:
|
|
{
|
|
if (getmessage(0)== nMSG_MAP_JOYSHIFT)
|
|
{
|
|
int nShift = getmessage(1)
|
|
|
|
callback($$Shell_CallbackHandler$$,SetJoyShiftValue,nShift)
|
|
|
|
initialize(oJoyPoller)
|
|
}
|
|
}
|
|
break
|
|
case oCtlHandler:
|
|
{
|
|
nCtlHandler = 1
|
|
}
|
|
break
|
|
}
|
|
switch(getmessage(0))
|
|
{
|
|
case nMSG_SET_DEVICEOPTIONS:
|
|
{
|
|
nTInvert = nTInvert + 1
|
|
nTInvert1 = nTInvert + 1
|
|
nTForce = nTForce + 1
|
|
nTJoyShift = nTJoyShift + 1
|
|
nTJoy = nTJoy + 1
|
|
nTMouse = nTMouse + 1
|
|
}
|
|
break
|
|
case nMSG_SET_INDEX:
|
|
{
|
|
nColumn = getmessage(1)
|
|
nRow = getmessage(2)
|
|
}
|
|
break
|
|
case nMSG_MAP_MOUSE: //Controltype Mouse = 3, Key = 1, Joy = 2
|
|
{
|
|
nMapping = getmessage(1)
|
|
callback($$Shell_CallbackHandler$$,ShellControlAssignValue,nRow,nColumn,nMapping)
|
|
}
|
|
break
|
|
case nMSG_MAP_KEY:
|
|
{
|
|
int nNormal = getmessage(1)
|
|
int nControl= getmessage(2)
|
|
callback($$Shell_CallbackHandler$$,ShellControlAssignValue,nRow,nColumn,nNormal,nControl)
|
|
}
|
|
break
|
|
case nMSG_UPDATE_MAP:
|
|
{
|
|
int nRow1
|
|
int nColumn1
|
|
callback($$Shell_CallbackHandler$$,ShellControlGetValue,nRow1,nColumn1,szMapping)
|
|
oLKeys.column[nColumn1].list_item[nRow1] = szMapping
|
|
}
|
|
break
|
|
case nMSG_MAP_KEYJOY_COMBO:
|
|
{
|
|
nKeyJoy = 1
|
|
nJoyShift = getmessage(1)
|
|
}
|
|
break
|
|
case nMSG_MAP_JOY:
|
|
{
|
|
if (nCtlHandler == 1)
|
|
{
|
|
int nNormal = getmessage(1)
|
|
if(nKeyJoy != 1)
|
|
{
|
|
nJoyShift = getmessage(2)
|
|
}
|
|
callback($$Shell_CallbackHandler$$,ShellControlAssignValue,nRow,nColumn,nNormal,nJoyShift)
|
|
nCtlHandler = 0
|
|
nKeyJoy = 0
|
|
nJoyShift = 0
|
|
}
|
|
}
|
|
break
|
|
case -1:
|
|
{
|
|
script_end
|
|
}
|
|
break
|
|
}
|
|
}
|
|
GUI_PAUSE
|
|
{
|
|
callback($$Shell_CallbackHandler$$,SetMouseSensitivity,nMouseSlid)
|
|
}
|
|
|
|
GUI_CONTINUE
|
|
{
|
|
// callback($$Shell_CallbackHandler$$,SaveSettings)
|
|
}
|
|
GUI_DESTROY
|
|
{
|
|
if(!exists(@Options@))
|
|
{
|
|
if (exists($$Shell_CallbackHandler$$))
|
|
{
|
|
callback($$Shell_CallbackHandler$$,SetMouseSensitivity,nMouseSlid)
|
|
callback($$Shell_CallbackHandler$$, ShellSaveOptions)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
s_InputHandler
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int nButtonID
|
|
int nButtons
|
|
int nShiftButton = 12
|
|
int shifted = 0
|
|
|
|
framerate = 0
|
|
catchup = 0
|
|
|
|
if (parent.nJoysticks != 0)//js_countdevices())
|
|
{
|
|
//
|
|
//Always use the first joystick...
|
|
//
|
|
js_setpolling(parent.nJoySelected, true)
|
|
|
|
//
|
|
//Only pay attention to the first twelve buttons
|
|
//
|
|
nButtons = js_countbuttons(parent.nJoySelected)
|
|
if (nButtons > 12)
|
|
{
|
|
nButtons = 12
|
|
}
|
|
}
|
|
}
|
|
GUI_EXECUTE
|
|
{
|
|
if(parent.nJoysticks != 0)
|
|
{
|
|
callback($$Shell_CallbackHandler$$,GetJoyShiftValue,nShiftButton)
|
|
|
|
shifted = 0
|
|
if (js_getbutton(parent.nJoySelected,nShiftButton))
|
|
{
|
|
shifted = 1
|
|
}
|
|
for (nButtonID = 0; nButtonID < nButtons ; nButtonID++)
|
|
{
|
|
if(nButtonID != nShiftButton)
|
|
{
|
|
if (js_getbutton(parent.nJoySelected, nButtonID))
|
|
{
|
|
mail(nMSG_MAP_JOYSHIFT,nButtonID,parent)
|
|
mail(nMSG_MAP_JOY,nButtonID,shifted,parent)
|
|
break
|
|
}
|
|
}
|
|
}
|
|
int joystickHat = js_getaxis(parent.nJoySelected, 8)
|
|
if ((joystickHat >= 625) && (joystickHat <= 875))
|
|
{
|
|
mail(nMSG_MAP_JOYSHIFT,10,parent)
|
|
mail(nMSG_MAP_JOY,10,shifted,parent)
|
|
}
|
|
if ((joystickHat >= 125) && (joystickHat <= 375))
|
|
{
|
|
mail(nMSG_MAP_JOYSHIFT,11,parent)
|
|
mail(nMSG_MAP_JOY,11,shifted,parent)
|
|
}
|
|
if (joystickHat != -1000 && (joystickHat < 125 || joystickHat > 875))
|
|
{
|
|
mail(nMSG_MAP_JOYSHIFT,12,parent)
|
|
mail(nMSG_MAP_JOY,12,shifted,parent)
|
|
}
|
|
if ((joystickHat > 375) && (joystickHat < 625))
|
|
{
|
|
mail(nMSG_MAP_JOYSHIFT,13,parent)
|
|
mail(nMSG_MAP_JOY,13,shifted,parent)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
s_Poller
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int nIn = 0
|
|
int nShift
|
|
string szNum = ""
|
|
int temp
|
|
|
|
object oJoyNumber = s_Text
|
|
|
|
oJoyNumber.nFontID = IDS_F_OM_LABEL
|
|
oJoyNumber.cTextColor = cWhite
|
|
oJoyNumber.nJustify = 3
|
|
initialize(oJoyNumber)
|
|
}
|
|
GUI_INIT
|
|
{
|
|
if(parent.nTJoyShift == 2)
|
|
{
|
|
region = 0,-5 to 30,11
|
|
callback($$Shell_CallbackHandler$$,GetJoyShiftValue,nShift)
|
|
temp = nShift + 1
|
|
szNum = conv$(temp)
|
|
}
|
|
else
|
|
{
|
|
region = 0,0 to 0,0
|
|
szNum = ""
|
|
}
|
|
oJoyNumber.location = location.x,location.y - 3,nZ_TEXT + 100
|
|
oJoyNumber.szText = szNum
|
|
oJoyNumber.nLayoutWidth = 30
|
|
oJoyNumber.nLayoutHeight= 16
|
|
initialize(oJoyNumber)
|
|
}
|
|
LBUTTON_UPDATE
|
|
{
|
|
if mouse.left == BUTTON_PRESSED
|
|
{
|
|
parent.oJoyCatcher.framerate = 30
|
|
}
|
|
}
|
|
REGION_ENTERED
|
|
{
|
|
nIn = 1
|
|
oRollover.nHelpID = IDS_HELP_OM_C_JOYSHIFT_BOX
|
|
mail (nMSG_INPUT_RESID,oRollover)
|
|
|
|
}
|
|
REGION_EXITED
|
|
{
|
|
nIn = 0
|
|
parent.oJoyCatcher.framerate = 0
|
|
mail (nMSG_CLEARHELP,oRollover)
|
|
|
|
}
|
|
GUI_DEACTIVATE
|
|
{
|
|
deactivate(oJoyNumber)
|
|
}
|
|
GUI_DRAW
|
|
{
|
|
if(parent.nTJoyShift == 2)
|
|
{
|
|
if(nIn == 1)
|
|
{
|
|
setpencolor(cBlack)
|
|
}
|
|
else
|
|
{
|
|
setpencolor(0x88000000)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
setpencolor(0x22222222)
|
|
}
|
|
ldrawrect 0,-5 to 30,11
|
|
|
|
if(nIn == 1 || parent.nTJoyShift == 2)
|
|
{
|
|
if(nIn == 1)
|
|
{
|
|
setpencolor(cWhite)
|
|
}
|
|
else
|
|
{
|
|
setpencolor(0x88FFFFFF)
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
setpencolor(0x66FFFFFF)
|
|
}
|
|
ldrawframe 0,-5 to 30,11
|
|
}
|
|
}
|
|
s_Cover
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int nX
|
|
int nY
|
|
}
|
|
GUI_INIT
|
|
{
|
|
region = 0,0 to nX,nY
|
|
}
|
|
GUI_DRAW
|
|
{
|
|
setpencolor(0x88888888)
|
|
ldrawrect 0,0 to nX,nY
|
|
}
|
|
}
|