void SetupExplosivesGUI() { UINT16 str[20]; INT16 yp; swprintf( str, L"%d", gpItem->bStatus[0] ); AddTextInputField( 485, 380, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); swprintf( str, L"%d", gpItem->ubNumberOfObjects ); AddTextInputField( 485, 400, 25, 15, MSYS_PRIORITY_NORMAL, str, 1, INPUTTYPE_NUMERICSTRICT ); if( Item[ gpItem->usItem ].ubPerPocket == 1 ) { DisableTextField( 2 ); } swprintf( str, L"%d", gpItem->bTrap ); AddTextInputField( 485, 420, 25, 15, MSYS_PRIORITY_NORMAL, str, 2, INPUTTYPE_NUMERICSTRICT ); if( gpEditingItemPool ) { swprintf( str, L"%d", 100 - gWorldItems[ gpEditingItemPool->iItemIndex ].ubNonExistChance ); AddTextInputField( 485, 440, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); } yp = 375; gfDetonator = FALSE; guiDetonatorButton = -1; if( ValidAttachment( DETONATOR, gpItem->usItem ) ) { guiDetonatorButton = CreateTextButton( L"DETONATOR", SMALLCOMPFONT, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 570, yp, 60, 12, BUTTON_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, ToggleDetonator ); yp += 14; if( FindAttachment( gpItem, DETONATOR ) != -1 ) { ButtonList[ guiDetonatorButton ]->uiFlags |= BUTTON_CLICKED_ON; gfDetonator = TRUE; } } }
void SetupArmourGUI() { UINT16 str[20]; swprintf( str, L"%d", gpItem->bStatus[0] ); AddTextInputField( 485, 380, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); swprintf( str, L"%d", gpItem->bTrap ); AddTextInputField( 485, 400, 25, 15, MSYS_PRIORITY_NORMAL, str, 2, INPUTTYPE_NUMERICSTRICT ); if( gpEditingItemPool ) { swprintf( str, L"%d", 100 - gWorldItems[ gpEditingItemPool->iItemIndex ].ubNonExistChance ); AddTextInputField( 485, 440, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); } guiCeramicPlatesButton = -1; if( ValidAttachment( CERAMIC_PLATES, gpItem->usItem ) ) { guiCeramicPlatesButton = CreateTextButton( L"CERAMIC PLATES", SMALLCOMPFONT, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 558, 375, 72, 12, BUTTON_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, ToggleCeramicPlates ); if( FindAttachment( gpItem, CERAMIC_PLATES ) != -1 ) { ButtonList[ guiCeramicPlatesButton ]->uiFlags |= BUTTON_CLICKED_ON; gfCeramicPlates = TRUE; } } }
void CreateFileDialog( UINT16 *zTitle ) { iFDlgState = DIALOG_NONE; DisableEditorTaskbar(); MSYS_DefineRegion( &BlanketRegion, 0, 0, gsVIEWPORT_END_X, gsVIEWPORT_END_Y, MSYS_PRIORITY_HIGH - 5, 0, 0, 0 ); //Okay and cancel buttons iFileDlgButtons[0] = CreateTextButton( L"Okay", FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT, 354, 225, 50, 30, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, FDlgOkCallback ); iFileDlgButtons[1] = CreateTextButton( L"Cancel", FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT, 406, 225, 50, 30, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, FDlgCancelCallback ); //Scroll buttons iFileDlgButtons[2] = CreateSimpleButton( 426,92,"EDITOR//uparrow.sti", BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, FDlgUpCallback ); iFileDlgButtons[3] = CreateSimpleButton( 426,182,"EDITOR//downarrow.sti", BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, FDlgDwnCallback ); //File list window iFileDlgButtons[4] = CreateHotSpot( (179+4), (69+3), (179+4+240), (69+120+3), MSYS_PRIORITY_HIGH-1, BUTTON_NO_CALLBACK, FDlgNamesCallback); //Title button iFileDlgButtons[5] = CreateTextButton(zTitle, HUGEFONT, FONT_LTKHAKI, FONT_DKKHAKI, BUTTON_USE_DEFAULT,179,39,281,30,BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH-2,BUTTON_NO_CALLBACK,BUTTON_NO_CALLBACK); DisableButton(iFileDlgButtons[5]); SpecifyDisabledButtonStyle( iFileDlgButtons[5], DISABLED_STYLE_NONE ); iFileDlgButtons[6] = -1; if( iCurrentAction == ACTION_SAVE_MAP ) { //checkboxes //The update world info checkbox iFileDlgButtons[6] = CreateCheckBoxButton( 183, 229, "EDITOR//smcheckbox.sti", MSYS_PRIORITY_HIGH, UpdateWorldInfoCallback ); if( gfUpdateSummaryInfo ) ButtonList[ iFileDlgButtons[6] ]->uiFlags |= BUTTON_CLICKED_ON; } //Add the text input fields InitTextInputModeWithScheme( DEFAULT_SCHEME ); //field 1 (filename) AddTextInputField( /*233*/183, 195, 190, 20, MSYS_PRIORITY_HIGH, gzFilename, 30, INPUTTYPE_EXCLUSIVE_DOSFILENAME ); //field 2 -- user field that allows mouse/key interaction with the filename list AddUserInputField( FileDialogModeCallback ); }
void InitDoorEditing( INT32 iMapIndex ) { DOOR *pDoor; if( !DoorAtGridNo( iMapIndex ) && !OpenableAtGridNo( iMapIndex ) ) return; gfEditingDoor = TRUE; iDoorMapIndex = iMapIndex; DisableEditorTaskbar(); MSYS_DefineRegion( &DoorRegion, 0, 0, SCREEN_BUFFER_WIDTH, SCREEN_BUFFER_HEIGHT, MSYS_PRIORITY_HIGH-2, 0, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK ); iDoorButton[ DOOR_BACKGROUND ] = CreateTextButton( 0, 0, 0, 0, BUTTON_USE_DEFAULT, 200, 130, 240, 100, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH - 1, BUTTON_NO_CALLBACK, BUTTON_NO_CALLBACK ); DisableButton( iDoorButton[ DOOR_BACKGROUND ] ); SpecifyDisabledButtonStyle( iDoorButton[ DOOR_BACKGROUND ], DISABLED_STYLE_NONE ); iDoorButton[ DOOR_OKAY ] = CreateTextButton(gzEditorStrings[EDITOR_STR_OKAY], FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT, 330, 195, 50, 30, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, DoorOkayCallback ); iDoorButton[ DOOR_CANCEL ] = CreateTextButton(gzEditorStrings[EDITOR_STR_CANCEL], FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT, 385, 195, 50, 30, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, DoorCancelCallback ); InitTextInputModeWithScheme( DEFAULT_SCHEME ); AddTextInputField( 210, 155, 25, 16, MSYS_PRIORITY_HIGH, L"0", 3, INPUTTYPE_NUMERICSTRICT ); AddTextInputField( 210, 175, 25, 16, MSYS_PRIORITY_HIGH, L"0", 2, INPUTTYPE_NUMERICSTRICT ); AddTextInputField( 210, 195, 25, 16, MSYS_PRIORITY_HIGH, L"0", 2, INPUTTYPE_NUMERICSTRICT ); iDoorButton[ DOOR_LOCKED ] = CreateCheckBoxButton( 210, 215, "EDITOR\\SmCheckbox.sti", MSYS_PRIORITY_HIGH, DoorToggleLockedCallback ); pDoor = FindDoorInfoAtGridNo( iDoorMapIndex ); if( pDoor ) { if( pDoor->fLocked ) { ButtonList[ iDoorButton[ DOOR_LOCKED ] ]->uiFlags |= BUTTON_CLICKED_ON; } SetInputFieldStringWithNumericStrictValue( 0, pDoor->ubLockID ); SetInputFieldStringWithNumericStrictValue( 1, pDoor->ubTrapID ); SetInputFieldStringWithNumericStrictValue( 2, pDoor->ubTrapLevel ); } else { ButtonList[ iDoorButton[ DOOR_LOCKED ] ]->uiFlags |= BUTTON_CLICKED_ON; } }
void SetupOwnershipGUI() { UINT16 str[20]; swprintf( str, L"%d", gpItem->ubOwnerProfile ); AddTextInputField( 485, 380, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); giOwnershipGroupButton = CreateTextButton( gszCivGroupNames[ gpItem->ubOwnerCivGroup ], SMALLCOMPFONT, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 485, 415, 80, 25, BUTTON_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, OwnershipGroupButtonCallback ); }
void SetupActionItemsGUI() { UINT16 str[4]; UINT16 *pStr; swprintf( str, L"%d", gpItem->bStatus[0] ); AddTextInputField( 485, 365, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); swprintf( str, L"%d", gpItem->bTrap ); AddTextInputField( 485, 385, 25, 15, MSYS_PRIORITY_NORMAL, str, 2, INPUTTYPE_NUMERICSTRICT ); if( gpEditingItemPool ) { swprintf( str, L"%d", 100 - gWorldItems[ gpEditingItemPool->iItemIndex ].ubNonExistChance ); AddTextInputField( 485, 440, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); } pStr = GetActionItemName( gpItem ); guiActionItemButton = CreateTextButton( pStr, FONT10ARIAL, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 510, 410, 100, 20, BUTTON_NO_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, ActionItemCallback ); }
void SetupGunGUI() { UINT16 str[20]; INT16 yp; memset( gfAttachment, 0, NUM_ATTACHMENT_BUTTONS ); swprintf( str, L"%d", gpItem->bGunStatus ); AddTextInputField( 485, 380, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); swprintf( str, L"%d", gpItem->ubGunShotsLeft ); AddTextInputField( 485, 400, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); swprintf( str, L"%d", gpItem->bTrap ); AddTextInputField( 485, 420, 25, 15, MSYS_PRIORITY_NORMAL, str, 2, INPUTTYPE_NUMERICSTRICT ); if( gpEditingItemPool ) { swprintf( str, L"%d", 100 - gWorldItems[ gpEditingItemPool->iItemIndex ].ubNonExistChance ); AddTextInputField( 485, 440, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); } //Attachments are a dynamic part of guns. None, some, or all attachments could be available //for a particular weapon. Show only the ones that we can apply to this gun. yp = 383; guiAttachmentButton[ SILENCER_ATTACHMENT_BUTTON ] = -1; if( ValidAttachment( SILENCER, gpItem->usItem ) ) { guiAttachmentButton[ SILENCER_ATTACHMENT_BUTTON ] = CreateTextButton( L"SILENCER", SMALLCOMPFONT, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 570, yp, 60, 12, BUTTON_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, ToggleAttachment ); yp += 14; if( FindAttachment( gpItem, SILENCER ) != -1 ) { ButtonList[ guiAttachmentButton[ SILENCER_ATTACHMENT_BUTTON ] ]->uiFlags |= BUTTON_CLICKED_ON; gfAttachment[0] = TRUE; } } guiAttachmentButton[ SNIPERSCOPE_ATTACHMENT_BUTTON ] = -1; if( ValidAttachment( SNIPERSCOPE, gpItem->usItem ) ) { guiAttachmentButton[ SNIPERSCOPE_ATTACHMENT_BUTTON ] = CreateTextButton( L"SNIPERSCOPE", SMALLCOMPFONT, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 570, yp, 60, 12, BUTTON_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, ToggleAttachment ); yp += 14; if( FindAttachment( gpItem, SNIPERSCOPE ) != -1 ) { ButtonList[ guiAttachmentButton[ SNIPERSCOPE_ATTACHMENT_BUTTON ] ]->uiFlags |= BUTTON_CLICKED_ON; gfAttachment[1] = TRUE; } } guiAttachmentButton[ LASERSCOPE_ATTACHMENT_BUTTON ] = -1; if( ValidAttachment( LASERSCOPE, gpItem->usItem ) ) { guiAttachmentButton[ LASERSCOPE_ATTACHMENT_BUTTON ] = CreateTextButton( L"LASERSCOPE", SMALLCOMPFONT, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 570, yp, 60, 12, BUTTON_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, ToggleAttachment ); yp += 14; if( FindAttachment( gpItem, LASERSCOPE ) != -1 ) { ButtonList[ guiAttachmentButton[ LASERSCOPE_ATTACHMENT_BUTTON ] ]->uiFlags |= BUTTON_CLICKED_ON; gfAttachment[2] = TRUE; } } guiAttachmentButton[ BIPOD_ATTACHMENT_BUTTON ] = -1; if( ValidAttachment( BIPOD, gpItem->usItem ) ) { guiAttachmentButton[ BIPOD_ATTACHMENT_BUTTON ] = CreateTextButton( L"BIPOD", SMALLCOMPFONT, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 570, yp, 60, 12, BUTTON_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, ToggleAttachment ); yp += 14; if( FindAttachment( gpItem, BIPOD ) != -1 ) { ButtonList[ guiAttachmentButton[ BIPOD_ATTACHMENT_BUTTON ] ]->uiFlags |= BUTTON_CLICKED_ON; gfAttachment[3] = TRUE; } } guiAttachmentButton[ DUCKBILL_ATTACHMENT_BUTTON ] = -1; if( ValidAttachment( DUCKBILL, gpItem->usItem ) ) { guiAttachmentButton[ DUCKBILL_ATTACHMENT_BUTTON ] = CreateTextButton( L"DUCKBILL", SMALLCOMPFONT, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 570, yp, 60, 12, BUTTON_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, ToggleAttachment ); yp += 14; if( FindAttachment( gpItem, DUCKBILL ) != -1 ) { ButtonList[ guiAttachmentButton[ DUCKBILL_ATTACHMENT_BUTTON ] ]->uiFlags |= BUTTON_CLICKED_ON; gfAttachment[4] = TRUE; } } guiAttachmentButton[ GLAUNCHER_ATTACHMENT_BUTTON ] = -1; if( ValidAttachment( UNDER_GLAUNCHER, gpItem->usItem ) ) { guiAttachmentButton[ GLAUNCHER_ATTACHMENT_BUTTON ] = CreateTextButton( L"G-LAUNCHER", SMALLCOMPFONT, FONT_YELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, 570, yp, 60, 12, BUTTON_TOGGLE, MSYS_PRIORITY_NORMAL, DEFAULT_MOVE_CALLBACK, ToggleAttachment ); yp += 14; if( FindAttachment( gpItem, UNDER_GLAUNCHER ) != -1 ) { ButtonList[ guiAttachmentButton[ GLAUNCHER_ATTACHMENT_BUTTON ] ]->uiFlags |= BUTTON_CLICKED_ON; gfAttachment[5] = TRUE; } } ReEvaluateAttachmentStatii(); }