Exemplo n.º 1
0
/*
 * InterfaceTab:  User is moving focus from given control in given direction.
 *   Return False iff event should not be sent to other modules (i.e. handled here)
 */
Bool InterfaceTab(int control, Bool forward)
{
   switch (control)
   {
   case IDC_MAIN:
      if (!forward)
	 break;

		if( StatsGetCurrentGroup() == STATS_INVENTORY )		//	ajw
			InventorySetFocus( forward );
		else
			StatsSetFocus( forward );
      return False;

   case IDC_MAINTEXT:
   case IDC_TEXTINPUT:
      if (forward)
	 break;
      
		if( StatsGetCurrentGroup() == STATS_INVENTORY )		//	ajw
			InventorySetFocus( forward );
		else
			StatsSetFocus( forward );

      return False;
      
   }
   return True;
}
Exemplo n.º 2
0
/*
 * StatButtonCommand:  User pressed stat button
 */
void StatButtonCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
	int group;
	list_type stat_list;

	group = StatsFindGroupByHwnd(hwndCtl) + 1;  // Skip main stat group
	if (group == GROUP_NONE)
		return;

	if (group != StatsGetCurrentGroup())
	{
		//	ajw Changes to make Inventory act somewhat like one of the stats groups.
		if( StatsGetCurrentGroup() == STATS_INVENTORY )
		{
			//	Inventory must be going away.
			ShowInventory( False );
//			StatsShowGroup( True );
		}

		if( group == STATS_INVENTORY )
		{
			//	The hacks continue... Force previously toggled non-inventory button to repaint and show new unpressed state.
			InvalidateRect( buttons[ StatsGetCurrentGroup()-2 ].hwnd, NULL, FALSE );

			StatsShowGroup( False );
			ShowInventory( True );
			DisplayInventoryAsStatGroup( (BYTE)STATS_INVENTORY );
		}
		else
		{
			// Check stat cache; if group not present, ask server
			if (StatCacheGetEntry(group, &stat_list) == True)
				DisplayStatGroup((BYTE) group, stat_list);
			else
			{
				debug(("Requesting group %d\n", group));
				RequestStats(group);
			}
		}
	}
	if( StatsGetCurrentGroup() == STATS_INVENTORY )
		InventorySetFocus( True );		//	Force focus to leave stats group window after button within it was pushed.
	//	[ xxx Still broken - click on Inv when it is already selected, but drag off of button and release. ]
}