WindowRequestDetail request.getLongDisplayString() doesn't wrap: "Tool of class: shovel......etc"
mkienenb opened this issue ยท 2 comments
"Tool of class: shovel with minimal level: Wood or Gold and with maximal level: Wood or Gold [etc]" needs to wrap on the request detail screen.
WindowRequestDetail.onOpened()
final String[] labels = new String[] {request.getLongDisplayString().getFormattedText()};
@mkienenb Take a look at the label
class. It is what actually does the rendering. You might need to introduce logic that autowraps using its FontRenderer
. In FontRenderer
there is a method that allows you to split a string given a width.
@OrionDevelopment Yes, i've taken a look at this. However, if I fix the wrapping in the label itself, it appears that I will break the y-positioning as WindowRequestDetail assumes that every label is 10 pixels high (Y_OFFSET_EACH_TEXTFIELD). As you say, the right fix would be to fix the label and fix the y-positioning anywhere a label is used. With my current lack of in-editor PMD and checkstyle support, I don't think I want to make such a sweeping change yet.
Another possibility is to make multiple labels per label text in the label-creating for loop.