mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 19:42:19 +00:00
Added parameter autocomplete coloring
This commit is contained in:
1 parent
c0a022c5b5
commit
f25b9164d0
3 files changed
+14
-8
No files matched your search
+10
-7
@@ -22,12 +22,13 @@ public class AutocompleteItem implements Comparable<AutocompleteItem> {
|
||||
public enum Kind {
|
||||
ENUM_CONSTANT(-1), // Enum constant value (highest priority for enums)
|
||||
METHOD(0), // Method or function
|
||||
FIELD(1), // Field or property
|
||||
VARIABLE(2), // Local variable or parameter
|
||||
CLASS(3), // Class or interface type
|
||||
ENUM(4), // Enum type
|
||||
KEYWORD(6), // Language keyword
|
||||
SNIPPET(7); // Code snippet
|
||||
FIELD(10), // Field or property
|
||||
PARAMETER(19), // Local variable or parameter
|
||||
VARIABLE(20), // Local variable or parameter
|
||||
CLASS(30), // Class or interface type
|
||||
ENUM(40), // Enum type
|
||||
KEYWORD(60), // Language keyword
|
||||
SNIPPET(70); // Code snippet
|
||||
|
||||
private final int priority;
|
||||
|
||||
@@ -158,7 +159,7 @@ public class AutocompleteItem implements Comparable<AutocompleteItem> {
|
||||
Kind kind;
|
||||
switch (field.getScope()) {
|
||||
case PARAMETER:
|
||||
kind = Kind.VARIABLE;
|
||||
kind = Kind.PARAMETER;
|
||||
break;
|
||||
case LOCAL:
|
||||
kind = Kind.VARIABLE;
|
||||
@@ -694,6 +695,7 @@ public class AutocompleteItem implements Comparable<AutocompleteItem> {
|
||||
case METHOD: return "m";
|
||||
case FIELD: return "f";
|
||||
case VARIABLE: return "v";
|
||||
case PARAMETER: return "p";
|
||||
case CLASS: return "C";
|
||||
case ENUM: return "E";
|
||||
case ENUM_CONSTANT: return "e";
|
||||
@@ -711,6 +713,7 @@ public class AutocompleteItem implements Comparable<AutocompleteItem> {
|
||||
case METHOD: return 0xFFB877DB; // Purple for methods
|
||||
case FIELD: return 0xFF79C0FF; // Blue for fields
|
||||
case VARIABLE: return 0xFF7EE787; // Green for variables
|
||||
case PARAMETER: return 0XFFFF00FF; // Green for variables
|
||||
case CLASS: return 0xFFFFA657; // Orange for classes
|
||||
case ENUM: return 0xFFFFD866; // Yellow for enums
|
||||
case ENUM_CONSTANT: return 0xFFFFD866;
|
||||
|
||||
@@ -482,6 +482,8 @@ public class AutocompleteMenu extends Gui {
|
||||
return TokenType.getColor(item.getTypeInfo());
|
||||
case VARIABLE:
|
||||
return TokenType.LOCAL_FIELD.getHexColor();
|
||||
case PARAMETER:
|
||||
return TokenType.PARAMETER.getHexColor();
|
||||
case KEYWORD:
|
||||
return TokenType.KEYWORD.getHexColor();
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package noppes.npcs.client.gui.util.script.interpreter.token;
|
||||
|
||||
import noppes.npcs.client.gui.util.script.interpreter.field.FieldInfo;
|
||||
import noppes.npcs.client.gui.util.script.interpreter.type.TypeInfo;
|
||||
|
||||
/**
|
||||
@@ -110,7 +111,7 @@ public enum TokenType {
|
||||
public static int getColor(TypeInfo typeInfo) {
|
||||
return getByType(typeInfo).getHexColor();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert this token type to a Minecraft color code character.
|
||||
* Used for backward compatibility with the existing rendering system.
|
||||
|
||||
Reference in new issue
Block a user