Closed bczretribution closed 7 months ago
This turns out to be quite the issue. I remember now that I kind of was like "good enough" with the renderer before figuring I would come back to it. The issue is that the choices are displayed in a JList and I need the Renderer for the JList to be able to handle variable heights and a fixed width. This turns out to be quite complicated! I have two basic solutions:
<html><div style=\"width:280px;\">STRING</div></html>
for the text. This appears to work but I don't love it. First of all the 280px doesn't feel right because the size of this panel is 400px so there is some weird conversion happening somewhere, and I can't guarantee that will be the same on all systems/themes.setSize(380, 5)
and then using getPreferredSize().height
which will now give the correct height for that width and text. This works and feels better to me, except for two problems. The JTextPane adds an empty line at the top of each panel because of a <p>
that gets added. This is annoying but not that problematic as it basically adds space between choices. Second, this works fine in almost all themes, but Metal and Nimbus do not set the height correctly and end up with too small panels where the text is mostly not visible. I have no idea why they would do this. However, we may drop Nimbus and Metal as themes, which would make this approach more viable.Ok, for now I am going to go with option (1) as it seems to work and look pretty good. Fixed in 373dd528f7.
Environment
story arcs 0.3
Description
I have noticed several issues of text overflowing its line off the side of the text box on some of the dialog screens. It only occurs with the text of the select-able choices (not with the conversation text), and only ever by a few letters at most (see half the "t" of "the"). As the text boxes are not scalable, it is not resolvable by the player. It has not been a serious issue however as each instance was easily discernible by context, until the trial of refusal dialog. When asked what battleground I preferred, the 3rd option is cut off and the player can only see an "m" (which my best guess took to mean "moon".)