diff --git a/bin/RabiClone.jar b/bin/RabiClone.jar index fce7dde..50aa3fe 100644 Binary files a/bin/RabiClone.jar and b/bin/RabiClone.jar differ diff --git a/src/sig/DrawLoop.java b/src/sig/DrawLoop.java index 243268e..429ae90 100644 --- a/src/sig/DrawLoop.java +++ b/src/sig/DrawLoop.java @@ -67,8 +67,58 @@ public class DrawLoop { } } } + + public static void Draw_Line(byte[] canvas,int x1,int y1,int x2,int y2,byte col,Alpha alpha) { + int x,y,dx,dy,dx1,dy1,px,py,xe,ye; + dx=x2-x1;dy=y2-y1; + dx1=Math.abs(dx);dy1=Math.abs(dy); + px=2*dy1-dx1;py=2*dx1-dy1; + if (dy1<=dx1) { + if (dx>=0) { + x=x1;y=y1;xe=x2-1; + } else { + x=x2-1;y=y2-1;xe=x1; + } + Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); + while (x0&&dy>0)) { + y=y+1; + } else { + y=y-1; + } + px=px+2*(dy1-dx1); + } + Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); + } + } else { + if (dy>=0) { + x=x1;y=y1;ye=y2-1; + } else { + x=x2-1;y=y2-1;ye=y1; + } + Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); + while (y0&&dy>0)) { + x=x+1; + } else { + x=x-1; + } + py=py+2*(dx1-dy1); + } + Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); + } + } + } - public static void FillRect(byte[] p,byte col,double x,double y,double w,double h) { + public static void Fill_Rect(byte[] p,byte col,double x,double y,double w,double h) { for (int xx=0;xx> actionHighlightSections = new ArrayList<>(); + int storedX=-1; + int storedY=-1; + int storedEndX=-1; public ConfigureControls(Panel panel) { super(panel); @@ -87,14 +90,17 @@ public class ConfigureControls extends Object{ for (Action a : Action.values()) { if (RabiClone.MOUSE_POS.getY()>=getY()+y&&RabiClone.MOUSE_POS.getY() sectionList = actionHighlightSections.get(a.ordinal()); int startX=sectionList.get(i)*Font.PROFONT_12.getGlyphWidth()-4; int endX=sectionList.get(i+1)*Font.PROFONT_12.getGlyphWidth()+4; if (selectedKeybind==null&&RabiClone.MOUSE_POS.getY()>=getY()+y&&RabiClone.MOUSE_POS.getY()=startX&&RabiClone.MOUSE_POS.getX()<=endX) { - Draw_Rect(p,(byte)PaletteColor.AZURE.ordinal(),startX,getY()+y,endX-startX,Font.PROFONT_12.getGlyphHeight()+4); + Draw_Rect(p,PaletteColor.RED,startX,getY()+y,endX-startX,Font.PROFONT_12.getGlyphHeight()+4); + storedX=startX; + storedY=y; + storedEndX=endX; selectedKeybind=KeyBind.KEYBINDS.get(a).get(i/2); break; } @@ -102,6 +108,10 @@ public class ConfigureControls extends Object{ Draw_Text_Ext(4,getY()+y,DisplayActionKeys(a),Font.PROFONT_12,Alpha.ALPHA0,PaletteColor.MIDNIGHT_BLUE); y+=Font.PROFONT_12.getGlyphHeight()+4; } + if (selectedKeybind!=null) { + Draw_Line(p,storedX,getY()+storedY,storedEndX,getY()+storedY+Font.PROFONT_12.getGlyphHeight()+4,PaletteColor.BLACK,Alpha.ALPHA32); + Draw_Line(p,storedX,getY()+storedY+Font.PROFONT_12.getGlyphHeight()+4,storedEndX,getY()+storedY,PaletteColor.BLACK,Alpha.ALPHA32); + } } else { Draw_Text_Ext(4, 4, new StringBuilder("Press a key to assign to ").append(selectedAction), Font.PROFONT_12, Alpha.ALPHA0, PaletteColor.MIDNIGHT_BLUE); }