mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 12:39:05 +00:00
Reverse Default Dialog Alignment
This commit is contained in:
1 parent
0ba3092e51
commit
66540a054d
3 files changed
+6
-6
No files matched your search
@@ -98,7 +98,7 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis
|
||||
addButton(new GuiNpcButton(10, guiLeft + 70, y += 22, 50, 20, new String[]{"gui.text", "gui.option", "display.fixed"}, dialog.titlePos));
|
||||
addLabel(new GuiNpcLabel(10, "dialog.titlePos", guiLeft + 4, y + 5));
|
||||
|
||||
addButton(new GuiNpcButton(24, guiLeft + 192, y, 50, 20, new String[]{"display.top", "display.bottom"}, dialog.alignment));
|
||||
addButton(new GuiNpcButton(24, guiLeft + 192, y, 50, 20, new String[]{"display.bottom", "display.top"}, dialog.alignment));
|
||||
addLabel(new GuiNpcLabel(27, "display.alignment", guiLeft + 126, y + 5));
|
||||
|
||||
addTextField(new GuiNpcTextField(11, this, guiLeft + 120, y += 25, 40, 20, String.valueOf(dialog.textWidth)));
|
||||
|
||||
@@ -503,7 +503,7 @@ public class GuiDialogInteract extends GuiNPCInterface implements IGuiClose
|
||||
int height = count - totalRows + lineOffset;
|
||||
int screenPos = optionStart;
|
||||
int y = (height * ClientProxy.Font.height()) + screenPos + scrollY;
|
||||
if (dialog.alignment == 0) {
|
||||
if (dialog.alignment == 1) {
|
||||
height = count - totalRows + lineOffset + 1;
|
||||
screenPos = optionStart - dialog.textHeight + ClientProxy.Font.height() + (totalRows - lineOffset);
|
||||
|
||||
@@ -515,7 +515,7 @@ public class GuiDialogInteract extends GuiNPCInterface implements IGuiClose
|
||||
}
|
||||
|
||||
if (block.titlePos == 0 || mainDialogText) {
|
||||
if (dialog.alignment == 0) {
|
||||
if (dialog.alignment == 1) {
|
||||
if (y < optionStart - dialog.textHeight || y > optionStart - ClientProxy.Font.height()/2f) {
|
||||
return;
|
||||
}
|
||||
@@ -584,7 +584,7 @@ public class GuiDialogInteract extends GuiNPCInterface implements IGuiClose
|
||||
textSoundEnabled = !textSoundEnabled;
|
||||
}
|
||||
|
||||
if (dialog.alignment == 0 && totalRows * ClientProxy.Font.height() > dialog.textHeight) {
|
||||
if (dialog.alignment == 1 && totalRows * ClientProxy.Font.height() > dialog.textHeight) {
|
||||
if ((i == mc.gameSettings.keyBindBack.getKeyCode() || i == 201) && scrollY < totalRows * ClientProxy.Font.height()) {//Page up
|
||||
scrollY += ClientProxy.Font.height() * 2;
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ public class Dialog implements ICompatibilty, IDialog {
|
||||
public boolean darkenScreen = true;
|
||||
public boolean showOptionLine = true;
|
||||
|
||||
//0 - Top, 1 - Bottom, 2 (Not implemented yet) - Center
|
||||
public byte alignment = 1;
|
||||
//0 - Bottom, 1 - Top, 2 (Not implemented yet) - Center
|
||||
public byte alignment = 0;
|
||||
|
||||
public boolean renderGradual = false;
|
||||
public boolean showPreviousBlocks = true;
|
||||
|
||||
Reference in new issue
Block a user