- 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
+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;
}
}
}
}