- Recommit Kaiden's class item cap fix r1790 (lost during meager of Big Maps Project code) & other related variables from INT16 to INT32; increased the class item limit in mapeditor (by Buggler)

- Map Editor: Items - Hotkeys (by Buggler)
o Hotkeys ',': Left Scroll
o Hotkeys '.': Right Scroll
o ('Shift': Jump 1 page; 'Ctrl': Jump 10 pages; 'Ctrl + Shift': Jump to first/last page)
- Changed saveloadscreen previous/next hotkey to ','/'.' due to interference with input_box navigation using arrow keys (by Buggler)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5877 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-02-27 19:06:52 +00:00
parent dfc17ea9c6
commit 834aa1eb13
15 changed files with 242 additions and 63 deletions
+3
View File
@@ -45,6 +45,7 @@ void InitEditorItemStatsButtons()
iEditorButton[ ITEMSTATS_DELETE_BTN ] =
CreateTextButton( iEditorItemStatsButtonsText[0], FONT10ARIAL, FONT_RED, FONT_BLACK, BUTTON_USE_DEFAULT,
iScreenWidthOffset + 600, 2 * iScreenHeightOffset + 441, 36, 16, BUTTON_NO_TOGGLE, MSYS_PRIORITY_NORMAL+1, DEFAULT_MOVE_CALLBACK, ItemStatsDeleteCallback );
SetButtonFastHelpText( iEditorButton[ ITEMSTATS_DELETE_BTN ], iEditorItemStatsButtonsText[1]);
}
void InitEditorMercsToolbar()
@@ -595,8 +596,10 @@ void InitEditorItemsToolbar()
iEditorButton[ITEMS_LEFTSCROLL] =
CreateEasyNoToggleButton( iScreenWidthOffset + 1, 2 * iScreenHeightOffset + 361,"EDITOR//leftscroll.sti", ItemsLeftScrollCallback);
SetButtonFastHelpText(iEditorButton[ITEMS_LEFTSCROLL], iEditorItemsToolbarText[11]);
iEditorButton[ITEMS_RIGHTSCROLL] =
CreateEasyNoToggleButton( iScreenWidthOffset + 50, 2 * iScreenHeightOffset + 361,"EDITOR//rightscroll.sti", ItemsRightScrollCallback);
SetButtonFastHelpText(iEditorButton[ITEMS_RIGHTSCROLL], iEditorItemsToolbarText[12]);
}
+2 -2
View File
@@ -230,7 +230,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
UINT32 uiVideoObjectIndex;
UINT16 usUselessWidth, usUselessHeight;
INT16 sWidth, sOffset, sStart;
INT16 i, x, y;
INT32 i, x, y;
UINT16 usCounter;
CHAR16 pStr[ 100 ];//, pStr2[ 100 ];
CHAR16 pItemName[SIZE_ITEM_NAME];
@@ -332,7 +332,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
//every pair of items (odd rounded up) requires 60 pixels for width.
//the minimum buffer size is 420. Height is always 80 pixels.
eInfo.sWidth = (eInfo.sNumItems > 12) ? ((eInfo.sNumItems+1)/2)*60 : SCREEN_HEIGHT - 120;
eInfo.sWidth = (eInfo.sNumItems > 12) ? (((INT32) eInfo.sNumItems+1)/2)*60 : SCREEN_HEIGHT - 120;
eInfo.sHeight = 80;
// Create item buffer
GetCurrentVideoSettings( &usUselessWidth, &usUselessHeight, &ubBitDepth );
+2 -2
View File
@@ -12,8 +12,8 @@ typedef struct{
UINT16 *pusItemIndex; //a dynamic array of Item indices
UINT32 uiBuffer; //index of buffer
UINT32 uiItemType; //Weapons, ammo, armour, explosives, equipment
INT16 sWidth, sHeight; //width and height of buffer
//Kaiden: was previously INT16 - Fix for number of items capped by class
//Kaiden/Buggler: was previously INT16 - Fix for number of items capped by class in editor
INT32 sWidth, sHeight; //width and height of buffer
INT16 sNumItems; //total number of items in the current class of item.
INT16 sSelItemIndex; //currently selected item index.
INT16 sHilitedItemIndex;
+157 -8
View File
@@ -1997,23 +1997,172 @@ void HandleKeyboardShortcuts( )
iCurrentAction = ACTION_NEXT_SELECTIONTYPE;
break;
case ',':
gusSelectionType = LINESELECTION;
gusPreserveSelectionWidth--;
if( !gusPreserveSelectionWidth )
gusPreserveSelectionWidth = 8;
// item left scroll
if( iCurrentTaskbar == TASK_ITEMS )
{
if( eInfo.sScrollIndex )
{
if( EditorInputEvent.usKeyState & CTRL_DOWN )
eInfo.sScrollIndex = __max(eInfo.sScrollIndex - 60, 0);
else
eInfo.sScrollIndex--;
if( !eInfo.sScrollIndex )
DisableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex < ((eInfo.sNumItems+1)/2)-6 )
EnableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
}
}
else
{
gusSelectionType = LINESELECTION;
gusPreserveSelectionWidth--;
if( !gusPreserveSelectionWidth )
gusPreserveSelectionWidth = 8;
}
gfRenderTaskbar = TRUE;
break;
case '.':
gusSelectionType = LINESELECTION;
gusPreserveSelectionWidth++;
if( gusPreserveSelectionWidth > 8 )
gusPreserveSelectionWidth = 1;
// item right scroll
if( iCurrentTaskbar == TASK_ITEMS )
{
if( eInfo.sScrollIndex < max( ((eInfo.sNumItems+1)/2)-6, 0) )
{
if( EditorInputEvent.usKeyState & CTRL_DOWN )
eInfo.sScrollIndex = __min(eInfo.sScrollIndex + 60, (eInfo.sNumItems+1)/2-6);
else
eInfo.sScrollIndex++;
EnableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex == max( ((eInfo.sNumItems+1)/2)-6, 0) )
DisableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
}
}
else
{
gusSelectionType = LINESELECTION;
gusPreserveSelectionWidth++;
if( gusPreserveSelectionWidth > 8 )
gusPreserveSelectionWidth = 1;
}
gfRenderTaskbar = TRUE;
break;
case '<':
// item left scroll by page
if( iCurrentTaskbar == TASK_ITEMS )
{
if( eInfo.sScrollIndex )
{
if( EditorInputEvent.usKeyState & CTRL_DOWN )
eInfo.sScrollIndex = 0;
else
eInfo.sScrollIndex = __max(eInfo.sScrollIndex - 6, 0);
if( !eInfo.sScrollIndex )
DisableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex < ((eInfo.sNumItems+1)/2)-6 )
EnableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
}
}
gfRenderTaskbar = TRUE;
break;
case '>':
// item right scroll by page
if( iCurrentTaskbar == TASK_ITEMS )
{
if( eInfo.sScrollIndex < max( ((eInfo.sNumItems+1)/2)-6, 0) )
{
if( EditorInputEvent.usKeyState & CTRL_DOWN )
eInfo.sScrollIndex = max( ((eInfo.sNumItems+1)/2)-6, 0);
else
eInfo.sScrollIndex = __min(eInfo.sScrollIndex + 6, (eInfo.sNumItems+1)/2-6);
EnableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex == max( ((eInfo.sNumItems+1)/2)-6, 0) )
DisableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
}
}
gfRenderTaskbar = TRUE;
break;
default:
iCurrentAction = ACTION_NULL;
break;
}
}
else if ( !HandleSummaryInput( &EditorInputEvent ) && !HandleTextInput( &EditorInputEvent ) && EditorInputEvent.usEvent == KEY_REPEAT )
{
switch( EditorInputEvent.usParam )
{
case ',':
// item left scroll
if( iCurrentTaskbar == TASK_ITEMS )
{
if( eInfo.sScrollIndex )
{
if( EditorInputEvent.usKeyState & CTRL_DOWN )
eInfo.sScrollIndex = __max(eInfo.sScrollIndex - 60, 0);
else
eInfo.sScrollIndex--;
if( !eInfo.sScrollIndex )
DisableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex < ((eInfo.sNumItems+1)/2)-6 )
EnableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
}
}
gfRenderTaskbar = TRUE;
break;
case '.':
// item right scroll
if( iCurrentTaskbar == TASK_ITEMS )
{
if( eInfo.sScrollIndex < max( ((eInfo.sNumItems+1)/2)-6, 0) )
{
if( EditorInputEvent.usKeyState & CTRL_DOWN )
eInfo.sScrollIndex = __min(eInfo.sScrollIndex + 60, (eInfo.sNumItems+1)/2-6);
else
eInfo.sScrollIndex++;
EnableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex == max( ((eInfo.sNumItems+1)/2)-6, 0) )
DisableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
}
}
gfRenderTaskbar = TRUE;
break;
case '<':
// item left scroll by page
if( iCurrentTaskbar == TASK_ITEMS )
{
if( eInfo.sScrollIndex )
{
eInfo.sScrollIndex = __max(eInfo.sScrollIndex - 6, 0);
if( !eInfo.sScrollIndex )
DisableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex < ((eInfo.sNumItems+1)/2)-6 )
EnableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
}
}
gfRenderTaskbar = TRUE;
break;
case '>':
// item right scroll by page
if( iCurrentTaskbar == TASK_ITEMS )
{
if( eInfo.sScrollIndex < max( ((eInfo.sNumItems+1)/2)-6, 0) )
{
eInfo.sScrollIndex = __min(eInfo.sScrollIndex + 6, (eInfo.sNumItems+1)/2-6);
EnableButton( iEditorButton[ITEMS_LEFTSCROLL] );
if( eInfo.sScrollIndex == max( ((eInfo.sNumItems+1)/2)-6, 0) )
DisableButton( iEditorButton[ITEMS_RIGHTSCROLL] );
}
}
gfRenderTaskbar = TRUE;
break;
}
}
}
}