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

[HS2] Fixed bug with incorrect character card paths #52

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

takahiro0327
Copy link
Contributor

#51 GetSourceFilePath() uses Dictionary<ChaFile, string> to map a file path to a ChaFile, and was not working as expected when the ChaFile was recycled.

Please review and merge.

Copy link
Owner

@ManlyMarco ManlyMarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when there are cards with the same file name in 2 subfolders?

@takahiro0327
Copy link
Contributor Author

takahiro0327 commented Jun 15, 2024

It is overwritten by the last registered card.
We only know the name of the card, and there is nothing we can do about it, is there?

Maybe a very large patch to the game's code to stop the recycling of ChaFile, or recording the full path instead of the file name, might help, but the effort would be tremendous.

Considering what went wrong, it was a bad idea to allow the existence of a file with the same name, ignoring the specification on the game itself that only the file name is used for management.

@takahiro0327
Copy link
Contributor Author

Note: The reason why charaFileName and path are different from the actual state of ChaFile is that they are set to values that were stored elsewhere immediately before the function was called.

  at BrowserFolders.NestedFilenamesMainGamePatch.ConvertCharaFilePath (AIChara.ChaFileControl& __instance, System.String& __result, System.String path) [0x00000] in <cd4d5d47c76a4944b6d2c03375fef644>:0 
  at AIChara.ChaFileControl.DMD<AIChara.ChaFileControl::ConvertCharaFilePath> (AIChara.ChaFileControl , System.String , System.Byte , System.Boolean ) [0x00000] in <aebd3b6ac6534b75930264311ce5b75d>:0 
  at AIChara.ChaFileControl.DMD<AIChara.ChaFileControl::LoadCharaFile> (AIChara.ChaFileControl , System.String , System.Byte , System.Boolean , System.Boolean ) [0x00000] in <aebd3b6ac6534b75930264311ce5b75d>:0 
  at HS2.MapSelectUI.DMD<HS2.MapSelectUI::MapSelecCursorEnter> (HS2.MapSelectUI , MapInfo+Param , System.Int32 ) [0x00000] in <aebd3b6ac6534b75930264311ce5b75d>:0 
  at HS2.MapSelectUI+<>c__DisplayClass24_0.<ResetMapScroll>b__4 () [0x00000] in <aebd3b6ac6534b75930264311ce5b75d>:0 
  at SceneAssist.PointerEnterExitAction.OnPointerEnter (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <aebd3b6ac6534b75930264311ce5b75d>:0 
  at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerEnterHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <f0cd79bc997b4fdfbb94781bafee7971>:0 
  at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00000] in <f0cd79bc997b4fdfbb94781bafee7971>:0 
  at UnityEngine.EventSystems.BaseInputModule.HandlePointerExitAndEnter (UnityEngine.EventSystems.PointerEventData currentPointerData, UnityEngine.GameObject newEnterTarget) [0x00000] in <f0cd79bc997b4fdfbb94781bafee7971>:0 
  at UnityEngine.EventSystems.PointerInputModule.ProcessMove (UnityEngine.EventSystems.PointerEventData pointerEvent) [0x00000] in <f0cd79bc997b4fdfbb94781bafee7971>:0 
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent (System.Int32 id) [0x00000] in <f0cd79bc997b4fdfbb94781bafee7971>:0 
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent () [0x00000] in <f0cd79bc997b4fdfbb94781bafee7971>:0 
  at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <f0cd79bc997b4fdfbb94781bafee7971>:0 
  at UnityEngine.EventSystems.EventSystem.Update () [0x00000] in <f0cd79bc997b4fdfbb94781bafee7971>:0 

image
image

@ManlyMarco ManlyMarco linked an issue Jun 17, 2024 that may be closed by this pull request
@ManlyMarco ManlyMarco merged commit f806899 into ManlyMarco:master Jun 17, 2024
@takahiro0327 takahiro0327 deleted the fix-chara-card-path branch June 17, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HS2: Wrong names are showing in map select.
2 participants