Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save gamefile's name with many dots is truncated when it is saved #18199

Closed
telk5093 opened this issue Oct 5, 2022 · 12 comments · Fixed by #20691
Closed

Save gamefile's name with many dots is truncated when it is saved #18199

telk5093 opened this issue Oct 5, 2022 · 12 comments · Fixed by #20691
Labels
bug Something went wrong.

Comments

@telk5093
Copy link
Contributor

telk5093 commented Oct 5, 2022

Operating System

Windows 10, 64 bits

OpenRCT2 build

OpenRCT2, v0.4.2-3-g47d0402 (47d0402 on develop) provided by GitHub

Describe the issue

Saving the park with named many dots, such as Some park name v1.1, then it truncates the last term after the last dot and hence saved as Some park name v1.
I'm guessing the game confuses it is an extension.

Area(s) with issue?

New Save Format (NSF)

Steps to reproduce

  1. Save park as Some park name v1.1
  2. Check that the park is saved as Some park name v1

Attachments

1

@telk5093 telk5093 added the bug Something went wrong. label Oct 5, 2022
@CookiePLMonster
Copy link
Contributor

How does it behave when you use a system file browser? Is it same or does it work properly then?

@telk5093
Copy link
Contributor Author

How does it behave when you use a system file browser? Is it same or does it work properly then?

It is fine when I use system file browser.

@beam41
Copy link
Contributor

beam41 commented Oct 15, 2022

The save logic just replace last dot without checking, thinking it was extension
It should be like system file browser -> if extension match last dot do nothing if not just append extension to the file.
Can I work on this ? Seem like no one has working on it.

@CookiePLMonster
Copy link
Contributor

It should be like system file browser -> if extension match last dot do nothing if not just append extension to the file.

Yeah, that sounds like the best way. Just be mindful of cases where multiple extensions are "valid" - I'm not sure if there are any cases like this in the codebase, though.

@beam41
Copy link
Contributor

beam41 commented Oct 15, 2022

we only have .park for game save and .td6 for track save I think

Btw, I found out there are check for this bug in system file browser

u8string outPath = ContextOpenCommonFileDialog(desc);
if (!outPath.empty())
{
// When the given save type was given, Windows still interprets a filename with a dot in its name as a custom extension,
// meaning files like "My Coaster v1.2" will not get the .td6 extension by default.
if (isSave && get_file_extension_type(outPath) != fileType)
outPath = Path::WithExtension(outPath, extension);
}

I will try to mimic this check.

@CookiePLMonster
Copy link
Contributor

I'm not sure the system file browser bug is still valid after #18250.

@beam41
Copy link
Contributor

beam41 commented Oct 15, 2022

Well, from my test, system file browser append extension correctly on its own, this line might not be important anymore, but I'm only tested on my win11 pc.

@CookiePLMonster
Copy link
Contributor

I think the save dialog also needs "All Files" removed - there is no point in letting the user save the park with a custom extension if it's to be rejected further down the line anyway.

@beam41
Copy link
Contributor

beam41 commented Oct 15, 2022

@CookiePLMonster I'd like to create another pull request for removing "All Files" but I'm not sure this logic can be remove too

u8string outPath = ContextOpenCommonFileDialog(desc);
if (!outPath.empty())
{
// When the given save type was given, Windows still interprets a filename with a dot in its name as a custom extension,
// meaning files like "My Coaster v1.2" will not get the .td6 extension by default.
if (isSave && get_file_extension_type(outPath) != fileType)
outPath = Path::WithExtension(outPath, extension);
}

I know in windows it fine, but I don't have linux machine.

@CookiePLMonster
Copy link
Contributor

It probably can, considering the fact comments specifically mention Windows. You might want to wait until someone from the dev team doublechecks though.

@CookiePLMonster
Copy link
Contributor

Any update on this?

@beam41
Copy link
Contributor

beam41 commented Nov 29, 2022

I have made a pull request. That should work with the current version but I'm busy now so you can take over.

