mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 01:49:40 +00:00
Added cursor caret color to editor color scheme
This commit is contained in:
1 parent
6f2288c81f
commit
05c27c5d20
4 files changed
+12
-8
No files matched your search
@@ -31,9 +31,6 @@ public class CustomNpcResourceListener implements
|
||||
|
||||
FolderResourcePack pack = new FolderResourcePack(CustomNpcs.Dir);
|
||||
LogWriter.info("[ResourceListener] Adding FolderResourcePack: " + CustomNpcs.Dir.getAbsolutePath());
|
||||
File schemeInFolder = new File(CustomNpcs.Dir, "assets/customnpcs/colorscheme/script_editor_scheme.json");
|
||||
LogWriter.info("[ResourceListener] Colorscheme in customnpcs folder: " + schemeInFolder.exists()
|
||||
+ " (" + schemeInFolder.getAbsolutePath() + ")");
|
||||
simplemanager.reloadResourcePack(pack);
|
||||
|
||||
ScriptColorScheme.reloadColorScheme(var1);
|
||||
|
||||
@@ -1053,7 +1053,7 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
if (active && isEnabled() && (recentInput || (cursorCounter / 10) % 2 == 0) && (selection.getCursorPosition() >= data.start && selection.getCursorPosition() < data.end || (i == list.size() - 1 && selection.getCursorPosition() == text.length()))) {
|
||||
int posX = x + LINE_NUMBER_GUTTER_WIDTH + ClientProxy.Font.width(
|
||||
line.substring(0, Math.min(selection.getCursorPosition() - data.start, line.length())));
|
||||
drawRect(posX + 1, posY, posX + 2, posY + container.lineHeight, 0xffffffff);
|
||||
drawRect(posX + 1, posY, posX + 2, posY + container.lineHeight, ScriptColorScheme.getBackgroundStyle().getCaretColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-3
@@ -178,9 +178,10 @@ public final class ScriptColorScheme {
|
||||
int lineNumberActiveColor = bg.has("lineNumberActiveColor") ? parseColor(bg.get("lineNumberActiveColor"), d.getLineNumberActiveColor(), "background.lineNumberActiveColor") : d.getLineNumberActiveColor();
|
||||
int scrollbarColor = bg.has("scrollbarColor") ? parseColor(bg.get("scrollbarColor"), d.getScrollbarColor(), "background.scrollbarColor") : d.getScrollbarColor();
|
||||
int borderColor = bg.has("borderColor") ? parseColor(bg.get("borderColor"), d.getBorderColor(), "background.borderColor") : d.getBorderColor();
|
||||
int caretColor = bg.has("caretColor") ? parseColor(bg.get("caretColor"), d.getCaretColor(), "background.caretColor") : d.getCaretColor();
|
||||
|
||||
return new BackgroundStyleEntry(backgroundColor, gutterColor, gutterSeparatorColor,
|
||||
lineNumberColor, lineNumberActiveColor, scrollbarColor, borderColor);
|
||||
lineNumberColor, lineNumberActiveColor, scrollbarColor, borderColor, caretColor);
|
||||
} catch (Exception e) {
|
||||
LogWriter.error("[ColorScheme] Error parsing 'background', using defaults: " + e.getMessage());
|
||||
return BackgroundStyleEntry.DEFAULT;
|
||||
@@ -241,7 +242,8 @@ public final class ScriptColorScheme {
|
||||
0xFF606366, // lineNumberColor (inactive)
|
||||
0xFFb9c7d6, // lineNumberActiveColor (current line)
|
||||
0xFFe0e0e0, // scrollbarColor
|
||||
0xffa0a0a0 // borderColor (outer border)
|
||||
0xffa0a0a0, // borderColor (outer border)
|
||||
0xffffffff // caretColor (cursor)
|
||||
);
|
||||
|
||||
private final int backgroundColor;
|
||||
@@ -251,10 +253,11 @@ public final class ScriptColorScheme {
|
||||
private final int lineNumberActiveColor;
|
||||
private final int scrollbarColor;
|
||||
private final int borderColor;
|
||||
private final int caretColor;
|
||||
|
||||
BackgroundStyleEntry(int backgroundColor, int gutterColor, int gutterSeparatorColor,
|
||||
int lineNumberColor, int lineNumberActiveColor,
|
||||
int scrollbarColor, int borderColor) {
|
||||
int scrollbarColor, int borderColor, int caretColor) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
this.gutterColor = gutterColor;
|
||||
this.gutterSeparatorColor = gutterSeparatorColor;
|
||||
@@ -262,6 +265,7 @@ public final class ScriptColorScheme {
|
||||
this.lineNumberActiveColor = lineNumberActiveColor;
|
||||
this.scrollbarColor = scrollbarColor;
|
||||
this.borderColor = borderColor;
|
||||
this.caretColor = caretColor;
|
||||
}
|
||||
|
||||
public int getBackgroundColor() { return backgroundColor; }
|
||||
@@ -271,5 +275,6 @@ public final class ScriptColorScheme {
|
||||
public int getLineNumberActiveColor() { return lineNumberActiveColor; }
|
||||
public int getScrollbarColor() { return scrollbarColor; }
|
||||
public int getBorderColor() { return borderColor; }
|
||||
public int getCaretColor() { return caretColor; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user