Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
1c13162f80 | |||
904a9925e2 | |||
413fab117b | |||
79bb1e576b | |||
824b8249d9 | |||
e210299f7f | |||
629f118e7c | |||
9e6aa20a21 | |||
63dfe0c60e | |||
f07a89fe22 | |||
2cee57d9e9 |
27
.classpath
27
.classpath
@ -5,15 +5,36 @@
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="lib" path="lib/commons-io-2.5.jar"/>
|
||||
<classpathentry kind="lib" path="lib/twitch-api-wrapper-0.3-jar-with-dependencies.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lwjgl-glfw.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lwjgl-glfw-natives-linux.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lwjgl-glfw-natives-macos.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lwjgl-glfw-natives-windows.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lwjgl.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lwjgl-natives-linux.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lwjgl-natives-macos.jar"/>
|
||||
<classpathentry kind="lib" path="lib/lwjgl-natives-windows.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jna-4.5.0.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jna-platform-4.5.0.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/basicplayer3.0.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/commons-io-2.5.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/commons-logging-api.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jl1.0.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jna-4.5.0.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jna-platform-4.5.0.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jogg-0.0.7.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jorbis-0.0.15.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jspeex0.9.7.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-glfw.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-glfw-natives-linux.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-glfw-natives-macos.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-glfw-natives-windows.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-natives-linux.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-natives-macos.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/lwjgl-natives-windows.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jna-4.5.0.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/jna-platform-4.5.0.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/mp3spi1.9.4.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/tritonus_share.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/twitch-api-wrapper-0.3-jar-with-dependencies.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/git/sigIRCv2/lib/vorbisspi1.0.2.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
BIN
lib/basicplayer3.0.jar
Normal file
BIN
lib/basicplayer3.0.jar
Normal file
Binary file not shown.
BIN
lib/commons-logging-api.jar
Normal file
BIN
lib/commons-logging-api.jar
Normal file
Binary file not shown.
BIN
lib/jl1.0.jar
Normal file
BIN
lib/jl1.0.jar
Normal file
Binary file not shown.
BIN
lib/jogg-0.0.7.jar
Normal file
BIN
lib/jogg-0.0.7.jar
Normal file
Binary file not shown.
BIN
lib/jorbis-0.0.15.jar
Normal file
BIN
lib/jorbis-0.0.15.jar
Normal file
Binary file not shown.
BIN
lib/jspeex0.9.7.jar
Normal file
BIN
lib/jspeex0.9.7.jar
Normal file
Binary file not shown.
BIN
lib/mp3spi1.9.4.jar
Normal file
BIN
lib/mp3spi1.9.4.jar
Normal file
Binary file not shown.
BIN
lib/resource/CP_Font.ttf
Normal file
BIN
lib/resource/CP_Font.ttf
Normal file
Binary file not shown.
BIN
lib/resource/deselected_button.png
Normal file
BIN
lib/resource/deselected_button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 229 B |
BIN
lib/resource/selected_button.png
Normal file
BIN
lib/resource/selected_button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 331 B |
BIN
lib/resource/sigIRCicon.png
Normal file
BIN
lib/resource/sigIRCicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
1
lib/resource/text/introText.html
Normal file
1
lib/resource/text/introText.html
Normal file
@ -0,0 +1 @@
|
||||
<img src="../sigIRCicon.png" style="float:left;padding-right:5px;vertical-align:text-bottom;"><font size="5"><b>sigIRC</b> allows you to present dynamic content to viewers on stream and provides various features that may be helpful to you as a streamer. Click <i>Next</i> to begin the setup process.</font>
|
12
lib/resource/text/setupProgramSettings.html
Normal file
12
lib/resource/text/setupProgramSettings.html
Normal file
@ -0,0 +1,12 @@
|
||||
<font size="5">Now it's time to configure basic features of <b>sigIRC</b>. sigIRC provides the following modules:
|
||||
<br>
|
||||
<ul>
|
||||
<li><b>Scrolling Chat</b> - Displays scrolling chat messages across the screen as users of your channel talk.</li>
|
||||
<li><b>Chat Log</b> - Displays a box that contains the latest chat messages from your channel for that day.</li>
|
||||
<li><b>Controller</b> - Displays a controller on screen and allows you to configure the buttons and display so viewers can see your button inputs.</li>
|
||||
<li><b>Twitch</b> - Displays a bar that shows your channel's stream uptime, number of followers, channel view, and current viewers. Also announces new followers of your stream.</li>
|
||||
<li><b>Rabi-Race</b> - For the game <b>Rabi-Ribi</b>. A tracker that allows players of the game to connect to each other in game rooms and see each others' progress as they race. Supports randomizer Egg Hunts and Item Hunts.</li>
|
||||
<li><b>Touhou Mother</b> - For the game <b>Touhou Mother</b>. A tracker that displays boss health whenever you get into a boss encounter, the amount of time the boss fight takes, and how much damage your party members deal.</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
Each module will open up in a separate window that you can place and resize on your screen as you see fit.</font>
|
1
lib/resource/text/setupTwitchName.html
Normal file
1
lib/resource/text/setupTwitchName.html
Normal file
@ -0,0 +1 @@
|
||||
<font size="5"><b>sigIRC</b> uses your Twitch account in order to retrieve and send data. Please input your Twitch username below and hit <i>Next</i> to continue. You will be asked for authentication details on the next screen.</font>
|
1
lib/resource/text/setupoauthToken.html
Normal file
1
lib/resource/text/setupoauthToken.html
Normal file
@ -0,0 +1 @@
|
||||
<font size="5">Below you will see a button to <i><a href="https://twitchapps.com/tmi/">https://twitchapps.com/tmi/</a></i> which will allow you to retrieve an <b>oauth Token</b>. Connect to Twitch and generate an <b>oauth token</b>, then copy and paste the token into the box below to grant this program the ability to use Twitch services.</font>
|
BIN
lib/tritonus_share.jar
Normal file
BIN
lib/tritonus_share.jar
Normal file
Binary file not shown.
BIN
lib/vorbisspi1.0.2.jar
Normal file
BIN
lib/vorbisspi1.0.2.jar
Normal file
Binary file not shown.
BIN
sigIRCv2.jar
BIN
sigIRCv2.jar
Binary file not shown.
@ -35,7 +35,7 @@ public class BackgroundColorButton {
|
||||
|
||||
public void draw(Graphics g) {
|
||||
if (buttonEnabled) {
|
||||
g.drawImage(buttonimg, x, y, sigIRC.panel);
|
||||
g.drawImage(buttonimg, x, y, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,8 @@ public class Emoticon {
|
||||
System.out.println("Saved to "+file.getName()+".");
|
||||
emotename = emoteName;
|
||||
}
|
||||
spacefiller = GetSpaceLength(sigIRC.panel.programFont);
|
||||
spacefillersmall = GetSpaceLength(sigIRC.panel.userFont);
|
||||
spacefiller = GetSpaceLength(sigIRC.programFont);
|
||||
spacefillersmall = GetSpaceLength(sigIRC.userFont);
|
||||
//System.out.println("Space size for "+emotename+" is "+spacefiller.length());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@ -49,8 +49,8 @@ public class Emoticon {
|
||||
image = ImageIO.read(file);
|
||||
emotename = emoteName;
|
||||
}
|
||||
spacefiller = GetSpaceLength(sigIRC.panel.programFont);
|
||||
spacefillersmall = GetSpaceLength(sigIRC.panel.userFont);
|
||||
spacefiller = GetSpaceLength(sigIRC.programFont);
|
||||
spacefillersmall = GetSpaceLength(sigIRC.userFont);
|
||||
//System.out.println("Space size for "+emotename+" is "+spacefiller.length());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -33,14 +33,20 @@ public class FileManager {
|
||||
return fileloc;
|
||||
}
|
||||
|
||||
public void verifyAndFetchFileFromServer() {
|
||||
public boolean verifyAndFetchFileFromServer() {
|
||||
if (fileloc.contains("_FAKE_")) {
|
||||
return false;
|
||||
}
|
||||
File file = new File(sigIRC.BASEDIR+fileloc);
|
||||
if (folder) {
|
||||
if (!file.exists()) {
|
||||
System.out.println("Could not find "+file.getAbsolutePath()+", creating Folder "+file.getName()+".");
|
||||
if (file.mkdirs()) {
|
||||
System.out.println(" >> Successfully created "+file.getAbsolutePath()+".");
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (!file.exists()) {
|
||||
@ -49,13 +55,17 @@ public class FileManager {
|
||||
org.apache.commons.io.FileUtils.copyURLToFile(new URL(serverURL+fileloc),file);
|
||||
if (file.exists()) {
|
||||
System.out.println(" >> Successfully downloaded "+file.getAbsolutePath()+".");
|
||||
return true;
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
53
src/sig/ListenerPanel.java
Normal file
53
src/sig/ListenerPanel.java
Normal file
@ -0,0 +1,53 @@
|
||||
package sig;
|
||||
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.awt.event.MouseWheelListener;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class ListenerPanel extends JPanel implements MouseListener, MouseWheelListener{
|
||||
|
||||
Module mod;
|
||||
|
||||
public ListenerPanel(Module mod) {
|
||||
this.addMouseListener(this);
|
||||
this.addMouseWheelListener(this);
|
||||
this.mod=mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseWheelMoved(MouseWheelEvent e) {
|
||||
this.mod.mouseWheelMoved(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
this.mod.mouseClicked(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
this.mod.mouseEntered(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
this.mod.mouseExited(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
this.mod.mousePressed(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
this.mod.mouseReleased(e);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,72 +1,124 @@
|
||||
package sig;
|
||||
import java.awt.Color;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.Vector;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import sig.utils.DrawUtils;
|
||||
import sig.utils.TextUtils;
|
||||
import sig.windows.ProgramWindow;
|
||||
|
||||
public class Module {
|
||||
public Rectangle2D position;
|
||||
public class Module extends JFrame implements ComponentListener, WindowListener, KeyListener{
|
||||
public ListenerPanel panel;
|
||||
public Rectangle position;
|
||||
protected boolean enabled;
|
||||
protected String name;
|
||||
public static BufferedImage IMG_DRAGBAR;
|
||||
public static BufferedImage MSG_SEPARATOR;
|
||||
public static boolean inDragZone=false;
|
||||
final public static int WINDOW_EXTRA_BORDER = 32; //Number of pixels that the border takes up (Reduces the size of the window)
|
||||
|
||||
final protected int titleHeight;
|
||||
|
||||
Point dragOffset;
|
||||
boolean dragging=false;
|
||||
public static boolean DRAGGING=false;
|
||||
public Graphics myGraphics;
|
||||
long lasttime = System.currentTimeMillis();
|
||||
float avgfps = sigIRC.framerate;
|
||||
int counter = 0;
|
||||
int avgcount = 10;
|
||||
int[] sum = new int[10];
|
||||
int windowUpdateCounter = 30;
|
||||
|
||||
public Module(Rectangle bounds, String moduleName) {
|
||||
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
this.addComponentListener(this);
|
||||
this.addWindowListener(this);
|
||||
this.addKeyListener(this);
|
||||
|
||||
public Module(Rectangle2D bounds, String moduleName) {
|
||||
this.position = bounds;
|
||||
System.out.println(position);
|
||||
this.name = moduleName;
|
||||
this.enabled=true;
|
||||
this.setTitle(moduleName);
|
||||
panel = new ListenerPanel(this){
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
draw(g);
|
||||
}
|
||||
};
|
||||
this.setLocation((int)position.getX(), (int)position.getY());
|
||||
|
||||
this.titleHeight = (int)TextUtils.calculateStringBoundsFont(this.name, sigIRC.panel.userFont).getHeight();
|
||||
this.titleHeight = (int)TextUtils.calculateStringBoundsFont(this.name, sigIRC.userFont).getHeight();
|
||||
|
||||
this.setSize(new Dimension((int)position.getWidth(), (int)position.getHeight()));
|
||||
|
||||
panel.setSize(this.getSize());
|
||||
//System.out.println("Module "+moduleName+": "+position);
|
||||
|
||||
this.add(panel);
|
||||
//this.pack();
|
||||
repaint();
|
||||
this.setVisible(true);
|
||||
|
||||
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
|
||||
scheduler.scheduleWithFixedDelay(()->{
|
||||
run();
|
||||
panel.repaint();
|
||||
},(long)((1d/(sigIRC.framerate+1))*1000),(long)((1d/(sigIRC.framerate+1))*1000),TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public Module(Rectangle2D bounds, String moduleName, boolean enabled) {
|
||||
public Module(Rectangle bounds, String moduleName, boolean enabled) {
|
||||
this(bounds, moduleName);
|
||||
this.enabled=enabled;
|
||||
}
|
||||
|
||||
protected void mouseModuleMousePress(MouseEvent ev) {
|
||||
int mouseX = ev.getX();
|
||||
int mouseY = ev.getY();
|
||||
//System.out.println(mouseX + "," + mouseY);
|
||||
enableWindowDrag(mouseX,mouseY);
|
||||
mousePressed(ev);
|
||||
|
||||
|
||||
public void updateFPSCounter() {
|
||||
float val = 1000f/(System.currentTimeMillis()-lasttime);
|
||||
sum[counter++ % sum.length] = (int)val;
|
||||
avgfps = (float)sum(sum)/sum.length;
|
||||
this.setTitle(name+" - "+(int)Math.round(avgfps)+" FPS");
|
||||
lasttime=System.currentTimeMillis();
|
||||
}
|
||||
|
||||
private void enableWindowDrag(int mouseX, int mouseY) {
|
||||
if (!sigIRC.overlayMode && !dragging && inDragBounds(mouseX,mouseY) && !DRAGGING) {
|
||||
//Enable dragging.
|
||||
dragOffset = new Point((int)position.getX() - mouseX,(int)position.getY()-mouseY);
|
||||
dragging=DRAGGING=true;
|
||||
private int sum(int[] array) {
|
||||
int val = 0;
|
||||
for (int i=0;i<array.length;i++) {
|
||||
val+=array[i];
|
||||
}
|
||||
}
|
||||
|
||||
public boolean inDragBounds(int x, int y) {
|
||||
return x>=position.getX() && x<=position.getX()+position.getWidth() &&
|
||||
y>=(int)position.getY()-Module.IMG_DRAGBAR.getHeight() &&
|
||||
y<=(int)position.getY();
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent ev) {
|
||||
return val;
|
||||
}
|
||||
|
||||
public void ApplyConfigWindowProperties() {
|
||||
@ -76,54 +128,10 @@ public class Module {
|
||||
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent ev) {
|
||||
if (dragging) {
|
||||
dragging=DRAGGING=false;
|
||||
ApplyConfigWindowProperties();
|
||||
sigIRC.config.saveProperties();
|
||||
}
|
||||
}
|
||||
|
||||
protected void moduleRun() {
|
||||
dragWindow();
|
||||
modifyCursor();
|
||||
run();
|
||||
}
|
||||
|
||||
private void modifyCursor() {
|
||||
if (!sigIRC.overlayMode) {
|
||||
int cursortype = sigIRC.panel.getCursor().getType();
|
||||
if (inDragZone &&
|
||||
cursortype!=Cursor.MOVE_CURSOR) {
|
||||
sigIRC.panel.setCursor(new Cursor(Cursor.MOVE_CURSOR));
|
||||
} else
|
||||
if (!inDragZone && cursortype!=Cursor.DEFAULT_CURSOR) {
|
||||
sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dragWindow() {
|
||||
if (dragging) {
|
||||
//sigIRC.panel.repaint(getDrawBounds().getBounds());
|
||||
int mouseX = sigIRC.panel.lastMouseX+(int)dragOffset.getX();
|
||||
int mouseY = sigIRC.panel.lastMouseY+(int)dragOffset.getY();
|
||||
int oldX = (int)position.getX();
|
||||
int oldY = (int)position.getY();
|
||||
position = new Rectangle((int)Math.min(Math.max(0,mouseX),sigIRC.window.getWidth()-position.getWidth()), (int)Math.min(Math.max(titleHeight,mouseY),sigIRC.window.getHeight()-position.getHeight()-titleHeight*2),(int)position.getWidth(),(int)position.getHeight());
|
||||
//System.out.println(sigIRC.panel.lastMouseX+","+sigIRC.panel.lastMouseY);
|
||||
ModuleDragEvent(oldX,oldY,mouseX,mouseY);
|
||||
}
|
||||
if (inDragBounds(sigIRC.panel.lastMouseX,sigIRC.panel.lastMouseY)) {
|
||||
inDragZone=true;
|
||||
//System.out.println("In Drag Zone for Module "+name);
|
||||
//sigIRC.panel.setCursor(new Cursor(Cursor.MOVE_CURSOR));
|
||||
} /*else
|
||||
if (sigIRC.panel.getCursor().getType()==Cursor.MOVE_CURSOR) {
|
||||
sigIRC.panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
}*/
|
||||
}
|
||||
|
||||
public Rectangle2D getPosition() {
|
||||
return position;
|
||||
}
|
||||
@ -132,47 +140,124 @@ public class Module {
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
drawModuleHeader(g);
|
||||
/*SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
sigIRC.panel.repaint(getDrawBounds().getBounds());
|
||||
}
|
||||
});*/
|
||||
}
|
||||
|
||||
private void drawModuleHeader(Graphics g) {
|
||||
if (!sigIRC.overlayMode) {
|
||||
g.drawImage(Module.IMG_DRAGBAR,
|
||||
(int)position.getX()+2,
|
||||
(int)position.getY()-Module.IMG_DRAGBAR.getHeight(),
|
||||
(int)position.getWidth()-4,
|
||||
Module.IMG_DRAGBAR.getHeight(),
|
||||
sigIRC.panel);
|
||||
DrawUtils.drawTextFont(g, sigIRC.panel.smallFont, (int)position.getX(), (int)position.getY()-titleHeight/2+4, Color.BLACK, this.name);
|
||||
//g.fillRect((int)position.getX(), (int)position.getY(), (int)position.getWidth(), (int)position.getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
private Rectangle2D getDrawBounds() {
|
||||
Rectangle2D drawBounds = new Rectangle((int)position.getX()-2,(int)position.getY()-titleHeight+3-1,(int)position.getWidth()+2,(int)position.getHeight()+titleHeight+1);
|
||||
return drawBounds;
|
||||
}
|
||||
|
||||
public void ModuleDragEvent(int oldX, int oldY, int newX, int newY) {
|
||||
|
||||
}
|
||||
|
||||
public void mouseWheel(MouseWheelEvent ev) {
|
||||
}
|
||||
|
||||
public void keypressed(KeyEvent ev) {
|
||||
|
||||
}
|
||||
|
||||
public void keyreleased(KeyEvent ev) {
|
||||
//g.fillRect(0, 0, (int)position.getWidth(), (int)position.getHeight());
|
||||
//DrawUtils.drawText(g, 0, 16, Color.WHITE, "Test");
|
||||
updateFPSCounter();
|
||||
}
|
||||
|
||||
public void windowClosed(WindowEvent ev) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowActivated(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowDeactivated(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowDeiconified(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowIconified(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowOpened(WindowEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentHidden(ComponentEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentMoved(ComponentEvent e) {
|
||||
if (this.isVisible()) {
|
||||
UpdatePosition(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdatePosition(ComponentEvent e) {
|
||||
position = new Rectangle((int)e.getComponent().getLocationOnScreen().getX(),(int)e.getComponent().getLocationOnScreen().getY(),e.getComponent().getWidth(),e.getComponent().getHeight());
|
||||
//System.out.println(position);
|
||||
ApplyConfigWindowProperties();
|
||||
sigIRC.configNeedsUpdating = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
if (this.isVisible()) {
|
||||
UpdatePosition(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentShown(ComponentEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void keyPressed(KeyEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void keyReleased(KeyEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void keyTyped(KeyEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void mouseWheelMoved(MouseWheelEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
}
|
||||
}
|
@ -3,7 +3,6 @@ package sig;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.MouseInfo;
|
||||
@ -31,41 +30,24 @@ import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
|
||||
import sig.modules.ChatLogModule;
|
||||
import sig.modules.ScrollingChatModule;
|
||||
import sig.modules.ChatLog.ChatLogMessage;
|
||||
import sig.utils.FileUtils;
|
||||
|
||||
public class MyPanel extends JPanel implements MouseListener, ActionListener, MouseWheelListener, KeyListener, ComponentListener, WindowListener{
|
||||
//List<String> messages = new ArrayList<String>();
|
||||
final public static Font programFont = new Font(sigIRC.messageFont,0,24);
|
||||
final public static Font userFont = new Font(sigIRC.usernameFont,0,16);
|
||||
final public static Font smallFont = new Font(sigIRC.touhoumotherConsoleFont,0,12);
|
||||
final public static Font rabiRibiMoneyDisplayFont = new Font("CP Font",0,16);
|
||||
final public static Font rabiRibiTinyDisplayFont = new Font("CP Font",0,12);
|
||||
public int lastMouseX = 0;
|
||||
public int lastMouseY = 0;
|
||||
|
||||
public MyPanel() {
|
||||
public class MyPanel extends JPanel{
|
||||
public MyPanel() {
|
||||
//setBorder(BorderFactory.createLineBorder(Color.black));
|
||||
addMouseListener(this);
|
||||
addMouseWheelListener(this);
|
||||
addComponentListener(this);
|
||||
addKeyListener(this);
|
||||
setFocusable(true);
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
/*public Dimension getPreferredSize() {
|
||||
return new Dimension(1280,480);
|
||||
}
|
||||
}*/
|
||||
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
// Draw Text
|
||||
//int counter=18;
|
||||
if (sigIRC.panel!=null) {
|
||||
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX()-sigIRC.panel.getLocationOnScreen().getX());
|
||||
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY()-sigIRC.panel.getLocationOnScreen().getY());
|
||||
//System.out.println("("+lastMouseX+","+lastMouseY+")");
|
||||
}
|
||||
/*if (sigIRC.window!=null && sigIRC.window.getMousePosition(true)!=null && sigIRC.overlayMode) {
|
||||
lastMouseX = (int)sigIRC.window.getMousePosition(true).getX();
|
||||
lastMouseY = (int)sigIRC.window.getMousePosition(true).getY();
|
||||
@ -75,6 +57,7 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
|
||||
lastMouseY = -1;
|
||||
}*/
|
||||
//
|
||||
/*
|
||||
for (Module m : sigIRC.modules) {
|
||||
m.draw(g);
|
||||
}
|
||||
@ -105,10 +88,7 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!sigIRC.overlayMode) {
|
||||
sigIRC.button.draw(g);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public void addMessage(String message) {
|
||||
@ -116,139 +96,26 @@ public class MyPanel extends JPanel implements MouseListener, ActionListener, Mo
|
||||
}
|
||||
|
||||
public void addMessage(String message, boolean playSound) {
|
||||
ScrollingText text = new ScrollingText(message,this.getWidth(),(int)(Math.random()*128),playSound);
|
||||
ScrollingText text = new ScrollingText(message,ScrollingChatModule.module.getWidth(),(int)(Math.random()*128),playSound);
|
||||
TextRow row = TextRow.PickRandomTextRow(text.getUsername());
|
||||
sigIRC.textobj.add(text);
|
||||
row.updateRow(text);
|
||||
//ChatLogMessage.importMessages(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent ev) {
|
||||
for (Module m : sigIRC.modules) {
|
||||
m.mouseModuleMousePress(ev);
|
||||
}
|
||||
sigIRC.button.onClickEvent(ev);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent ev) {
|
||||
for (Module m : sigIRC.modules) {
|
||||
m.mouseReleased(ev);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseWheelMoved(MouseWheelEvent ev) {
|
||||
for (Module m : sigIRC.modules) {
|
||||
m.mouseWheel(ev);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyTyped(KeyEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent ev) {
|
||||
for (Module m : sigIRC.modules) {
|
||||
m.keypressed(ev);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent ev) {
|
||||
for (Module m : sigIRC.modules) {
|
||||
m.keyreleased(ev);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentResized(ComponentEvent ev) {
|
||||
UpdateComponent(ev.getComponent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentMoved(ComponentEvent ev) {
|
||||
UpdateComponent(ev.getComponent());
|
||||
}
|
||||
|
||||
public static void UpdateComponent(Component com) {
|
||||
sigIRC.windowX = (int)sigIRC.window.getLocationOnScreen().getX();
|
||||
sigIRC.windowY = (int)sigIRC.window.getLocationOnScreen().getY();
|
||||
sigIRC.windowWidth = sigIRC.window.getWidth();
|
||||
sigIRC.windowHeight = sigIRC.window.getHeight();
|
||||
sigIRC.config.setInteger("windowX", sigIRC.windowX);
|
||||
sigIRC.config.setInteger("windowY", sigIRC.windowY);
|
||||
sigIRC.config.setInteger("windowWidth", sigIRC.windowWidth);
|
||||
sigIRC.config.setInteger("windowHeight", sigIRC.windowHeight);
|
||||
sigIRC.button.x = sigIRC.panel.getX()+sigIRC.panel.getWidth()-96;
|
||||
sigIRC.button.y = 64+sigIRC.rowobj.size()*sigIRC.rowSpacing;
|
||||
//com.repaint();
|
||||
//sigIRC.panel.repaint();
|
||||
sigIRC.config.saveProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentShown(ComponentEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentHidden(ComponentEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowActivated(WindowEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowClosed(WindowEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent ev) {
|
||||
for (Module m : sigIRC.modules) {
|
||||
m.windowClosed(ev);
|
||||
if (sigIRC.window!=null && sigIRC.window.getLocationOnScreen()!=null) {
|
||||
sigIRC.windowX = (int)sigIRC.window.getLocationOnScreen().getX();
|
||||
sigIRC.windowY = (int)sigIRC.window.getLocationOnScreen().getY();
|
||||
sigIRC.windowWidth = sigIRC.window.getWidth();
|
||||
sigIRC.windowHeight = sigIRC.window.getHeight();
|
||||
sigIRC.config.setInteger("windowX", sigIRC.windowX);
|
||||
sigIRC.config.setInteger("windowY", sigIRC.windowY);
|
||||
sigIRC.config.setInteger("windowWidth", sigIRC.windowWidth);
|
||||
sigIRC.config.setInteger("windowHeight", sigIRC.windowHeight);
|
||||
//com.repaint();
|
||||
//sigIRC.panel.repaint();
|
||||
sigIRC.config.saveProperties();
|
||||
}
|
||||
sigIRC.config.saveProperties();
|
||||
if (sigIRC.autoUpdateProgram) {
|
||||
try {
|
||||
FileUtils.copyFile(new File(sigIRC.PROGRAM_UPDATE_FILE), new File(sigIRC.BASEDIR+"sigIRCv2.jar"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowDeactivated(WindowEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowDeiconified(WindowEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowIconified(WindowEvent ev) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowOpened(WindowEvent ev) {
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import javax.sound.sampled.LineUnavailableException;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import sig.modules.ScrollingChatModule;
|
||||
import sig.utils.DrawUtils;
|
||||
import sig.utils.FileUtils;
|
||||
import sig.utils.SoundUtils;
|
||||
@ -88,9 +89,9 @@ public class ScrollingText {
|
||||
|
||||
this.shadowSize=2;
|
||||
|
||||
this.stringWidth = (int)TextUtils.calculateStringBoundsFont(this.message,MyPanel.programFont).getWidth();
|
||||
this.stringHeight = (int)TextUtils.calculateStringBoundsFont(this.message,MyPanel.programFont).getHeight();
|
||||
this.userstringWidth = (int)TextUtils.calculateStringBoundsFont(this.username,MyPanel.userFont).getWidth();
|
||||
this.stringWidth = (int)TextUtils.calculateStringBoundsFont(this.message,sigIRC.programFont).getWidth();
|
||||
this.stringHeight = (int)TextUtils.calculateStringBoundsFont(this.message,sigIRC.programFont).getHeight();
|
||||
this.userstringWidth = (int)TextUtils.calculateStringBoundsFont(this.username,sigIRC.userFont).getWidth();
|
||||
}
|
||||
|
||||
public ScrollingText(String msg, double x, double y, boolean playSound) {
|
||||
@ -172,15 +173,15 @@ public class ScrollingText {
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
if (isAlive && WithinBounds(x,y,Math.max(TextUtils.calculateStringBoundsFont(username, MyPanel.userFont).getWidth(), TextUtils.calculateStringBoundsFont(message, MyPanel.programFont).getWidth()),Math.max(TextUtils.calculateStringBoundsFont(username, MyPanel.userFont).getHeight(), TextUtils.calculateStringBoundsFont(message, MyPanel.programFont).getHeight()))) {
|
||||
if (isAlive && WithinBounds(x,y,Math.max(TextUtils.calculateStringBoundsFont(username, sigIRC.userFont).getWidth(), TextUtils.calculateStringBoundsFont(message, sigIRC.programFont).getWidth()),Math.max(TextUtils.calculateStringBoundsFont(username, sigIRC.userFont).getHeight(), TextUtils.calculateStringBoundsFont(message, sigIRC.programFont).getHeight()))) {
|
||||
//DrawUtils.drawTextFont(g, MyPanel.userFont, x+8, y+stringHeight-20, Color.GREEN, username);
|
||||
DrawUtils.drawOutlineText(g, MyPanel.userFont, x+8, y+stringHeight-20, 2, userColor, Color.BLACK, username);
|
||||
DrawUtils.drawOutlineText(g, MyPanel.programFont, x, y+stringHeight, 2, Color.WHITE, Color.BLACK, message);
|
||||
DrawUtils.drawOutlineText(g, sigIRC.userFont, x+8, y+stringHeight-20, 2, userColor, Color.BLACK, username);
|
||||
DrawUtils.drawOutlineText(g, sigIRC.programFont, x, y+stringHeight, 2, Color.WHITE, Color.BLACK, message);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean WithinBounds(double x, double y, double w, double h) {
|
||||
if (x<sigIRC.panel.getWidth() && x+w>0 && y<sigIRC.panel.getHeight() && y+h>0) {
|
||||
if (x<ScrollingChatModule.module.getWidth() && x+w>0 && y<ScrollingChatModule.module.getHeight() && y+h>0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -188,28 +189,28 @@ public class ScrollingText {
|
||||
|
||||
public int FindLeftMostCornerInDisplay() {
|
||||
if (x-shadowSize>0) {
|
||||
return Math.min((int)x-shadowSize, sigIRC.panel.getWidth());
|
||||
return Math.min((int)x-shadowSize, ScrollingChatModule.module.getWidth());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public int FindTopMostCornerInDisplay() {
|
||||
if (y-shadowSize>0) {
|
||||
return Math.min((int)y-shadowSize, sigIRC.panel.getHeight());
|
||||
return Math.min((int)y-shadowSize, ScrollingChatModule.module.getHeight());
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public int FindRightMostCornerInDisplay() {
|
||||
if (x+stringWidth+(int)sigIRC.BASESCROLLSPD+1+shadowSize+1>0) {
|
||||
return Math.min(Math.max(stringWidth,userstringWidth+8)+(int)sigIRC.BASESCROLLSPD+1+shadowSize+1, sigIRC.panel.getWidth()-(int)x);
|
||||
return Math.min(Math.max(stringWidth,userstringWidth+8)+(int)sigIRC.BASESCROLLSPD+1+shadowSize+1, ScrollingChatModule.module.getWidth()-(int)x);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public int FindBottomMostCornerInDisplay() {
|
||||
if (y+stringHeight+shadowSize>0) {
|
||||
return Math.min(stringHeight+shadowSize+4, sigIRC.panel.getHeight()-(int)y);
|
||||
return Math.min(stringHeight+shadowSize+4, ScrollingChatModule.module.getHeight()-(int)y);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@ -267,8 +268,8 @@ public class ScrollingText {
|
||||
break;
|
||||
}
|
||||
}
|
||||
textMaxWidth = (int)TextUtils.calculateStringBoundsFont(basemsg, sigIRC.panel.programFont).getWidth();
|
||||
textMaxHeight = Math.max(textMaxHeight,(int)TextUtils.calculateStringBoundsFont(basemsg, sigIRC.panel.programFont).getHeight());
|
||||
textMaxWidth = (int)TextUtils.calculateStringBoundsFont(basemsg, sigIRC.programFont).getWidth();
|
||||
textMaxHeight = Math.max(textMaxHeight,(int)TextUtils.calculateStringBoundsFont(basemsg, sigIRC.programFont).getHeight());
|
||||
return basemsg;
|
||||
}
|
||||
|
||||
@ -282,7 +283,7 @@ public class ScrollingText {
|
||||
|
||||
private void GenerateEmoticon(int pos, String basemsg, Emoticon e) {
|
||||
String cutstring = basemsg.substring(0, pos);
|
||||
double width = TextUtils.calculateStringBoundsFont(cutstring, sigIRC.panel.programFont).getWidth();
|
||||
double width = TextUtils.calculateStringBoundsFont(cutstring, sigIRC.programFont).getWidth();
|
||||
//System.out.println("Width of '"+cutstring+"' is "+width);
|
||||
sigIRC.createEmoticon(e, this, (int)(width), 0);
|
||||
textMaxHeight = Math.max(textMaxHeight, e.getImage().getHeight());
|
||||
|
@ -42,7 +42,7 @@ public class TextRow {
|
||||
}
|
||||
|
||||
private int DetermineScrollSpd() {
|
||||
return maxX/Math.max(600,sigIRC.windowWidth)+(sigIRC.chatScrollSpd*2);
|
||||
return maxX/Math.max(600,sigIRC.windowWidth)+(sigIRC.chatScrollSpd);
|
||||
}
|
||||
|
||||
public static TextRow PickRandomTextRow(String username) {
|
||||
|
@ -3,6 +3,8 @@ import java.awt.Graphics;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import sig.modules.ScrollingChatModule;
|
||||
|
||||
public class TwitchEmote {
|
||||
Emoticon emote;
|
||||
int x=0; //X Offset
|
||||
@ -38,7 +40,7 @@ public class TwitchEmote {
|
||||
|
||||
public void draw(Graphics g) {
|
||||
if (WithinBounds((int)(text.getX()+x), (int)(text.getY()+y), emote.getImage().getWidth(), emote.getImage().getHeight())) {
|
||||
g.drawImage(emote.getImage(), (int)(text.getX()+x), (int)(text.getY()+y), sigIRC.panel);
|
||||
g.drawImage(emote.getImage(), (int)(text.getX()+x), (int)(text.getY()+y), null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +49,7 @@ public class TwitchEmote {
|
||||
}
|
||||
|
||||
private boolean WithinBounds(double x, double y, double w, double h) {
|
||||
if (x<sigIRC.panel.getWidth() && x+w>0 && y<sigIRC.panel.getHeight() && y+h>0) {
|
||||
if (x<ScrollingChatModule.module.getWidth() && x+w>0 && y<ScrollingChatModule.module.getHeight() && y+h>0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -4,6 +4,7 @@ import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@ -25,7 +26,7 @@ public class ChatLogMessage {
|
||||
String username;
|
||||
List<String> displayMessage = new ArrayList<String>();
|
||||
final static public int MESSAGE_SPACING = 24;
|
||||
final static public int BORDER_SPACING = 8;
|
||||
final static public int BORDER_SPACING = 16;
|
||||
final static public Color SHADOW_COL = new Color(35,35,35,255);
|
||||
int usernameWidth = 0;
|
||||
boolean active=true;
|
||||
@ -34,25 +35,32 @@ public class ChatLogMessage {
|
||||
this.refModule = ChatLogModule.chatlogmodule;
|
||||
this.rawMessage = rawMessage;
|
||||
this.position = new Point(0,(int)refModule.getPosition().getHeight()-MESSAGE_SPACING);
|
||||
//System.out.println("1");
|
||||
WrapText();
|
||||
//System.out.println("2");
|
||||
for (ChatLogMessage clm : this.refModule.messageHistory) {
|
||||
clm.position.setLocation(
|
||||
clm.position.getX(),
|
||||
clm.position.getY()-messageDisplaySize.getY());
|
||||
//System.out.println(clm.rawMessage+": "+clm.position);
|
||||
}
|
||||
//System.out.println("3");
|
||||
this.position.setLocation(this.position.getX(), this.position.getY()-messageDisplaySize.getY()+ChatLogModule.chatlogmodule.scrolllog_yoffset);
|
||||
//System.out.println(displayMessage);
|
||||
this.username = DetectUsername(displayMessage);
|
||||
//System.out.println("4");
|
||||
if (this.username!=null) {
|
||||
displayMessage.set(0,GetMessage(displayMessage.get(0)+" "));
|
||||
usernameWidth = (int)TextUtils.calculateStringBoundsFont(this.username, sigIRC.panel.userFont).getWidth();
|
||||
usernameWidth = (int)TextUtils.calculateStringBoundsFont(this.username, sigIRC.userFont).getWidth();
|
||||
}
|
||||
for (int i=0;i<displayMessage.size();i++) {
|
||||
//System.out.println("displayMessage["+i+"] before: "+displayMessage.get(i));
|
||||
displayMessage.set(i, ReplaceMessageWithEmoticons(" "+displayMessage.get(i)+" ",(i==0)?usernameWidth:0,i*MESSAGE_SPACING));
|
||||
String msg = ReplaceMessageWithEmoticons(" "+displayMessage.get(i)+" ",(i==0)?usernameWidth:0,i*MESSAGE_SPACING);
|
||||
displayMessage.set(i, msg);
|
||||
//System.out.println("displayMessage["+i+"] after: "+displayMessage.get(i));
|
||||
}
|
||||
//System.out.println("5 "+displayMessage.size());
|
||||
//System.out.println("6");
|
||||
}
|
||||
|
||||
private String ReplaceMessageWithEmoticons(String basemsg, int xpos, int ypos) {
|
||||
@ -99,7 +107,7 @@ public class ChatLogMessage {
|
||||
|
||||
private void GenerateEmoticon(int textpos, int xpos, int ypos, String basemsg, Emoticon e) {
|
||||
String cutstring = basemsg.substring(0, textpos);
|
||||
double width = TextUtils.calculateStringBoundsFont(cutstring, sigIRC.panel.userFont).getWidth();
|
||||
double width = TextUtils.calculateStringBoundsFont(cutstring, sigIRC.userFont).getWidth();
|
||||
//System.out.println("Width of '"+cutstring+"' is "+width);
|
||||
//System.out.println("Offsetting emote by "+xpos+"+"+width);
|
||||
sigIRC.createEmoticon(e, this, (int)(xpos+width), ypos+16);
|
||||
@ -156,11 +164,11 @@ public class ChatLogMessage {
|
||||
|
||||
private void WrapText() {
|
||||
String rawmessage = rawMessage;
|
||||
int textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, sigIRC.panel.userFont).getWidth();
|
||||
int textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, sigIRC.userFont).getWidth();
|
||||
int maxWidth = (int)refModule.getPosition().getWidth()-BORDER_SPACING;
|
||||
do {
|
||||
rawmessage = BreakTextAtNextSection(rawmessage+" ",maxWidth);
|
||||
textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, sigIRC.panel.userFont).getWidth();
|
||||
textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, sigIRC.userFont).getWidth();
|
||||
} while (textWidth>maxWidth);
|
||||
if (rawmessage.length()>0) {
|
||||
displayMessage.add(rawmessage);
|
||||
@ -170,13 +178,13 @@ public class ChatLogMessage {
|
||||
}
|
||||
|
||||
private String BreakTextAtNextSection(String msg, int maxWidth) {
|
||||
int marker = 1;
|
||||
int textWidth = (int)TextUtils.calculateStringBoundsFont(msg.substring(0, marker), sigIRC.panel.userFont).getWidth();
|
||||
int marker = msg.indexOf(' ');
|
||||
int textWidth = (int)TextUtils.calculateStringBoundsFont(msg.substring(0, marker), sigIRC.userFont).getWidth();
|
||||
while (textWidth<maxWidth) {
|
||||
if (marker<msg.length()) {
|
||||
int tempmarker = msg.indexOf(' ', marker);
|
||||
if (tempmarker!=-1) {
|
||||
textWidth = (int)TextUtils.calculateStringBoundsFont(msg.substring(0, tempmarker), sigIRC.panel.userFont).getWidth();
|
||||
textWidth = (int)TextUtils.calculateStringBoundsFont(msg.substring(0, tempmarker), sigIRC.userFont).getWidth();
|
||||
if (textWidth<maxWidth) {
|
||||
marker = tempmarker+1;
|
||||
}
|
||||
@ -198,10 +206,10 @@ public class ChatLogMessage {
|
||||
/*SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
sigIRC.panel.repaint(
|
||||
(int)Math.max(refModule.getPosition().getX()+position.getX(),0),
|
||||
(int)Math.max(refModule.getPosition().getY()+position.getY(),0),
|
||||
(int)Math.min(sigIRC.panel.getWidth()-(refModule.getPosition().getX()+position.getX()+messageDisplaySize.getX()),messageDisplaySize.getX()),
|
||||
(int)Math.min(sigIRC.panel.getHeight()-(refModule.getPosition().getY()+position.getY()+messageDisplaySize.getY()),messageDisplaySize.getY()));
|
||||
(int)Math.max(position.getX(),0),
|
||||
(int)Math.max(position.getY(),0),
|
||||
(int)Math.min(sigIRC.panel.getWidth()-(position.getX()+messageDisplaySize.getX()),messageDisplaySize.getX()),
|
||||
(int)Math.min(sigIRC.panel.getHeight()-(position.getY()+messageDisplaySize.getY()),messageDisplaySize.getY()));
|
||||
}
|
||||
});*/
|
||||
//System.out.println(refModule.getPosition()+","+position);
|
||||
@ -213,25 +221,36 @@ public class ChatLogMessage {
|
||||
for (int i=0;i<displayMessage.size();i++) {
|
||||
//System.out.println(displayMessage.get(i));
|
||||
if (username!=null && i==0) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, refModule.getPosition().getX()+position.getX(), refModule.getPosition().getY()+position.getY()+(i*MESSAGE_SPACING)+32, 2, GetUserNameColor(this.username), SHADOW_COL, this.username);
|
||||
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, refModule.getPosition().getX()+position.getX()+usernameWidth+2, refModule.getPosition().getY()+position.getY()+(i*MESSAGE_SPACING)+32, Color.BLACK, displayMessage.get(i));
|
||||
DrawUtils.drawOutlineText(g, sigIRC.userFont, position.getX(), position.getY()+(i*MESSAGE_SPACING)+32-Module.WINDOW_EXTRA_BORDER, 2, GetUserNameColor(this.username), SHADOW_COL, this.username);
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, position.getX()+usernameWidth+2, position.getY()+(i*MESSAGE_SPACING)+32-Module.WINDOW_EXTRA_BORDER, Color.BLACK, displayMessage.get(i));
|
||||
} else {
|
||||
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, refModule.getPosition().getX()+position.getX(), refModule.getPosition().getY()+position.getY()+(i*MESSAGE_SPACING)+32, Color.BLACK, displayMessage.get(i));
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, position.getX(), position.getY()+(i*MESSAGE_SPACING)+32-Module.WINDOW_EXTRA_BORDER, Color.BLACK, displayMessage.get(i));
|
||||
}
|
||||
}
|
||||
g.drawImage(Module.MSG_SEPARATOR, (int)(refModule.getPosition().getX()+position.getX()+8), (int)(refModule.getPosition().getY()+position.getY()+messageDisplaySize.getY()+12), (int)(messageDisplaySize.getX()-8), 1, sigIRC.panel);
|
||||
//g.drawLine((int)(refModule.getPosition().getX()+position.getX()+8), (int)(refModule.getPosition().getY()+position.getY()+messageDisplaySize.getY()+32), (int)(refModule.getPosition().getX()+position.getX()+messageDisplaySize.getX()-8), (int)(refModule.getPosition().getY()+position.getY()+messageDisplaySize.getY()+32));
|
||||
g.drawImage(Module.MSG_SEPARATOR, (int)(position.getX()+8), (int)(position.getY()+messageDisplaySize.getY()+8-Module.WINDOW_EXTRA_BORDER), (int)(messageDisplaySize.getX()-8), 1, null);
|
||||
//g.drawLine((int)(position.getX()+8), (int)(position.getY()+messageDisplaySize.getY()+32), (int)(position.getX()+messageDisplaySize.getX()-8), (int)(position.getY()+messageDisplaySize.getY()+32));
|
||||
}
|
||||
for (int i=0;i<sigIRC.chatlogtwitchemoticons.size();i++) {
|
||||
if (sigIRC.chatlogtwitchemoticons.get(i).textRefIsVisible()) {
|
||||
ChatLogTwitchEmote emote = sigIRC.chatlogtwitchemoticons.get(i);
|
||||
//System.out.println("Twitch emote is "+emote.emote.getEmoteName()+" "+emote.x+","+emote.y);
|
||||
sigIRC.chatlogtwitchemoticons.get(i).draw(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void importMessages(String...logContents) {
|
||||
if (sigIRC.chatlogmodule_enabled) {
|
||||
//System.out.println("Adding chat message "+Arrays.toString(logContents));
|
||||
for (String s : logContents) {
|
||||
//System.out.println(" For "+s+":");
|
||||
if (s!=null) {
|
||||
if (ChatLogModule.chatlogmodule.messageHistory.size()>=ChatLogModule.messageHistoryCount) {
|
||||
//System.out.println(" Removed.");
|
||||
ChatLogModule.chatlogmodule.messageHistory.remove(0).cleanup();
|
||||
}
|
||||
ChatLogModule.chatlogmodule.messageHistory.add(new ChatLogMessage(s));
|
||||
//System.out.println(" Adding "+s+".");
|
||||
ChatLogModule.chatlogmodule.messageQueue.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -242,8 +261,8 @@ public class ChatLogMessage {
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return (refModule.getPosition().getY()+position.getY()+MESSAGE_SPACING)>refModule.getPosition().getY() &&
|
||||
(refModule.getPosition().getY()+position.getY()+messageDisplaySize.getY())<refModule.getPosition().getY()+refModule.getPosition().getHeight()-16;
|
||||
return (position.getY()+MESSAGE_SPACING-Module.WINDOW_EXTRA_BORDER)>0 &&
|
||||
(position.getY()+messageDisplaySize.getY())<refModule.getPosition().getHeight()-16;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -5,6 +5,7 @@ import java.awt.Graphics;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import sig.Emoticon;
|
||||
import sig.Module;
|
||||
import sig.ScrollingText;
|
||||
import sig.sigIRC;
|
||||
|
||||
@ -42,13 +43,15 @@ public class ChatLogTwitchEmote {
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
if (WithinBounds((int)(text.position.getX()+x), (int)(text.position.getY()+y), emote.getImage().getWidth(), emote.getImage().getHeight())) {
|
||||
g.drawImage(emote.getImage(), (int)(text.refModule.getPosition().getX()+text.position.getX()+x), (int)(text.refModule.getPosition().getY()+text.position.getY()+y), sigIRC.panel);
|
||||
if (WithinBounds((int)(text.position.getX()+x), (int)(text.position.getY()+y-Module.WINDOW_EXTRA_BORDER), emote.getImage().getWidth(), emote.getImage().getHeight())) {
|
||||
//g.drawString("Emote", (int)(text.position.getX()+x), (int)(text.position.getY()+y));
|
||||
//System.out.println("Emote Pos: "+(int)(text.position.getX()+x)+","+(int)(text.position.getY()+y));
|
||||
g.drawImage(emote.getImage(), (int)(text.position.getX()+x), (int)(text.position.getY()+y-Module.WINDOW_EXTRA_BORDER), null);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean WithinBounds(double x, double y, double w, double h) {
|
||||
if (x<sigIRC.panel.getWidth() && x+w>0 && y<sigIRC.panel.getHeight() && y+h>0) {
|
||||
if (x<text.refModule.panel.getWidth() && x+w>0 && y<text.refModule.panel.getHeight() && y+h>0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -2,6 +2,8 @@ package sig.modules;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
@ -29,8 +31,13 @@ public class ChatLogModule extends Module{
|
||||
public static ChatLogModule chatlogmodule;
|
||||
public int scrolllog_yoffset = 0;
|
||||
public Color backgroundColor;
|
||||
long positionsNeedUpdating = 0; //Set it to System.currentTimeMillis() to request a configuration save.
|
||||
Rectangle prevpos = (Rectangle)position.clone();
|
||||
int justOpened=2;
|
||||
public List<String> messageQueue = new ArrayList<String>();
|
||||
|
||||
public ChatLogModule(Rectangle2D bounds, String moduleName) {
|
||||
|
||||
public ChatLogModule(Rectangle bounds, String moduleName) {
|
||||
super(bounds, moduleName);
|
||||
//Initialize();
|
||||
chatlogmodule = this;
|
||||
@ -47,19 +54,19 @@ public class ChatLogModule extends Module{
|
||||
if (logContents.length>messageHistoryCount) {
|
||||
logContents = Arrays.copyOfRange(logContents, logContents.length-messageHistoryCount-1, logContents.length);
|
||||
}
|
||||
messageHistory.clear();
|
||||
ChatLogMessage.importMessages(logContents);
|
||||
}
|
||||
}
|
||||
|
||||
public void run() {
|
||||
super.run();
|
||||
for (int i=0;i<messageQueue.size();i++) {
|
||||
messageHistory.add(new ChatLogMessage(messageQueue.remove(0)));
|
||||
i--;
|
||||
}
|
||||
if (delay>0 && sigIRC.subEmotesCompleted) {
|
||||
delay--;
|
||||
} else
|
||||
if (!initialized)
|
||||
{
|
||||
Initialize();
|
||||
initialized=true;
|
||||
}
|
||||
for (int i=0; i<messageHistory.size();i++) {
|
||||
ChatLogMessage clm = messageHistory.get(i);
|
||||
@ -71,20 +78,39 @@ public class ChatLogModule extends Module{
|
||||
}
|
||||
}
|
||||
}
|
||||
if (positionsNeedUpdating==0 && (prevpos.getWidth()!=position.getWidth() || prevpos.getHeight()!=position.getHeight())) {
|
||||
positionsNeedUpdating=System.currentTimeMillis();
|
||||
}
|
||||
if (positionsNeedUpdating!=0 && System.currentTimeMillis()-positionsNeedUpdating>1000) {
|
||||
positionsNeedUpdating=0;
|
||||
int diff = (int)(position.getHeight()-prevpos.getHeight());
|
||||
prevpos = (Rectangle)position.clone();
|
||||
/*for (ChatLogMessage clm : messageHistory) {
|
||||
clm.position.y+=diff;
|
||||
}*/
|
||||
messageHistory.clear();
|
||||
sigIRC.chatlogtwitchemoticons.clear();
|
||||
Initialize();
|
||||
moveAllMessages(-scrolllog_yoffset);
|
||||
scrolllog_yoffset=0;
|
||||
//repaint();
|
||||
}
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
super.draw(g);
|
||||
g.setColor(backgroundColor);
|
||||
g.fill3DRect((int)position.getX(), (int)position.getY(), (int)position.getWidth(), (int)position.getHeight(), true);
|
||||
g.fill3DRect(0, 0, (int)position.getWidth(), (int)position.getHeight(), true);
|
||||
g.setColor(Color.BLACK);
|
||||
for (int i=0; i<messageHistory.size();i++) {
|
||||
ChatLogMessage clm = messageHistory.get(i);
|
||||
if (clm!=null) {
|
||||
try {
|
||||
clm.draw(g);
|
||||
} catch (ConcurrentModificationException e) {
|
||||
e.printStackTrace();
|
||||
if (messageHistory!=null) {
|
||||
for (int i=0; i<messageHistory.size();i++) {
|
||||
ChatLogMessage clm = messageHistory.get(i);
|
||||
if (clm!=null) {
|
||||
try {
|
||||
clm.draw(g);
|
||||
} catch (ConcurrentModificationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -93,13 +119,18 @@ public class ChatLogModule extends Module{
|
||||
public void ApplyConfigWindowProperties() {
|
||||
sigIRC.chatlogmodule_X=(int)position.getX();
|
||||
sigIRC.chatlogmodule_Y=(int)position.getY();
|
||||
sigIRC.chatlogmodule_width=(int)position.getWidth();
|
||||
sigIRC.chatlogmodule_height=(int)position.getHeight();
|
||||
sigIRC.config.setInteger("CHATLOG_module_X", sigIRC.chatlogmodule_X);
|
||||
sigIRC.config.setInteger("CHATLOG_module_Y", sigIRC.chatlogmodule_Y);
|
||||
sigIRC.config.setInteger("CHATLOG_module_width", sigIRC.chatlogmodule_width);
|
||||
sigIRC.config.setInteger("CHATLOG_module_height", sigIRC.chatlogmodule_height);
|
||||
sigIRC.config.saveProperties();
|
||||
}
|
||||
|
||||
public void mouseWheel(MouseWheelEvent ev) {
|
||||
public void mouseWheelMoved(MouseWheelEvent ev) {
|
||||
if (mouseInBounds(ev.getX(),ev.getY())) {
|
||||
int scrollMult = 8;
|
||||
int scrollMult = 12;
|
||||
int scrollAmt = -ev.getWheelRotation()*scrollMult;
|
||||
if (scrollAmt>0) {
|
||||
if (HighestMessageIsVisible()) {
|
||||
@ -141,14 +172,14 @@ public class ChatLogModule extends Module{
|
||||
}
|
||||
|
||||
private boolean mouseInBounds(int mouseX, int mouseY) {
|
||||
return mouseX>=position.getX() &&
|
||||
mouseX<=position.getX()+position.getWidth() &&
|
||||
mouseY>=position.getX() &&
|
||||
mouseY<=position.getX()+position.getHeight();
|
||||
return mouseX>=0 &&
|
||||
mouseX<=0+position.getWidth() &&
|
||||
mouseY>=0 &&
|
||||
mouseY<=0+position.getHeight();
|
||||
}
|
||||
|
||||
|
||||
public void keypressed(KeyEvent ev) {
|
||||
public void keyPressed(KeyEvent ev) {
|
||||
int key = ev.getKeyCode();
|
||||
int scroll = 0;
|
||||
if (key==KeyEvent.VK_PAGE_UP) {
|
||||
@ -158,7 +189,7 @@ public class ChatLogModule extends Module{
|
||||
scroll=-8;
|
||||
}
|
||||
if (key==KeyEvent.VK_HOME) {
|
||||
scroll=Math.abs(GetHighestMessagePosition());
|
||||
scroll=Math.abs(GetHighestMessagePosition()-Module.WINDOW_EXTRA_BORDER);
|
||||
}
|
||||
if (key==KeyEvent.VK_END) {
|
||||
moveAllMessages(-scrolllog_yoffset);
|
||||
|
@ -52,7 +52,7 @@ public class ClickableButton {
|
||||
g.setColor(Color.BLACK);
|
||||
g.fillRect((int)module.getPosition().getX()+x+1,
|
||||
(int)module.getPosition().getY()+y+1, width-1, height-1);
|
||||
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, module.getPosition().getX()+x-TextUtils.calculateStringBoundsFont(label, sigIRC.panel.userFont).getWidth()/2+width/2, module.getPosition().getY()+y+height-1, Color.WHITE, label);
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, module.getPosition().getX()+x-TextUtils.calculateStringBoundsFont(label, sigIRC.userFont).getWidth()/2+width/2, module.getPosition().getY()+y+height-1, Color.WHITE, label);
|
||||
g.setColor(color_identity);
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ public class ControlConfigurationWindow extends JFrame implements WindowListener
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
try {
|
||||
g.drawImage(ImageIO.read(new File(ControllerModule.CONTROLLERPATH+"4-way_axis.png")), 0, 0, this);
|
||||
g.drawImage(ImageIO.read(new File(ControllerModule.CONTROLLERPATH+"4-way_axis.png")), 0, 0, null);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -279,7 +279,7 @@ public class ControlConfigurationWindow extends JFrame implements WindowListener
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
try {
|
||||
g.drawImage(ImageIO.read(new File(ControllerModule.CONTROLLERPATH+"2-way_axis.png")), 0, 0, this);
|
||||
g.drawImage(ImageIO.read(new File(ControllerModule.CONTROLLERPATH+"2-way_axis.png")), 0, 0, null);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ public class ControllerModule extends Module{
|
||||
}
|
||||
}*/
|
||||
}
|
||||
g.drawImage(controller_img, (int)(position.getX()), (int)(position.getY()), sigIRC.panel);
|
||||
g.drawImage(controller_img, (int)(position.getX()), (int)(position.getY()), null);
|
||||
for (ClickableButton cb : click_buttons) {
|
||||
cb.draw(g);
|
||||
}
|
||||
@ -653,7 +653,7 @@ public class ControllerModule extends Module{
|
||||
g.setColor(color_identity);
|
||||
}
|
||||
}
|
||||
g.drawImage(controller_overlay_img, (int)(position.getX()), (int)(position.getY()), sigIRC.panel);
|
||||
g.drawImage(controller_overlay_img, (int)(position.getX()), (int)(position.getY()), null);
|
||||
|
||||
for (Axis a : axes) {
|
||||
a.drawIndicator(g);
|
||||
|
@ -83,7 +83,7 @@ class ImagePanel extends JPanel implements MouseListener{
|
||||
g.setColor(new Color(0,0,64));
|
||||
g.fillRect(0, 0, 50, 50);
|
||||
}
|
||||
g.drawImage(img, 0, 0, this);
|
||||
g.drawImage(img, 0, 0, null);
|
||||
if (selected) {
|
||||
g.setColor(Color.YELLOW);
|
||||
for (int i=0;i<2;i++) {
|
||||
|
@ -13,7 +13,7 @@ import sig.utils.DrawUtils;
|
||||
import sig.utils.TextUtils;
|
||||
|
||||
public class ClickableButton {
|
||||
protected int x,y,width,height;
|
||||
public int x,y,width,height;
|
||||
protected String label;
|
||||
protected RabiRaceModule module;
|
||||
|
||||
@ -37,19 +37,19 @@ public class ClickableButton {
|
||||
}
|
||||
|
||||
public boolean mouseInsideBounds(MouseEvent ev) {
|
||||
return ev.getX()>=module.getPosition().getX()+x && ev.getX()<=module.getPosition().getX()+x+width &&
|
||||
ev.getY()>=module.getPosition().getY()+y && ev.getY()<=module.getPosition().getY()+y+height;
|
||||
return ev.getX()>=0+x && ev.getX()<=0+x+width &&
|
||||
ev.getY()>=0+y && ev.getY()<=0+y+height;
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
Color color_identity = g.getColor();
|
||||
g.setColor(Color.WHITE);
|
||||
g.drawRect((int)module.getPosition().getX()+x,
|
||||
(int)module.getPosition().getY()+y, width, height);
|
||||
g.drawRect((int)0+x,
|
||||
(int)0+y, width, height);
|
||||
g.setColor(Color.BLACK);
|
||||
g.fillRect((int)module.getPosition().getX()+x+1,
|
||||
(int)module.getPosition().getY()+y+1, width-1, height-1);
|
||||
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, module.getPosition().getX()+x-TextUtils.calculateStringBoundsFont(label, sigIRC.panel.userFont).getWidth()/2+width/2, module.getPosition().getY()+y+height-1, Color.WHITE, label);
|
||||
g.fillRect((int)0+x+1,
|
||||
(int)0+y+1, width-1, height-1);
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, 0+x-TextUtils.calculateStringBoundsFont(label, sigIRC.userFont).getWidth()/2+width/2, 0+y+height-1, Color.WHITE, label);
|
||||
g.setColor(color_identity);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,11 @@ public class JoinButton extends ClickableButton{
|
||||
try {
|
||||
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=leavesession&name="+RabiRaceModule.module.myProfile.username+"&session="+RabiRaceModule.mySession.id),file);
|
||||
RabiRaceModule.mySession=null;
|
||||
if (
|
||||
RabiRaceModule.module.myProfile!=null) {
|
||||
RabiRaceModule.module.myProfile.image_display_update_required = true;
|
||||
RabiRaceModule.module.myProfile.stat_update_required = true;
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
@ -42,6 +42,7 @@ public enum MemoryData {
|
||||
CHARGE_RING(MemoryOffset.CHARGE_RING,"Charge Ring","charge_ring.png",true),
|
||||
CARROT_SHOOTER(MemoryOffset.CARROT_SHOOTER,"Carrot Shooter","carrot_shooter.png",true),
|
||||
SUPER_CARROT(MemoryOffset.SUPER_CARROT,"Super Carrot","super_carrot.png",true),
|
||||
GOLD_CARROT(MemoryOffset.GOLD_CARROT,"Gold Carrot","gold_carrot.png",true),
|
||||
/*DLC_ITEM1(MemoryOffset.DLC_ITEM1,"","",true),
|
||||
DLC_ITEM2(MemoryOffset.DLC_ITEM2,"","",true),
|
||||
DLC_ITEM4(MemoryOffset.DLC_ITEM4,"","",true),*/
|
||||
|
@ -49,13 +49,16 @@ public class Profile {
|
||||
RabiRaceModule parent;
|
||||
public long lastWebUpdate = System.currentTimeMillis();
|
||||
DecimalFormat df = new DecimalFormat("0.0");
|
||||
Profile oldProfile;
|
||||
public Profile oldProfile;
|
||||
public boolean isArchive = false;
|
||||
final static Color TEAL = new Color(0,128,128);
|
||||
public Image statUpdateCacheImage;
|
||||
public Image imageDisplayUpdateImage;
|
||||
public boolean stat_update_required = true;
|
||||
public boolean image_display_update_required = true;
|
||||
public int avatarval = 0;
|
||||
public static Image rainbowEggImage;
|
||||
public static Image darkRainbowEggImage;
|
||||
|
||||
public Profile(RabiRaceModule module) {
|
||||
this(module,true);
|
||||
@ -83,35 +86,71 @@ public class Profile {
|
||||
oldProfile.key_items = (LinkedHashMap<MemoryData, Integer>)key_items.clone();
|
||||
oldProfile.badges = (LinkedHashMap<MemoryData, Integer>)badges.clone();
|
||||
oldProfile.playtime = playtime;
|
||||
oldProfile.difficulty = difficulty;
|
||||
oldProfile.loop = loop;
|
||||
oldProfile.itempct = itempct;
|
||||
oldProfile.mappct = mappct;
|
||||
}
|
||||
|
||||
public int compareAllChangedStatValues() {
|
||||
int count=0;
|
||||
if (oldProfile.playtime/60!=playtime/60 ||
|
||||
oldProfile.avatarval!=avatar.value ||
|
||||
oldProfile.isPaused!=isPaused ||
|
||||
oldProfile.difficulty!=difficulty ||
|
||||
oldProfile.loop!=loop ||
|
||||
oldProfile.itempct!=itempct ||
|
||||
oldProfile.mappct!=mappct) {
|
||||
//System.out.println("Something has changed.");
|
||||
count++;
|
||||
} else {
|
||||
/*System.out.println("All values are the same... "+oldProfile.playtime+","+playtime+"|"
|
||||
+oldProfile.avatarval+","+avatar.value+"|"+oldProfile.isPaused+","+isPaused+"|"
|
||||
+oldProfile.difficulty+","+difficulty+"|"+oldProfile.loop+","+loop+"|"
|
||||
+oldProfile.itempct+","+itempct+"|"+oldProfile.mappct+","+mappct+"|");*/
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public int compareAllChangedValues() {
|
||||
int count=0;
|
||||
if (oldProfile.healthUps!=healthUps) {
|
||||
count++;
|
||||
//System.out.println("Health ups changed. "+(healthUps-oldProfile.healthUps));
|
||||
}
|
||||
if (oldProfile.attackUps!=attackUps) {
|
||||
count++;
|
||||
//System.out.println("Attack ups changed. "+(attackUps-oldProfile.attackUps));
|
||||
}
|
||||
if (oldProfile.manaUps!=manaUps) {
|
||||
count++;
|
||||
//System.out.println("Mana ups changed. "+(manaUps-oldProfile.manaUps));
|
||||
}
|
||||
if (oldProfile.regenUps!=regenUps) {
|
||||
count++;
|
||||
//System.out.println("Regen ups changed. "+(regenUps-oldProfile.regenUps));
|
||||
}
|
||||
if (oldProfile.packUps!=packUps) {
|
||||
count++;
|
||||
//System.out.println("Pack ups changed. "+(packUps-oldProfile.packUps));
|
||||
}
|
||||
if (oldProfile.rainbowEggCount!=rainbowEggCount) {
|
||||
//System.out.println("Rainbow Egg Count changed. "+(rainbowEggCount-oldProfile.rainbowEggCount));
|
||||
count++;
|
||||
}
|
||||
for (MemoryData md : key_items.keySet()) {
|
||||
if ((!oldProfile.key_items.containsKey(md) &&
|
||||
key_items.containsKey(md)) || (
|
||||
key_items.containsKey(md)) || ((
|
||||
oldProfile.key_items.containsKey(md) &&
|
||||
key_items.containsKey(md)) &&
|
||||
oldProfile.key_items.get(md)!=key_items.get(md)
|
||||
oldProfile.key_items.get(md).compareTo(key_items.get(md))!=0)
|
||||
) {
|
||||
/*if (!oldProfile.key_items.containsKey(md) &&
|
||||
key_items.containsKey(md)) {
|
||||
System.out.println("Key item difference: "+(md));
|
||||
} else {
|
||||
System.out.println("Key item value difference: "+md+":"+(oldProfile.key_items.get(md)+"->"+key_items.get(md)));
|
||||
}*/
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -120,8 +159,14 @@ public class Profile {
|
||||
badges.containsKey(md)) || (
|
||||
oldProfile.badges.containsKey(md) &&
|
||||
badges.containsKey(md)) &&
|
||||
oldProfile.badges.get(md)!=badges.get(md)
|
||||
oldProfile.badges.get(md).compareTo(badges.get(md))!=0
|
||||
) {
|
||||
/*if (!oldProfile.badges.containsKey(md) &&
|
||||
badges.containsKey(md)) {
|
||||
System.out.println("Badge difference: "+(md));
|
||||
} else {
|
||||
System.out.println("Badge value difference: "+md+":"+(oldProfile.badges.get(md)+"->"+badges.get(md)));
|
||||
}*/
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -339,23 +384,28 @@ public class Profile {
|
||||
|
||||
g2.setColor(Color.BLACK);
|
||||
//g2.fillRect(1, 1, 32, 32);
|
||||
g2.drawImage(avatar.getAvatarImage(), 1, 1, sigIRC.panel);
|
||||
g2.drawImage(avatar.getAvatarImage(), 1, 1, null);
|
||||
g2.setColor(ScrollingText.GetUserNameColor(displayName));
|
||||
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, 54, 26, 1, g2.getColor(), Color.BLACK, displayName);
|
||||
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.2), 50, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName());
|
||||
DrawUtils.drawOutlineText(g2, sigIRC.rabiRibiMoneyDisplayFont, 54, 26, 1, g2.getColor(), Color.BLACK, displayName);
|
||||
DrawUtils.drawCenteredOutlineText(g2, sigIRC.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.2), 50, 1, GetDifficultyColor(), Color.BLACK, GetDifficultyName());
|
||||
String text = TextUtils.convertSecondsToTimeFormat(playtime/60);
|
||||
if (isPaused) {
|
||||
g2.setColor(new Color(128,96,0));
|
||||
} else {
|
||||
g2.setColor(Color.BLACK);
|
||||
}
|
||||
DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)(tmp.getWidth() - TextUtils.calculateStringBoundsFont(text, sigIRC.panel.rabiRibiMoneyDisplayFont).getWidth()) - 2, 16, 1, g2.getColor(), Color.GRAY, text);
|
||||
DrawUtils.drawOutlineText(g2, sigIRC.rabiRibiMoneyDisplayFont, (int)(tmp.getWidth() - TextUtils.calculateStringBoundsFont(text, sigIRC.rabiRibiMoneyDisplayFont).getWidth()) - 2, 16, 1, g2.getColor(), Color.GRAY, text);
|
||||
text = "Map "+df.format(mappct)+"% Item "+df.format(itempct)+"%";
|
||||
//DrawUtils.drawOutlineText(g2, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)(parent.position.getWidth() - TextUtils.calculateStringBoundsFont(text, sigIRC.panel.rabiRibiMoneyDisplayFont).getWidth()) - 2, 16, 1, g2.getColor(), Color.GRAY, text);
|
||||
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.6), 50, 2, Color.WHITE, Color.BLACK, text);
|
||||
DrawUtils.drawCenteredOutlineText(g2, sigIRC.rabiRibiTinyDisplayFont, (int)(tmp.getWidth()*0.6), 50, 2, Color.WHITE, Color.BLACK, text);
|
||||
|
||||
if (statUpdateCacheImage!=null) {
|
||||
statUpdateCacheImage.flush();
|
||||
}
|
||||
g2.dispose();
|
||||
statUpdateCacheImage = tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
|
||||
//stat_update_required = false;
|
||||
stat_update_required = false;
|
||||
System.out.println("Updated stat text for user "+username+".");
|
||||
}
|
||||
|
||||
return statUpdateCacheImage;
|
||||
@ -399,6 +449,110 @@ public class Profile {
|
||||
return diffstring;
|
||||
}
|
||||
|
||||
public Image getRainbowEggPanel(int w, Session session) {
|
||||
BufferedImage tmp = new BufferedImage(400,175,BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2 = tmp.createGraphics();
|
||||
if (Profile.darkRainbowEggImage==null) {
|
||||
Profile.darkRainbowEggImage = DrawUtils.getBlendedImage(g2, RabiRaceModule.image_map.get("easter_egg.png"), new Color(0,0,0,192), RabiRaceModule.window);
|
||||
Profile.rainbowEggImage = DrawUtils.getBlendedImage(g2, RabiRaceModule.image_map.get("easter_egg.png"), RabiRaceModule.rainbowcycler.getCycleColor(), RabiRaceModule.window);
|
||||
} else {
|
||||
Profile.rainbowEggImage.flush();
|
||||
Profile.rainbowEggImage = DrawUtils.getBlendedImage(g2, RabiRaceModule.image_map.get("easter_egg.png"), RabiRaceModule.rainbowcycler.getCycleColor(), RabiRaceModule.window);
|
||||
//System.out.println("Rainbow egg color is "+RabiRaceModule.rainbowcycler.getCycleColor());
|
||||
}
|
||||
//DrawUtils.drawTextFont(g, sigIRC.panel.userFont, parent.position.getX(), parent.position.getY()+26, Color.BLACK, "Values: "+readIntFromMemory(MemoryOffset.DLC_ITEM1)+","+readIntFromMemory(MemoryOffset.DLC_ITEM2)+","+readIntFromMemory(MemoryOffset.DLC_ITEM3)+","+readIntFromMemory(MemoryOffset.DLC_ITEM4));
|
||||
final int border=20;
|
||||
final int width=(int)(tmp.getWidth()-border*2);
|
||||
int spacing=width/5;
|
||||
int shiftyval = 0;
|
||||
double iconsize = 1;
|
||||
final int icon_size = 24;
|
||||
int rainbowEggLimit = 0;
|
||||
|
||||
int gamemode = -1;
|
||||
if (RabiRaceModule.mySession!=null) {
|
||||
gamemode = RabiRaceModule.mySession.gamemode;
|
||||
}
|
||||
|
||||
if (gamemode!=-1) {
|
||||
switch (gamemode) {
|
||||
case 0:{ //Egg Hunt.
|
||||
if (session.eggCount>0) {
|
||||
spacing = width/session.eggCount;
|
||||
rainbowEggLimit = session.eggCount;
|
||||
} else {
|
||||
spacing = width/5;
|
||||
rainbowEggLimit = session.eggCount;
|
||||
}
|
||||
//Image img = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
for (int i=0;i<session.eggCount;i++) {
|
||||
//Color col = (rainbowEggCount>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192);
|
||||
//DrawUtils.drawImage(g2, img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36),col,parent.panel);
|
||||
Image img;
|
||||
if (rainbowEggCount>i) {
|
||||
img = Profile.rainbowEggImage;
|
||||
} else {
|
||||
img = Profile.darkRainbowEggImage;
|
||||
}
|
||||
g2.drawImage(img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36), null);
|
||||
}
|
||||
}break;
|
||||
}
|
||||
} else {
|
||||
shiftyval = -RabiRaceModule.image_map.get("easter_egg.png").getWidth(parent.panel)/2;
|
||||
iconsize = 1;
|
||||
}
|
||||
/*
|
||||
{
|
||||
Image img = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
Color col = RabiRaceModule.rainbowcycler.getCycleColor();
|
||||
DrawUtils.drawImage(g2, img, (int)(border+((1.5)*spacing)-img.getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel);
|
||||
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.programFont, (int)(border+((3)*spacing)-img.getWidth(sigIRC.panel)/4),(int)12+img.getHeight(sigIRC.panel), 1, Color.WHITE, Color.BLUE,"x"+rainbowEggCount);
|
||||
}
|
||||
*/
|
||||
int size = key_items.size();
|
||||
int count = 0;
|
||||
try {
|
||||
int i=0;
|
||||
Image[] imgs = new Image[]{RabiRaceModule.image_map.get("health_up.png"),
|
||||
RabiRaceModule.image_map.get("mana_up.png"),
|
||||
RabiRaceModule.image_map.get("regen_up.png"),
|
||||
RabiRaceModule.image_map.get("pack_up.png"),
|
||||
RabiRaceModule.image_map.get("attack_up.png")};
|
||||
int[] amts = new int[]{
|
||||
healthUps,
|
||||
manaUps,
|
||||
regenUps,
|
||||
packUps,
|
||||
attackUps,
|
||||
};
|
||||
if (rainbowEggCount>rainbowEggLimit) {
|
||||
imgs = Arrays.copyOf(imgs, imgs.length+1);
|
||||
imgs[imgs.length-1] = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
amts = Arrays.copyOf(amts, amts.length+1);
|
||||
amts[amts.length-1] = rainbowEggCount;
|
||||
spacing = width/6;
|
||||
}
|
||||
//g2.drawImage(RabiRaceModule.image_map.get("bunny_strike.png"),(int)(+border+(i++)*(spacing)-img2.getWidth(sigIRC.panel)/4),(int)(+96+56), (int)icon_size, (int)icon_size, sigIRC.panel);
|
||||
int counting=0;
|
||||
for (Image img : imgs) {
|
||||
if (counting++==5) {
|
||||
g2.drawImage(rainbowEggImage, (int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval,(int)icon_size,(int)icon_size,null);
|
||||
//DrawUtils.drawImageScaled(g2, img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, RabiRaceModule.rainbowcycler.getCycleColor(), parent.panel);
|
||||
}
|
||||
//DrawUtils.drawCenteredOutlineText(g2, sigIRC.programFont, (int)((+border+((i)*(spacing))-icon_size/2)+(spacing/2)+4), (int)(+96+56+icon_size+12)+shiftyval, 1, Color.WHITE, Color.BLUE, Integer.toString(amts[i++]));
|
||||
i++;
|
||||
}
|
||||
} catch (ConcurrentModificationException e) {
|
||||
|
||||
}
|
||||
g2.dispose();
|
||||
//g.drawImage(tmp, (int)parent.position.getX(), (int)parent.position.getY(), 120, 64, sigIRC.panel);
|
||||
//image_display_update_required=false;
|
||||
//System.out.println("Updated Image Display for user "+username+".");
|
||||
return tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
|
||||
}
|
||||
|
||||
public Image getStatPanel(int w, Session session) {
|
||||
|
||||
if (imageDisplayUpdateImage==null || image_display_update_required) {
|
||||
@ -424,15 +578,23 @@ public class Profile {
|
||||
if (session.eggCount>0) {
|
||||
spacing = width/session.eggCount;
|
||||
rainbowEggLimit = session.eggCount;
|
||||
//shiftyval+=RabiRaceModule.image_map.get("easter_egg.png").getHeight(parent.panel);
|
||||
} else {
|
||||
spacing = width/5;
|
||||
rainbowEggLimit = session.eggCount;
|
||||
}
|
||||
Image img = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
for (int i=0;i<session.eggCount;i++) {
|
||||
Color col = (rainbowEggCount>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192);
|
||||
DrawUtils.drawImage(g2, img, (int)(border+i*spacing-img.getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel);
|
||||
}
|
||||
//Image img = RabiRaceModule.image_map.get("easter_egg.png");
|
||||
/*for (int i=0;i<session.eggCount;i++) {
|
||||
//Color col = (rainbowEggCount>i)?RabiRaceModule.rainbowcycler.getCycleColor():new Color(0,0,0,192);
|
||||
//DrawUtils.drawImage(g2, img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36),col,parent.panel);
|
||||
Image img;
|
||||
if (rainbowEggCount>i) {
|
||||
img = Profile.rainbowEggImage;
|
||||
} else {
|
||||
img = Profile.darkRainbowEggImage;
|
||||
}
|
||||
g2.drawImage(img, (int)(border+i*spacing-img.getWidth(parent.panel)/4),(int)(36), parent.panel);
|
||||
}*/
|
||||
}break;
|
||||
case 1:{ //Item Hunt.
|
||||
spacing = width/session.itemHuntData.length;
|
||||
@ -443,16 +605,16 @@ public class Profile {
|
||||
(badges.containsKey(item) &&
|
||||
badges.get(item)>=1)) {
|
||||
//DrawUtils.drawImage(g2, item.getImage(), (int)(border+i*spacing-item.getImage().getWidth(sigIRC.panel)/4),(int)(36),col,sigIRC.panel);
|
||||
g2.drawImage(item.getImage(), (int)(border+i*spacing),(int)(36+16), icon_size*2, icon_size*2, sigIRC.panel);
|
||||
g2.drawImage(item.getImage(), (int)(border+i*spacing),(int)(36+16), icon_size*2, icon_size*2, null);
|
||||
} else {
|
||||
DrawUtils.drawImageScaled(g2, item.getImage(), (int)(border+i*spacing),(int)(36+16),icon_size*2, icon_size*2,new Color(0,0,0,192),sigIRC.panel);
|
||||
DrawUtils.drawImageScaled(g2, item.getImage(), (int)(border+i*spacing),(int)(36+16),icon_size*2, icon_size*2,new Color(0,0,0,192),null);
|
||||
}
|
||||
}
|
||||
spacing=width/5;
|
||||
}break;
|
||||
}
|
||||
} else {
|
||||
shiftyval = -RabiRaceModule.image_map.get("easter_egg.png").getWidth(sigIRC.panel)/2;
|
||||
shiftyval = -RabiRaceModule.image_map.get("easter_egg.png").getWidth(parent.panel)/2;
|
||||
iconsize = 1;
|
||||
}
|
||||
/*
|
||||
@ -470,15 +632,15 @@ public class Profile {
|
||||
if (key_items.get(data)<0) {
|
||||
Image img = data.getImage().getScaledInstance(icon_size, icon_size, Image.SCALE_DEFAULT);
|
||||
if (size*icon_size<width) {
|
||||
DrawUtils.drawImageScaled(g2, img, (int)(+border+((count++)*icon_size)), (int)(+96+8)+shiftyval, (int)icon_size*iconsize, (int)icon_size*iconsize, new Color(0,0,0,128), sigIRC.panel);
|
||||
DrawUtils.drawImageScaled(g2, img, (int)(+border+((count++)*icon_size)), (int)(+96+8)+shiftyval, (int)icon_size*iconsize, (int)icon_size*iconsize, new Color(0,0,0,128), null);
|
||||
} else {
|
||||
DrawUtils.drawImageScaled(g2, img, (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)icon_size*iconsize, (int)icon_size*iconsize, new Color(0,0,0,128), sigIRC.panel);
|
||||
DrawUtils.drawImageScaled(g2, img, (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)icon_size*iconsize, (int)icon_size*iconsize, new Color(0,0,0,128), null);
|
||||
}
|
||||
} else {
|
||||
if (size*icon_size<width) {
|
||||
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel);
|
||||
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), null);
|
||||
} else {
|
||||
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel);
|
||||
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+8)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -486,14 +648,14 @@ public class Profile {
|
||||
size = badges.size();
|
||||
for (MemoryData data : badges.keySet()) {
|
||||
if (size*icon_size<width) {
|
||||
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel);
|
||||
g2.drawImage(data.getImage(), (int)(+border+((count++)*icon_size)), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), null);
|
||||
if (badges.get(data)==2) {
|
||||
DrawUtils.drawOutlineText(g2, sigIRC.panel.smallFont, (int)(+border+((count-1)*icon_size))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E");
|
||||
DrawUtils.drawOutlineText(g2, sigIRC.smallFont, (int)(+border+((count-1)*icon_size))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E");
|
||||
}
|
||||
} else {
|
||||
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), sigIRC.panel);
|
||||
g2.drawImage(data.getImage(), (int)(+border+((width/size)*(count++))), (int)(+96+32)+shiftyval, (int)(icon_size*iconsize), (int)(icon_size*iconsize), null);
|
||||
if (badges.get(data)==2) {
|
||||
DrawUtils.drawOutlineText(g2, sigIRC.panel.smallFont, (int)(+border+((width/size)*(count-1)))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E");
|
||||
DrawUtils.drawOutlineText(g2, sigIRC.smallFont, (int)(+border+((width/size)*(count-1)))+4, (int)(+96+32)+icon_size+shiftyval, 1, Color.WHITE, TEAL, "E");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -520,20 +682,22 @@ public class Profile {
|
||||
//g2.drawImage(RabiRaceModule.image_map.get("bunny_strike.png"),(int)(+border+(i++)*(spacing)-img2.getWidth(sigIRC.panel)/4),(int)(+96+56), (int)icon_size, (int)icon_size, sigIRC.panel);
|
||||
int counting=0;
|
||||
for (Image img : imgs) {
|
||||
if (counting++==5) {
|
||||
DrawUtils.drawImageScaled(g2, img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, RabiRaceModule.rainbowcycler.getCycleColor(), sigIRC.panel);
|
||||
} else {
|
||||
g2.drawImage(img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, sigIRC.panel);
|
||||
if (counting++!=5) {
|
||||
//Rainbow egg is drawn separately.
|
||||
g2.drawImage(img,(int)(+border+((i)*(spacing))-icon_size/2),(int)(+96+56)+shiftyval, (int)icon_size, (int)icon_size, null);
|
||||
}
|
||||
DrawUtils.drawCenteredOutlineText(g2, sigIRC.panel.programFont, (int)((+border+((i)*(spacing))-icon_size/2)+(spacing/2)+4), (int)(+96+56+icon_size+12)+shiftyval, 1, Color.WHITE, Color.BLUE, Integer.toString(amts[i++]));
|
||||
DrawUtils.drawCenteredOutlineText(g2, sigIRC.programFont, (int)((+border+((i)*(spacing))-icon_size/2)+(spacing/2)+4), (int)(+96+56+icon_size+12)+shiftyval, 1, Color.WHITE, Color.BLUE, Integer.toString(amts[i++]));
|
||||
}
|
||||
} catch (ConcurrentModificationException e) {
|
||||
|
||||
}
|
||||
if (imageDisplayUpdateImage!=null) {
|
||||
imageDisplayUpdateImage.flush();
|
||||
}
|
||||
imageDisplayUpdateImage = tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING);
|
||||
//g.drawImage(tmp, (int)parent.position.getX(), (int)parent.position.getY(), 120, 64, sigIRC.panel);
|
||||
//image_display_update_required=false;
|
||||
//System.out.println("Updated Image Display.");
|
||||
image_display_update_required=false;
|
||||
//System.out.println("Updated Image Display for user "+username+".");
|
||||
}
|
||||
|
||||
return imageDisplayUpdateImage;
|
||||
@ -600,8 +764,10 @@ public class Profile {
|
||||
for (Profile p : players) {
|
||||
Image panel = p.getStatPanel(w,session);
|
||||
Image panel2 = p.getStatText(w,session);
|
||||
g.drawImage(panel,(int)(x+xx*panel.getWidth(sigIRC.panel)/((rows+cols)/2d)),(int)(y+yy*panel.getHeight(sigIRC.panel)/((rows+cols)/2d)),(int)(panel.getWidth(sigIRC.panel)/((rows+cols)/2d)),(int)(panel.getHeight(sigIRC.panel)/((rows+cols)/2d)),sigIRC.panel);
|
||||
g.drawImage(panel2,(int)(x+xx*panel2.getWidth(sigIRC.panel)/((rows+cols)/2d)),(int)(y+yy*panel2.getHeight(sigIRC.panel)/((rows+cols)/2d)),(int)(panel2.getWidth(sigIRC.panel)/((rows+cols)/2d)),(int)(panel2.getHeight(sigIRC.panel)/((rows+cols)/2d)),sigIRC.panel);
|
||||
Image panel3 = p.getRainbowEggPanel(w,session);
|
||||
g.drawImage(panel,(int)(x+xx*panel.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(y+yy*panel.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),null);
|
||||
g.drawImage(panel2,(int)(x+xx*panel2.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(y+yy*panel2.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel2.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel2.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),null);
|
||||
g.drawImage(panel3,(int)(x+xx*panel3.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(y+yy*panel3.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel3.getWidth(RabiRaceModule.module.panel)/((rows+cols)/2d)),(int)(panel3.getHeight(RabiRaceModule.module.panel)/((rows+cols)/2d)),null);
|
||||
if (xx+1<cols) {
|
||||
xx++;
|
||||
} else {
|
||||
|
@ -474,7 +474,7 @@ public class SessionCreateWindow extends JFrame{
|
||||
setBackground(list.getBackground());
|
||||
setForeground(list.getForeground());
|
||||
}
|
||||
setFont(sigIRC.panel.rabiRibiMoneyDisplayFont);
|
||||
setFont(sigIRC.rabiRibiMoneyDisplayFont);
|
||||
setIconTextGap(4);
|
||||
return this;
|
||||
}
|
||||
|
@ -151,6 +151,10 @@ public class SessionListWindow extends JFrame{
|
||||
org.apache.commons.io.FileUtils.copyURLToFile(new URL("http://45.33.13.215/rabirace/send.php?key=joinsession&name="+RabiRaceModule.module.myProfile.username+"&session="+session.id+"&password="+hashedPass),file);
|
||||
String[] data = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/tmp_session.data");
|
||||
|
||||
if (RabiRaceModule.module.myProfile!=null) {
|
||||
RabiRaceModule.module.myProfile.image_display_update_required = true;
|
||||
RabiRaceModule.module.myProfile.stat_update_required = true;
|
||||
}
|
||||
if (data.length==1) {
|
||||
int errorCode = Integer.parseInt(data[0]);
|
||||
switch (errorCode) {
|
||||
|
@ -4,6 +4,7 @@ import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Image;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
@ -49,6 +50,7 @@ import sig.modules.utils.PsapiTools;
|
||||
import sig.utils.DrawUtils;
|
||||
import sig.utils.FileUtils;
|
||||
import sig.utils.TextUtils;
|
||||
import sig.windows.ProgramWindow;
|
||||
|
||||
public class RabiRaceModule extends Module{
|
||||
final static String ITEMS_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/items/";
|
||||
@ -80,7 +82,7 @@ public class RabiRaceModule extends Module{
|
||||
public static List<MemoryData> key_items_list = new ArrayList<MemoryData>();
|
||||
public static List<MemoryData> badges_list = new ArrayList<MemoryData>();
|
||||
|
||||
public RabiRaceModule(Rectangle2D bounds, String moduleName) {
|
||||
public RabiRaceModule(Rectangle bounds, String moduleName) {
|
||||
super(bounds, moduleName);
|
||||
//Initialize();
|
||||
Initialize();
|
||||
@ -130,6 +132,7 @@ public class RabiRaceModule extends Module{
|
||||
|
||||
File dir = new File(ITEMS_DIRECTORY);
|
||||
|
||||
/*
|
||||
for (MemoryData data : MemoryData.values()) {
|
||||
//Attempt to fetch from server.
|
||||
new FileManager("sigIRC/rabi-ribi/items/"+data.img_path).verifyAndFetchFileFromServer();
|
||||
@ -143,7 +146,7 @@ public class RabiRaceModule extends Module{
|
||||
new FileManager("sigIRC/rabi-ribi/items/regen_up.png").verifyAndFetchFileFromServer();
|
||||
new FileManager("sigIRC/rabi-ribi/items/pack_up.png").verifyAndFetchFileFromServer();
|
||||
new FileManager("sigIRC/rabi-ribi/items/attack_up.png").verifyAndFetchFileFromServer();
|
||||
|
||||
*/
|
||||
AddImagesToImageMap(dir,ITEMS_DIRECTORY);
|
||||
dir = new File(AVATAR_DIRECTORY);
|
||||
AddImagesToImageMap(dir,AVATAR_DIRECTORY);
|
||||
@ -164,8 +167,8 @@ public class RabiRaceModule extends Module{
|
||||
|
||||
//trimeadProfile.username = "trimead";
|
||||
|
||||
join_button = new JoinButton(new Rectangle(2,(int)(position.getHeight()-18),120,18),"Join Session (0)",this);
|
||||
create_button = new CreateButton(new Rectangle(122,(int)(position.getHeight()-18),120,18),"Create Session",this);
|
||||
join_button = new JoinButton(new Rectangle(2,(int)(position.getHeight()-Module.WINDOW_EXTRA_BORDER-36),120,18),"Join Session (0)",this);
|
||||
create_button = new CreateButton(new Rectangle(122,(int)(position.getHeight()-Module.WINDOW_EXTRA_BORDER-36),120,18),"Create Session",this);
|
||||
}
|
||||
|
||||
private void AddImagesToImageMap(File dir, String DIRECTORY) {
|
||||
@ -280,8 +283,11 @@ public class RabiRaceModule extends Module{
|
||||
}
|
||||
|
||||
public void run() {
|
||||
super.run();
|
||||
if (foundRabiRibi) {
|
||||
rainbowcycler.run();
|
||||
//Profile.rainbowEggImage.flush();
|
||||
//Profile.rainbowEggImage = DrawUtils.getBlendedImage(RabiRaceModule.module.panel.getGraphics().create(), RabiRaceModule.image_map.get("easter_egg.png"), RabiRaceModule.rainbowcycler.getCycleColor(), RabiRaceModule.window);
|
||||
if (window!=null) {
|
||||
window.run();
|
||||
}
|
||||
@ -296,11 +302,24 @@ public class RabiRaceModule extends Module{
|
||||
}
|
||||
}
|
||||
|
||||
public void componentResized(ComponentEvent e) {
|
||||
super.componentResized(e);
|
||||
if (myProfile!=null) {
|
||||
myProfile.image_display_update_required=true;
|
||||
myProfile.stat_update_required=true;
|
||||
}
|
||||
if (join_button!=null && create_button!=null) {
|
||||
join_button.y=(int)(position.getHeight()-Module.WINDOW_EXTRA_BORDER-36);
|
||||
create_button.y=(int)(position.getHeight()-Module.WINDOW_EXTRA_BORDER-36);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateMyProfile() {
|
||||
if (foundRabiRibi) {
|
||||
//System.out.println("Called.");
|
||||
int paused = readIntFromMemory(MemoryOffset.PAUSED);
|
||||
float itempct = readFloatFromMemory(MemoryOffset.ITEM_PERCENT);
|
||||
myProfile.oldProfile.isPaused = myProfile.isPaused;
|
||||
myProfile.isPaused = paused==1;
|
||||
//System.out.println(itempct+","+paused);
|
||||
if (paused==0 && itempct>=0) {
|
||||
@ -323,8 +342,16 @@ public class RabiRaceModule extends Module{
|
||||
if (myProfile.compareAllChangedValues()>0) {
|
||||
myProfile.image_display_update_required=true;
|
||||
}
|
||||
myProfile.stat_update_required=true;
|
||||
if (myProfile.compareAllChangedStatValues()>0) {
|
||||
myProfile.stat_update_required=true;
|
||||
}
|
||||
myProfile.oldProfile.avatarval = myProfile.avatar.value;
|
||||
firstUpdate=false;
|
||||
} else
|
||||
if (myProfile.compareAllChangedStatValues()>0) {
|
||||
myProfile.archiveAllValues();
|
||||
myProfile.oldProfile.avatarval = myProfile.avatar.value;
|
||||
myProfile.stat_update_required=true;
|
||||
}
|
||||
if (mySession!=null) {
|
||||
for (Profile p : mySession.getPlayers()) {
|
||||
@ -341,8 +368,13 @@ public class RabiRaceModule extends Module{
|
||||
public void ApplyConfigWindowProperties() {
|
||||
sigIRC.rabiracemodule_X=(int)position.getX();
|
||||
sigIRC.rabiracemodule_Y=(int)position.getY();
|
||||
sigIRC.rabiracemodule_width=(int)position.getWidth();
|
||||
sigIRC.rabiracemodule_height=(int)position.getHeight();
|
||||
sigIRC.config.setInteger("RABIRACE_module_X", sigIRC.rabiracemodule_X);
|
||||
sigIRC.config.setInteger("RABIRACE_module_Y", sigIRC.rabiracemodule_Y);
|
||||
sigIRC.config.setInteger("RABIRACE_module_width", sigIRC.rabiracemodule_width);
|
||||
sigIRC.config.setInteger("RABIRACE_module_height", sigIRC.rabiracemodule_height);
|
||||
sigIRC.config.saveProperties();
|
||||
}
|
||||
|
||||
/*public int readIntFromErinaData(MemoryOffset val) {
|
||||
@ -436,31 +468,31 @@ public class RabiRaceModule extends Module{
|
||||
|
||||
public void draw(Graphics g) {
|
||||
super.draw(g);
|
||||
|
||||
if (!foundRabiRibi) {
|
||||
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, position.getX(), position.getY()+26, Color.BLACK, "Rabi-Ribi not found! Please start it.");
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, 0, 0+26, Color.BLACK, "Rabi-Ribi not found! Please start it.");
|
||||
} else {
|
||||
//myProfile.draw(g);
|
||||
Image panel = myProfile.getStatPanel((int)position.getWidth(),mySession);
|
||||
|
||||
if (sigIRC.panel.lastMouseX>=position.getX() &&
|
||||
sigIRC.panel.lastMouseX<=position.getX()+(int)((position.getWidth()/400)*50) &&
|
||||
sigIRC.panel.lastMouseY>=position.getY() &&
|
||||
sigIRC.panel.lastMouseY<=position.getY()+(int)(((position.getWidth()/400)*50))) {
|
||||
Image panel = myProfile.getStatPanel((int)position.getWidth()-24,mySession);
|
||||
//System.out.println(ProgramWindow.frame.lastMouseX+","+ProgramWindow.frame.lastMouseY+";"+position.getX()+","+position.getY());
|
||||
if (ProgramWindow.frame.lastMouseX>=position.getX() &&
|
||||
ProgramWindow.frame.lastMouseX<=position.getX()+(int)((position.getWidth()/400)*50) &&
|
||||
ProgramWindow.frame.lastMouseY>=position.getY()+Module.WINDOW_EXTRA_BORDER &&
|
||||
ProgramWindow.frame.lastMouseY<=position.getY()+Module.WINDOW_EXTRA_BORDER+(int)(((position.getWidth()/400)*50))) {
|
||||
mouseoverAvatar=true;
|
||||
Color ident = g.getColor();
|
||||
g.setColor(new Color(196,196,196,128));
|
||||
g.fillRect((int)(position.getX()+1), (int)(position.getY()+1), (int)((position.getWidth()/400)*50), (int)((position.getWidth()/400)*50));
|
||||
g.fillRect((int)(0+1), (int)(0+1), (int)((position.getWidth()/400)*50), (int)((position.getWidth()/400)*50));
|
||||
g.setColor(ident);
|
||||
//System.out.println("Mouse over avatar.");
|
||||
} else {
|
||||
mouseoverAvatar=false;
|
||||
}
|
||||
|
||||
g.drawImage(panel, (int)position.getX(), (int)position.getY(), sigIRC.panel);
|
||||
g.drawImage(myProfile.getStatText((int)position.getWidth(),mySession), (int)position.getX(), (int)position.getY(), sigIRC.panel);
|
||||
g.drawImage(panel, (int)0, (int)0, null);
|
||||
g.drawImage(myProfile.getStatText((int)position.getWidth()-24,mySession), (int)0, (int)0, null);
|
||||
g.drawImage(myProfile.getRainbowEggPanel((int)position.getWidth()-24,mySession), (int)0, (int)0, null);
|
||||
|
||||
//Profile.DrawMultiPanel(g, (int)(position.getX()), (int)(position.getY())+panel.getHeight(sigIRC.panel), (int)position.getWidth(), testing);
|
||||
//Profile.DrawMultiPanel(g, (int)(0), (int)(0)+panel.getHeight(sigIRC.panel), (int)position.getWidth(), testing);
|
||||
if (mySession!=null) {
|
||||
List<Profile> sessionPlayers = new ArrayList<Profile>();
|
||||
for (Profile p : mySession.getPlayers()) {
|
||||
@ -469,7 +501,7 @@ public class RabiRaceModule extends Module{
|
||||
//System.out.println("Found unique player "+p);
|
||||
}
|
||||
}
|
||||
Profile.DrawMultiPanel(g, (int)(position.getX()), (int)(position.getY())+panel.getHeight(sigIRC.panel), (int)position.getWidth(), mySession);
|
||||
Profile.DrawMultiPanel(g, (int)(0), (int)(0)+panel.getHeight(module.panel), (int)position.getWidth()-24, mySession);
|
||||
}
|
||||
|
||||
if (firstCheck) {
|
||||
@ -479,7 +511,7 @@ public class RabiRaceModule extends Module{
|
||||
}
|
||||
}
|
||||
g.setColor(Color.BLACK);
|
||||
g.fillRect((int)(position.getX()), (int)(position.getY()+position.getHeight()-28-20), (int)(position.getWidth()), 20);
|
||||
g.fillRect((int)(0), (int)(0+position.getHeight()-28-20), (int)(position.getWidth()), 20);
|
||||
for (int i=0;i<messages.size();i++) {
|
||||
messages.get(i).draw(g);
|
||||
}
|
||||
@ -497,7 +529,7 @@ public class RabiRaceModule extends Module{
|
||||
this.msg = message;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.bounds = TextUtils.calculateStringBoundsFont(message, sigIRC.panel.rabiRibiTinyDisplayFont);
|
||||
this.bounds = TextUtils.calculateStringBoundsFont(message, sigIRC.rabiRibiTinyDisplayFont);
|
||||
RabiRaceModule.lastScrollX += bounds.getWidth() + 96;
|
||||
}
|
||||
|
||||
@ -511,7 +543,7 @@ public class RabiRaceModule extends Module{
|
||||
|
||||
public void draw(Graphics g) {
|
||||
if (x<position.getWidth()) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.rabiRibiTinyDisplayFont, position.getX()+x, position.getY()+y-6, 2, Color.WHITE, Color.GRAY, msg);
|
||||
DrawUtils.drawOutlineText(g, sigIRC.rabiRibiTinyDisplayFont, 0+x, 0+y-6, 2, Color.WHITE, Color.GRAY, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,19 @@
|
||||
package sig.modules.RabiRibi;
|
||||
|
||||
public enum MemoryOffset {
|
||||
MONEY(0xD654CC,0x12DA99C+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DA9AC+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
|
||||
PLAYTIME(0xD642D8,0x12D97A8+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DB050+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881), //In frames (Rabi-Ribi runs at 60FPS).
|
||||
MONEY(0xD654CC,0x12DA99C+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DA9AC+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12FE9B4),
|
||||
PLAYTIME(0xD642D8,0x12D97A8+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12DB050+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12DB040+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190), //In frames (Rabi-Ribi runs at 60FPS).
|
||||
//UNKNOWN1(0xD65BDC), //???? Originally assumed to be "Health Ups".
|
||||
HEALTHUP_START(0xD6342C,0xD6342C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6342C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
HEALTHUP_END(0xD63528,0xD63528+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63528+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
ATTACKUP_START(0xD6352C,0xD6352C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6352C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
ATTACKUP_END(0xD63628,0xD63628+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63628+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
MANAUP_START(0xD6362C,0xD6362C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6362C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
MANAUP_END(0xD63728,0xD63728+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63728+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
REGENUP_START(0xD6372C,0xD6372C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6372C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
REGENUP_END(0xD63828,0xD63828+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63828+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
PACKUP_START(0xD6382C,0xD6382C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6382C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
PACKUP_END(0xD63928,0xD63928+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63928+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
HEALTHUP_START(0xD6342C,0xD6342C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6342C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6342C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
HEALTHUP_END(0xD63528,0xD63528+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63528+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63528+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
ATTACKUP_START(0xD6352C,0xD6352C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6352C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6352C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
ATTACKUP_END(0xD63628,0xD63628+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63628+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63628+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
MANAUP_START(0xD6362C,0xD6362C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6362C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6362C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
MANAUP_END(0xD63728,0xD63728+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63728+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63728+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
REGENUP_START(0xD6372C,0xD6372C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6372C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6372C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
REGENUP_END(0xD63828,0xD63828+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63828+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63828+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
PACKUP_START(0xD6382C,0xD6382C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6382C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6382C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
PACKUP_END(0xD63928,0xD63928+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63928+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63928+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
/*ENTITY_ARRAY(0x0096DA3C), //Erina Data Pointer.
|
||||
ERINA_HP(0x4D8),
|
||||
ERINA_MAXHP(0x4E8),
|
||||
@ -38,110 +38,110 @@ public enum MemoryOffset {
|
||||
|
||||
|
||||
|
||||
GAME_DIFFICULTY(0xD64338,0xD64338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12D9818+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
|
||||
GAME_LOOP(0xD6D05C,0xD6D05C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12E253C+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
|
||||
GAME_DIFFICULTY(0xD64338,0xD64338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12D9818+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D9808+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190),
|
||||
GAME_LOOP(0xD6D05C,0xD6D05C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12E253C+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12E252C+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190),
|
||||
|
||||
HAMMER(0xD632B0,0xD632B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
AIR_JUMP(0xD632B4,0xD632B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
SLIDING_POWDER(0xD632B8,0xD632B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
CARROT_BOMB(0xD632BC,0xD632BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
HOURGLASS(0xD632C0,0xD632C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
SPEED_BOOST(0xD632C4,0xD632C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
AUTO_EARRINGS(0xD632C8,0xD632C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
RIBBON(0xD632CC,0xD632CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
SOUL_HEART(0xD632D0,0xD632D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
RABI_SLIPPERS(0xD632D4,0xD632D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BUNNY_WHIRL(0xD632D8,0xD632D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
QUICK_BARETTE(0xD632DC,0xD632DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BOOK_OF_CARROT(0xD632E0,0xD632E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
CHAOS_ROD(0xD632E4,0xD632E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
HAMMER_WAVE(0xD632E8,0xD632E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
HAMMER_ROLL(0xD632EC,0xD632EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
LIGHT_ORB(0xD632F0,0xD632F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
WATER_ORB(0xD632F4,0xD632F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
FIRE_ORB(0xD632F8,0xD632F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
NATURE_ORB(0xD632FC,0xD632FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
P_HAIRPIN(0xD63300,0x12D87D0+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12D87D0+OffsetHelper.MEMORY_OFFSET_V185_TO_V1881),
|
||||
SUNNY_BEAM(0xD63304,0xD63304+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63304+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
PLUS_NECKLACE(0xD63308,0xD63308+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63308+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
CYBER_FLOWER(0xD6330C,0xD6330C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6330C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
HEALING_STAFF(0xD63310,0xD63310+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63310+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
MAX_BRACELET(0xD63314,0xD63314+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63314+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
EXPLODE_SHOT(0xD63318,0xD63318+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63318+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
AIR_DASH(0xD6331C,0xD6331C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6331C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BUNNY_STRIKE(0xD63320,0xD63320+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63320+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
STRANGE_BOX(0xD63324,0xD63324+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63324+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
WALL_JUMP(0xD63328,0xD63328+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63328+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
SPIKE_BARRIER(0xD6332C,0xD6332C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6332C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BUNNY_AMULET(0xD63330,0xD63330+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63330+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
CHARGE_RING(0xD63334,0xD63334+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63334+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
CARROT_SHOOTER(0xD63338,0xD63338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63338+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
SUPER_CARROT(0xD6333C,0xD6333C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6333C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
RUMI_DONUT(0xD63340,0xD63340+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63340+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
RUMI_CAKE(0xD63344,0xD63344+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63344+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
GOLD_CARROT(0xD63348,0xD63348+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63348+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
COCOA_BOMB(0xD6334C,0xD6334C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6334C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM1(0xD63350,0xD63350+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63350+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
TROPHY(0xD63354,0xD63354+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63354+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
EXCLAMATION_POINT(0xD63358,0xD63358+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63358+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM2(0xD6335C,0xD6335C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6335C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM3(0xD63360,0xD63360+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63360+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM4(0xD63364,0xD63364+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63364+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
RAINBOW_MAGIC(0xD63368,0xD63368+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63368+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM5(0xD6336C,0xD6336C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6336C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM6(0xD63370,0xD63370+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63370+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM7(0xD63374,0xD63374+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63374+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM8(0xD63378,0xD63378+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63378+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM9(0xD6337C,0xD6337C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6337C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM10(0xD63380,0xD63380+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63380+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM11(0xD63384,0xD63384+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63384+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM12(0xD63388,0xD63388+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63388+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM13(0xD6338C,0xD6338C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6338C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
UNKNOWN_ITEM14(0xD63390,0xD63390+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63390+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
HAMMER(0xD632B0,0xD632B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
AIR_JUMP(0xD632B4,0xD632B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
SLIDING_POWDER(0xD632B8,0xD632B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
CARROT_BOMB(0xD632BC,0xD632BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
HOURGLASS(0xD632C0,0xD632C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
SPEED_BOOST(0xD632C4,0xD632C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
AUTO_EARRINGS(0xD632C8,0xD632C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
RIBBON(0xD632CC,0xD632CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
SOUL_HEART(0xD632D0,0xD632D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
RABI_SLIPPERS(0xD632D4,0xD632D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BUNNY_WHIRL(0xD632D8,0xD632D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
QUICK_BARETTE(0xD632DC,0xD632DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BOOK_OF_CARROT(0xD632E0,0xD632E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
CHAOS_ROD(0xD632E4,0xD632E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
HAMMER_WAVE(0xD632E8,0xD632E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
HAMMER_ROLL(0xD632EC,0xD632EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
LIGHT_ORB(0xD632F0,0xD632F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
WATER_ORB(0xD632F4,0xD632F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
FIRE_ORB(0xD632F8,0xD632F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
NATURE_ORB(0xD632FC,0xD632FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD632FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD632FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
P_HAIRPIN(0xD63300,0x12D87D0+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12D87D0+OffsetHelper.MEMORY_OFFSET_V185_TO_V1881,0x12D87D0+OffsetHelper.MEMORY_OFFSET_V185_TO_V1881),
|
||||
SUNNY_BEAM(0xD63304,0xD63304+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63304+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63304+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
PLUS_NECKLACE(0xD63308,0xD63308+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63308+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63308+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
CYBER_FLOWER(0xD6330C,0xD6330C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6330C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6330C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
HEALING_STAFF(0xD63310,0xD63310+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63310+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63310+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
MAX_BRACELET(0xD63314,0xD63314+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63314+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63314+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
EXPLODE_SHOT(0xD63318,0xD63318+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63318+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63318+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
AIR_DASH(0xD6331C,0xD6331C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6331C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6331C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BUNNY_STRIKE(0xD63320,0xD63320+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63320+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63320+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
STRANGE_BOX(0xD63324,0xD63324+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63324+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63324+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
WALL_JUMP(0xD63328,0xD63328+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63328+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63328+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
SPIKE_BARRIER(0xD6332C,0xD6332C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6332C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6332C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BUNNY_AMULET(0xD63330,0xD63330+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63330+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63330+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
CHARGE_RING(0xD63334,0xD63334+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63334+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63334+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
CARROT_SHOOTER(0xD63338,0xD63338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63338+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63338+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
SUPER_CARROT(0xD6333C,0xD6333C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6333C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6333C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
RUMI_DONUT(0xD63340,0xD63340+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63340+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63340+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
RUMI_CAKE(0xD63344,0xD63344+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63344+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63344+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
GOLD_CARROT(0xD63348,0xD63348+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63348+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63348+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
COCOA_BOMB(0xD6334C,0xD6334C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6334C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6334C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM1(0xD63350,0xD63350+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63350+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63350+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
TROPHY(0xD63354,0xD63354+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63354+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63354+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
EXCLAMATION_POINT(0xD63358,0xD63358+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63358+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63358+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM2(0xD6335C,0xD6335C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6335C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6335C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM3(0xD63360,0xD63360+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63360+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63360+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM4(0xD63364,0xD63364+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63364+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63364+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
RAINBOW_MAGIC(0xD63368,0xD63368+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63368+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63368+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM5(0xD6336C,0xD6336C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6336C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6336C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM6(0xD63370,0xD63370+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63370+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63370+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM7(0xD63374,0xD63374+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63374+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63374+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM8(0xD63378,0xD63378+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63378+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63378+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM9(0xD6337C,0xD6337C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6337C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6337C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM10(0xD63380,0xD63380+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63380+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63380+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM11(0xD63384,0xD63384+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63384+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63384+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM12(0xD63388,0xD63388+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63388+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63388+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM13(0xD6338C,0xD6338C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6338C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6338C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
UNKNOWN_ITEM14(0xD63390,0xD63390+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63390+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63390+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
/*DLC_ITEM1(0xD63394,0xD63394+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851),
|
||||
DLC_ITEM2(0xD63398,0xD63398+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851),*/
|
||||
BUNNY_CLOVER(0xD6339C,0xD6339C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12D887C+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
|
||||
FAIRYS_FLUTE(0,0x12D8874+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12D8884+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
|
||||
BUNNY_MEMORIES(0,0x12D7878,0x12D8888+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
|
||||
WIND_BLESSING(0,0x12D7870,0x12D8880+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
|
||||
DLC_ITEM4(0xD633A0,0xD633A0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633A0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_HEALTH_PLUS(0xD633AC,0xD633AC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633AC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_HEALTH_SURGE(0xD633B0,0xD633B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_MANA_PLUS(0xD633B4,0xD633B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_MANA_SURGE(0xD633B8,0xD633B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_CRISIS_BOOST(0xD633BC,0xD633BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_ATK_GROW(0xD633C0,0xD633C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_DEF_GROW(0xD633C4,0xD633C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_ATK_TRADE(0xD633C8,0xD633C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_DEF_TRADE(0xD633CC,0xD633CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_ARM_STRENGTH(0xD633D0,0xD633D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_CARROT_BOOST(0xD633D4,0xD633D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_WEAKEN(0xD633D8,0xD633D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_SELF_DEFENSE(0xD633DC,0xD633DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_ARMORED(0xD633E0,0xD633E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_LUCKY_SEVEN(0xD633E4,0xD633E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_HEX_CANCEL(0xD633E8,0xD633E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_PURE_LOVE(0xD633EC,0xD633EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_TOXIC_STRIKE(0xD633F0,0xD633F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_FRAME_CANCEL(0xD633F4,0xD633F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_HEALTH_WAGER(0xD633F8,0xD633F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_MANA_WAGER(0xD633FC,0xD633FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_STAMINA_PLUS(0xD63400,0xD63400+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63400+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_BLESSED(0xD63404,0xD63404+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63404+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_HITBOX_DOWN(0xD63408,0xD63408+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63408+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_CASHBACK(0xD6340C,0xD6340C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6340C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_SURVIVAL(0xD63410,0xD63410+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63410+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_TOP_FORM(0xD63414,0xD63414+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63414+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_TOUGH_SKIN(0xD63418,0xD63418+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63418+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_ERINA_BADGE(0xD6341C,0xD6341C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6341C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_RIBBON_BADGE(0xD63420,0xD63420+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63420+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_AUTO_TRIGGER(0xD63424,0xD63424+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63424+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BADGE_LILITHS_GIFT(0xD63428,0xD63428+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63428+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
BUNNY_CLOVER(0xD6339C,0xD6339C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0x12D887C+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D886C+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190),
|
||||
FAIRYS_FLUTE(0,0x12D8874+OffsetHelper.KEY_ITEM_OFFSET_V185_TO_V1851,0x12D8884+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8874+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190),
|
||||
BUNNY_MEMORIES(0,0x12D7878,0x12D8888+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8888-0x10+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190),
|
||||
WIND_BLESSING(0,0x12D7870,0x12D8880+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x12D8880-0x10+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190),
|
||||
DLC_ITEM4(0xD633A0,0xD633A0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633A0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633A0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_HEALTH_PLUS(0xD633AC,0xD633AC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633AC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633AC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_HEALTH_SURGE(0xD633B0,0xD633B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633B0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_MANA_PLUS(0xD633B4,0xD633B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633B4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_MANA_SURGE(0xD633B8,0xD633B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633B8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_CRISIS_BOOST(0xD633BC,0xD633BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633BC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_ATK_GROW(0xD633C0,0xD633C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633C0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_DEF_GROW(0xD633C4,0xD633C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633C4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_ATK_TRADE(0xD633C8,0xD633C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633C8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_DEF_TRADE(0xD633CC,0xD633CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633CC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_ARM_STRENGTH(0xD633D0,0xD633D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633D0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_CARROT_BOOST(0xD633D4,0xD633D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633D4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_WEAKEN(0xD633D8,0xD633D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633D8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_SELF_DEFENSE(0xD633DC,0xD633DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633DC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_ARMORED(0xD633E0,0xD633E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633E0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_LUCKY_SEVEN(0xD633E4,0xD633E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633E4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_HEX_CANCEL(0xD633E8,0xD633E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633E8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_PURE_LOVE(0xD633EC,0xD633EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633EC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_TOXIC_STRIKE(0xD633F0,0xD633F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633F0+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_FRAME_CANCEL(0xD633F4,0xD633F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633F4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_HEALTH_WAGER(0xD633F8,0xD633F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633F8+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_MANA_WAGER(0xD633FC,0xD633FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD633FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD633FC+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_STAMINA_PLUS(0xD63400,0xD63400+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63400+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63400+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_BLESSED(0xD63404,0xD63404+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63404+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63404+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_HITBOX_DOWN(0xD63408,0xD63408+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63408+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63408+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_CASHBACK(0xD6340C,0xD6340C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6340C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6340C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_SURVIVAL(0xD63410,0xD63410+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63410+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63410+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_TOP_FORM(0xD63414,0xD63414+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63414+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63414+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_TOUGH_SKIN(0xD63418,0xD63418+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63418+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63418+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_ERINA_BADGE(0xD6341C,0xD6341C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD6341C+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD6341C+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_RIBBON_BADGE(0xD63420,0xD63420+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63420+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63420+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_AUTO_TRIGGER(0xD63424,0xD63424+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63424+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63424+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
BADGE_LILITHS_GIFT(0xD63428,0xD63428+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD63428+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD63428+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
//13413E8
|
||||
ITEM_PERCENT(0,0x13413E8,0x1342408+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
|
||||
MAP_PERCENT(0,0x13413E4,0x1342404+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881),
|
||||
RAINBOW_EGG_COUNT(0xD65FD4,0xD65FD4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD65FD4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881),
|
||||
PAUSED(0,0xC969A0,0xC979A0),
|
||||
ITEM_PERCENT(0,0x13413E8,0x1342408+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x13423F8+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190),
|
||||
MAP_PERCENT(0,0x13413E4,0x1342404+OffsetHelper.MEMORY_OFFSET_V188_TO_V1881,0x13423F4+OffsetHelper.MEMORY_OFFSET_V1881_TO_V190),
|
||||
RAINBOW_EGG_COUNT(0xD65FD4,0xD65FD4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V1851,0xD65FD4+OffsetHelper.MEMORY_OFFSET_V175_TO_V1881,0xD65FD4+OffsetHelper.MEMORY_OFFSET_V175_TO_V190),
|
||||
PAUSED(0,0xC969A0,0xC979A0,0xCBB9AC),
|
||||
;
|
||||
|
||||
long offset;
|
||||
@ -149,7 +149,7 @@ public enum MemoryOffset {
|
||||
long offset_v188;
|
||||
long latest_offset;
|
||||
|
||||
MemoryOffset(long offset,long offset_v185,long offset_v188) {
|
||||
MemoryOffset(long offset,long offset_v185,long offset_v188,long offset_v190) {
|
||||
this.offset=offset;
|
||||
this.offset_v185=offset_v185;
|
||||
this.offset_v188=offset_v188;
|
||||
@ -186,4 +186,6 @@ class OffsetHelper{
|
||||
final static long MEMORY_OFFSET_V188_TO_V1881 = -0x10;
|
||||
final static long MEMORY_OFFSET_V185_TO_V1881 = KEY_ITEM_OFFSET_V185_TO_V188+MEMORY_OFFSET_V188_TO_V1881;
|
||||
final static long MEMORY_OFFSET_V175_TO_V1881 = KEY_ITEM_OFFSET_V175_TO_V188+MEMORY_OFFSET_V188_TO_V1881;
|
||||
final static long MEMORY_OFFSET_V1881_TO_V190 = 0x24018;
|
||||
final static long MEMORY_OFFSET_V175_TO_V190 = MEMORY_OFFSET_V175_TO_V1881+MEMORY_OFFSET_V1881_TO_V190;
|
||||
}
|
@ -62,7 +62,7 @@ public class RabiRibiModule extends Module{
|
||||
if (moneyearned>0 && moneytime>playtime) {
|
||||
setTarget(overlay.getScreenPosition(readFloatFromErinaData(MemoryOffset.ERINA_XPOS), readFloatFromErinaData(MemoryOffset.ERINA_YPOS)));
|
||||
//System.out.println(x+","+y);
|
||||
DrawUtils.drawCenteredOutlineText(g, sigIRC.panel.rabiRibiMoneyDisplayFont, (int)x, (int)y-96, 2, Color.ORANGE, Color.BLACK, "+"+moneyearned+"EN");
|
||||
DrawUtils.drawCenteredOutlineText(g, sigIRC.rabiRibiMoneyDisplayFont, (int)x, (int)y-96, 2, Color.ORANGE, Color.BLACK, "+"+moneyearned+"EN");
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -234,9 +234,9 @@ public class RabiRibiModule extends Module{
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "HP: "+readIntFromErinaData(MemoryOffset.ERINA_HP)+"/"+readIntFromErinaData(MemoryOffset.ERINA_MAXHP));
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "POS ("+(int)readFloatFromErinaData(MemoryOffset.ERINA_XPOS)/1280+","+(int)readFloatFromErinaData(MemoryOffset.ERINA_YPOS)/720+")");
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "MAP: "+readIntFromMemory(MemoryOffset.MAPID));*/
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "POS ("+(readFloatFromErinaData(MemoryOffset.ERINA_XPOS))+","+(readFloatFromErinaData(MemoryOffset.ERINA_YPOS))+")");
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "MONEY: ("+(readIntFromMemory(MemoryOffset.MONEY))+")");
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "CAMERA ("+(readIntFromMemory(MemoryOffset.CAMERA_XPOS))+","+(readIntFromMemory(MemoryOffset.CAMERA_YPOS))+")");
|
||||
DrawUtils.drawOutlineText(g, sigIRC.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "POS ("+(readFloatFromErinaData(MemoryOffset.ERINA_XPOS))+","+(readFloatFromErinaData(MemoryOffset.ERINA_YPOS))+")");
|
||||
DrawUtils.drawOutlineText(g, sigIRC.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "MONEY: ("+(readIntFromMemory(MemoryOffset.MONEY))+")");
|
||||
DrawUtils.drawOutlineText(g, sigIRC.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "CAMERA ("+(readIntFromMemory(MemoryOffset.CAMERA_XPOS))+","+(readIntFromMemory(MemoryOffset.CAMERA_YPOS))+")");
|
||||
//DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "SCREENPOS ("+overlay.getScreenPosition(readFloatFromErinaData(MemoryOffset.ERINA_XPOS), readFloatFromErinaData(MemoryOffset.ERINA_YPOS))+")");
|
||||
overlay.draw(g);
|
||||
/*DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE,
|
||||
@ -255,8 +255,8 @@ public class RabiRibiModule extends Module{
|
||||
for (Integer numb : entities.keySet()) {
|
||||
Entity ent = entities.get(numb);
|
||||
if (ent.getLastHitTime()>readIntFromMemory(MemoryOffset.PLAYTIME)-180) {
|
||||
for (String s : TextUtils.WrapText("Entity "+ent.getID()+": "+ent.getHealth()+"/"+ent.getMaxHealth()+" HP "+((ent.getHealth()/(float)ent.getMaxHealth())*100)+"%".replaceAll(",", ", "), sigIRC.panel.programFont, position.getWidth()-20)) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX()+20, position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE,
|
||||
for (String s : TextUtils.WrapText("Entity "+ent.getID()+": "+ent.getHealth()+"/"+ent.getMaxHealth()+" HP "+((ent.getHealth()/(float)ent.getMaxHealth())*100)+"%".replaceAll(",", ", "), sigIRC.programFont, position.getWidth()-20)) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.programFont, position.getX()+20, position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE,
|
||||
s);
|
||||
}
|
||||
}
|
||||
@ -270,7 +270,7 @@ public class RabiRibiModule extends Module{
|
||||
int playtime = readIntFromMemory(MemoryOffset.PLAYTIME);
|
||||
|
||||
if (statustext.length()>0 && statustime>playtime-300) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=48), 3, Color.GREEN, Color.LIGHT_GRAY, statustext);
|
||||
DrawUtils.drawOutlineText(g, sigIRC.programFont, position.getX(), position.getY()+(i+=48), 3, Color.GREEN, Color.LIGHT_GRAY, statustext);
|
||||
}
|
||||
|
||||
en_counter.draw(g);
|
||||
|
203
src/sig/modules/ScrollingChatModule.java
Normal file
203
src/sig/modules/ScrollingChatModule.java
Normal file
@ -0,0 +1,203 @@
|
||||
package sig.modules;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import sig.CustomSound;
|
||||
import sig.Module;
|
||||
import sig.TextRow;
|
||||
import sig.sigIRC;
|
||||
import sig.utils.FileUtils;
|
||||
import sig.windows.ProgramWindow;
|
||||
|
||||
public class ScrollingChatModule extends Module{
|
||||
|
||||
final static int MSGTIMER = 300;
|
||||
final static int AUTOSAVETIMER = 600;
|
||||
int last_authentication_msg = MSGTIMER;
|
||||
int last_autosave = AUTOSAVETIMER;
|
||||
public static ScrollingChatModule module;
|
||||
|
||||
public ScrollingChatModule(Rectangle bounds, String moduleName) {
|
||||
super(bounds, moduleName);
|
||||
|
||||
ScrollingChatModule.module = this;
|
||||
String[] filedata = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/oauthToken.txt");
|
||||
|
||||
for (int i=0;i<sigIRC.chatRows;i++) {
|
||||
sigIRC.rowobj.add(new TextRow(32+sigIRC.ROWSEPARATION*i));
|
||||
}
|
||||
//UpdateSubEmoticons();
|
||||
}
|
||||
|
||||
public void run() {
|
||||
super.run();
|
||||
UpdateScrollingText();
|
||||
UpdateAuthenticationCountdownMessage();
|
||||
//System.out.println("Called.");
|
||||
}
|
||||
|
||||
|
||||
private void UpdateSubEmoticons() {
|
||||
if (!sigIRC.downloadedSubEmotes &&
|
||||
sigIRC.disableChatMessages &&
|
||||
sigIRC.subchannelCount==sigIRC.subchannelIds.size()) {
|
||||
Thread downloadThread = new Thread(){
|
||||
public void run() {
|
||||
JSONObject data = GetSubEmoteJson();
|
||||
sigIRC.downloadSubEmotes(data);
|
||||
sigIRC.subEmotesCompleted=true;
|
||||
}
|
||||
};
|
||||
downloadThread.start();
|
||||
sigIRC.downloadedSubEmotes=true;
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyConfigWindowProperties() {
|
||||
sigIRC.scrollingchatmodule_X=(int)position.getX();
|
||||
sigIRC.scrollingchatmodule_Y=(int)position.getY();
|
||||
sigIRC.scrollingchatmodule_width=(int)position.getWidth();
|
||||
sigIRC.scrollingchatmodule_height=(int)position.getHeight();
|
||||
sigIRC.config.setInteger("SCROLLINGCHAT_module_X", sigIRC.scrollingchatmodule_X);
|
||||
sigIRC.config.setInteger("SCROLLINGCHAT_module_Y", sigIRC.scrollingchatmodule_Y);
|
||||
sigIRC.config.setInteger("SCROLLINGCHAT_module_width", sigIRC.scrollingchatmodule_width);
|
||||
sigIRC.config.setInteger("SCROLLINGCHAT_module_height", sigIRC.scrollingchatmodule_height);
|
||||
sigIRC.config.saveProperties();
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
super.draw(g);
|
||||
for (int i=0;i<sigIRC.textobj.size();i++) {
|
||||
if (sigIRC.textobj.get(i).isActive()) {
|
||||
if (sigIRC.overlayMode) {
|
||||
if (!sigIRC.textobj.get(i).intersects((int)(ProgramWindow.frame.lastMouseX-position.getX()),(int)(ProgramWindow.frame.lastMouseY-position.getY()))) {
|
||||
sigIRC.textobj.get(i).setVisible(true);
|
||||
sigIRC.textobj.get(i).draw(g);
|
||||
} else {
|
||||
//System.out.println("Setting to False.");
|
||||
sigIRC.textobj.get(i).setVisible(false);
|
||||
}
|
||||
} else {
|
||||
sigIRC.textobj.get(i).draw(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0;i<sigIRC.twitchemoticons.size();i++) {
|
||||
if (sigIRC.twitchemoticons.get(i).isActive() &&
|
||||
sigIRC.twitchemoticons.get(i).textRefIsVisible()) {
|
||||
sigIRC.twitchemoticons.get(i).draw(g);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private JSONObject GetSubEmoteJson() {
|
||||
JSONObject subemotes = null;
|
||||
try {
|
||||
File filer = new File(sigIRC.SUBEMOTELISTFILE);
|
||||
if (!filer.exists()) {
|
||||
System.out.println("Local copy of Sub emotes not found. Downloading in background...");
|
||||
subemotes = FileUtils.readJsonFromUrlWithFilter("https://twitchemotes.com/api_cache/v3/subscriber.json",sigIRC.subchannelIds,sigIRC.SUBEMOTELISTFILE,true);
|
||||
} else {
|
||||
if (sigIRC.lastSubEmoteUpdate == Calendar.getInstance().get(Calendar.DAY_OF_YEAR)) {
|
||||
System.out.println("Using local copy of Sub emote JSON.");
|
||||
subemotes = FileUtils.readJsonFromFileWithFilter(sigIRC.SUBEMOTELISTFILE,sigIRC.subchannelIds);
|
||||
} else {
|
||||
System.out.println("Local copy of Sub emote JSON out-of-date! Re-downloading in background...");
|
||||
subemotes = FileUtils.readJsonFromFileWithFilter(sigIRC.SUBEMOTELISTFILE,sigIRC.subchannelIds);
|
||||
new Thread(){
|
||||
public void run() {
|
||||
try {
|
||||
FileUtils.readJsonFromUrlWithFilter("https://twitchemotes.com/api_cache/v3/subscriber.json",sigIRC.subchannelIds,sigIRC.SUBEMOTELISTFILE,true);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
} catch (JSONException | IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
sigIRC.lastSubEmoteUpdate = Calendar.getInstance().get(Calendar.DAY_OF_YEAR);
|
||||
sigIRC.config.setInteger("lastSubEmote_APIUpdate", sigIRC.lastSubEmoteUpdate);
|
||||
return subemotes;
|
||||
}
|
||||
|
||||
private void UpdateAuthenticationCountdownMessage() {
|
||||
if (sigIRC.downloadsComplete) {
|
||||
if ((!sigIRC.authenticated || sigIRC.testMode) && last_authentication_msg<MSGTIMER) {
|
||||
last_authentication_msg++;
|
||||
} else
|
||||
if ((!sigIRC.authenticated || sigIRC.testMode) && last_authentication_msg>=MSGTIMER) {
|
||||
last_authentication_msg=0;
|
||||
if (!sigIRC.authenticated && !sigIRC.testMode) {
|
||||
sigIRC.panel.addMessage("SYSTEM: Your oauthToken was not successful. Please go to the sigIRC folder and make sure your oauthToken.txt file is correct!!! SwiftRage",!sigIRC.playedoAuthSoundOnce);
|
||||
if (!sigIRC.playedoAuthSoundOnce) {
|
||||
sigIRC.playedoAuthSoundOnce=true;
|
||||
}
|
||||
} else {
|
||||
sigIRC.panel.addMessage("SYSTEM: This is a test message for your testing convenience. mikansBox",!sigIRC.playedoAuthSoundOnce);
|
||||
}
|
||||
}
|
||||
if (last_autosave<AUTOSAVETIMER) {
|
||||
last_authentication_msg++;
|
||||
} else
|
||||
if (last_autosave>=AUTOSAVETIMER) {
|
||||
last_autosave=0;
|
||||
sigIRC.windowX = (int)sigIRC.window.getLocationOnScreen().getX();
|
||||
sigIRC.windowY = (int)sigIRC.window.getLocationOnScreen().getY();
|
||||
sigIRC.windowWidth = sigIRC.window.getWidth();
|
||||
sigIRC.windowHeight = sigIRC.window.getHeight();
|
||||
sigIRC.config.setInteger("windowX", sigIRC.windowX);
|
||||
sigIRC.config.setInteger("windowY", sigIRC.windowY);
|
||||
sigIRC.config.setInteger("windowWidth", sigIRC.windowWidth);
|
||||
sigIRC.config.setInteger("windowHeight", sigIRC.windowHeight);
|
||||
sigIRC.config.saveProperties();
|
||||
}
|
||||
if (sigIRC.lastPlayedDing>0) {
|
||||
sigIRC.lastPlayedDing--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateScrollingText() {
|
||||
for (int i=0;i<sigIRC.twitchemoticons.size();i++) {
|
||||
boolean keep = sigIRC.twitchemoticons.get(i).run();
|
||||
if (!keep) {
|
||||
sigIRC.twitchemoticons.remove(i--);
|
||||
}
|
||||
}
|
||||
for (int i=0;i<sigIRC.textobj.size();i++) {
|
||||
//System.out.println(sigIRC.textobj.get(i).getX()+","+sigIRC.textobj.get(i).getY());
|
||||
boolean keep = sigIRC.textobj.get(i).run();
|
||||
if (!keep) {
|
||||
sigIRC.textobj.remove(i--);
|
||||
}
|
||||
}
|
||||
ProcessTextRows();
|
||||
for (CustomSound cs : sigIRC.customsounds) {
|
||||
if (!cs.isSoundAvailable()) {
|
||||
cs.decreaseCooldown(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ProcessTextRows() {
|
||||
for (TextRow tr : sigIRC.rowobj) {
|
||||
tr.update();
|
||||
}
|
||||
sigIRC.dingEnabled = (sigIRC.textobj.size()<=sigIRC.dingThreshold);
|
||||
//System.out.println(sigIRC.textobj.size()+"/"+sigIRC.dingThreshold+sigIRC.dingEnabled);
|
||||
}
|
||||
}
|
@ -17,7 +17,6 @@ import java.util.Arrays;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import sig.MyPanel;
|
||||
import sig.sigIRC;
|
||||
import sig.modules.TouhouMotherModule;
|
||||
import sig.utils.DrawUtils;
|
||||
@ -48,7 +47,7 @@ public class SwapButton extends TouhouMotherButton{
|
||||
public void draw(Graphics g) {
|
||||
super.draw(g);
|
||||
if (displaytime>0) {
|
||||
DrawUtils.drawOutlineText(g, MyPanel.smallFont, x+buttonimg.getWidth()+4, y+buttonimg.getHeight(), 2, Color.WHITE, new Color(60,0,150), message);
|
||||
DrawUtils.drawOutlineText(g, sigIRC.smallFont, x+buttonimg.getWidth()+4, y+buttonimg.getHeight(), 2, Color.WHITE, new Color(60,0,150), message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class TouhouMotherButton {
|
||||
}
|
||||
|
||||
public void draw(Graphics g) {
|
||||
g.drawImage(buttonimg, x, y, sigIRC.panel);
|
||||
g.drawImage(buttonimg, x, y, null);
|
||||
}
|
||||
|
||||
public void onClickEvent(MouseEvent ev) {
|
||||
|
@ -11,7 +11,6 @@ import java.util.Arrays;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import sig.MyPanel;
|
||||
import sig.sigIRC;
|
||||
import sig.modules.TouhouMotherModule;
|
||||
import sig.utils.DrawUtils;
|
||||
@ -41,10 +40,10 @@ public class UpdateButton extends TouhouMotherButton{
|
||||
|
||||
public void draw(Graphics g) {
|
||||
if (buttonEnabled) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.smallFont, x-TextUtils.calculateStringBoundsFont(data[currentselection].split(",")[0], sigIRC.panel.smallFont).getWidth(), (int)module.getBounds().getY()+(int)module.getBounds().getHeight()-8, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
DrawUtils.drawOutlineText(g, sigIRC.smallFont, x-TextUtils.calculateStringBoundsFont(data[currentselection].split(",")[0], sigIRC.smallFont).getWidth(), (int)module.getBounds().getY()+(int)module.getBounds().getHeight()-8, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
data[currentselection].split(",")[0]);
|
||||
if (displaytime>0) {
|
||||
DrawUtils.drawOutlineText(g, MyPanel.smallFont, x-module.getBounds().getWidth()+buttonimg.getWidth()*2, y+buttonimg.getHeight(), 2, Color.WHITE, new Color(60,0,150), message);
|
||||
DrawUtils.drawOutlineText(g, sigIRC.smallFont, x-module.getBounds().getWidth()+buttonimg.getWidth()*2, y+buttonimg.getHeight(), 2, Color.WHITE, new Color(60,0,150), message);
|
||||
}
|
||||
super.draw(g);
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class TouhouMotherModule extends Module implements ActionListener{
|
||||
if (currentBoss!=null) {
|
||||
DrawBossAndPlayerInfo(g);
|
||||
} else {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, (int)position.getX()+4, (int)position.getY()+4+16, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
DrawUtils.drawOutlineText(g, sigIRC.programFont, (int)position.getX()+4, (int)position.getY()+4+16, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
DataProperty.getDataPropertyBasedOnID(data_display_id).getDisplayName());
|
||||
DrawSortedHealthbarsBasedOnDataProperty(g, DataProperty.getDataPropertyBasedOnID(data_display_id), 0, -64);
|
||||
}
|
||||
@ -144,23 +144,23 @@ public class TouhouMotherModule extends Module implements ActionListener{
|
||||
}
|
||||
|
||||
public void DrawBossAndPlayerInfo(Graphics g) {
|
||||
g.drawImage(bossImage, (int)position.getX()+4, (int)position.getY()+4, sigIRC.panel);
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+4, (int)position.getY()+4+16, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
g.drawImage(bossImage, (int)position.getX()+4, (int)position.getY()+4, null);
|
||||
DrawUtils.drawOutlineText(g, sigIRC.programFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+4, (int)position.getY()+4+16, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
currentBoss.getName());
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+4, (int)position.getY()+4+48, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
DrawUtils.drawOutlineText(g, sigIRC.userFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+4, (int)position.getY()+4+48, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
real_bossHP+" / "+bossMaxHP +" ("+Math.round(((real_bossHP/(double)bossMaxHP)*100))+"%)");
|
||||
DrawUtils.drawHealthbar(g, new Rectangle(
|
||||
Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+4,
|
||||
(int)position.getY()+4+20,
|
||||
(int)TextUtils.calculateStringBoundsFont(bossMaxHP+" / "+bossMaxHP +" ("+Math.round((1d*100))+"%", sigIRC.panel.userFont).getWidth(),
|
||||
(int)TextUtils.calculateStringBoundsFont(bossMaxHP+" / "+bossMaxHP +" ("+Math.round((1d*100))+"%", sigIRC.userFont).getWidth(),
|
||||
8
|
||||
), real_bossHP/(double)bossMaxHP, ChooseHealthbarColor(real_bossHP/(double)bossMaxHP));
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+16, (int)position.getY()+4+68, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
DrawUtils.drawOutlineText(g, sigIRC.userFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+16, (int)position.getY()+4+68, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
TextUtils.convertSecondsToTimeFormat(secondsCount));
|
||||
int record = TimeRecord.getRecord(currentBoss.getID());
|
||||
if (record!=TimeRecord.ERROR_VALUE) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.smallFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+
|
||||
TextUtils.calculateStringBoundsFont(TextUtils.convertSecondsToTimeFormat(secondsCount), sigIRC.panel.userFont).getWidth()+20,
|
||||
DrawUtils.drawOutlineText(g, sigIRC.smallFont, Math.min(bossImage.getWidth()+4,160)+(int)position.getX()+
|
||||
TextUtils.calculateStringBoundsFont(TextUtils.convertSecondsToTimeFormat(secondsCount), sigIRC.userFont).getWidth()+20,
|
||||
(int)position.getY()+4+72, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
"RECORD "+TextUtils.convertSecondsToTimeFormat(record));
|
||||
}
|
||||
@ -175,7 +175,7 @@ public class TouhouMotherModule extends Module implements ActionListener{
|
||||
int totaldmg = calculateDataPropertyTotalValue(property);
|
||||
for (int i=0;i<sorteddmg.length;i++) {
|
||||
if (sorteddmg[i]!=-1 && characterDatabase[sorteddmg[i]].getDataProperty(property)>0) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, Math.min(((bossImage!=null)?bossImage.getWidth():0)+4,160)+(int)position.getX()+4-Math.min(50, (bossImage!=null)?bossImage.getWidth():0)+x, (int)position.getY()+4+96+pos+y, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
DrawUtils.drawOutlineText(g, sigIRC.userFont, Math.min(((bossImage!=null)?bossImage.getWidth():0)+4,160)+(int)position.getX()+4-Math.min(50, (bossImage!=null)?bossImage.getWidth():0)+x, (int)position.getY()+4+96+pos+y, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
characterDatabase[sorteddmg[i]].getName());
|
||||
DrawUtils.drawHealthbar(g,
|
||||
new Rectangle(
|
||||
@ -186,7 +186,7 @@ public class TouhouMotherModule extends Module implements ActionListener{
|
||||
)
|
||||
, (double)characterDatabase[sorteddmg[i]].getDataProperty(property)/maxdmg, characterDatabase[sorteddmg[i]].getColor());
|
||||
DecimalFormat df = new DecimalFormat("0.0");
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.smallFont, Math.min((bossImage!=null)?bossImage.getWidth():0+4,160)+(int)position.getX()+4+Math.max(0, 50-((bossImage!=null)?bossImage.getWidth():0))+108+x, (int)position.getY()+4+96+pos+y, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
DrawUtils.drawOutlineText(g, sigIRC.smallFont, Math.min((bossImage!=null)?bossImage.getWidth():0+4,160)+(int)position.getX()+4+Math.max(0, 50-((bossImage!=null)?bossImage.getWidth():0))+108+x, (int)position.getY()+4+96+pos+y, 1, Color.WHITE, new Color(30,0,86,255),
|
||||
characterDatabase[sorteddmg[i]].getDataProperty(property)+" "+"("+df.format(((((double)characterDatabase[sorteddmg[i]].getDataProperty(property)/totaldmg))*100))+"%)");
|
||||
pos+=16;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class FancyNumber {
|
||||
public Rectangle draw(Graphics g, int x, int y) {
|
||||
int xoffset = 0;
|
||||
int yoffset = 0;
|
||||
g.drawImage(icon, x, y, sigIRC.panel);
|
||||
g.drawImage(icon, x, y, null);
|
||||
xoffset+=icon.getWidth()+4;
|
||||
if (displayedValue!=lastValue) {
|
||||
if (delayCount==0) {
|
||||
@ -77,11 +77,11 @@ public class FancyNumber {
|
||||
delayCount--;
|
||||
}
|
||||
}
|
||||
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, x+xoffset, y+yoffset+TextUtils.calculateStringBoundsFont(Integer.toString(displayedValue), sigIRC.panel.userFont).getHeight()/2+3, new Color(184,181,192), Integer.toString(displayedValue));
|
||||
xoffset+=TextUtils.calculateStringBoundsFont(Integer.toString(displayedValue), sigIRC.panel.userFont).getWidth()+4;
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, x+xoffset, y+yoffset+TextUtils.calculateStringBoundsFont(Integer.toString(displayedValue), sigIRC.userFont).getHeight()/2+3, new Color(184,181,192), Integer.toString(displayedValue));
|
||||
xoffset+=TextUtils.calculateStringBoundsFont(Integer.toString(displayedValue), sigIRC.userFont).getWidth()+4;
|
||||
if (lastValueChange>0) {
|
||||
lastValueChange--;
|
||||
g.drawImage((upArrow)?TwitchModule.UPARROWIMAGE:TwitchModule.DOWNARROWIMAGE, x+xoffset, y+yoffset, sigIRC.panel);
|
||||
g.drawImage((upArrow)?TwitchModule.UPARROWIMAGE:TwitchModule.DOWNARROWIMAGE, x+xoffset, y+yoffset, null);
|
||||
}
|
||||
xoffset+=((upArrow)?TwitchModule.UPARROWIMAGE.getWidth():TwitchModule.DOWNARROWIMAGE.getWidth())+4;
|
||||
return new Rectangle(x,y,xoffset,yoffset+16);
|
||||
|
@ -434,7 +434,7 @@ public class TwitchModule extends Module{
|
||||
new int[]{yoffset-4,yoffset-4,yoffset+16,yoffset+16},
|
||||
4);
|
||||
if (currentlyPlaying!=null && currentlyPlaying.length()>0) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, xoffset, yoffset+TextUtils.calculateStringBoundsFont(currentlyPlaying, sigIRC.panel.userFont).getHeight()/2+3, 2, g.getColor(), new Color(195,195,195), currentlyPlaying);xoffset+=TextUtils.calculateStringBoundsFont(currentlyPlaying, sigIRC.panel.userFont).getWidth()+16;
|
||||
DrawUtils.drawOutlineText(g, sigIRC.userFont, xoffset, yoffset+TextUtils.calculateStringBoundsFont(currentlyPlaying, sigIRC.userFont).getHeight()/2+3, 2, g.getColor(), new Color(195,195,195), currentlyPlaying);xoffset+=TextUtils.calculateStringBoundsFont(currentlyPlaying, sigIRC.userFont).getWidth()+16;
|
||||
}
|
||||
Rectangle offsets = DrawUptime(g, xoffset, yoffset);xoffset+=offsets.getWidth();
|
||||
offsets = views_numb.draw(g, xoffset, yoffset);xoffset+=offsets.getWidth();
|
||||
@ -445,10 +445,11 @@ public class TwitchModule extends Module{
|
||||
private Rectangle DrawUptime(Graphics g, int x, int y) {
|
||||
int xoffset = 0;
|
||||
int yoffset = 0;
|
||||
g.drawImage(UPTIMEIMAGE, x+xoffset, y+yoffset-2, sigIRC.panel);xoffset+=UPTIMEIMAGE.getWidth()+4;
|
||||
g.drawImage(UPTIMEIMAGE, x+xoffset, y+yoffset-2, null);
|
||||
xoffset+=UPTIMEIMAGE.getWidth()+4;
|
||||
String timediff = TimeUtils.GetTimeDifferenceFromCurrentDate(uptime);
|
||||
if (timediff.length()>0) {
|
||||
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, x+xoffset, y+yoffset+TextUtils.calculateStringBoundsFont(timediff, sigIRC.panel.userFont).getHeight()/2+3,new Color(184,181,192),timediff);xoffset+=TextUtils.calculateStringBoundsFont(timediff, sigIRC.panel.userFont).getWidth()+12;
|
||||
DrawUtils.drawTextFont(g, sigIRC.userFont, x+xoffset, y+yoffset+TextUtils.calculateStringBoundsFont(timediff, sigIRC.userFont).getHeight()/2+3,new Color(184,181,192),timediff);xoffset+=TextUtils.calculateStringBoundsFont(timediff, sigIRC.userFont).getWidth()+12;
|
||||
}
|
||||
yoffset+=16;
|
||||
return new Rectangle(x,y,xoffset,yoffset);
|
||||
@ -477,12 +478,12 @@ public class TwitchModule extends Module{
|
||||
//g.drawImage(follower_img, (int)bounds.getX()+xAlteration, (int)bounds.getY()+yAlteration, sigIRC.panel);
|
||||
//g.drawImage(follower_img, (int)bounds.getX(), (int)bounds.getY(), , , sigIRC.panel)
|
||||
g.drawImage(follower_img, (int)position.getX(), (int)position.getY()+canvasYOffset, (int)position.getX()+follower_img.getWidth()+canvasXOffset, (int)position.getY()+follower_img.getHeight(),
|
||||
-xAlteration, 0, follower_img.getWidth(), follower_img.getHeight()-yAlteration, sigIRC.panel);
|
||||
Rectangle2D usernameTextsize = TextUtils.calculateStringBoundsFont(announcedFollowerUser.getDisplayName(), sigIRC.panel.programFont);
|
||||
-xAlteration, 0, follower_img.getWidth(), follower_img.getHeight()-yAlteration, null);
|
||||
Rectangle2D usernameTextsize = TextUtils.calculateStringBoundsFont(announcedFollowerUser.getDisplayName(), sigIRC.programFont);
|
||||
int textY = (int)position.getY()+sigIRC.twitchmodule_followerText_Y+yAlteration;
|
||||
int textX = (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration;
|
||||
if (textY<position.getY()+position.getHeight() && textX+usernameTextsize.getWidth()>position.getX()) {
|
||||
DrawUtils.drawCenteredText(g, sigIRC.panel.programFont, (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration, (int)position.getY()+sigIRC.twitchmodule_followerText_Y+yAlteration, Color.BLACK, announcedFollowerUser.getDisplayName());
|
||||
DrawUtils.drawCenteredText(g, sigIRC.programFont, (int)position.getX()+sigIRC.twitchmodule_followerText_centerX+xAlteration, (int)position.getY()+sigIRC.twitchmodule_followerText_Y+yAlteration, Color.BLACK, announcedFollowerUser.getDisplayName());
|
||||
}
|
||||
if (announcedFollowerUser.getBio()!=null && !announcedFollowerUser.getBio().equalsIgnoreCase("null")) {
|
||||
if (followerUserLogo!=null) {
|
||||
@ -491,10 +492,10 @@ public class TwitchModule extends Module{
|
||||
int img_starty = (int)(position.getY()+follower_img.getHeight()+2-image_size/2);
|
||||
//g.setColor(Color.BLACK);
|
||||
//g.drawRect(img_startx, img_starty, image_size, image_size);
|
||||
g.drawImage(followerUserLogo, img_startx, img_starty, img_startx+image_size, img_starty+image_size, 0, 0, followerUserLogo.getWidth(), followerUserLogo.getHeight(), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerImgBackgroundColor), sigIRC.panel);
|
||||
g.drawImage(followerUserLogo, img_startx, img_starty, img_startx+image_size, img_starty+image_size, 0, 0, followerUserLogo.getWidth(), followerUserLogo.getHeight(), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerImgBackgroundColor),null);
|
||||
}
|
||||
if (announcedFollowerUser.getBio()!=null && announcedFollowerUser.getBio().length()>0) {
|
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.userFont, position.getX()+position.getWidth()-ticksPassed*3, position.getY()+follower_img.getHeight()+2+8, 2, TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerTextColor), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerShadowTextColor), announcedFollowerUser.getBio());
|
||||
DrawUtils.drawOutlineText(g, sigIRC.userFont, position.getX()+position.getWidth()-ticksPassed*3, position.getY()+follower_img.getHeight()+2+8, 2, TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerTextColor), TextUtils.convertStringToColor(sigIRC.twitchmodule_newfollowerShadowTextColor), announcedFollowerUser.getBio());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,10 @@ import sig.utils.FileUtils;
|
||||
import sig.utils.GithubUtils;
|
||||
import sig.utils.MemoryUtils;
|
||||
import sig.utils.TextUtils;
|
||||
import sig.windows.IntroDialog;
|
||||
import sig.windows.LoadingDialog;
|
||||
import sig.windows.ProgramWindow;
|
||||
import sig.windows.TwitchEmoteDownload;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
@ -67,7 +71,10 @@ import javax.imageio.ImageIO;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public class sigIRC{
|
||||
final public static String VERSION = "1.0";
|
||||
|
||||
public static MyPanel panel = null;
|
||||
public static boolean offlineMode = false;
|
||||
public static ColorPanel colorpanel = null;
|
||||
public static List<ScrollingText> textobj = new ArrayList<ScrollingText>();
|
||||
public static List<TextRow> rowobj = new ArrayList<TextRow>();
|
||||
@ -77,8 +84,8 @@ public class sigIRC{
|
||||
public static List<ChatLogTwitchEmote> chatlogtwitchemoticons = new ArrayList<ChatLogTwitchEmote>();
|
||||
public static List<CustomSound> customsounds = new ArrayList<CustomSound>();
|
||||
public static List<Module> modules = new ArrayList<Module>();
|
||||
static UpdateEvent updater = new UpdateEvent();
|
||||
static Timer programClock = new Timer(32,updater);
|
||||
//static UpdateEvent updater = new UpdateEvent();
|
||||
//static Timer programClock = new Timer(32,updater);
|
||||
final public static int BASESCROLLSPD = 4;
|
||||
final public static int ROWSEPARATION = 64;
|
||||
final public static String BASEDIR = "./";
|
||||
@ -86,35 +93,36 @@ public class sigIRC{
|
||||
final public static String WINDOWTITLE = "sigIRCv2";
|
||||
public final static String PROGRAM_EXECUTABLE_URL = "https://github.com/sigonasr2/sigIRCv2/raw/master/sigIRCv2.jar";
|
||||
public static ConfigFile config;
|
||||
static String server;
|
||||
public static String server;
|
||||
public static String nickname;
|
||||
public static String channel;
|
||||
public static boolean authenticated=false;
|
||||
public static int lastPlayedDing=0;
|
||||
final public static int DINGTIMER=150;
|
||||
static boolean dingEnabled=true;
|
||||
static int dingThreshold;
|
||||
static Color backgroundcol;
|
||||
public static BackgroundColorButton button;
|
||||
public static JFrame window;
|
||||
static boolean overlayMode=false;
|
||||
static boolean showWindowControls=false;
|
||||
static int windowX=0;
|
||||
static int windowY=0;
|
||||
static int windowWidth=0;
|
||||
static int windowHeight=0;
|
||||
static int chatRows=3;
|
||||
public static boolean dingEnabled=true;
|
||||
public static int dingThreshold;
|
||||
public static Color backgroundcol;
|
||||
//public static BackgroundColorButton button;
|
||||
public static ProgramWindow window;
|
||||
public static boolean overlayMode=false;
|
||||
public static boolean showWindowControls=false;
|
||||
public static boolean updateAvailable=false;
|
||||
public static int windowX=0;
|
||||
public static int windowY=0;
|
||||
public static int windowWidth=0;
|
||||
public static int windowHeight=0;
|
||||
public static int chatRows=3;
|
||||
static int chatScrollSpd=4;
|
||||
static int rowSpacing=64;
|
||||
static String messageFont="Gill Sans Ultra Bold Condensed";
|
||||
static String usernameFont="GillSansMTStd-Book";
|
||||
static String touhoumotherConsoleFont="Agency FB Bold";
|
||||
static boolean touhoumothermodule_enabled=false;
|
||||
static boolean twitchmodule_enabled=true;
|
||||
public static boolean touhoumothermodule_enabled=false;
|
||||
public static boolean twitchmodule_enabled=true;
|
||||
public static boolean chatlogmodule_enabled=true;
|
||||
static boolean downloadsComplete=false;
|
||||
static boolean hardwareAcceleration=true;
|
||||
static boolean playedoAuthSoundOnce=false;
|
||||
public static boolean downloadsComplete=false;
|
||||
public static boolean hardwareAcceleration=true;
|
||||
public static boolean playedoAuthSoundOnce=false;
|
||||
public static int twitchmodule_width=500;
|
||||
public static int twitchmodule_height=200;
|
||||
public static int twitchmodule_X=320;
|
||||
@ -157,10 +165,12 @@ public class sigIRC{
|
||||
public final static String SUBEMOTELISTFILE = "sigIRC/subemotes.json";
|
||||
public static long channel_id = -1;
|
||||
public static int lastSubEmoteUpdate = -1;
|
||||
public static boolean autoUpdateProgram = true;
|
||||
public static int framerate = 30;
|
||||
public static int autoUpdateProgram = 0; //0 = Auto Update, 1 = Notify, 2 = Disabled
|
||||
public static Image programIcon;
|
||||
final public static int MAX_CONNECTION_RETRIES = 100;
|
||||
public static int retryCounter = 0;
|
||||
public static long configNeedsUpdating = 0; //Set it to System.currentTimeMillis() to request a configuration save.
|
||||
|
||||
public static int subchannelCount = 0;
|
||||
public static HashMap<Long,String> subchannelIds = new HashMap<Long,String>();
|
||||
@ -169,9 +179,27 @@ public class sigIRC{
|
||||
public static boolean subEmotesCompleted=false;
|
||||
public static boolean disableChatMessages=false;
|
||||
|
||||
public static LoadingDialog loadingdialog;
|
||||
|
||||
static int lastWindowX = 0;
|
||||
static int lastWindowY = 0;
|
||||
|
||||
public static int scrollingchatmodule_X=0;
|
||||
public static int scrollingchatmodule_Y=0;
|
||||
public static int scrollingchatmodule_width=0;
|
||||
public static int scrollingchatmodule_height=0;
|
||||
|
||||
final public static Font rabiRibiTinyDisplayFont = new Font("CP Font",0,12);
|
||||
|
||||
final public static Font rabiRibiMoneyDisplayFont = new Font("CP Font",0,16);
|
||||
|
||||
final public static Font smallFont = new Font(touhoumotherConsoleFont,0,12);
|
||||
|
||||
final public static Font userFont = new Font(usernameFont,0,16);
|
||||
|
||||
//List<String> messages = new ArrayList<String>();
|
||||
final public static Font programFont = new Font(messageFont,0,24);
|
||||
|
||||
public static Twitch manager = new Twitch();
|
||||
|
||||
public static void main(String[] args) {
|
||||
@ -215,6 +243,10 @@ public class sigIRC{
|
||||
touhoumothermodule_Y = config.getInteger("TOUHOUMOTHER_module_Y",312);
|
||||
touhoumothermodule_width = config.getInteger("TOUHOUMOTHER_module_width",320);
|
||||
touhoumothermodule_height = config.getInteger("TOUHOUMOTHER_module_height",312);
|
||||
scrollingchatmodule_X = config.getInteger("SCROLLINGCHAT_module_X",0);
|
||||
scrollingchatmodule_Y = config.getInteger("SCROLLINGCHAT_module_Y",312);
|
||||
scrollingchatmodule_width = config.getInteger("SCROLLINGCHAT_module_width",320);
|
||||
scrollingchatmodule_height = config.getInteger("SCROLLINGCHAT_module_height",312);
|
||||
/*rabiribimodule_X = config.getInteger("RABIRIBI_module_X",0);
|
||||
rabiribimodule_Y = config.getInteger("RABIRIBI_module_Y",312);
|
||||
rabiribimodule_width = config.getInteger("RABIRIBI_module_width",320);
|
||||
@ -236,12 +268,20 @@ public class sigIRC{
|
||||
chatlogmodule_backgroundColor = config.getProperty("CHATLOG_module_BackgroundColor", "195,195,195,255");
|
||||
chatlogMessageHistory = config.getInteger("CHATLOG_module_MessageHistory",50);
|
||||
hardwareAcceleration = config.getBoolean("hardware_acceleration",true);
|
||||
autoUpdateProgram = config.getBoolean("Automatically_Update_Program", true);
|
||||
autoUpdateProgram = config.getInteger("Auto_Update_Program", 0);
|
||||
disableChatMessages = config.getBoolean("Disable_Chat_Messages", false);
|
||||
lastSubEmoteUpdate = config.getInteger("lastSubEmote_APIUpdate",Calendar.getInstance().get(Calendar.DAY_OF_YEAR));
|
||||
framerate = config.getInteger("Max_FPS",30);
|
||||
manager.setClientId("o4c2x0l3e82scgar4hpxg6m5dfjbem");
|
||||
//System.out.println(manager.auth().hasAccessToken());
|
||||
|
||||
//new IntroDialog();
|
||||
loadingdialog = new LoadingDialog();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
DownloadAllRequiredDependencies();
|
||||
|
||||
String[] filedata = FileUtils.readFromFile(BASEDIR+"sigIRC/oauthToken.txt");
|
||||
@ -266,7 +306,7 @@ public class sigIRC{
|
||||
downloadsComplete=true;
|
||||
}
|
||||
});
|
||||
InitializeIRCConnection(server, nickname, channel, oauth);
|
||||
InitializeIRCConnection(server, nickname, channel, oauth);*/
|
||||
}
|
||||
|
||||
private static void Initialize() {
|
||||
@ -289,6 +329,10 @@ public class sigIRC{
|
||||
return conf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Now handled by LoadingDialog.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void DownloadAllRequiredDependencies() {
|
||||
FileManager manager = new FileManager("sigIRC/oauthToken.txt"); manager.verifyAndFetchFileFromServer();
|
||||
manager = new FileManager("sigIRC/Emotes/",true); manager.verifyAndFetchFileFromServer();
|
||||
@ -330,29 +374,33 @@ public class sigIRC{
|
||||
System.out.println("Downloaded Dependencies. ");
|
||||
}
|
||||
|
||||
private static void DownloadProgramUpdate() {
|
||||
public static void DownloadProgramUpdate() {
|
||||
//System.out.println("Last commit size was "+GithubUtils.getSizeOfFileFromLatestGithubCommit("sigIRCv2.jar")+"B");
|
||||
if (autoUpdateProgram) {
|
||||
File updatedir = new File(sigIRC.BASEDIR+"sigIRC/updates/");
|
||||
updatedir.mkdirs();
|
||||
File controllerdir = new File(ControllerModule.CONTROLLERPATH);
|
||||
controllerdir.mkdirs();
|
||||
File programFile = new File(sigIRC.BASEDIR+"sigIRC/updates/sigIRCv2.jar");
|
||||
File currentProgramFile = new File(sigIRC.BASEDIR+"sigIRCv2.jar");
|
||||
System.out.println("File size is "+currentProgramFile.length());
|
||||
long fileSize = GithubUtils.getSizeOfFileFromLatestGithubCommit("sigIRCv2.jar");
|
||||
System.out.println("File size on Github is "+fileSize);
|
||||
if (fileSize!=programFile.length()) {
|
||||
System.out.println("File size on Github varies from currently running program... Downloading new program.");
|
||||
try {
|
||||
if (programFile.exists()) {
|
||||
programFile.delete();
|
||||
if (autoUpdateProgram==0) {
|
||||
Thread t = new Thread(()->{
|
||||
File updatedir = new File(sigIRC.BASEDIR+"sigIRC/updates/");
|
||||
updatedir.mkdirs();
|
||||
File controllerdir = new File(ControllerModule.CONTROLLERPATH);
|
||||
controllerdir.mkdirs();
|
||||
File programFile = new File(sigIRC.BASEDIR+"sigIRC/updates/sigIRCv2.jar");
|
||||
File currentProgramFile = new File(sigIRC.BASEDIR+"sigIRCv2.jar");
|
||||
System.out.println("File size is "+currentProgramFile.length());
|
||||
long fileSize = GithubUtils.getSizeOfFileFromLatestGithubCommit("sigIRCv2.jar");
|
||||
System.out.println("File size on Github is "+fileSize);
|
||||
if (fileSize!=programFile.length()) {
|
||||
System.out.println("File size on Github varies from currently running program... Downloading new program.");
|
||||
try {
|
||||
if (programFile.exists()) {
|
||||
programFile.delete();
|
||||
}
|
||||
org.apache.commons.io.FileUtils.copyURLToFile(new URL(sigIRC.PROGRAM_EXECUTABLE_URL),programFile);
|
||||
sigIRC.updateAvailable=true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
org.apache.commons.io.FileUtils.copyURLToFile(new URL(sigIRC.PROGRAM_EXECUTABLE_URL),programFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
|
||||
@ -490,17 +538,8 @@ public class sigIRC{
|
||||
//return true;
|
||||
}
|
||||
|
||||
private static void performTwitchEmoteUpdate() {
|
||||
public static void prepareTwitchEmoteUpdate() {
|
||||
try {
|
||||
JSONObject twitchemotes = FileUtils.readJsonFromUrl("https://twitchemotes.com/api_cache/v3/global.json");
|
||||
System.out.println("Twitch emote Json read.");
|
||||
for (String emotes : twitchemotes.keySet()) {
|
||||
JSONObject emote = twitchemotes.getJSONObject(emotes);
|
||||
int id = emote.getInt("id");
|
||||
String name = emote.getString("code");
|
||||
emoticons.add(new Emoticon(name, new URL(TWITCHEMOTEURL+id+"/1.0")));
|
||||
System.out.println("Emote "+id+" with name "+name);
|
||||
}
|
||||
//System.out.println("Subscriber object: "+subemotes);
|
||||
String[] channel_names = FileUtils.readFromFile(sigIRC.BASEDIR+"sigIRC/subscribers.txt");
|
||||
subchannelCount = channel_names.length;
|
||||
@ -523,30 +562,7 @@ public class sigIRC{
|
||||
}*/
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
emoticons.add(new Emoticon(":)","1"));
|
||||
emoticons.add(new Emoticon(":(","2"));
|
||||
emoticons.add(new Emoticon(":o","3"));
|
||||
emoticons.add(new Emoticon(":O","3"));
|
||||
emoticons.add(new Emoticon(":z","4"));
|
||||
emoticons.add(new Emoticon(":Z","4"));
|
||||
emoticons.add(new Emoticon("B)","5"));
|
||||
emoticons.add(new Emoticon(":\\","6"));
|
||||
emoticons.add(new Emoticon(":/","6"));
|
||||
emoticons.add(new Emoticon(";)","7"));
|
||||
emoticons.add(new Emoticon(";p","8"));
|
||||
emoticons.add(new Emoticon(";P","8"));
|
||||
emoticons.add(new Emoticon(":p","9"));
|
||||
emoticons.add(new Emoticon(":P","9"));
|
||||
emoticons.add(new Emoticon("R)","10"));
|
||||
emoticons.add(new Emoticon("o_O","20"));
|
||||
emoticons.add(new Emoticon("O_o","20"));
|
||||
emoticons.add(new Emoticon(":D","11"));
|
||||
emoticons.add(new Emoticon(">(","12"));
|
||||
emoticons.add(new Emoticon("<3","13"));
|
||||
}
|
||||
|
||||
/*private static void DefineEmoticons() {
|
||||
@ -566,6 +582,7 @@ public class sigIRC{
|
||||
public static void runIRCLoop(String channel, BufferedWriter writer, BufferedReader reader) throws IOException {
|
||||
String line;
|
||||
while ((line = reader.readLine( )) != null) {
|
||||
System.out.println("Waiting for data..."+line);
|
||||
if (line.toLowerCase( ).startsWith("PING ")) {
|
||||
// We must respond to PINGs to avoid being disconnected.
|
||||
writer.write("PONG " + line.substring(5) + "\r\n");
|
||||
@ -632,13 +649,13 @@ public class sigIRC{
|
||||
|
||||
f.setIconImage(programIcon);
|
||||
|
||||
button = new BackgroundColorButton(new File(sigIRC.BASEDIR+"backcolor.png"),panel.getX()+panel.getWidth()-96,64+rowobj.size()*rowSpacing);
|
||||
//button = new BackgroundColorButton(new File(sigIRC.BASEDIR+"backcolor.png"),panel.getX()+panel.getWidth()-96,64+rowobj.size()*rowSpacing);
|
||||
if (sigIRC.overlayMode) {
|
||||
f.setBackground(new Color(0,0,0,0));
|
||||
f.setAlwaysOnTop(true);
|
||||
}
|
||||
//f.setOpacity(0.5f);
|
||||
f.addWindowListener(sigIRC.panel);
|
||||
//f.addWindowListener(sigIRC.panel);
|
||||
return f;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.text.AttributedString;
|
||||
|
||||
import sig.MyPanel;
|
||||
import sig.sigIRC;
|
||||
|
||||
public class DrawUtils {
|
||||
public static void drawOutlineText(Graphics g, Font font, double x, double y, int outline_size, Color text_color, Color shadow_color, String message) {
|
||||
@ -56,7 +56,7 @@ public class DrawUtils {
|
||||
public static void drawText(Graphics g, double x, double y, Color color, String message) {
|
||||
if (message.length()>0) {
|
||||
AttributedString as = new AttributedString(message);
|
||||
as.addAttribute(TextAttribute.FONT, MyPanel.programFont);
|
||||
as.addAttribute(TextAttribute.FONT, sigIRC.programFont);
|
||||
g.setColor(color);
|
||||
g.drawString(as.getIterator(),(int)x,(int)y);
|
||||
}
|
||||
@ -106,6 +106,17 @@ public class DrawUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static Image getBlendedImage(Graphics g, Image img, Color blend_col, ImageObserver source) {
|
||||
BufferedImage tmp = new BufferedImage(img.getWidth(source),img.getHeight(source),BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2 = tmp.createGraphics();
|
||||
g2.drawImage(img, 0, 0, null);
|
||||
g2.setComposite(AlphaComposite.SrcAtop);
|
||||
g2.setColor(blend_col);
|
||||
g2.fillRect(0, 0, img.getWidth(source), img.getHeight(source));
|
||||
g2.dispose();
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static void drawImage(Graphics g, Image img, double x, double y, Color blend_col, ImageObserver source) {
|
||||
BufferedImage tmp = new BufferedImage(img.getWidth(source),img.getHeight(source),BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2 = tmp.createGraphics();
|
||||
@ -114,7 +125,7 @@ public class DrawUtils {
|
||||
g2.setColor(blend_col);
|
||||
g2.fillRect(0, 0, img.getWidth(source), img.getHeight(source));
|
||||
g2.dispose();
|
||||
g.drawImage(tmp,(int)x,(int)y,source);
|
||||
g.drawImage(tmp,(int)x,(int)y,null);
|
||||
}
|
||||
|
||||
public static void drawImageScaled(Graphics g, Image img, double x, double y, double xsize, double ysize, Color blend_col, ImageObserver source) {
|
||||
@ -125,7 +136,7 @@ public class DrawUtils {
|
||||
g2.setColor(blend_col);
|
||||
g2.fillRect(0, 0, img.getWidth(source), img.getHeight(source));
|
||||
g2.dispose();
|
||||
g.drawImage(tmp,(int)x,(int)y,(int)xsize,(int)ysize,source);
|
||||
g.drawImage(tmp,(int)x,(int)y,(int)xsize,(int)ysize,null);
|
||||
}
|
||||
|
||||
public static Color invertColor(Color c) {
|
||||
|
@ -11,6 +11,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Reader;
|
||||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
@ -207,18 +208,21 @@ public class FileUtils {
|
||||
}
|
||||
|
||||
public static JSONObject readJsonFromUrl(String url, String file, boolean writeToFile) throws IOException, JSONException {
|
||||
InputStream is = new URL(url).openStream();
|
||||
InputStream is;
|
||||
try {
|
||||
is = new URL(url).openStream();
|
||||
BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
|
||||
String jsonText = readAll(rd);
|
||||
if (writeToFile) {
|
||||
writetoFile(new String[]{jsonText},file);
|
||||
}
|
||||
JSONObject json = new JSONObject(jsonText);
|
||||
return json;
|
||||
} finally {
|
||||
is.close();
|
||||
return json;
|
||||
} catch (UnknownHostException e) {
|
||||
sigIRC.offlineMode = true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static JSONArray readJsonArrayFromUrl(String url, String file, boolean writeToFile) throws IOException, JSONException {
|
||||
|
@ -12,7 +12,8 @@ import sig.sigIRC;
|
||||
public class TextUtils {
|
||||
|
||||
public static Rectangle2D calculateStringBoundsFont(String msg, Font font) {
|
||||
FontRenderContext frc = sigIRC.panel.getFontMetrics(font).getFontRenderContext();
|
||||
//System.out.println(sigIRC.loadingdialog);
|
||||
FontRenderContext frc = sigIRC.loadingdialog.getFontMetrics(font).getFontRenderContext();
|
||||
return font.getStringBounds(msg, frc);
|
||||
}
|
||||
|
||||
|
416
src/sig/windows/IntroDialog.java
Normal file
416
src/sig/windows/IntroDialog.java
Normal file
@ -0,0 +1,416 @@
|
||||
package sig.windows;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Desktop;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.FontFormatException;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.net.Socket;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Box;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.border.TitledBorder;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import javax.swing.text.BadLocationException;
|
||||
import javax.swing.text.html.HTMLDocument;
|
||||
|
||||
import sig.sigIRC;
|
||||
import sig.modules.RabiRaceModule;
|
||||
import sig.utils.FileUtils;
|
||||
|
||||
public class IntroDialog extends JFrame{
|
||||
Font systemFont;
|
||||
final static Color panelBackgroundColor = new Color(192,192,192);
|
||||
JPanel displayPanel;
|
||||
JPanel borderPanel;
|
||||
JPanel buttonPanel;
|
||||
JButton nextbutton;
|
||||
JButton exitbutton;
|
||||
JButton backbutton;
|
||||
JEditorPane introText;
|
||||
TitledBorder border;
|
||||
JTextField nameBox,oauthTokenBox;
|
||||
JPanel namePanel;
|
||||
JLabel nameLabel;
|
||||
JLabel oauthLabel;
|
||||
JScrollPane scrollDisplayPanel;
|
||||
JButton openWebpage;
|
||||
ModuleButton[] moduleButtons;
|
||||
JComboBox<String> updateType;
|
||||
|
||||
static Icon deselected_icon,selected_icon;
|
||||
|
||||
public IntroDialog() {
|
||||
this.setLocationByPlatform(true);
|
||||
this.setVisible(true);
|
||||
this.setTitle("sigIRCv2 v"+sigIRC.VERSION);
|
||||
|
||||
InputStream stream = sigIRC.class.getResourceAsStream("/resource/CP_Font.ttf");
|
||||
//File font = new File(sigIRC.BASEDIR+"sigIRC/CP_Font.ttf");
|
||||
|
||||
try {
|
||||
systemFont = Font.createFont(Font.TRUETYPE_FONT,stream);
|
||||
GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(systemFont);
|
||||
systemFont = new Font("CP Font",0,16);
|
||||
} catch (FontFormatException | IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
borderPanel = new JPanel();
|
||||
displayPanel = new JPanel();
|
||||
buttonPanel = new JPanel();
|
||||
namePanel = new JPanel();
|
||||
namePanel.setBackground(panelBackgroundColor);
|
||||
namePanel.setPreferredSize(new Dimension(560,320));
|
||||
nameBox = new JTextField(30);
|
||||
oauthTokenBox = new JTextField(30);
|
||||
//dialogPanel.setSize(this.getSize());
|
||||
border = BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.BLACK, 2, true),"Welcome to sigIRC!",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,systemFont);
|
||||
borderPanel.setBorder(border);
|
||||
|
||||
this.add(borderPanel);
|
||||
|
||||
try {
|
||||
this.setIconImage(ImageIO.read(sigIRC.class.getResource("/resource/sigIRCicon.png")));
|
||||
deselected_icon = new ImageIcon(ImageIO.read(sigIRC.class.getResource("/resource/deselected_button.png")));
|
||||
selected_icon = new ImageIcon(ImageIO.read(sigIRC.class.getResource("/resource/selected_button.png")));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
moduleButtons = new ModuleButton[]{
|
||||
new ModuleButton("Scrolling Chat"),
|
||||
new ModuleButton("Chat Log"),
|
||||
new ModuleButton("Controller"),
|
||||
new ModuleButton("Twitch"),
|
||||
new ModuleButton("Rabi-Race"),
|
||||
new ModuleButton("Touhou Mother"),
|
||||
};
|
||||
|
||||
moduleButtons[0].setSelected(true);
|
||||
moduleButtons[1].setSelected(true);
|
||||
moduleButtons[3].setSelected(true);
|
||||
|
||||
introText = new JEditorPane();
|
||||
try {
|
||||
introText.setPage(sigIRC.class.getResource("/resource/text/introText.html"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
introText.setPreferredSize(new Dimension(560, 320));
|
||||
introText.setEditable(false);
|
||||
introText.setBackground(panelBackgroundColor);
|
||||
|
||||
|
||||
backbutton = new JButton("< Back");
|
||||
backbutton.setPreferredSize(new Dimension(128,24));
|
||||
backbutton.setActionCommand("2");
|
||||
backbutton.setEnabled(false);
|
||||
backbutton.addActionListener(new ActionListener(){
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
setupBackPage(ev.getActionCommand());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
nextbutton = new JButton("Next >");
|
||||
nextbutton.setPreferredSize(new Dimension(128,24));
|
||||
nextbutton.setActionCommand("2");
|
||||
nextbutton.addActionListener(new ActionListener(){
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
setupPage(ev.getActionCommand());
|
||||
}
|
||||
|
||||
});
|
||||
exitbutton = new JButton("Exit");
|
||||
exitbutton.setPreferredSize(new Dimension(128,24));
|
||||
|
||||
displayPanel.setPreferredSize(new Dimension(680,360));
|
||||
|
||||
scrollDisplayPanel = new JScrollPane();
|
||||
scrollDisplayPanel.setViewportView(introText);
|
||||
scrollDisplayPanel.setPreferredSize(introText.getPreferredSize());
|
||||
scrollDisplayPanel.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
scrollDisplayPanel.setBorder(null);
|
||||
displayPanel.add(scrollDisplayPanel);
|
||||
displayPanel.add(namePanel);
|
||||
displayPanel.setBackground(panelBackgroundColor);
|
||||
|
||||
buttonPanel.setPreferredSize(new Dimension(680,48));
|
||||
|
||||
buttonPanel.add(Box.createHorizontalStrut(128));
|
||||
buttonPanel.add(backbutton);
|
||||
buttonPanel.add(Box.createHorizontalStrut(12));
|
||||
buttonPanel.add(nextbutton);
|
||||
buttonPanel.add(Box.createHorizontalStrut(80));
|
||||
buttonPanel.add(exitbutton);
|
||||
buttonPanel.setBackground(panelBackgroundColor);
|
||||
|
||||
borderPanel.add(displayPanel);
|
||||
borderPanel.add(buttonPanel);
|
||||
|
||||
borderPanel.setBackground(panelBackgroundColor);
|
||||
|
||||
this.setSize(720, 480);
|
||||
this.setBackground(panelBackgroundColor);
|
||||
this.setResizable(false);
|
||||
}
|
||||
|
||||
protected void setupBackPage(String page) {
|
||||
switch (page) {
|
||||
case "2":{
|
||||
setupPage("1");
|
||||
}break;
|
||||
case "3":{
|
||||
setupPage("2");
|
||||
}break;
|
||||
case "4":{
|
||||
setupPage("3");
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
protected void setupPage(String page) {
|
||||
switch (page) {
|
||||
case "1":{
|
||||
scrollDisplayPanel.setPreferredSize(new Dimension(560, 320));
|
||||
try {
|
||||
introText.setPage(sigIRC.class.getResource("/resource/text/introText.html"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
displayPanel.validate();
|
||||
backbutton.setEnabled(false);
|
||||
nextbutton.setActionCommand("2");
|
||||
namePanel.removeAll();
|
||||
namePanel.validate();
|
||||
border.setTitle("Welcome to sigIRC!");
|
||||
borderPanel.repaint();
|
||||
}break;
|
||||
case "2":{
|
||||
border.setTitle("Setup Twitch Account");
|
||||
borderPanel.repaint();
|
||||
try {
|
||||
introText.setPage(sigIRC.class.getResource("/resource/text/setupTwitchName.html"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
scrollDisplayPanel.setPreferredSize(new Dimension(560,180));
|
||||
nameLabel = new JLabel("Twitch Username: ");
|
||||
namePanel.removeAll();
|
||||
namePanel.add(nameLabel);
|
||||
namePanel.add(nameBox);
|
||||
namePanel.setPreferredSize(new Dimension(560,320));
|
||||
namePanel.setBackground(panelBackgroundColor);
|
||||
nextbutton.setActionCommand("3");
|
||||
backbutton.setActionCommand("2");
|
||||
namePanel.validate();
|
||||
displayPanel.validate();
|
||||
displayPanel.repaint();
|
||||
backbutton.setEnabled(true);
|
||||
}break;
|
||||
case "3":{
|
||||
border.setTitle("Setup Twitch Account");
|
||||
borderPanel.repaint();
|
||||
if (nameBox.getText().length()==0) {
|
||||
JOptionPane.showMessageDialog(this, "You must enter a Twitch Username!", "Error!", JOptionPane.WARNING_MESSAGE);
|
||||
break;
|
||||
}
|
||||
try {
|
||||
introText.setPage(sigIRC.class.getResource("/resource/text/setupoauthToken.html"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
openWebpage = new JButton("Get oauthToken");
|
||||
openWebpage.addActionListener(new ActionListener(){
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI("https://twitchapps.com/tmi/"));
|
||||
} catch (IOException | URISyntaxException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
scrollDisplayPanel.setPreferredSize(new Dimension(560,180));
|
||||
nextbutton.setActionCommand("4");
|
||||
backbutton.setActionCommand("3");
|
||||
try {
|
||||
introText.setPage(sigIRC.class.getResource("/resource/text/setupoauthToken.html"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
oauthLabel = new JLabel("Twitch oauth Token:");
|
||||
namePanel.removeAll();
|
||||
namePanel.add(openWebpage);
|
||||
namePanel.add(Box.createRigidArea(new Dimension(640,32)));
|
||||
namePanel.add(oauthLabel);
|
||||
namePanel.add(oauthTokenBox);
|
||||
namePanel.validate();
|
||||
}break;
|
||||
case "4":{
|
||||
oauthTokenBox.setText(oauthTokenBox.getText().trim());
|
||||
if (oauthTokenBox.getText().length()!=36) {
|
||||
JOptionPane.showMessageDialog(this, "An oauth Token is 36 characters long. Please verify you have copied and pasted it correctly! (Include the oauth: part)", "Error!", JOptionPane.WARNING_MESSAGE);
|
||||
break;
|
||||
}
|
||||
border.setTitle("Connecting to Twitch...");
|
||||
borderPanel.repaint();
|
||||
this.repaint();
|
||||
if (!AttemptConnection()) {
|
||||
JOptionPane.showMessageDialog(this, "Failed to authenticate with Twitch! Please verify your username, oauth Token, and Internet Connection and then try again.", "Error!", JOptionPane.WARNING_MESSAGE);
|
||||
border.setTitle("Setup Twitch Account");
|
||||
borderPanel.repaint();
|
||||
break;
|
||||
}
|
||||
border.setTitle("Successfully Authenticated!");
|
||||
borderPanel.repaint();
|
||||
try {
|
||||
introText.setPage(sigIRC.class.getResource("/resource/text/setupProgramSettings.html"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
scrollDisplayPanel.setPreferredSize(new Dimension(560,200));
|
||||
namePanel.removeAll();
|
||||
JLabel label = new JLabel("Program Updating Behavior: ");
|
||||
JLabel modulelabel = new JLabel("Select all Modules you want enabled:");
|
||||
updateType = new JComboBox<String>();
|
||||
updateType.addItem("Automatically Update");
|
||||
updateType.addItem("Notify when Update Available");
|
||||
updateType.addItem("Never Update");
|
||||
namePanel.add(label);
|
||||
namePanel.add(updateType);
|
||||
namePanel.add(Box.createRigidArea(new Dimension(520,4)));
|
||||
namePanel.add(modulelabel);
|
||||
namePanel.add(Box.createRigidArea(new Dimension(520,4)));
|
||||
for (ModuleButton button : moduleButtons) {
|
||||
namePanel.add(button);
|
||||
}
|
||||
nextbutton.setActionCommand("5");
|
||||
backbutton.setActionCommand("4");
|
||||
//namePanel.setMinimumSize(new Dimension(560,64));
|
||||
namePanel.validate();
|
||||
displayPanel.validate();
|
||||
displayPanel.repaint();
|
||||
sigIRC.config.setProperty("nickname", nameBox.getText());
|
||||
sigIRC.config.setProperty("channel", "#"+nameBox.getText());
|
||||
sigIRC.config.saveProperties();
|
||||
FileUtils.writetoFile(new String[]{oauthTokenBox.getText()}, sigIRC.BASEDIR+"sigIRC/oauthToken.txt");
|
||||
}break;
|
||||
case "5":{
|
||||
sigIRC.disableChatMessages = !moduleButtons[0].isSelected();
|
||||
sigIRC.chatlogmodule_enabled = moduleButtons[1].isSelected();
|
||||
sigIRC.controllermodule_enabled = moduleButtons[2].isSelected();
|
||||
sigIRC.twitchmodule_enabled = moduleButtons[3].isSelected();
|
||||
sigIRC.rabiracemodule_enabled = moduleButtons[4].isSelected();
|
||||
sigIRC.touhoumothermodule_enabled = moduleButtons[5].isSelected();
|
||||
sigIRC.config.setBoolean("Disable_Chat_Messages", sigIRC.disableChatMessages);
|
||||
sigIRC.config.setBoolean("Module_chatlog_Enabled", sigIRC.chatlogmodule_enabled);
|
||||
sigIRC.config.setBoolean("Module_controller_Enabled", sigIRC.controllermodule_enabled);
|
||||
sigIRC.config.setBoolean("Module_twitch_Enabled", sigIRC.twitchmodule_enabled);
|
||||
sigIRC.config.setBoolean("Module_rabirace_Enabled", sigIRC.rabiracemodule_enabled);
|
||||
sigIRC.config.setBoolean("Module_touhoumother_Enabled", sigIRC.touhoumothermodule_enabled);
|
||||
switch ((String)updateType.getSelectedItem()) {
|
||||
case "Automatically Update":{
|
||||
sigIRC.autoUpdateProgram = 0;
|
||||
}break;
|
||||
case "Notify when Update Available":{
|
||||
sigIRC.autoUpdateProgram = 1;
|
||||
}break;
|
||||
case "Never Update":{
|
||||
sigIRC.autoUpdateProgram = 2;
|
||||
}break;
|
||||
}
|
||||
sigIRC.config.setInteger("Auto_Update_Program", sigIRC.autoUpdateProgram);
|
||||
sigIRC.config.saveProperties();
|
||||
this.invalidate();
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean AttemptConnection() {
|
||||
Socket socket;
|
||||
try {
|
||||
socket = new Socket(sigIRC.server, 6667);
|
||||
BufferedWriter writer = new BufferedWriter(
|
||||
new OutputStreamWriter(socket.getOutputStream( )));
|
||||
BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(socket.getInputStream( )));
|
||||
|
||||
// Log on to the server.
|
||||
writer.write("PASS " + oauthTokenBox.getText() + "\r\n");
|
||||
writer.write("NICK " + nameBox.getText() + "\r\n");
|
||||
writer.flush( );
|
||||
return sigIRC.VerifyLogin(reader);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class ModuleButton extends JToggleButton{
|
||||
String label = "";
|
||||
ModuleButton button;
|
||||
public ModuleButton(String label) {
|
||||
this.label = label;
|
||||
this.button = this;
|
||||
this.setBackground(Color.DARK_GRAY);
|
||||
button.setForeground(Color.GRAY);
|
||||
button.setIconTextGap(4);
|
||||
button.setIcon(IntroDialog.deselected_icon);
|
||||
button.setSelectedIcon(IntroDialog.selected_icon);
|
||||
this.setText(label);
|
||||
this.addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
if (button.isSelected()) {
|
||||
button.setForeground(Color.BLUE);
|
||||
}
|
||||
else {
|
||||
button.setBackground(Color.DARK_GRAY);
|
||||
button.setForeground(Color.GRAY);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
226
src/sig/windows/LoadingDialog.java
Normal file
226
src/sig/windows/LoadingDialog.java
Normal file
@ -0,0 +1,226 @@
|
||||
package sig.windows;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JProgressBar;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import sig.Emoticon;
|
||||
import sig.FileManager;
|
||||
import sig.sigIRC;
|
||||
import sig.modules.RabiRace.Avatar;
|
||||
import sig.modules.RabiRace.MemoryData;
|
||||
import sig.utils.FileUtils;
|
||||
|
||||
public class LoadingDialog extends JFrame{
|
||||
JProgressBar bar = new JProgressBar();
|
||||
List<FileManager> managers = new ArrayList<FileManager>();
|
||||
FakeFileManager programUpdate = new FakeFileManager("_FAKE_");
|
||||
FakeFileManager twitchEmoteUpdate = new FakeFileManager("_FAKE_");
|
||||
public JPanel panel;
|
||||
public static List<TwitchEmoteDownload> emotes = new ArrayList<TwitchEmoteDownload>();
|
||||
|
||||
public LoadingDialog() {
|
||||
sigIRC.loadingdialog = this;
|
||||
panel = new JPanel();
|
||||
|
||||
managers.add(new FileManager("sigIRC/oauthToken.txt"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/",true));
|
||||
managers.add(new FileManager("sigIRC/subscribers.txt"));
|
||||
managers.add(new FileManager("sigIRC/logs/",true));
|
||||
managers.add(new FileManager("sigIRC/sounds/",true));
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/",true));
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/unknown.png"));
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/characters",true));
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/items",true));
|
||||
//managers.add(new FileManager("sigIRC/sounds/Glaceon_cry.wav")
|
||||
File follower_sounds_folder = new File(sigIRC.BASEDIR+"sigIRC/follower_sounds");
|
||||
if (!follower_sounds_folder.exists()) {
|
||||
managers.add(new FileManager("sigIRC/follower_sounds/Glaceon_cry.wav"));
|
||||
managers.add(new FileManager("sigIRC/follower_sounds/README.txt"));
|
||||
}
|
||||
managers.add(new FileManager("sigIRC/record"));
|
||||
managers.add(new FileManager("sigIRC/glaceon_follower.png"));
|
||||
managers.add(new FileManager("sigIRC/sigIRCicon.png"));
|
||||
managers.add(new FileManager("sigIRC/icon_down_arrow.png"));
|
||||
managers.add(new FileManager("sigIRC/icon_follower_count.png"));
|
||||
managers.add(new FileManager("sigIRC/icon_up_arrow.png"));
|
||||
managers.add(new FileManager("sigIRC/icon_uptime.png"));
|
||||
managers.add(new FileManager("sigIRC/icon_viewers_count.png"));
|
||||
managers.add(new FileManager("sigIRC/icon_views_count.png"));
|
||||
managers.add(new FileManager("sigIRC/message_separator.png"));
|
||||
managers.add(new FileManager("sigIRC/controller/2-way_axis.png"));
|
||||
managers.add(new FileManager("sigIRC/controller/4-way_axis.png"));
|
||||
managers.add(new FileManager("sigIRC/controller/controller_overlay.png"));
|
||||
managers.add(new FileManager("sigIRC/controller/controller_template.png"));
|
||||
managers.add(new FileManager("sigIRC/CP_Font.ttf"));
|
||||
managers.add(new FileManager("kill.png"));
|
||||
managers.add(new FileManager("memory"));
|
||||
managers.add(new FileManager("swap.png"));
|
||||
managers.add(new FileManager("update.png"));
|
||||
managers.add(new FileManager("backcolor.png"));
|
||||
managers.add(new FileManager("drag_bar.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/1.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/2.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/3.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/4.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/5.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/6.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/7.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/8.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/9.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/10.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/11.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/12.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/13.png"));
|
||||
managers.add(new FileManager("sigIRC/Emotes/20.png"));
|
||||
managers.add(programUpdate);
|
||||
|
||||
if (sigIRC.rabiracemodule_enabled) {
|
||||
for (MemoryData data : MemoryData.values()) {
|
||||
//Attempt to fetch from server.
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/items/"+data.img_path));
|
||||
}
|
||||
for (Avatar avatar : Avatar.values()) {
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/characters/"+avatar.fileName));
|
||||
}
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/items/easter_egg.png"));
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/items/health_up.png"));
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/items/mana_up.png"));
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/items/regen_up.png"));
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/items/pack_up.png"));
|
||||
managers.add(new FileManager("sigIRC/rabi-ribi/items/attack_up.png"));
|
||||
}
|
||||
|
||||
if (!sigIRC.offlineMode) {
|
||||
JSONObject twitchemotes;
|
||||
try {
|
||||
twitchemotes = FileUtils.readJsonFromUrl("https://twitchemotes.com/api_cache/v3/global.json");
|
||||
System.out.println("Twitch emote Json read.");
|
||||
if (twitchemotes!=null) {
|
||||
for (String emotes : twitchemotes.keySet()) {
|
||||
JSONObject emote = twitchemotes.getJSONObject(emotes);
|
||||
int id = emote.getInt("id");
|
||||
String name = emote.getString("code");
|
||||
LoadingDialog.emotes.add(new TwitchEmoteDownload(name,id));
|
||||
managers.add(new FakeFileManager("_FAKE_"));
|
||||
//emoticons.add(new Emoticon(name, new URL(TWITCHEMOTEURL+id+"/1.0")));
|
||||
System.out.println("Emote "+id+" with name "+name);
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException | JSONException | IOException e) {
|
||||
sigIRC.offlineMode=true;
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
bar.setValue(0);
|
||||
bar.setMaximum(managers.size());
|
||||
bar.setPreferredSize(new Dimension(240,24));
|
||||
bar.setString("Downloading resources... (0/"+managers.size()+")");
|
||||
bar.setStringPainted(true);
|
||||
|
||||
panel.setSize(new Dimension(260,30));
|
||||
|
||||
panel.add(bar);
|
||||
|
||||
this.add(panel);
|
||||
|
||||
this.setSize(new Dimension(260,36));
|
||||
this.setLocationByPlatform(true);
|
||||
this.setMinimumSize(new Dimension(260, 36));
|
||||
this.setMaximumSize(new Dimension(260, 36));
|
||||
this.setUndecorated(true);
|
||||
this.setVisible(true);
|
||||
this.setAlwaysOnTop(true);
|
||||
this.setFocusable(false);
|
||||
|
||||
for (FileManager manager : managers) {
|
||||
if (manager.verifyAndFetchFileFromServer()) {
|
||||
bar.setValue(bar.getValue()+1);
|
||||
UpdateBar();
|
||||
}
|
||||
}
|
||||
|
||||
for (TwitchEmoteDownload d : emotes) {
|
||||
try {
|
||||
if (!sigIRC.offlineMode) {
|
||||
d.download();
|
||||
}
|
||||
bar.setValue(bar.getValue()+1);
|
||||
UpdateBar();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (!sigIRC.offlineMode) {
|
||||
sigIRC.prepareTwitchEmoteUpdate();
|
||||
}
|
||||
twitchEmoteUpdate.setDone();
|
||||
bar.setValue(bar.getValue()+1);
|
||||
UpdateBar();
|
||||
if (!sigIRC.offlineMode) {
|
||||
sigIRC.DownloadProgramUpdate();
|
||||
}
|
||||
programUpdate.setDone();
|
||||
bar.setValue(bar.getValue()+1);
|
||||
UpdateBar();
|
||||
|
||||
sigIRC.emoticons.add(new Emoticon(":)","1"));
|
||||
sigIRC.emoticons.add(new Emoticon(":(","2"));
|
||||
sigIRC.emoticons.add(new Emoticon(":o","3"));
|
||||
sigIRC.emoticons.add(new Emoticon(":O","3"));
|
||||
sigIRC.emoticons.add(new Emoticon(":z","4"));
|
||||
sigIRC.emoticons.add(new Emoticon(":Z","4"));
|
||||
sigIRC.emoticons.add(new Emoticon("B)","5"));
|
||||
sigIRC.emoticons.add(new Emoticon(":\\","6"));
|
||||
sigIRC.emoticons.add(new Emoticon(":/","6"));
|
||||
sigIRC.emoticons.add(new Emoticon(";)","7"));
|
||||
sigIRC.emoticons.add(new Emoticon(";p","8"));
|
||||
sigIRC.emoticons.add(new Emoticon(";P","8"));
|
||||
sigIRC.emoticons.add(new Emoticon(":p","9"));
|
||||
sigIRC.emoticons.add(new Emoticon(":P","9"));
|
||||
sigIRC.emoticons.add(new Emoticon("R)","10"));
|
||||
sigIRC.emoticons.add(new Emoticon("o_O","20"));
|
||||
sigIRC.emoticons.add(new Emoticon("O_o","20"));
|
||||
sigIRC.emoticons.add(new Emoticon(":D","11"));
|
||||
sigIRC.emoticons.add(new Emoticon(">(","12"));
|
||||
sigIRC.emoticons.add(new Emoticon("<3","13"));
|
||||
|
||||
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//Load is done. Start up the panel.
|
||||
sigIRC.window = new ProgramWindow();
|
||||
this.setVisible(false);
|
||||
sigIRC.downloadsComplete=true;
|
||||
}
|
||||
|
||||
private void UpdateBar() {
|
||||
bar.setString("Downloading resources... ("+bar.getValue()+"/"+managers.size()+")");
|
||||
}
|
||||
}
|
||||
|
||||
class FakeFileManager extends FileManager{
|
||||
boolean done=false;
|
||||
public FakeFileManager(String location) {
|
||||
super(location);
|
||||
}
|
||||
public void setDone() {
|
||||
done=true;
|
||||
}
|
||||
}
|
46
src/sig/windows/ModuleSelectButton.java
Normal file
46
src/sig/windows/ModuleSelectButton.java
Normal file
@ -0,0 +1,46 @@
|
||||
package sig.windows;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import sig.Module;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
class ModuleSelectButton extends JToggleButton{
|
||||
String label = "";
|
||||
ModuleSelectButton button;
|
||||
Module myModule;
|
||||
public ModuleSelectButton(String label, Module module) {
|
||||
this.label=label;
|
||||
this.button=this;
|
||||
this.myModule=module;
|
||||
this.setBackground(Color.DARK_GRAY);
|
||||
this.setText(label);
|
||||
this.setToolTipText("Click to enable and disable the \n"+label+" module.");
|
||||
this.setPreferredSize(new Dimension(160,56));
|
||||
this.setForeground(Color.GRAY);
|
||||
this.setIconTextGap(4);
|
||||
this.setSelectedIcon(ProgramWindow.selected_icon);
|
||||
this.setIcon(ProgramWindow.deselected_icon);
|
||||
this.setSelected(true);
|
||||
button.setForeground(Color.BLUE);
|
||||
this.addChangeListener(new ChangeListener() {
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
if (button.isSelected()) {
|
||||
button.setForeground(Color.BLUE);
|
||||
}
|
||||
else {
|
||||
button.setBackground(Color.DARK_GRAY);
|
||||
button.setForeground(Color.GRAY);
|
||||
}
|
||||
myModule.setVisible(button.isSelected());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
6
src/sig/windows/ProgramText.java
Normal file
6
src/sig/windows/ProgramText.java
Normal file
@ -0,0 +1,6 @@
|
||||
package sig.windows;
|
||||
|
||||
public class ProgramText {
|
||||
public static String intro_text = "Welcome to sigIRCv2!"
|
||||
+ "";
|
||||
}
|
169
src/sig/windows/ProgramWindow.java
Normal file
169
src/sig/windows/ProgramWindow.java
Normal file
@ -0,0 +1,169 @@
|
||||
package sig.windows;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.Image;
|
||||
import java.awt.MouseInfo;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
import javazoom.jlgui.basicplayer.BasicController;
|
||||
import javazoom.jlgui.basicplayer.BasicPlayer;
|
||||
import javazoom.jlgui.basicplayer.BasicPlayerEvent;
|
||||
import javazoom.jlgui.basicplayer.BasicPlayerException;
|
||||
import javazoom.jlgui.basicplayer.BasicPlayerListener;
|
||||
import sig.BackgroundColorButton;
|
||||
import sig.ColorPanel;
|
||||
import sig.Module;
|
||||
import sig.MyPanel;
|
||||
import sig.sigIRC;
|
||||
import sig.modules.ChatLogModule;
|
||||
import sig.modules.RabiRaceModule;
|
||||
import sig.modules.ScrollingChatModule;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class ProgramWindow extends JFrame{
|
||||
|
||||
public static Icon deselected_icon,selected_icon;
|
||||
|
||||
List<ModuleSelectButton> buttons = new ArrayList<ModuleSelectButton>();
|
||||
|
||||
public int lastMouseX = 0;
|
||||
|
||||
public int lastMouseY = 0;
|
||||
|
||||
public static ProgramWindow frame;
|
||||
|
||||
public ProgramWindow() {
|
||||
ProgramWindow.frame=this;
|
||||
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
|
||||
scheduler.scheduleWithFixedDelay(()->{
|
||||
if (sigIRC.configNeedsUpdating>0 &&
|
||||
System.currentTimeMillis()-sigIRC.configNeedsUpdating>1000) {
|
||||
sigIRC.config.saveProperties();
|
||||
sigIRC.configNeedsUpdating=0;
|
||||
}
|
||||
},1000,1000,TimeUnit.MILLISECONDS);
|
||||
scheduler.scheduleWithFixedDelay(()->{
|
||||
lastMouseX = (int)(MouseInfo.getPointerInfo().getLocation().getX());
|
||||
lastMouseY = (int)(MouseInfo.getPointerInfo().getLocation().getY());
|
||||
},(long)((1d/(sigIRC.framerate+1))*1000),(long)((1d/(sigIRC.framerate+1))*1000),TimeUnit.MILLISECONDS);
|
||||
|
||||
try {
|
||||
sigIRC.programIcon = ImageIO.read(sigIRC.class.getResource("/resource/sigIRCicon.png"));
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
deselected_icon = new ImageIcon(ImageIO.read(sigIRC.class.getResource("/resource/deselected_button.png")));
|
||||
selected_icon = new ImageIcon(ImageIO.read(sigIRC.class.getResource("/resource/selected_button.png")));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (sigIRC.overlayMode && sigIRC.showWindowControls) {
|
||||
JFrame.setDefaultLookAndFeelDecorated(true);
|
||||
}
|
||||
System.setProperty("sun.java2d.opengl", Boolean.toString(sigIRC.hardwareAcceleration));
|
||||
System.setProperty("sun.java2d.d3d",Boolean.toString(true));
|
||||
JFrame f = new JFrame("sigIRCv2");
|
||||
this.setAutoRequestFocus(true);
|
||||
this.toFront();
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
if (sigIRC.overlayMode && !sigIRC.showWindowControls) {
|
||||
this.setUndecorated(true);
|
||||
}
|
||||
|
||||
|
||||
sigIRC.panel = new MyPanel();
|
||||
|
||||
JLabel myLabel = new JLabel("Module Control:");
|
||||
if (sigIRC.overlayMode) {
|
||||
sigIRC.panel.setOpaque(false);
|
||||
}
|
||||
sigIRC.panel.setBackground(Color.BLACK);
|
||||
myLabel.setBackground(sigIRC.panel.getBackground());
|
||||
myLabel.setForeground(Color.WHITE);
|
||||
myLabel.setIcon(new ImageIcon(sigIRC.programIcon.getScaledInstance(48, 48, Image.SCALE_AREA_AVERAGING)));
|
||||
|
||||
sigIRC.panel.add(myLabel);
|
||||
|
||||
if (!sigIRC.disableChatMessages) {
|
||||
ScrollingChatModule mod = new ScrollingChatModule(new Rectangle((int)sigIRC.scrollingchatmodule_X,(int)sigIRC.scrollingchatmodule_Y,(int)sigIRC.scrollingchatmodule_width,(int)sigIRC.scrollingchatmodule_height),"Scrolling Chat");
|
||||
ModuleSelectButton button = new ModuleSelectButton("Scrolling Chat",mod);
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.chatlogmodule_enabled) {
|
||||
ChatLogModule mod = new ChatLogModule(new Rectangle(sigIRC.chatlogmodule_X,sigIRC.chatlogmodule_Y,sigIRC.chatlogmodule_width,sigIRC.chatlogmodule_height),"Chat Log");
|
||||
ModuleSelectButton button = new ModuleSelectButton("Chat Log",mod);
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.controllermodule_enabled) {
|
||||
ModuleSelectButton button = new ModuleSelectButton("Controller",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.twitchmodule_enabled) {
|
||||
ModuleSelectButton button = new ModuleSelectButton("Twitch",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.rabiracemodule_enabled) {
|
||||
RabiRaceModule mod = new RabiRaceModule(new Rectangle((int)sigIRC.rabiracemodule_X,(int)sigIRC.rabiracemodule_Y,(int)sigIRC.rabiracemodule_width,(int)sigIRC.rabiracemodule_height),"Rabi Race");
|
||||
ModuleSelectButton button = new ModuleSelectButton("Rabi-Race",mod);
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
if (sigIRC.touhoumothermodule_enabled) {
|
||||
ModuleSelectButton button = new ModuleSelectButton("Touhou Mother",new Module(new Rectangle(0,0,0,0),"Test"));
|
||||
sigIRC.panel.add(button);
|
||||
}
|
||||
GridLayout myLayout = new GridLayout(0,1);
|
||||
sigIRC.panel.setLayout(myLayout);
|
||||
|
||||
///Play MUSIC
|
||||
/*BasicPlayer player = new BasicPlayer();
|
||||
try {
|
||||
player.open(new File("D:\\Videos\\4K Video Downloader\\3R2 - The Truth Never Spoken (Energetic Trance Mix).mp3"));
|
||||
player.play();
|
||||
} catch (BasicPlayerException e) {
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
|
||||
//colorpanel = new ColorPanel();
|
||||
//this.add(colorpanel);
|
||||
this.setLocationByPlatform(true);
|
||||
this.add(sigIRC.panel);
|
||||
//this.pack();
|
||||
this.setSize(240, 640);
|
||||
this.setVisible(true);
|
||||
//this.setLocation(sigIRC.windowX, sigIRC.windowY);
|
||||
//this.setSize(sigIRC.windowWidth, sigIRC.windowHeight);
|
||||
|
||||
this.setIconImage(sigIRC.programIcon);
|
||||
|
||||
// button = new BackgroundColorButton(new File(sigIRC.BASEDIR+"backcolor.png"),panel.getX()+panel.getWidth()-96,64+rowobj.size()*rowSpacing);
|
||||
if (sigIRC.overlayMode) {
|
||||
this.setBackground(new Color(0,0,0,0));
|
||||
this.setAlwaysOnTop(true);
|
||||
}
|
||||
//this.setOpacity(0.5f);
|
||||
//this.addWindowListener(sigIRC.panel);
|
||||
|
||||
//Module testMod = new Module(new Rectangle(0,0,640,480),"Test");
|
||||
}
|
||||
}
|
21
src/sig/windows/TwitchEmoteDownload.java
Normal file
21
src/sig/windows/TwitchEmoteDownload.java
Normal file
@ -0,0 +1,21 @@
|
||||
package sig.windows;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import sig.Emoticon;
|
||||
import sig.sigIRC;
|
||||
|
||||
public class TwitchEmoteDownload {
|
||||
String name;
|
||||
int id;
|
||||
|
||||
public TwitchEmoteDownload(String name,int id) {
|
||||
this.name=name;
|
||||
this.id=id;
|
||||
}
|
||||
|
||||
public void download() throws MalformedURLException {
|
||||
sigIRC.emoticons.add(new Emoticon(name,new URL(sigIRC.TWITCHEMOTEURL+id+"/1.0")));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user