@telk5093 telk5093 closed this as completed Mar 6, 2023
@telk5093 telk5093 reopened this Mar 6, 2023
CookiePLMonster added a commit to CookiePLMonster/OpenRCT2 that referenced this issue Aug 6, 2023
CookiePLMonster added a commit to CookiePLMonster/OpenRCT2 that referenced this issue Aug 6, 2023
CookiePLMonster added a commit to CookiePLMonster/OpenRCT2 that referenced this issue Aug 6, 2023
CookiePLMonster added a commit to CookiePLMonster/OpenRCT2 that referenced this issue Sep 7, 2023
CookiePLMonster added a commit to CookiePLMonster/OpenRCT2 that referenced this issue Oct 11, 2023
janisozaur added a commit that referenced this issue Dec 31, 2023
- Feature: [#12078] Add shortcut key for toggling wall slope.
- Feature: [#19919] Add diagonal brakes and diagonal block brakes to most coaster types.
- Feature: [#20141] Add additional track pieces to the Giga Coaster.
- Feature: [#20825] Made setting the game speed a game action.
- Feature: [#20830] Display author field on scenery window.
- Feature: [#20853] [Plugin] Add “BaseTileElement.owner” which is saved in the park file.
- Feature: [objects#257] Re-introduce the RCT1 road, which does not have handrails.
- Feature: [OpenMusic#46] Added Mystic ride music style.
- Feature: [OpenMusic#50] Added Rock style 4 ride music.
- Improved: [objects#261] Add composer credits on all RCT2 music objects.
- Change: [#20790] Default ride price set to free if park charges for entry.
- Change: [#20880] Restore removed default coaster colours.
- Change: [#21102] The money effect will now update even when the game is paused.
- Change: [objects#244] Update sort priorities for expansion scenery groups.
- Change: [objects#256] Use recoloured RCT2 artwork on the Fruity Ices Stall, rather than the (slightly different) RCT1 artwork.
- Fix: [#5677] Balloons pass through the ground and objects.
- Fix: [#12299] Placing ride entrances/exits ignores the Disable Clearance Checks cheat.
- Fix: [#13473] Guests complain that the default Circus price is too high.
- Fix: [#15293] TTF fonts don’t format correctly with OpenGL.
- Fix: [#16453] Tile inspector invisibility shortcut does not use a game action.
- Fix: [#16926] When multiple vehicles are grouped in research, only one of them is unlocked.
- Fix: [#17774] Misplaced/missing land and construction rights tiles in RCT1 & RCT2 scenarios.
- Fix: [#18199] Dots in the game save’s name no longer get truncated.
- Fix: [#19722] “Forbid tree removal” restriction doesn’t forbid removal of large scenery tree items.
- Fix: [#20253] Crash when displaying a Lay-Down RC’s half loop.
- Fix: [#20356] Cannot set tertiary colour on small scenery.
- Fix: [#20624] Scrolling text glitches after language is changed.
- Fix: [#20679] Android: game crashes at launch.
- Fix: [#20737] Spent money in player window underflows when getting refunds.
- Fix: [#20747] Staff speed cheat not applying to newly hired staff, UI not showing the current applied speed.
- Fix: [#20778] [Plugin] Incorrect target api when executing custom actions.
- Fix: [#20807] Tertiary colour not copied with small scenery.
- Fix: [#20964] Crash when player connects to server with a group assigned that no longer exists.
- Fix: [#20995] TTF fonts don’t support hinting, outlines, or insets with OpenGL.
- Fix: [#21042] Peeps don’t render properly in S4 parks.
- Fix: [objects#246, objects#248] Some objects are incorrectly marked as originating from RCT1.
- Fix: [objects#260] Submarine Ride has its capacity listed incorrectly.
KatieZeldaKat pushed a commit to KatieZeldaKat/OpenRCT2 that referenced this issue Jan 2, 2024
- Feature: [OpenRCT2#12078] Add shortcut key for toggling wall slope.
- Feature: [OpenRCT2#19919] Add diagonal brakes and diagonal block brakes to most coaster types.
- Feature: [OpenRCT2#20141] Add additional track pieces to the Giga Coaster.
- Feature: [OpenRCT2#20825] Made setting the game speed a game action.
- Feature: [OpenRCT2#20830] Display author field on scenery window.
- Feature: [OpenRCT2#20853] [Plugin] Add “BaseTileElement.owner” which is saved in the park file.
- Feature: [objects#257] Re-introduce the RCT1 road, which does not have handrails.
- Feature: [OpenMusic#46] Added Mystic ride music style.
- Feature: [OpenMusic#50] Added Rock style 4 ride music.
- Improved: [objects#261] Add composer credits on all RCT2 music objects.
- Change: [OpenRCT2#20790] Default ride price set to free if park charges for entry.
- Change: [OpenRCT2#20880] Restore removed default coaster colours.
- Change: [OpenRCT2#21102] The money effect will now update even when the game is paused.
- Change: [objects#244] Update sort priorities for expansion scenery groups.
- Change: [objects#256] Use recoloured RCT2 artwork on the Fruity Ices Stall, rather than the (slightly different) RCT1 artwork.
- Fix: [OpenRCT2#5677] Balloons pass through the ground and objects.
- Fix: [OpenRCT2#12299] Placing ride entrances/exits ignores the Disable Clearance Checks cheat.
- Fix: [OpenRCT2#13473] Guests complain that the default Circus price is too high.
- Fix: [OpenRCT2#15293] TTF fonts don’t format correctly with OpenGL.
- Fix: [OpenRCT2#16453] Tile inspector invisibility shortcut does not use a game action.
- Fix: [OpenRCT2#16926] When multiple vehicles are grouped in research, only one of them is unlocked.
- Fix: [OpenRCT2#17774] Misplaced/missing land and construction rights tiles in RCT1 & RCT2 scenarios.
- Fix: [OpenRCT2#18199] Dots in the game save’s name no longer get truncated.
- Fix: [OpenRCT2#19722] “Forbid tree removal” restriction doesn’t forbid removal of large scenery tree items.
- Fix: [OpenRCT2#20253] Crash when displaying a Lay-Down RC’s half loop.
- Fix: [OpenRCT2#20356] Cannot set tertiary colour on small scenery.
- Fix: [OpenRCT2#20624] Scrolling text glitches after language is changed.
- Fix: [OpenRCT2#20679] Android: game crashes at launch.
- Fix: [OpenRCT2#20737] Spent money in player window underflows when getting refunds.
- Fix: [OpenRCT2#20747] Staff speed cheat not applying to newly hired staff, UI not showing the current applied speed.
- Fix: [OpenRCT2#20778] [Plugin] Incorrect target api when executing custom actions.
- Fix: [OpenRCT2#20807] Tertiary colour not copied with small scenery.
- Fix: [OpenRCT2#20964] Crash when player connects to server with a group assigned that no longer exists.
- Fix: [OpenRCT2#20995] TTF fonts don’t support hinting, outlines, or insets with OpenGL.
- Fix: [OpenRCT2#21042] Peeps don’t render properly in S4 parks.
- Fix: [objects#246, objects#248] Some objects are incorrectly marked as originating from RCT1.
- Fix: [objects#260] Submarine Ride has its capacity listed incorrectly.
CorySanin added a commit to CorySanin/OpenRCT2 that referenced this issue Feb 4, 2024
Release v0.4.7

- Feature: [OpenRCT2#12078] Add shortcut key for toggling wall slope.
- Feature: [OpenRCT2#19919] Add diagonal brakes and diagonal block brakes to most coaster types.
- Feature: [OpenRCT2#20141] Add additional track pieces to the Giga Coaster.
- Feature: [OpenRCT2#20825] Made setting the game speed a game action.
- Feature: [OpenRCT2#20830] Display author field on scenery window.
- Feature: [OpenRCT2#20853] [Plugin] Add “BaseTileElement.owner” which is saved in the park file.
- Feature: [objects#257] Re-introduce the RCT1 road, which does not have handrails.
- Feature: [OpenMusic#46] Added Mystic ride music style.
- Feature: [OpenMusic#50] Added Rock style 4 ride music.
- Improved: [objects#261] Add composer credits on all RCT2 music objects.
- Change: [OpenRCT2#20790] Default ride price set to free if park charges for entry.
- Change: [OpenRCT2#20880] Restore removed default coaster colours.
- Change: [OpenRCT2#21102] The money effect will now update even when the game is paused.
- Change: [objects#244] Update sort priorities for expansion scenery groups.
- Change: [objects#256] Use recoloured RCT2 artwork on the Fruity Ices Stall, rather than the (slightly different) RCT1 artwork.
- Fix: [OpenRCT2#5677] Balloons pass through the ground and objects.
- Fix: [OpenRCT2#12299] Placing ride entrances/exits ignores the Disable Clearance Checks cheat.
- Fix: [OpenRCT2#13473] Guests complain that the default Circus price is too high.
- Fix: [OpenRCT2#15293] TTF fonts don’t format correctly with OpenGL.
- Fix: [OpenRCT2#16453] Tile inspector invisibility shortcut does not use a game action.
- Fix: [OpenRCT2#16926] When multiple vehicles are grouped in research, only one of them is unlocked.
- Fix: [OpenRCT2#17774] Misplaced/missing land and construction rights tiles in RCT1 & RCT2 scenarios.
- Fix: [OpenRCT2#18199] Dots in the game save’s name no longer get truncated.
- Fix: [OpenRCT2#19722] “Forbid tree removal” restriction doesn’t forbid removal of large scenery tree items.
- Fix: [OpenRCT2#20253] Crash when displaying a Lay-Down RC’s half loop.
- Fix: [OpenRCT2#20356] Cannot set tertiary colour on small scenery.
- Fix: [OpenRCT2#20624] Scrolling text glitches after language is changed.
- Fix: [OpenRCT2#20679] Android: game crashes at launch.
- Fix: [OpenRCT2#20737] Spent money in player window underflows when getting refunds.
- Fix: [OpenRCT2#20747] Staff speed cheat not applying to newly hired staff, UI not showing the current applied speed.
- Fix: [OpenRCT2#20778] [Plugin] Incorrect target api when executing custom actions.
- Fix: [OpenRCT2#20807] Tertiary colour not copied with small scenery.
- Fix: [OpenRCT2#20964] Crash when player connects to server with a group assigned that no longer exists.
- Fix: [OpenRCT2#20995] TTF fonts don’t support hinting, outlines, or insets with OpenGL.
- Fix: [OpenRCT2#21042] Peeps don’t render properly in S4 parks.
- Fix: [objects#246, objects#248] Some objects are incorrectly marked as originating from RCT1.
- Fix: [objects#260] Submarine Ride has its capacity listed incorrectly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something went wrong.
Projects
None yet
3 participants