mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 11:05:12 +00:00
Chat Bubbles using Custom Font - Fix Font Types
- Fixes Arabic Font
This commit is contained in:
1 parent
ce6e31abed
commit
e5d884fb07
2 files changed
+22
-6
No files matched your search
@@ -61,7 +61,14 @@ public class RenderChatMessages implements IChatMessages{
|
||||
int size = 0;
|
||||
for (TextBlockClient block : messages.values())
|
||||
size += block.lines.size();
|
||||
int textYSize = (int) (size * font.FONT_HEIGHT * scale);
|
||||
|
||||
int fontHeight;
|
||||
if(ConfigClient.ChatBubblesFontType)
|
||||
fontHeight = ClientProxy.Font.height();
|
||||
else
|
||||
fontHeight = font.FONT_HEIGHT;
|
||||
|
||||
int textYSize = (int) (size * fontHeight * scale);
|
||||
GL11.glTranslatef((float)par3 + 0.0F, (float)par5 + textYSize * textscale * var14, (float)par7);
|
||||
GL11.glScalef(textscale, textscale, textscale);
|
||||
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
|
||||
@@ -116,11 +123,14 @@ public class RenderChatMessages implements IChatMessages{
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
int index = 0;
|
||||
for(TextBlockClient block : messages.values()){
|
||||
for(IChatComponent chat : block.lines){
|
||||
String message = chat.getFormattedText();
|
||||
font.drawString(message, -font.getStringWidth(message) / 2, index * font.FONT_HEIGHT, black);
|
||||
index++;
|
||||
}
|
||||
for(IChatComponent chat : block.lines){
|
||||
String message = chat.getFormattedText();
|
||||
if(ConfigClient.ChatBubblesFontType)
|
||||
ClientProxy.Font.drawString(message, -ClientProxy.Font.width(message) / 2, index * fontHeight, black);
|
||||
else
|
||||
font.drawString(message, -font.getStringWidth(message) / 2, index * fontHeight, black);
|
||||
index++;
|
||||
}
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
}
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
@@ -42,6 +42,9 @@ public class ConfigClient
|
||||
public static Property FontSizeProperty;
|
||||
public static int FontSize = 18;
|
||||
|
||||
public static Property ChatBubblesFontTypeProperty;
|
||||
public static boolean ChatBubblesFontType = false;
|
||||
|
||||
/**
|
||||
* Questing Properties
|
||||
**/
|
||||
@@ -97,6 +100,9 @@ public class ConfigClient
|
||||
FontSizeProperty = config.get(VISUAL, "Font Size", 18, "Font size for custom fonts (doesn't work with minecrafts font)");
|
||||
FontSize = FontSizeProperty.getInt(18);
|
||||
|
||||
ChatBubblesFontTypeProperty = config.get(VISUAL, "Chat Bubbles Font Type", false, "Enable the use of Custom Font for Chat Bubbles");
|
||||
ChatBubblesFontType = ChatBubblesFontTypeProperty.getBoolean(false);
|
||||
|
||||
// Questing
|
||||
TrackingInfoAlignmentProperty = config.get(QUESTING, "Tracking Info Alignment", 3, "Client sided! Determines where tracking quest info shows up on the screen based on a number from 0 to 8. Default: 3");
|
||||
TrackingInfoAlignment = TrackingInfoAlignmentProperty.getInt(3);
|
||||
|
||||
Reference in new issue
Block a user