Fix some scrolling issues on market screen

This commit is contained in:
cim 2014-12-07 16:23:29 +00:00
parent bce6485b39
commit 4c7b5aa465

View File

@ -1788,6 +1788,7 @@ NSComparisonResult marketSorterByMassUnit(id a, id b, void *market);
[self setMissionBackgroundSpecial:nil]; [self setMissionBackgroundSpecial:nil];
[self setEquipScreenBackgroundDescriptor:nil]; [self setEquipScreenBackgroundDescriptor:nil];
marketOffset = 0; marketOffset = 0;
DESTROY(marketSelectedCommodity);
script_time = 0.0; script_time = 0.0;
script_time_check = SCRIPT_TIMER_INTERVAL; script_time_check = SCRIPT_TIMER_INTERVAL;
@ -9991,7 +9992,11 @@ static NSString *last_outfitting_key=nil;
if (goodsIndex <= marketOffset) if (goodsIndex <= marketOffset)
{ {
// is off top of list, move list upwards // is off top of list, move list upwards
marketOffset = goodsIndex-1; if (goodsIndex == 0) {
marketOffset = 0;
} else {
marketOffset = goodsIndex-1;
}
} }
else if (goodsIndex > marketOffset+(GUI_ROW_MARKET_END-GUI_ROW_MARKET_START)-2) else if (goodsIndex > marketOffset+(GUI_ROW_MARKET_END-GUI_ROW_MARKET_START)-2)
{ {
@ -10005,7 +10010,6 @@ static NSString *last_outfitting_key=nil;
} }
} }
// GUI stuff // GUI stuff
{ {
OOGUIRow start_row = GUI_ROW_MARKET_START; OOGUIRow start_row = GUI_ROW_MARKET_START;