mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 19:15:14 -04:00
Fix opening inventory with hidden block selected not displaying the block's details as the menu title
This commit is contained in:
parent
2ea26fcf5e
commit
e492db93f6
@ -417,10 +417,11 @@ double Math_Atan2(double x, double y) {
|
||||
return Atan(y / x) + PI;
|
||||
return Atan(y / x) - PI;
|
||||
}
|
||||
if (y > 0)
|
||||
return PI / 2.0;
|
||||
if (y < 0)
|
||||
return -PI / 2.0;
|
||||
|
||||
/* x = 0 case */
|
||||
if (y > 0) return PI / 2.0;
|
||||
if (y < 0) return -PI / 2.0;
|
||||
|
||||
return DBL_NAN;
|
||||
}
|
||||
|
||||
|
@ -1649,10 +1649,17 @@ static void InventoryScreen_MoveToSelected(struct InventoryScreen* s) {
|
||||
if (Game_ClassicMode) {
|
||||
/* Accuracy: Original classic preserves selected block across inventory menu opens */
|
||||
TableWidget_SetToIndex(table, table->selectedIndex);
|
||||
TableWidget_RecreateTitle(table, true);
|
||||
} else {
|
||||
TableWidget_SetToBlock(table, Inventory_SelectedBlock);
|
||||
|
||||
if (table->selectedIndex == -1) {
|
||||
/* Hidden block in inventory - display title for it still */
|
||||
InventoryScreen_OnUpdateTitle(Inventory_SelectedBlock);
|
||||
} else {
|
||||
TableWidget_RecreateTitle(table, true);
|
||||
}
|
||||
}
|
||||
TableWidget_RecreateTitle(table, true);
|
||||
}
|
||||
|
||||
static void InventoryScreen_Init(void* screen) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user