Editor Fixes (by Buggler)

- Fixed item deletion from item pool when no item selected
- Added Shift, Ctrl, Ctrl+Shift hotkeys to item scrolling click 
- Fixed Rdn button not depressed upon clicking other item buttons
- Fixed B, R, S text not shown for random items

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5949 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-03-22 14:39:37 +00:00
parent 9592be9122
commit 728d2f7cfe
4 changed files with 39 additions and 8 deletions
+24 -2
View File
@@ -798,7 +798,18 @@ void ItemsLeftScrollCallback(GUI_BUTTON *btn, INT32 reason)
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP) if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{ {
gfRenderTaskbar = TRUE; gfRenderTaskbar = TRUE;
eInfo.sScrollIndex--; if (_KeyDown( 17 ) ) // CTRL
{
if (_KeyDown( 16 ) ) // SHIFT
eInfo.sScrollIndex = 0;
else
eInfo.sScrollIndex = __max(eInfo.sScrollIndex - 60, 0);
}
else if (_KeyDown( 16 ) ) // SHIFT
eInfo.sScrollIndex = __max(eInfo.sScrollIndex - 6, 0);
else
eInfo.sScrollIndex--;
if( !eInfo.sScrollIndex ) if( !eInfo.sScrollIndex )
DisableButton( iEditorButton[ITEMS_LEFTSCROLL] ); DisableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex < ((eInfo.sNumItems+1)/2)-6 ) if( eInfo.sScrollIndex < ((eInfo.sNumItems+1)/2)-6 )
@@ -811,7 +822,18 @@ void ItemsRightScrollCallback(GUI_BUTTON *btn, INT32 reason)
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP) if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{ {
gfRenderTaskbar = TRUE; gfRenderTaskbar = TRUE;
eInfo.sScrollIndex++; if (_KeyDown( 17 ) ) // CTRL
{
if (_KeyDown( 16 ) ) // SHIFT
eInfo.sScrollIndex = max( ((eInfo.sNumItems+1)/2)-6, 0);
else
eInfo.sScrollIndex = __min(eInfo.sScrollIndex + 60, (eInfo.sNumItems+1)/2-6);
}
else if (_KeyDown( 16 ) ) // SHIFT
eInfo.sScrollIndex = __min(eInfo.sScrollIndex + 6, (eInfo.sNumItems+1)/2-6);
else
eInfo.sScrollIndex++;
EnableButton( iEditorButton[ITEMS_LEFTSCROLL] ); EnableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex == max( ((eInfo.sNumItems+1)/2)-6, 0) ) if( eInfo.sScrollIndex == max( ((eInfo.sNumItems+1)/2)-6, 0) )
DisableButton( iEditorButton[ITEMS_RIGHTSCROLL] ); DisableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
+1 -1
View File
@@ -29,7 +29,7 @@ BOOLEAN gfShowExitGrids = FALSE;
void SetEditorItemsTaskbarMode( UINT16 usNewMode ) void SetEditorItemsTaskbarMode( UINT16 usNewMode )
{ {
UnclickEditorButtons( ITEMS_WEAPONS, ITEMS_KEYS ); UnclickEditorButtons( ITEMS_WEAPONS, ITEMS_RANDOMITEM );
switch( usNewMode ) switch( usNewMode )
{ {
case ITEMS_WEAPONS: case ITEMS_WEAPONS:
+12 -4
View File
@@ -398,7 +398,8 @@ void ExecuteItemStatsCmd( /*UINT8*/ UINT16 ubAction )
case ITEMSTATS_DEFAULT: case ITEMSTATS_DEFAULT:
break; break;
case ITEMSTATS_DELETE: case ITEMSTATS_DELETE:
DeleteSelectedItem(); if ( gbEditingMode != EDITING_NOTHING )
DeleteSelectedItem();
break; break;
case ITEMSTATS_SHOW: case ITEMSTATS_SHOW:
ShowSelectedItem(); ShowSelectedItem();
@@ -585,12 +586,22 @@ void UpdateItemStatsPanel()
SetFontForeground( FONT_GRAY2 ); SetFontForeground( FONT_GRAY2 );
SetFontShadow( FONT_NEARBLACK ); SetFontShadow( FONT_NEARBLACK );
SetFontBackground( FONT_BLACK ); SetFontBackground( FONT_BLACK );
if( gpItem && iCurrentTaskbar == TASK_ITEMS && if( gpItem && iCurrentTaskbar == TASK_ITEMS &&
gbEditingMode != EDITING_TRIGGERS && gbEditingMode != EDITING_ACTIONITEMS ) gbEditingMode != EDITING_TRIGGERS && gbEditingMode != EDITING_ACTIONITEMS )
{ {
mprintf( iScreenWidthOffset + 500, 2 * iScreenHeightOffset + 366, pUpdateItemStatsPanelText[0] ); mprintf( iScreenWidthOffset + 500, 2 * iScreenHeightOffset + 366, pUpdateItemStatsPanelText[0] );
} }
SetFontForeground( FONT_YELLOW ); SetFontForeground( FONT_YELLOW );
if( gpItem && iCurrentTaskbar == TASK_ITEMS )
{
mprintf( iScreenWidthOffset + 587, 2 * iScreenHeightOffset + 366, pUpdateItemStatsPanelText[25] );
mprintf( iScreenWidthOffset + 609, 2 * iScreenHeightOffset + 366, pUpdateItemStatsPanelText[26] );
mprintf( iScreenWidthOffset + 630, 2 * iScreenHeightOffset + 366, pUpdateItemStatsPanelText[27] );
}
switch( gbEditingMode ) switch( gbEditingMode )
{ {
case EDITING_NOTHING: case EDITING_NOTHING:
@@ -654,9 +665,6 @@ void UpdateItemStatsPanel()
} }
if( gpEditingItemPool ) if( gpEditingItemPool )
{ {
mprintf( iScreenWidthOffset + 587, 2 * iScreenHeightOffset + 366, pUpdateItemStatsPanelText[25] );
mprintf( iScreenWidthOffset + 609, 2 * iScreenHeightOffset + 366, pUpdateItemStatsPanelText[26] );
mprintf( iScreenWidthOffset + 630, 2 * iScreenHeightOffset + 366, pUpdateItemStatsPanelText[27] );
INT32 iPercent = 100 - gWorldItems[ gpEditingItemPool->iItemIndex ].ubNonExistChance; INT32 iPercent = 100 - gWorldItems[ gpEditingItemPool->iItemIndex ].ubNonExistChance;
if( iPercent == 100 ) if( iPercent == 100 )
SetFontForeground( FONT_YELLOW ); SetFontForeground( FONT_YELLOW );
+2 -1
View File
@@ -181,6 +181,7 @@ BOOLEAN EditModeInit( void );
BOOLEAN EditModeShutdown( void ); BOOLEAN EditModeShutdown( void );
void EnsureStatusOfEditorButtons(); void EnsureStatusOfEditorButtons();
extern INT8 gbEditingMode;
extern BOOLEAN fAllDone; extern BOOLEAN fAllDone;
extern DisplayList Selection; extern DisplayList Selection;
@@ -1464,7 +1465,7 @@ void HandleKeyboardShortcuts( )
break; break;
case DEL: case DEL:
if( iCurrentTaskbar == TASK_ITEMS ) if( iCurrentTaskbar == TASK_ITEMS && gbEditingMode != 0 ) //gbEditingMode != EDITING_NOTHING
DeleteSelectedItem(); DeleteSelectedItem();
else if( gsSelectedMercID != -1 ) else if( gsSelectedMercID != -1 )
{ {