mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 12:47:58 +03:00
tr2/inventory: fix button mashing loading game instead of saving
Resolves #2863.
This commit is contained in:
parent
d97edaf1eb
commit
0c5b5dbb7b
4 changed files with 25 additions and 11 deletions
|
@ -2,6 +2,7 @@
|
||||||
- changed The Golden Mask strings to default to the OG strings file for the main tables (#2847)
|
- changed The Golden Mask strings to default to the OG strings file for the main tables (#2847)
|
||||||
- fixed Lara voiding if she stops on a tile with a closing door, and the door isn't on a portal (#2848)
|
- fixed Lara voiding if she stops on a tile with a closing door, and the door isn't on a portal (#2848)
|
||||||
- fixed guns carried by enemies not being converted to ammo if Lara has picked up the same gun elsewhere in the same level (#2856)
|
- fixed guns carried by enemies not being converted to ammo if Lara has picked up the same gun elsewhere in the same level (#2856)
|
||||||
|
- fixed button mashing triggering load instead of save on a specific passport animation frame (#2863, regression from 1.0)
|
||||||
- fixed guns carried by enemies not being converted to ammo if Lara starts the level with the gun and the game has later been reloaded (#2850, regression from 1.0)
|
- fixed guns carried by enemies not being converted to ammo if Lara starts the level with the gun and the game has later been reloaded (#2850, regression from 1.0)
|
||||||
- fixed 1920x1080 screenshots in 16:9 aspect mode being saved as 1919x1080 (#2845, regression from 0.8)
|
- fixed 1920x1080 screenshots in 16:9 aspect mode being saved as 1919x1080 (#2845, regression from 0.8)
|
||||||
- fixed clicks in audio sounds (#2846, regression from 0.2)
|
- fixed clicks in audio sounds (#2846, regression from 0.2)
|
||||||
|
|
|
@ -694,7 +694,6 @@ static GF_COMMAND M_Control(INV_RING *const ring)
|
||||||
InvRing_MotionSetup(ring, RNG_CLOSING_ITEM, RNG_DESELECT, 0);
|
InvRing_MotionSetup(ring, RNG_CLOSING_ITEM, RNG_DESELECT, 0);
|
||||||
g_Input = (INPUT_STATE) {};
|
g_Input = (INPUT_STATE) {};
|
||||||
g_InputDB = (INPUT_STATE) {};
|
g_InputDB = (INPUT_STATE) {};
|
||||||
|
|
||||||
if (ring->mode == INV_LOAD_MODE || ring->mode == INV_SAVE_MODE
|
if (ring->mode == INV_LOAD_MODE || ring->mode == INV_SAVE_MODE
|
||||||
|| ring->mode == INV_SAVE_CRYSTAL_MODE) {
|
|| ring->mode == INV_SAVE_CRYSTAL_MODE) {
|
||||||
InvRing_MotionSetup(
|
InvRing_MotionSetup(
|
||||||
|
@ -713,7 +712,7 @@ static GF_COMMAND M_Control(INV_RING *const ring)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ring->mode == INV_TITLE_MODE
|
if (ring->mode == INV_TITLE_MODE
|
||||||
&& ((inv_item->object_id == O_DETAIL_OPTION)
|
&& (inv_item->object_id == O_DETAIL_OPTION
|
||||||
|| inv_item->object_id == O_SOUND_OPTION
|
|| inv_item->object_id == O_SOUND_OPTION
|
||||||
|| inv_item->object_id == O_CONTROL_OPTION
|
|| inv_item->object_id == O_CONTROL_OPTION
|
||||||
|| inv_item->object_id == O_GAMMA_OPTION)) {
|
|| inv_item->object_id == O_GAMMA_OPTION)) {
|
||||||
|
|
|
@ -639,10 +639,10 @@ static GF_COMMAND M_Control(INV_RING *const ring)
|
||||||
|
|
||||||
if (g_InputDB.menu_confirm) {
|
if (g_InputDB.menu_confirm) {
|
||||||
g_Inv_Chosen = inv_item->object_id;
|
g_Inv_Chosen = inv_item->object_id;
|
||||||
if (ring->type != RT_MAIN) {
|
if (ring->type == RT_MAIN) {
|
||||||
g_InvRing_Source[RT_OPTION].current = ring->current_object;
|
|
||||||
} else {
|
|
||||||
g_InvRing_Source[RT_MAIN].current = ring->current_object;
|
g_InvRing_Source[RT_MAIN].current = ring->current_object;
|
||||||
|
} else {
|
||||||
|
g_InvRing_Source[RT_OPTION].current = ring->current_object;
|
||||||
}
|
}
|
||||||
if (ring->mode == INV_TITLE_MODE
|
if (ring->mode == INV_TITLE_MODE
|
||||||
&& (inv_item->object_id == O_DETAIL_OPTION
|
&& (inv_item->object_id == O_DETAIL_OPTION
|
||||||
|
@ -783,7 +783,7 @@ INV_RING *InvRing_Open(const INVENTORY_MODE mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < 8; i++) {
|
for (int32_t i = 0; i < 8; i++) {
|
||||||
g_Inv_ExtraData[i] = 0;
|
g_Inv_ExtraData[i] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_InvRing_Source[RT_MAIN].current = 0;
|
g_InvRing_Source[RT_MAIN].current = 0;
|
||||||
|
|
|
@ -66,6 +66,8 @@ static void M_LoadGame(INVENTORY_ITEM *inv_item);
|
||||||
static void M_SaveGame(INVENTORY_ITEM *inv_item);
|
static void M_SaveGame(INVENTORY_ITEM *inv_item);
|
||||||
static void M_NewGame(void);
|
static void M_NewGame(void);
|
||||||
static void M_PlayAnyLevel(INVENTORY_ITEM *inv_item);
|
static void M_PlayAnyLevel(INVENTORY_ITEM *inv_item);
|
||||||
|
static int32_t M_GetCurrentPage(const INVENTORY_ITEM *inv_item);
|
||||||
|
static bool M_IsFlipping(const INVENTORY_ITEM *inv_item);
|
||||||
static void M_FlipLeft(INVENTORY_ITEM *inv_item);
|
static void M_FlipLeft(INVENTORY_ITEM *inv_item);
|
||||||
static void M_FlipRight(INVENTORY_ITEM *inv_item);
|
static void M_FlipRight(INVENTORY_ITEM *inv_item);
|
||||||
static void M_Close(INVENTORY_ITEM *inv_item);
|
static void M_Close(INVENTORY_ITEM *inv_item);
|
||||||
|
@ -318,6 +320,17 @@ static void M_PlayAnyLevel(INVENTORY_ITEM *const inv_item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int32_t M_GetCurrentPage(const INVENTORY_ITEM *const inv_item)
|
||||||
|
{
|
||||||
|
const int32_t frame = inv_item->goal_frame - inv_item->open_frame;
|
||||||
|
return frame % 5 == 0 ? frame / 5 : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool M_IsFlipping(const INVENTORY_ITEM *const inv_item)
|
||||||
|
{
|
||||||
|
return M_GetCurrentPage(inv_item) == -1;
|
||||||
|
}
|
||||||
|
|
||||||
static void M_FlipLeft(INVENTORY_ITEM *const inv_item)
|
static void M_FlipLeft(INVENTORY_ITEM *const inv_item)
|
||||||
{
|
{
|
||||||
M_RemoveAllText();
|
M_RemoveAllText();
|
||||||
|
@ -413,18 +426,19 @@ void Option_Passport_Control(INVENTORY_ITEM *const item, const bool is_busy)
|
||||||
|
|
||||||
InvRing_RemoveAllText();
|
InvRing_RemoveAllText();
|
||||||
|
|
||||||
const int32_t frame = item->goal_frame - item->open_frame;
|
if (M_IsFlipping(item)) {
|
||||||
const int32_t page = frame % 5 == 0 ? frame / 5 : -1;
|
|
||||||
const bool is_flipping = page == -1;
|
|
||||||
if (is_flipping) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_State.current_page = page;
|
m_State.current_page = M_GetCurrentPage(item);
|
||||||
if (m_State.current_page < m_State.active_page) {
|
if (m_State.current_page < m_State.active_page) {
|
||||||
M_FlipRight(item);
|
M_FlipRight(item);
|
||||||
|
g_Input = (INPUT_STATE) {};
|
||||||
|
g_InputDB = (INPUT_STATE) {};
|
||||||
} else if (m_State.current_page > m_State.active_page) {
|
} else if (m_State.current_page > m_State.active_page) {
|
||||||
M_FlipLeft(item);
|
M_FlipLeft(item);
|
||||||
|
g_Input = (INPUT_STATE) {};
|
||||||
|
g_InputDB = (INPUT_STATE) {};
|
||||||
} else {
|
} else {
|
||||||
m_State.is_ready = true;
|
m_State.is_ready = true;
|
||||||
M_ShowPage(item);
|
M_ShowPage(item);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue