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

[Feature Request] Adjust Font Size #19

Open
richardziegler opened this issue May 10, 2024 · 13 comments
Open

[Feature Request] Adjust Font Size #19

richardziegler opened this issue May 10, 2024 · 13 comments

Comments

@richardziegler
Copy link
Contributor

Hello! Thanks for your work on this mod!

Have you looked into adding an option to adjust the font size? I know that the assets for dialogue boxes won't scale with it but I am interested in what can be done here.

Also: I am a software dev and would love to spend some time looking at this myself and contribute if possible! I'm happy to chat on Discord about this if you're open to it!

@Lyall
Copy link
Owner

Lyall commented May 11, 2024

It's do-able for sure but like you said, if you just increase the font size then it will go out of the bounds of the text-bubble.

For example, this

// Set text size
[HarmonyPatch(typeof(Scenario.UI.UIConversation), nameof(Scenario.UI.UIConversation.SetText))]
[HarmonyPostfix]
public static void SetTextSize(Scenario.UI.UIConversation __instance)
{
    Log.LogInfo($"Increasing font size.");
    __instance.TextData._text.fontSize *= 2;
}

Gets you this:
EiyudenChronicle_2024_05_11_23_33_11_968

@Lyall
Copy link
Owner

Lyall commented May 11, 2024

What might be better is to raise the scale of the conversation window. For example here's the vanilla game vs 1.4x scale on the conversation window.

EiyudenChronicle_2024_05_11_23_40_58_207
EiyudenChronicle_2024_05_11_23_41_04_983

@richardziegler
Copy link
Contributor Author

What might be better is to raise the scale of the conversation window. For example here's the vanilla game vs 1.4x scale on the conversation window.

EiyudenChronicle_2024_05_11_23_40_58_207

EiyudenChronicle_2024_05_11_23_41_04_983

This looks incredible! I was worried there would need to be asset replacements and was starting analysis on Ghidra for RE too.

I'm about to travel for work so I'll try getting a PR open for that once I get back if you haven't already 🙂

@richardziegler
Copy link
Contributor Author

What might be better is to raise the scale of the conversation window. For example here's the vanilla game vs 1.4x scale on the conversation window.

EiyudenChronicle_2024_05_11_23_40_58_207 EiyudenChronicle_2024_05_11_23_41_04_983

Hey hey, I'm back from my trip. Do you happen to remember what class the scale property was in? (Or if it was just a single property at all.) I've dug through these classes and was able to change the width of the Conversation window but scaling the whole thing I've come up dry.
image

@Lyall
Copy link
Owner

Lyall commented May 19, 2024

Hey hey, I'm back from my trip. Do you happen to remember what class the scale property was in? (Or if it was just a single property at all.) I've dug through these classes and was able to change the width of the Conversation window but scaling the whole thing I've come up dry.
image

Sorry I should have posted the code snippet responsible for the previous result. It would look a little something like this:

// Increase size of conversation window
[HarmonyPatch(typeof(Scenario.UI.UIConversationGroup), nameof(Scenario.UI.UIConversationGroup.Initialize))]
[HarmonyPostfix]
public static void SetTextSize(Scenario.UI.UIConversationGroup __instance)
{
    Log.LogInfo($"Increasing size of conversation window.");
    __instance.GetComponent<RectTransform>().localScale = new Vector3(1.4f, 1.4f, 1f);
}

That would get you a 1.4x increase on the size of the conversation window.

@richardziegler
Copy link
Contributor Author

Hey hey, I'm back from my trip. Do you happen to remember what class the scale property was in? (Or if it was just a single property at all.) I've dug through these classes and was able to change the width of the Conversation window but scaling the whole thing I've come up dry.
image

Sorry I should have posted the code snippet responsible for the previous result. It would look a little something like this:

// Increase size of conversation window
[HarmonyPatch(typeof(Scenario.UI.UIConversationGroup), nameof(Scenario.UI.UIConversationGroup.Initialize))]
[HarmonyPostfix]
public static void SetTextSize(Scenario.UI.UIConversationGroup __instance)
{
    Log.LogInfo($"Increasing size of conversation window.");
    __instance.GetComponent<RectTransform>().localScale = new Vector3(1.4f, 1.4f, 1f);
}

That would get you a 1.4x increase on the size of the conversation window.

Many thanks! I opened a PR for this functionality after implementing and testing. I appreciate you working through this with me to get it in. 😊

@Lyall
Copy link
Owner

Lyall commented May 22, 2024

I've just put out v0.9.8 with your patch included.

@richardziegler
Copy link
Contributor Author

I've just put out v0.9.8 with your patch included.

Woo! Thanks! I want to see if I can detect when the conversation window size increase pushes it off the edge of the screen and then reposition it a bit to fit it inside the screen bounds. If I figure that out I'll open a new PR for that improvement too. 😊

@edale2
Copy link

edale2 commented Jun 2, 2024

Is it possible to scale size of these conversation windows in the corner of the screen (preferably independently of the scaling that's already been done)? I typically don't even notice them until the conversations are 1/2 over with how small and out of the way they are.

image

@richardziegler
Copy link
Contributor Author

Is it possible to scale size of these conversation windows in the corner of the screen (preferably independently of the scaling that's already been done)? I typically don't even notice them until the conversations are 1/2 over with how small and out of the way they are.

image

I imagine they should be. I will try to find time this week to look into it. 🙂

@richardziegler
Copy link
Contributor Author

@edale2 Do you have a save file in a good spot where you know those conversations will happen? To not give any spoilers, I'm at a weird part in the game so I don't know when the next time I'll have some of those are. So having a save file in a good testing spot would help me nail down what UI component that is.

@edale2
Copy link

edale2 commented Jun 3, 2024

https://mega.nz/file/XExXQY6A#lZquWldwT3vFyCqANyYIp6O21vlvqcPkNhrOdf5ZeAs

Save data location: C:\Users\ [username]\AppData\LocalLow\505 Games S_p_A\EiyudenChronicle\GOGSave\SaveData (may be different for Steam version)

Save slot 2. Right at the beginning of the game. Just exit the inn, leave town, dismiss the worldmap tutorial screen, and take a few steps away from the town to trigger a 2 or 3 line dialog.

After that dialog, Enter Fort Xialuke to the south, and you'll trigger a much longer set of dialog.

And after that dialog, you can go back to the worldmap, then go North to the Northern Forest, and after a short cutscene another longer dialog will start.

that'll give you one on the worldmap, one in a dungeon, and one in a "town" (insomuch as the Fort can be considered a town).

@edale2
Copy link

edale2 commented Jun 21, 2024

@richardziegler Any progress on resizing those text boxes?

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

No branches or pull requests

3 participants