Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
|
1c13162f80 | 7 years ago |
|
904a9925e2 | 7 years ago |
|
413fab117b | 7 years ago |
|
79bb1e576b | 7 years ago |
|
824b8249d9 | 7 years ago |
|
e210299f7f | 7 years ago |
|
629f118e7c | 7 years ago |
|
9e6aa20a21 | 7 years ago |
|
63dfe0c60e | 7 years ago |
|
f07a89fe22 | 7 years ago |
|
2cee57d9e9 | 7 years ago |
@ -1,4 +0,0 @@ |
||||
eclipse.preferences.version=1 |
||||
encoding//src/sig/modules/RabiRace/SessionCreateWindow.java=UTF-8 |
||||
encoding//src/sig/modules/RabiRace/SessionListWindow.java=UTF-8 |
||||
encoding//src/sig/modules/RabiRibi/MemoryOffset.java=UTF-8 |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 331 B |
After Width: | Height: | Size: 7.0 KiB |
@ -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> |
@ -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> |
@ -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> |
@ -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> |
@ -1,76 +0,0 @@ |
||||
# |
||||
#Properties file for sigIRCv2 |
||||
#Thu Sep 13 20:34:27 CDT 2018 |
||||
Auto_Update_Program=1 |
||||
Automatically_Update_Program=false |
||||
BANDORI_module_X=76 |
||||
BANDORI_module_Y=307 |
||||
BANDORI_module_height=120 |
||||
BANDORI_module_width=640 |
||||
CHATLOG_module_BackgroundColor=195,195,195,255 |
||||
CHATLOG_module_MessageHistory=50 |
||||
CHATLOG_module_X=1042 |
||||
CHATLOG_module_Y=388 |
||||
CHATLOG_module_height=518 |
||||
CHATLOG_module_width=516 |
||||
CONTROLLER_module_X=46 |
||||
CONTROLLER_module_Y=272 |
||||
CONTROLLER_module_height=312 |
||||
CONTROLLER_module_width=320 |
||||
Disable_Chat_Messages=false |
||||
Max_FPS=30 |
||||
Module_bandori_Enabled=false |
||||
Module_chatlog_Enabled=false |
||||
Module_controller_Enabled=false |
||||
Module_rabirace_Enabled=false |
||||
Module_rabiribi_Enabled=false |
||||
Module_touhoumother_Enabled=false |
||||
Module_twitch_Enabled=false |
||||
RABIRACE_module_X=492 |
||||
RABIRACE_module_Y=226 |
||||
RABIRACE_module_height=561 |
||||
RABIRACE_module_width=481 |
||||
RABIRIBI_module_X=0 |
||||
RABIRIBI_module_Y=0 |
||||
RABIRIBI_module_height=1050 |
||||
RABIRIBI_module_width=1680 |
||||
SCROLLINGCHAT_module_X=1016 |
||||
SCROLLINGCHAT_module_Y=223 |
||||
SCROLLINGCHAT_module_height=132 |
||||
SCROLLINGCHAT_module_width=456 |
||||
TOUHOUMOTHER_module_X=0 |
||||
TOUHOUMOTHER_module_Y=312 |
||||
TOUHOUMOTHER_module_height=312 |
||||
TOUHOUMOTHER_module_width=320 |
||||
TWITCH_module_X=507 |
||||
TWITCH_module_Y=366 |
||||
TWITCH_module_followerText_Y=42 |
||||
TWITCH_module_followerText_centerX=292 |
||||
TWITCH_module_follower_img=sigIRC/glaceon_follower.png |
||||
TWITCH_module_follower_img_animation=true |
||||
TWITCH_module_height=200 |
||||
TWITCH_module_newFollowerImgBackgroundColor=90,90,90 |
||||
TWITCH_module_newFollowerImgLogoSize=32 |
||||
TWITCH_module_newFollowerShadowTextColor=26,90,150 |
||||
TWITCH_module_newFollowerTextColor=255,255,255 |
||||
TWITCH_module_width=500 |
||||
Testing_Mode=false |
||||
backgroundColor=-10066177 |
||||
channel=\#SigoNitori |
||||
chatRows=3 |
||||
chatScrollSpd=4 |
||||
dingThreshold=6 |
||||
hardware_acceleration=true |
||||
lastSubEmote_APIUpdate=331 |
||||
messageFont=Gill Sans Ultra Bold Condensed |
||||
nickname=SigoNitori |
||||
overlayMode=false |
||||
rowSpacing=64 |
||||
server=irc.chat.twitch.tv |
||||
showWindowControls=true |
||||
touhoumotherConsoleFont=Agency FB Bold |
||||
usernameFont=Segoe UI Semibold |
||||
windowHeight=632 |
||||
windowWidth=1212 |
||||
windowX=442 |
||||
windowY=205 |
@ -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,10 +0,0 @@ |
||||
package sig; |
||||
|
||||
public class ModuleLinker { |
||||
public String name = ""; |
||||
public Module mod; |
||||
public ModuleLinker(String name,Module mod) { |
||||
this.name = name; |
||||
this.mod = mod; |
||||
} |
||||
} |
@ -1,208 +0,0 @@ |
||||
package sig; |
||||
|
||||
import java.awt.Color; |
||||
import java.awt.Dimension; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
import java.awt.event.WindowEvent; |
||||
import java.awt.event.WindowListener; |
||||
|
||||
import javax.swing.BoxLayout; |
||||
import javax.swing.JCheckBox; |
||||
import javax.swing.JColorChooser; |
||||
import javax.swing.JFrame; |
||||
import javax.swing.JPanel; |
||||
|
||||
import sig.modules.BandoriModule; |
||||
import sig.modules.ChatLogModule; |
||||
import sig.modules.ControllerModule; |
||||
import sig.modules.DDRStepModule; |
||||
import sig.modules.RabiRaceModule; |
||||
import sig.modules.RabiRibiModule; |
||||
import sig.modules.TouhouMotherModule; |
||||
import sig.modules.TwitchModule; |
||||
|
||||
public class ModuleSelector extends JFrame implements WindowListener{ |
||||
public static JCheckBox bandoriBox = new JCheckBox("Bandori",sigIRC.bandorimodule_enabled); |
||||
public static JCheckBox ddrstepBox = new JCheckBox("DDR Step",sigIRC.ddrstepmodule_enabled); |
||||
public static JCheckBox rabiraceBox = new JCheckBox("Rabi Race",sigIRC.rabiracemodule_enabled); |
||||
public static JCheckBox rabiribiBox = new JCheckBox("Rabi Ribi (Broken)",sigIRC.rabiribimodule_enabled); |
||||
public static JCheckBox controllerBox = new JCheckBox("Controller",sigIRC.controllermodule_enabled); |
||||
public static JCheckBox chatlogBox = new JCheckBox("Chat Log",sigIRC.chatlogmodule_enabled); |
||||
public static JCheckBox twitchBox = new JCheckBox("Twitch",sigIRC.twitchmodule_enabled); |
||||
public static JCheckBox touhoumotherBox = new JCheckBox("Touhou Mother",sigIRC.touhoumothermodule_enabled); |
||||
public ModuleSelector() { |
||||
JPanel panel = new JPanel(); |
||||
bandoriBox.setActionCommand("bandori"); |
||||
bandoriBox.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent ev) { |
||||
if (ev.getActionCommand().equalsIgnoreCase("bandori")) { |
||||
if (ModuleSelector.bandoriBox.isSelected()) { |
||||
BandoriModule.loadModule(); |
||||
} else { |
||||
BandoriModule.unloadModule(); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
bandoriBox.setVisible(true); |
||||
ddrstepBox.setActionCommand("ddrstep"); |
||||
ddrstepBox.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent ev) { |
||||
if (ev.getActionCommand().equalsIgnoreCase("ddrstep")) { |
||||
if (ModuleSelector.ddrstepBox.isSelected()) { |
||||
DDRStepModule.loadModule(); |
||||
} else { |
||||
DDRStepModule.unloadModule(); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
ddrstepBox.setVisible(true); |
||||
rabiraceBox.setActionCommand("rabirace"); |
||||
rabiraceBox.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent ev) { |
||||
if (ev.getActionCommand().equalsIgnoreCase("rabirace")) { |
||||
if (ModuleSelector.rabiraceBox.isSelected()) { |
||||
RabiRaceModule.loadModule(); |
||||
} else { |
||||
RabiRaceModule.unloadModule(); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
rabiraceBox.setVisible(true); |
||||
rabiribiBox.setActionCommand("rabiribi"); |
||||
rabiribiBox.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent ev) { |
||||
if (ev.getActionCommand().equalsIgnoreCase("rabiribi")) { |
||||
if (ModuleSelector.rabiribiBox.isSelected()) { |
||||
RabiRibiModule.loadModule(); |
||||
} else { |
||||
RabiRibiModule.unloadModule(); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
rabiribiBox.setVisible(true); |
||||
controllerBox.setActionCommand("controller"); |
||||
controllerBox.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent ev) { |
||||
if (ev.getActionCommand().equalsIgnoreCase("controller")) { |
||||
if (ModuleSelector.controllerBox.isSelected()) { |
||||
ControllerModule.loadModule(); |
||||
} else { |
||||
ControllerModule.unloadModule(); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
controllerBox.setVisible(true); |
||||
chatlogBox.setActionCommand("chatlog"); |
||||
chatlogBox.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent ev) { |
||||
if (ev.getActionCommand().equalsIgnoreCase("chatlog")) { |
||||
if (ModuleSelector.chatlogBox.isSelected()) { |
||||
ChatLogModule.loadModule(); |
||||
} else { |
||||
ChatLogModule.unloadModule(); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
chatlogBox.setVisible(true); |
||||
twitchBox.setActionCommand("twitch"); |
||||
twitchBox.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent ev) { |
||||
if (ev.getActionCommand().equalsIgnoreCase("twitch")) { |
||||
if (ModuleSelector.twitchBox.isSelected()) { |
||||
TwitchModule.loadModule(); |
||||
} else { |
||||
TwitchModule.unloadModule(); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
twitchBox.setVisible(true); |
||||
touhoumotherBox.setActionCommand("touhoumother"); |
||||
touhoumotherBox.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent ev) { |
||||
if (ev.getActionCommand().equalsIgnoreCase("touhoumother")) { |
||||
if (ModuleSelector.touhoumotherBox.isSelected()) { |
||||
TouhouMotherModule.loadModule(); |
||||
} else { |
||||
TouhouMotherModule.unloadModule(); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
touhoumotherBox.setVisible(true); |
||||
|
||||
panel.setVisible(true); |
||||
panel.add(twitchBox); |
||||
panel.add(chatlogBox); |
||||
panel.add(controllerBox); |
||||
panel.add(rabiraceBox); |
||||
panel.add(bandoriBox); |
||||
panel.add(touhoumotherBox); |
||||
panel.add(ddrstepBox); |
||||
panel.add(rabiribiBox); |
||||
|
||||
panel.setLayout(new BoxLayout(panel,BoxLayout.PAGE_AXIS)); |
||||
|
||||
this.add(panel); |
||||
this.pack(); |
||||
//this.setVisible(true);
|
||||
this.repaint(); |
||||
} |
||||
|
||||
@Override |
||||
public void windowOpened(WindowEvent e) { |
||||
// TODO Auto-generated method stub
|
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void windowClosing(WindowEvent e) { |
||||
// TODO Auto-generated method stub
|
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void windowClosed(WindowEvent e) { |
||||
// TODO Auto-generated method stub
|
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void windowIconified(WindowEvent e) { |
||||
// TODO Auto-generated method stub
|
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void windowDeiconified(WindowEvent e) { |
||||
// TODO Auto-generated method stub
|
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void windowActivated(WindowEvent e) { |
||||
// TODO Auto-generated method stub
|
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void windowDeactivated(WindowEvent e) { |
||||
// TODO Auto-generated method stub
|
||||
|
||||
} |
||||
} |
@ -1,50 +0,0 @@ |
||||
package sig; |
||||
|
||||
import java.awt.Color; |
||||
import java.awt.Graphics; |
||||
import java.awt.event.MouseEvent; |
||||
import java.awt.event.MouseWheelEvent; |
||||
import java.awt.image.BufferedImage; |
||||
import java.io.File; |
||||
import java.io.IOException; |
||||
import java.util.Arrays; |
||||
|
||||
import javax.imageio.ImageIO; |
||||
|
||||
import sig.sigIRC; |
||||
import sig.modules.TouhouMotherModule; |
||||
import sig.utils.DrawUtils; |
||||
import sig.utils.FileUtils; |
||||
import sig.utils.TextUtils; |
||||
|
||||
public class ModuleSelectorButton { |
||||
BufferedImage buttonimg; |
||||
int x=0; |
||||
int y=0; |
||||
boolean buttonEnabled = true; |
||||
|
||||
public ModuleSelectorButton(File filename, int x, int y) { |
||||
this.x=x; |
||||
this.y=y; |
||||
try { |
||||
buttonimg = ImageIO.read(filename); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
|
||||
public void draw(Graphics g) { |
||||
if (buttonEnabled) { |
||||
g.drawImage(buttonimg, x, y, sigIRC.panel); |
||||
} |
||||
} |
||||
|
||||
public void onClickEvent(MouseEvent ev) { |
||||
if (buttonEnabled && !sigIRC.overlayMode) { |
||||
if (ev.getX()>=x && ev.getX()<=x+buttonimg.getWidth() && |
||||
ev.getY()>=y && ev.getY()<=y+buttonimg.getHeight()) { |
||||
sigIRC.moduleSelectorWindow.setVisible(true); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,43 +0,0 @@ |
||||
package sig.modules.Bandori; |
||||
|
||||
import java.util.Random; |
||||
|
||||
public class SongPart { |
||||
String name; |
||||
int trials; |
||||
int successes; |
||||
|
||||
public SongPart(String partname) { |
||||
this.name = partname; |
||||
this.trials = this.successes = 0; |
||||
} |
||||
|
||||
public void setTitle(String title) { |
||||
this.name = title; |
||||
} |
||||
|
||||
public void setSuccesses(Integer successes) { |
||||
this.successes = successes; |
||||
} |
||||
|
||||
public void setTrials(Integer trials) { |
||||
this.trials = trials; |
||||
} |
||||
|
||||
public String getTitle() { |
||||
return this.name; |
||||
} |
||||
public Integer getSuccesses() { |
||||
return this.successes; |
||||
} |
||||
public Integer getTotal() { |
||||
return this.trials; |
||||
} |
||||
|
||||
public void AddtoTrials(boolean success) { |
||||
if (success) { |
||||
this.successes++; |
||||
} |
||||
this.trials++; |
||||
} |
||||
} |
@ -1,482 +0,0 @@ |
||||
package sig.modules; |
||||
|
||||
import java.awt.Color; |
||||
import java.awt.Graphics; |
||||
import java.awt.Rectangle; |
||||
import java.awt.event.KeyEvent; |
||||
import java.awt.event.WindowEvent; |
||||
import java.awt.geom.Rectangle2D; |
||||
import java.awt.image.BufferedImage; |
||||
import java.io.File; |
||||
import java.io.IOException; |
||||
import java.text.DecimalFormat; |
||||
import java.util.ArrayList; |
||||
import java.util.Arrays; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Random; |
||||
|
||||
import javax.imageio.ImageIO; |
||||
import javax.swing.JOptionPane; |
||||
|
||||
import javafx.geometry.Point2D; |
||||
import sig.FileManager; |
||||
import sig.Module; |
||||
import sig.sigIRC; |
||||
import sig.modules.Bandori.SongPart; |
||||
import sig.utils.DrawUtils; |
||||
import sig.utils.SoundUtils; |
||||
|
||||
public class BandoriModule extends Module{ |
||||
public static BandoriModule bandori_module; |
||||
public BufferedImage stamp_collection1,stamp_collection2,stamp_collection3 |
||||
,stamp_collection4,stamp_collection5,stamp_collection6,stamp_collection7,stamp_collection8,stamp_collection9,stamp_collection10,stamp_collection11; |
||||
public static HashMap<String,ImageScheme> image_map = new HashMap<String,ImageScheme>(); |
||||
public static HashMap<String,List<String>> stamp_map = new HashMap<String,List<String>>(); |
||||
static List<Stamp> active_stamps = new ArrayList<Stamp>(); |
||||
String songtitle = ""; |
||||
List<SongPart> parts = new ArrayList<SongPart>(); |
||||
boolean holdControl = false, holdAlt = false; |
||||
JOptionPane pane = new JOptionPane(); |
||||
|
||||
|
||||
public BandoriModule(Rectangle2D bounds, String moduleName) { |
||||
this(bounds,moduleName,true); |
||||
} |
||||
|
||||
public BandoriModule(Rectangle2D bounds, String moduleName, boolean enabled) { |
||||
super(bounds, moduleName, enabled); |
||||
Initialize(); |
||||
} |
||||
|
||||
void Initialize() { |
||||
BandoriModule.bandori_module = this; |
||||
try { |
||||
stamp_collection1 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamps1.png")); |
||||
stamp_collection2 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamps2_2.png")); |
||||
stamp_collection3 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_018003.png")); |
||||
stamp_collection4 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_003003.png")); |
||||
stamp_collection5 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_007003.png")); |
||||
stamp_collection6 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_011005.png")); |
||||
stamp_collection7 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_013003.png")); |
||||
stamp_collection8 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_016002.png")); |
||||
stamp_collection9 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_017004.png")); |
||||
stamp_collection10 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_021004.png")); |
||||
stamp_collection11 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/stamp_006004.png")); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
image_map.put("kasumi_gogo", new ImageScheme(stamp_collection1,0)); |
||||
image_map.put("tae_letsplay", new ImageScheme(stamp_collection1,1)); |
||||
image_map.put("rimi_choco", new ImageScheme(stamp_collection1,2)); |
||||
image_map.put("saya_bread", new ImageScheme(stamp_collection1,3)); |
||||
image_map.put("arisa_doki", new ImageScheme(stamp_collection1,4)); |
||||
image_map.put("ran_same", new ImageScheme(stamp_collection1,5)); |
||||
image_map.put("moca_youdidit", new ImageScheme(stamp_collection1,6)); |
||||
image_map.put("himari_heyheyhoh", new ImageScheme(stamp_collection1,7)); |
||||
image_map.put("tomoe_letsdothis", new ImageScheme(stamp_collection1,8)); |
||||
image_map.put("tsugumi_wecandoit", new ImageScheme(stamp_collection1,9)); |
||||
image_map.put("kokoro_happylucky", new ImageScheme(stamp_collection1,10)); |
||||
image_map.put("kaoru_fleeting", new ImageScheme(stamp_collection1,11)); |
||||
image_map.put("hagumi_smileyay", new ImageScheme(stamp_collection1,12)); |
||||
image_map.put("kanon_fuee", new ImageScheme(stamp_collection1,13)); |
||||
image_map.put("misaki_ready", new ImageScheme(stamp_collection1,14)); |
||||
image_map.put("aya_fever", new ImageScheme(stamp_collection1,15)); |
||||
image_map.put("hina_fullcombo", new ImageScheme(stamp_collection1,16)); |
||||
image_map.put("chisato_planned", new ImageScheme(stamp_collection1,17)); |
||||
image_map.put("maya_huhehe", new ImageScheme(stamp_collection1,18)); |
||||
image_map.put("eve_bushido", new ImageScheme(stamp_collection1,19)); |
||||
image_map.put("yukina_notbad", new ImageScheme(stamp_collection1,20)); |
||||
image_map.put("sayo_goodwork", new ImageScheme(stamp_collection1,21)); |
||||
image_map.put("lisa_nextonelastone", new ImageScheme(stamp_collection1,22)); |
||||
image_map.put("ako_onemoretime", new ImageScheme(stamp_collection1,23)); |
||||
image_map.put("rinko_jam", new ImageScheme(stamp_collection2,0)); |
||||
image_map.put("marina_yeahyeah", new ImageScheme(stamp_collection2,1)); //Skip 2.
|
||||
image_map.put("cookie_cookie", new ImageScheme(stamp_collection2,2)); //Skip 2.
|
||||
image_map.put("kokoro_moremore", new ImageScheme(stamp_collection2,3)); |
||||
image_map.put("arisa_huh", new ImageScheme(stamp_collection2,4)); |
||||
image_map.put("yukina_followmylead", new ImageScheme(stamp_collection2,5)); |
||||
image_map.put("kaoru_suchalovelyevening", new ImageScheme(stamp_collection2,6)); |
||||
image_map.put("rimi_congrats", new ImageScheme(stamp_collection2,7)); |
||||
image_map.put("ran_somethingbigiscoming", new ImageScheme(stamp_collection2,8)); |
||||
image_map.put("tsugumi_comeon", new ImageScheme(stamp_collection2,9)); |
||||
image_map.put("tae_fufusocute", new ImageScheme(stamp_collection2,10)); |
||||
image_map.put("eve_marchintobattle", new ImageScheme(stamp_collection2,11)); |
||||
image_map.put("saya_illtry", new ImageScheme(stamp_collection2,12)); |
||||
image_map.put("lisa_imsohappy", new ImageScheme(stamp_collection2,13)); |
||||
image_map.put("sayo_ohwell", new ImageScheme(stamp_collection2,14)); |
||||
image_map.put("ako_areyouokay", new ImageScheme(stamp_collection2,15)); |
||||
image_map.put("chisato_thisissomuchfun", new ImageScheme(stamp_collection2,16)); |
||||
image_map.put("rinko_theresnoway", new ImageScheme(stamp_collection2,17)); |
||||
image_map.put("tae_thisisgreat", new ImageScheme(stamp_collection2,18)); |
||||
image_map.put("moca_thisisgettinginteresting", new ImageScheme(stamp_collection2,19)); |
||||
image_map.put("kaoru_takemyhand", new ImageScheme(stamp_collection2,20)); |
||||
image_map.put("kokoro_letsmaketheworldsmile", new ImageScheme(stamp_collection2,21)); |
||||
image_map.put("hina_nowwereboppin", new ImageScheme(stamp_collection2,22)); |
||||
image_map.put("kokoro_what_a_great_idea", new ImageScheme(stamp_collection2,23)); |
||||
image_map.put("sayo_im_sorry", new ImageScheme(stamp_collection2,24)); |
||||
image_map.put("hagumi_hooray", new ImageScheme(stamp_collection2,25)); |
||||
image_map.put("tsugumi_amazing", new ImageScheme(stamp_collection2,26)); |
||||
image_map.put("eve_thefruits", new ImageScheme(stamp_collection2,27)); |
||||
image_map.put("lisa_imnotready", new ImageScheme(stamp_collection2,28)); |
||||
image_map.put("arisa_okayhereigo", new ImageScheme(stamp_collection2,29)); |
||||
image_map.put("tomoe_giveityourall", new ImageScheme(stamp_collection2,30)); |
||||
image_map.put("kanon_keepgoing", new ImageScheme(stamp_collection2,31)); |
||||
image_map.put("kokoro_letshavefun", new ImageScheme(stamp_collection2,32)); |
||||
image_map.put("kasumi_letshaveagreatshow", new ImageScheme(stamp_collection2,33)); |
||||
image_map.put("ako_illshowyousomethingcool", new ImageScheme(stamp_collection2,34)); |
||||
image_map.put("yukina_mindifipetyou", new ImageScheme(stamp_collection2,35)); |
||||
image_map.put("maya_whoa", new ImageScheme(stamp_collection2,36)); |
||||
image_map.put("hina_interesting", new ImageScheme(stamp_collection2,37)); |
||||
image_map.put("kaoru_imherewithyou", new ImageScheme(stamp_collection2,38)); |
||||
image_map.put("ran_itonlygetsbetter", new ImageScheme(stamp_collection2,39)); |
||||
image_map.put("himari_onthescene", new ImageScheme(stamp_collection2,40)); |
||||
image_map.put("rinko_wasthatgood", new ImageScheme(stamp_collection2,41)); |
||||
image_map.put("chisato_greaterthangreat", new SingleImageScheme(stamp_collection3)); |
||||
image_map.put("rimi_imsureitllbefine", new SingleImageScheme(stamp_collection4)); |
||||
image_map.put("moca_letsgetstarted", new SingleImageScheme(stamp_collection5)); |
||||
image_map.put("kokoro_justlikethat", new SingleImageScheme(stamp_collection6)); |
||||
image_map.put("hagumi_roar", new SingleImageScheme(stamp_collection7)); |
||||
image_map.put("aya_somuchpressure", new SingleImageScheme(stamp_collection8)); |
||||
image_map.put("hina_ivebeenwaiting", new SingleImageScheme(stamp_collection9)); |
||||
image_map.put("yukina_nexttime", new SingleImageScheme(stamp_collection10)); |
||||
image_map.put("ran_showtime", new SingleImageScheme(stamp_collection11)); |
||||
|
||||
stamp_map.put("kasumi_gogo",Arrays.asList("gogo")); |
||||
stamp_map.put("cookie_cookie",Arrays.asList("0.o","o.0",":3","fat","michellecookie")); |
||||
stamp_map.put("tae_letsplay",Arrays.asList("playtogether","wanttoplay","multilive","letsplay")); |
||||
stamp_map.put("rimi_choco",Arrays.asList("choco","cornet")); |
||||
stamp_map.put("saya_bread",Arrays.asList("bread")); |
||||
stamp_map.put("arisa_doki",Arrays.asList("doki","chomama","baka")); |
||||
stamp_map.put("ran_same",Arrays.asList("sameasalways","alwayssame","alwaysthesame","itsum")); |
||||
stamp_map.put("moca_youdidit",Arrays.asList("youdidit","congratulations","buns","mocatastic")); |
||||
stamp_map.put("himari_heyheyhoh",Arrays.asList("heyo","heyhey","hihi","hiyo","aao")); |
||||
stamp_map.put("tomoe_letsdothis",Arrays.asList("letsdothis","letsdoit")); |
||||
stamp_map.put("tsugumi_wecandoit",Arrays.asList("wegotthis","wegotit","wecan")); |
||||
stamp_map.put("kokoro_happylucky",Arrays.asList("happy!","lucky")); |
||||
stamp_map.put("kaoru_fleeting",Arrays.asList("fleeting")); |
||||
stamp_map.put("aya_fever",Arrays.asList("fever","ayay")); |
||||
stamp_map.put("hagumi_smileyay",Arrays.asList("smileyay","yay!")); |
||||
stamp_map.put("kanon_fuee",Arrays.asList("fuu","fue","waa","reee")); |
||||
stamp_map.put("misaki_ready",Arrays.asList("ready")); |
||||
stamp_map.put("hina_fullcombo",Arrays.asList("fc","fcd","fullcombo","nomiss","allperfect","notasinglemiss","thefc","anfc","fullperfect","easyfc","ezfc")); |
||||
stamp_map.put("chisato_planned",Arrays.asList("justasplanned","allplanned","calculated","thatcoming")); |
||||
stamp_map.put("maya_huhehe",Arrays.asList("hehe","huehe","huehue","shuwashuwa")); |
||||
stamp_map.put("eve_bushido",Arrays.asList("bushido")); |
||||
stamp_map.put("yukina_notbad",Arrays.asList("notbad","veryclose")); |
||||
stamp_map.put("sayo_goodwork",Arrays.asList("goodwork","goodjob","nicejob","welldone","greatwork","greatjob")); |
||||
stamp_map.put("lisa_nextonelastone",Arrays.asList("lastone","mylast")); |
||||
stamp_map.put("ako_onemoretime",Arrays.asList("onemore","goagain","keepplaying","dontstop","runit")); |
||||
stamp_map.put("rinko_jam",Arrays.asList("lovethissong","jam"/*,"happybirthday"*/)); |
||||
stamp_map.put("marina_yeahyeah",Arrays.asList("yeahyeah","letsgo")); |
||||
stamp_map.put("kokoro_moremore",Arrays.asList("moremore","iwantmore")); |
||||
stamp_map.put("arisa_huh",Arrays.asList("huh?","hh?","yy?","aat?","aa?","tt?","nani","nand")); |
||||
stamp_map.put("yukina_followmylead",Arrays.asList("followmylead","takethelead","guideyou","fullydevoted")); |
||||
stamp_map.put("kaoru_suchalovelyevening",Arrays.asList("goodevening","lovelyevening","beautifulnight","grandnight","wonderfulevening")); |
||||
stamp_map.put("rimi_congrats",Arrays.asList("grats")); |
||||
stamp_map.put("ran_somethingbigiscoming",Arrays.asList("somethingbig","iscoming","thatishowiroll","truecolor")); |
||||
stamp_map.put("tsugumi_comeon",Arrays.asList("comeon","dontbeafraid","dontbeshy")); |
||||
stamp_map.put("tae_fufusocute",Arrays.asList("socute","kawaii","fufu","adorable","cute")); |
||||
stamp_map.put("eve_marchintobattle",Arrays.asList("marchintobattle","chargeintobattle")); |
||||
stamp_map.put("saya_illtry",Arrays.asList("illtry","itachance","itatry","atleastonce")); |
||||
stamp_map.put("lisa_imsohappy",Arrays.asList("ecstatic","sohappy","toohappy")); |
||||
stamp_map.put("sayo_ohwell",Arrays.asList("ohwell","ahwell","youtried")); |
||||
stamp_map.put("ako_areyouokay",Arrays.asList("youok","beok","daijo")); |
||||
stamp_map.put("chisato_thisissomuchfun",Arrays.asList("muchfun","veryfun","reallyfun","extremelyfun","offun")); |
||||
stamp_map.put("rinko_theresnoway",Arrays.asList("noway")); |
||||
stamp_map.put("tae_thisisgreat",Arrays.asList("thisisgreat","thisisawesome","thisiswonderful")); |
||||
stamp_map.put("moca_thisisgettinginteresting",Arrays.asList("gettinginteresting","thingsaregetting","thisisgetting")); |
||||
stamp_map.put("kaoru_takemyhand",Arrays.asList("takemyhand","allowmeto","demonstrate","romeo")); |
||||
stamp_map.put("kokoro_letsmaketheworldsmile",Arrays.asList("hhw","happyworld","hellohappy","worldsmile")); |
||||
stamp_map.put("hina_nowwereboppin",Arrays.asList("bop","nowwere","zap")); |
||||
stamp_map.put("kokoro_what_a_great_idea",Arrays.asList("greatidea","goodidea","greatthinking","goodthinking")); |
||||
stamp_map.put("sayo_im_sorry",Arrays.asList("sorry","gomen","apologize","somethingwrong","forgive")); |
||||
stamp_map.put("hagumi_hooray",Arrays.asList("hooray","hiphip","whoo","yahoo")); |
||||
stamp_map.put("tsugumi_amazing",Arrays.asList("amazing","wow","sugoi","wooo","cool!","tsugurific")); |
||||
stamp_map.put("eve_thefruits",Arrays.asList("fruits","labor","hardwork","effort")); |
||||
stamp_map.put("lisa_imnotready",Arrays.asList("notready","notprep","stopit","holdon","onemin","onemom","noread","wontberead","notrdy","nottime","notime","waitam","waitforme")); |
||||
stamp_map.put("arisa_okayhereigo",Arrays.asList("hereigo","okayilltry","alrightilltry","domybest","trymybest","alrighty","itashot","myturn","domybest")); |
||||
stamp_map.put("tomoe_giveityourall",Arrays.asList("giveiteverything","allyougot","everythingyougot","tryyourbest","giveityourall","youreverything","yourall")); |
||||
stamp_map.put("kanon_keepgoing",Arrays.asList("keepgoing","dontstop","youcandoit","makeit","gaja","petan","pettan","pengu")); |
||||
stamp_map.put("kokoro_letshavefun",Arrays.asList("havefun","timeforfun")); |
||||
stamp_map.put("kasumi_letshaveagreatshow",Arrays.asList("greatshow")); |
||||
stamp_map.put("ako_illshowyousomethingcool",Arrays.asList("cool","havefun","timeforfun")); |
||||
stamp_map.put("yukina_mindifipetyou",Arrays.asList("petyou")); |
||||
stamp_map.put("maya_whoa",Arrays.asList("waaa","whoa")); //It's Showtime~!
|
||||
stamp_map.put("hina_interesting",Arrays.asList("rururu","interesting","ding")); |
||||
stamp_map.put("kaoru_imherewithyou",Arrays.asList("herewithyou","hereforyou")); |
||||
stamp_map.put("ran_itonlygetsbetter",Arrays.asList("getsbetter","onlygets")); |
||||
stamp_map.put("rinko_wasthatgood",Arrays.asList("wasthatgood","wasitgood")); |
||||
stamp_map.put("himari_onthescene",Arrays.asList("thescene")); |
||||
stamp_map.put("chisato_greaterthangreat",Arrays.asList("greater")); |
||||
stamp_map.put("rimi_imsureitllbefine",Arrays.asList("isfine","itwillbefine","itllbefine","itsfine","thatsokay","bealright")); |
||||
stamp_map.put("moca_letsgetstarted",Arrays.asList("started")); |
||||
stamp_map.put("kokoro_justlikethat",Arrays.asList("likethat")); |
||||
stamp_map.put("hagumi_roar",Arrays.asList("roar","rawr","meow")); |
||||
stamp_map.put("aya_somuchpressure",Arrays.asList("pressure","tough","thisalright","itsalright")); |
||||
stamp_map.put("hina_ivebeenwaiting",Arrays.asList("waiting")); |
||||
stamp_map.put("yukina_nexttime",Arrays.asList("nexttime")); |
||||
stamp_map.put("ran_showtime",Arrays.asList("showtime")); |
||||
|
||||
/*for (String s : image_map.keySet()) { |
||||
ImageScheme scheme = image_map.get(s); |
||||
try { |
||||
BufferedImage img = crop(scheme.base,scheme.stamp_index%6*270+4, scheme.stamp_index/6*223+3, 258, 214); |
||||
ImageIO.write(img, "png", new File(sigIRC.BASEDIR + "sigIRC/stamps/"+s+".png")); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
}*/ |
||||
for (int i=0;i<4;i++) { |
||||
parts.add(new SongPart("Song Part "+i)); |
||||
} |
||||
} |
||||
|
||||
public static void loadModule() { |
||||
sigIRC.modules.add(new BandoriModule( |
||||
new Rectangle(sigIRC.bandorimodule_X,sigIRC.bandorimodule_Y,sigIRC.bandorimodule_width,sigIRC.bandorimodule_height), |
||||
"Bandori" |
||||
)); |
||||
sigIRC.bandorimodule_enabled=true; |
||||
sigIRC.config.setBoolean("Module_bandori_Enabled", sigIRC.bandorimodule_enabled); |
||||
sigIRC.config.saveProperties(); |
||||
} |
||||
public static void unloadModule() { |
||||
for (int i=0;i<sigIRC.modules.size();i++) { |
||||
if (sigIRC.modules.get(i) instanceof BandoriModule) { |
||||
sigIRC.modules.remove(sigIRC.modules.get(i)); |
||||
} |
||||
} |
||||
sigIRC.bandorimodule_enabled=false; |
||||
sigIRC.config.setBoolean("Module_bandori_Enabled", sigIRC.bandorimodule_enabled); |
||||
sigIRC.config.saveProperties(); |
||||
} |
||||
|
||||
public BufferedImage crop(BufferedImage img, int x, int y, int targetWidth, int targetHeight) throws IOException { |
||||
int height = img.getHeight(); |
||||
int width = img.getWidth(); |
||||
|
||||
// Coordinates of the image's middle
|
||||
int xc = (width - targetWidth) / 2; |
||||
int yc = (height - targetHeight) / 2; |
||||
|
||||
// Crop
|
||||
BufferedImage croppedImage = img.getSubimage(x, y, targetWidth, targetHeight); |
||||
/*BufferedImage croppedImage = img.getSubimage( |
||||
xc, |
||||
yc, |
||||
targetWidth, // widht
|
||||
targetHeight // height
|
||||
);*/ |
||||
return croppedImage; |
||||
} |
||||
|
||||
public void run() { |
||||
for (int i=0;i<active_stamps.size();i++) { |
||||
Stamp s = active_stamps.get(i); |
||||
if (!s.run()) { |
||||
active_stamps.remove(i--); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public static void checkForStamp(String user,String message) { |
||||
boolean foundmatch = false; |
||||
message = message.toLowerCase().replaceAll("[ ]", ""); |
||||
if (message.length()>480) { |
||||
return; |
||||
} |
||||
for (String key : image_map.keySet()) { |
||||
for (String message_search : stamp_map.get(key)) { |
||||
String filteredmessage = message; |
||||
filteredmessage = filteredmessage.replaceAll("[^A-Za-z0-9]",""); |
||||
|
||||
if (filteredmessage.contains("gettinginteresting") && |
||||
message_search.equalsIgnoreCase("interesting")) { |
||||
break; |
||||
} |
||||
if (filteredmessage.contains("notready") && |
||||
message_search.equalsIgnoreCase("ready")) { |
||||
break; |
||||
} |
||||
//System.out.println(filteredmessage);
|
||||
if (message_search.contains("?") || message_search.contains("!") |
||||
|| message_search.contains(".") || message_search.contains(":")) { |
||||
if (message.contains(message_search)) { |
||||
foundmatch = true; |
||||
CreateStamp(key); |
||||
System.out.println("Stamp "+key+" created by user "+user+" MESSAGE:"+message+"."); |
||||
break; |
||||
} |
||||
} else { |
||||
if (filteredmessage.contains(message_search)) { |
||||
foundmatch=true; |
||||
CreateStamp(key); |
||||
System.out.println("Stamp "+key+" created by user "+user+" MESSAGE:"+message+"."); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
if (foundmatch) { |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public static void CreateStamp(String stamp_name) { |
||||
final int STAMP_DURATION = 180; |
||||
String soundName = sigIRC.BASEDIR+"sigIRC/sounds/stamp_sound.wav"; |
||||
FileManager manager = new FileManager("sigIRC/sounds/stamp_sound.wav"); |
||||
manager.verifyAndFetchFileFromServer(); |
||||
SoundUtils.playSound(soundName); |
||||
active_stamps.add(new Stamp(image_map.get(stamp_name),STAMP_DURATION)); |
||||
} |
||||
|
||||
public void ApplyConfigWindowProperties() { |
||||
sigIRC.bandorimodule_X=(int)position.getX(); |
||||
sigIRC.bandorimodule_Y=(int)position.getY(); |
||||
sigIRC.config.setInteger("BANDORI_module_X", sigIRC.bandorimodule_X); |
||||
sigIRC.config.setInteger("BANDORI_module_Y", sigIRC.bandorimodule_Y); |
||||
} |
||||
|
||||
public void windowClosed(WindowEvent ev) { |
||||
|
||||
} |
||||
|
||||
public void draw(Graphics g) { |
||||
super.draw(g); |
||||
if (sigIRC.panel!=null) { |
||||
for (Stamp s : active_stamps) { |
||||
//Stamp is 130x107 pixels
|
||||
if (s.scheme instanceof SingleImageScheme) { |
||||
g.drawImage(s.scheme.base,(int)(s.randX+position.getX()),(int)position.getY()+24, (int)(s.randX+130+position.getX()), (int)position.getY()+24+107,0,0, |
||||
s.scheme.base.getWidth(),s.scheme.base.getHeight(),sigIRC.panel); |
||||
} else { |
||||
g.drawImage(s.scheme.base, (int)(s.randX+position.getX()), (int)position.getY()+24, (int)(s.randX+130+position.getX()), (int)position.getY()+24+107, |
||||
s.scheme.stamp_index%6*270+4, s.scheme.stamp_index/6*223+3, s.scheme.stamp_index%6*270+260+4, s.scheme.stamp_index/6*223+214+3, sigIRC.panel); |
||||
} |
||||
} |
||||
Point2D basepos = new Point2D(this.getPosition().getX(),this.getPosition().getHeight()+this.getPosition().getY()+24); |
||||
double successChance = 1; |
||||
DecimalFormat df = new DecimalFormat("0"); |
||||
DecimalFormat df2 = new DecimalFormat("0.0"); |
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, basepos.getX(), basepos.getY()-24, 2, Color.WHITE, Color.BLACK, songtitle); |
||||
for (int i=0;i<parts.size();i++) { |
||||
SongPart s = parts.get(i); |
||||
if (s.getTotal()!=0) { |
||||
double successRate = (double)s.getSuccesses()/s.getTotal(); |
||||
successChance *= successRate; |
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, basepos.getX(), basepos.getY()+i*24, 2, Color.WHITE, Color.BLACK, s.getTitle()+" - "+s.getSuccesses()+"/"+s.getTotal()+" ("+df.format(successRate*100)+"%)"); |
||||
} |
||||
} |
||||
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, basepos.getX(), basepos.getY()+parts.size()*24+8, 2, Color.WHITE, Color.BLACK, "Expected Attempts: "+(df.format(1d/successChance))+" Success Chance: "+df2.format((successChance)*100)+"%"); |
||||
} |
||||
} |
||||
|
||||
public void keypressed(KeyEvent ev) { |
||||
super.keypressed(ev); |
||||
switch (ev.getKeyCode()) { |
||||
case KeyEvent.VK_CONTROL:{ |
||||
holdControl=true; |
||||
System.out.println("Pressed Control"); |
||||
}break; |
||||
case KeyEvent.VK_ALT:{ |
||||
holdAlt=true; |
||||
System.out.println("Pressed Alt"); |
||||
}break; |
||||
case KeyEvent.VK_HOME:{ |
||||
String input = pane.showInputDialog(sigIRC.window, "Song Title:", songtitle); |
||||
this.songtitle = input; |
||||
}break; |
||||
case KeyEvent.VK_1:{ |
||||
if (holdControl) { |
||||
SetupPart(0); |
||||
} else { |
||||
AddtoAllParts(0); |
||||
} |
||||
}break; |
||||
case KeyEvent.VK_2:{ |
||||
if (holdControl) { |
||||
SetupPart(1); |
||||
} else { |
||||
AddtoAllParts(1); |
||||
} |
||||
}break; |
||||
case KeyEvent.VK_3:{ |
||||
if (holdControl) { |
||||
SetupPart(2); |
||||
} else { |
||||
AddtoAllParts(2); |
||||
} |
||||
}break; |
||||
case KeyEvent.VK_4:{ |
||||
if (holdControl) { |
||||
SetupPart(3); |
||||
} else { |
||||
AddtoAllParts(3); |
||||
} |
||||
}break; |
||||
} |
||||
} |
||||
|
||||
private void AddtoAllParts(int partnumb) { |
||||
for (int i=0;i<=partnumb;i++) { |
||||
parts.get(i).AddtoTrials(holdAlt); |
||||
} |
||||
} |
||||
|
||||
private void SetupPart(int partnumb) { |
||||
String input = pane.showInputDialog(sigIRC.window,"Name Part 1:",parts.get(partnumb).getTitle()); |
||||
String input2 = pane.showInputDialog(sigIRC.window,"Provide Success/Total Count (X/Y Format)",parts.get(partnumb).getSuccesses()+"/"+parts.get(partnumb).getTotal()); |
||||
if (input.length()>0) { |
||||
parts.get(partnumb).setTitle(input); |
||||
parts.get(partnumb).setSuccesses(Integer.parseInt(input2.split("/")[0])); |
||||
parts.get(partnumb).setTrials(Integer.parseInt(input2.split("/")[1])); |
||||
} |
||||
holdControl=holdAlt=false; |
||||
} |
||||
|
||||
public void keyreleased(KeyEvent ev) { |
||||
super.keyreleased(ev); |
||||
switch (ev.getKeyCode()) { |
||||
case KeyEvent.VK_CONTROL:{ |
||||
holdControl=false; |
||||
System.out.println("Released Control"); |
||||
}break; |
||||
case KeyEvent.VK_ALT:{ |
||||
holdAlt=false; |
||||
System.out.println("Released Alt"); |
||||
}break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
class Stamp{ |
||||
ImageScheme scheme; |
||||
int timer; |
||||
int randX = (int)(Math.random()*(BandoriModule.bandori_module.position.getWidth()-130)); |
||||
Stamp(ImageScheme scheme,int start_timer) { |
||||
this.scheme = scheme; |
||||
this.timer = start_timer; |
||||
} |
||||
public boolean run() { |
||||
return --timer>0; |
||||
} |
||||
} |
||||
|
||||
class ImageScheme{ |
||||
BufferedImage base; |
||||
int stamp_index; //0-23.
|
||||
ImageScheme(BufferedImage base,int index) { |
||||
this.base=base; |
||||
this.stamp_index=index; |
||||
} |
||||
} |
||||
|
||||
class SingleImageScheme extends ImageScheme{ |
||||
|
||||
SingleImageScheme(BufferedImage base) { |
||||
super(base, 0); |
||||
} |
||||
|
||||
} |
@ -1,303 +0,0 @@ |
||||
package sig.modules; |
||||
|
||||
import java.awt.Color; |
||||
import java.awt.Graphics; |
||||
import java.awt.Image; |
||||
import java.awt.Point; |
||||
import java.awt.Rectangle; |
||||
import java.awt.event.KeyEvent; |
||||
import java.awt.geom.Rectangle2D; |
||||
import java.io.File; |
||||
import java.io.IOException; |
||||
import java.util.ArrayList; |
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
import javax.imageio.ImageIO; |
||||
import javax.sound.sampled.AudioInputStream; |
||||
import javax.sound.sampled.AudioSystem; |
||||
import javax.sound.sampled.Clip; |
||||
import javax.sound.sampled.LineUnavailableException; |
||||
import javax.sound.sampled.UnsupportedAudioFileException; |
||||
import javax.swing.JFileChooser; |
||||
import javax.swing.JOptionPane; |
||||
|
||||
import sig.Module; |
||||
import sig.sigIRC; |
||||
import sig.modules.Controller.Controller; |
||||
|
||||
public class DDRStepModule extends Module{ |
||||
public static DDRStepModule step_module; |
||||
ControllerModule controller; |
||||
Controller cont; |
||||
AudioInputStream songStream,metronomeStream; |
||||
Clip audioClip,metronomeClick; |
||||
int bpm=180; |
||||
int lastsystemtime = 0; |
||||
int lastnotetime = 0; |
||||
int offset = 0; |
||||
int framecounter = 0; |
||||
Image arrow_img1,arrow_img2; |
||||
byte[] lastbuttonstate = new byte[]{0,0,0,0,0,0}; |
||||
boolean[] lastpressedstate = new boolean[]{false,false,false,false,false,false}; |
||||
List<Note> notelist = new ArrayList<Note>(); |
||||
boolean notepressed=false; |
||||
int notespd = 256; |
||||
|
||||
public DDRStepModule(Rectangle2D bounds, String moduleName) { |
||||
this(bounds,moduleName,true); |
||||
} |
||||
|
||||
public DDRStepModule(Rectangle2D bounds, String moduleName, boolean enabled) { |
||||
super(bounds, moduleName, enabled); |
||||
Initialize(); |
||||
} |
||||
|
||||
void Initialize() { |
||||
DDRStepModule.step_module = this; |
||||
if (sigIRC.controllermodule_enabled) { |
||||
try { |
||||
metronomeStream = AudioSystem.getAudioInputStream(new File(sigIRC.BASEDIR+"sigIRC/sounds/tick.wav")); |
||||
try { |
||||
metronomeClick = AudioSystem.getClip(); |
||||
metronomeClick.open(metronomeStream); |
||||
} catch (LineUnavailableException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} catch (UnsupportedAudioFileException e1) { |
||||
e1.printStackTrace(); |
||||
} catch (IOException e1) { |
||||
e1.printStackTrace(); |
||||
} |
||||
controller = ControllerModule.controller_module; |
||||
cont = controller.getControllers().get(0); |
||||
try { |
||||
arrow_img1 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/ddr_notes1.png")); |
||||
arrow_img2 = ImageIO.read(new File(sigIRC.BASEDIR+"sigIRC/ddr_notes2.png")); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} else { |
||||
System.out.println("Cannot initialize DDRStepModule due to Controller Module being disabled!"); |
||||
this.enabled = false; |
||||
} |
||||
} |
||||
|
||||
public static void loadModule() { |
||||
sigIRC.modules.add(new DDRStepModule( |
||||
new Rectangle(sigIRC.ddrstepmodule_X,sigIRC.ddrstepmodule_Y,sigIRC.ddrstepmodule_width,sigIRC.ddrstepmodule_height), |
||||
"DDR Step" |
||||
)); |
||||
sigIRC.ddrstepmodule_enabled=true; |
||||
sigIRC.config.setBoolean("Module_ddrstep_Enabled", sigIRC.ddrstepmodule_enabled); |
||||
sigIRC.config.saveProperties(); |
||||
} |
||||
public static void unloadModule() { |
||||
for (int i=0;i<sigIRC.modules.size();i++) { |
||||
if (sigIRC.modules.get(i) instanceof DDRStepModule) { |
||||
sigIRC.modules.remove(sigIRC.modules.get(i)); |
||||
} |
||||
} |
||||
sigIRC.ddrstepmodule_enabled=false; |
||||
sigIRC.config.setBoolean("Module_ddrstep_Enabled", sigIRC.ddrstepmodule_enabled); |
||||
sigIRC.config.saveProperties(); |
||||
} |
||||
|
||||
public void run() { |
||||
super.run(); |
||||
|
||||
if (cont!=null) { |
||||
//System.out.println(cont.outputButtons());
|
||||
/* Start = 1 |
||||
Select = 0 |
||||
Up = 5 |
||||
Right = 2 |
||||
Left = 4 |
||||
Down = 3 |
||||
*/ |
||||
|
||||
|
||||
//System.out.println((System.currentTimeMillis()-(1000/(bpm/60d)))+"/"+lastsystemtime);
|
||||
if (audioClip!=null && |
||||
audioClip.isRunning() && lastsystemtime<audioClip.getFramePosition()-(44100/(bpm/60d))) { |
||||
//System.out.print("Tick. ");
|
||||
lastsystemtime += (44100/(bpm/60d)); |
||||
//metronomeClick.loop(Clip.LOOP_CONTINUOUSLY);
|
||||
metronomeClick.stop(); |
||||
metronomeClick.setFramePosition(0); |
||||
metronomeClick.start(); |
||||
} //METRONOME CODE.
|
||||
if (audioClip!=null && |
||||
audioClip.isRunning() && lastnotetime<audioClip.getFramePosition()-(44100/((bpm*2)/60d))) { |
||||
//System.out.print("Tick. ");
|
||||
lastnotetime += (44100/((bpm*2)/60d)); |
||||
for (int i=0;i<6;i++) { |
||||
lastpressedstate[i]=false; |
||||
} |
||||
} |
||||
if (audioClip!=null && audioClip.isRunning()) { |
||||
framecounter++; |
||||
System.out.println(audioClip.getFramePosition()); |
||||
//UP
|
||||
//44100Hz = 1 second
|
||||
} |
||||
byte[] buttons = cont.getButtons(); |
||||
HandleButton(BUTTONDIR.UP,buttons); |
||||
HandleButton(BUTTONDIR.DOWN,buttons); |
||||
HandleButton(BUTTONDIR.LEFT,buttons); |
||||
HandleButton(BUTTONDIR.RIGHT,buttons); |
||||
} |
||||
} |
||||
|
||||
void HandleButton(BUTTONDIR button, byte[] buttons) { |
||||
if (lastbuttonstate[button.getButton()]==0 && buttons[button.getButton()]==1) { |
||||
System.out.println(button+" Pressed"/* at "+audioClip.getFramePosition()*/); |
||||
lastbuttonstate[button.getButton()] = buttons[button.getButton()]; |
||||
if (!lastpressedstate[button.button]) { |
||||
lastpressedstate[button.button]=true; |
||||
notelist.add(new Note(lastnotetime,button.getNote())); |
||||
} |
||||
} else |
||||
if (lastbuttonstate[button.getButton()]==1 && buttons[button.getButton()]==0) { |
||||
System.out.println(button+" Released"/* at "+audioClip.getFramePosition()*/); |
||||
lastbuttonstate[button.getButton()] = buttons[button.getButton()]; |
||||
} |
||||
} |
||||
|
||||
class Note{ |
||||
int framePosition; |
||||
//(44100/(bpm/60d)) = Quarter Note Snapping
|
||||
//(44100/((bpm*2)/60d)) = Eighth Note Snapping
|
||||
NOTEPROPERTIES direction; |
||||
|
||||
Note(int framePosition, NOTEPROPERTIES direction) { |
||||
this.framePosition = framePosition; |
||||
this.direction = direction; |
||||
} |
||||
} |
||||
|
||||
enum NOTEPROPERTIES{ |
||||
UP(0,2), |
||||
DOWN(-64,1), |
||||
LEFT(-128,0), |
||||
RIGHT(64,3); |
||||
|
||||
int xoffset,subimage; |
||||
|
||||
NOTEPROPERTIES(int xoffset,int subimage) { |
||||
this.xoffset = xoffset; |
||||
this.subimage = subimage; |
||||
} |
||||
|
||||
int getXOffset() { |
||||
return xoffset; |
||||
} |
||||
|
||||
int getSubimage() { |
||||
return subimage; |
||||
} |
||||
} |
||||
|
||||
enum BUTTONDIR{ |
||||
UP(5,NOTEPROPERTIES.UP), |
||||
DOWN(3,NOTEPROPERTIES.DOWN), |
||||
LEFT(4,NOTEPROPERTIES.LEFT), |
||||
RIGHT(2,NOTEPROPERTIES.RIGHT); |
||||
|
||||
int button; |
||||
NOTEPROPERTIES note; |
||||
|
||||
BUTTONDIR(int button, NOTEPROPERTIES note) { |
||||
this.button = button; |
||||
this.note = note; |
||||
} |
||||
|
||||
int getButton() { |
||||
return button; |
||||
} |
||||
NOTEPROPERTIES getNote() { |
||||
return note; |
||||
} |
||||
} |
||||
|
||||
public void draw(Graphics g) { |
||||
super.draw(g); |
||||
Point initialP = new Point((int)this.position.getCenterX()-arrow_img1.getWidth(sigIRC.window)/2,(int)this.position.getY()+(int)this.position.getHeight()); |
||||
g.drawImage(arrow_img1, (int)this.position.getCenterX()-arrow_img1.getWidth(sigIRC.window)/2, (int)this.position.getY()+(int)this.position.getHeight(), sigIRC.window); |
||||
|
||||
if (audioClip!=null && audioClip.isRunning()) { |
||||
for (int i=notelist.size()-1;i>0;i--) { |
||||
Note n = notelist.get(i); |
||||
if ((int)(notespd*((audioClip.getFramePosition()-n.framePosition)/44100d))>this.position.getHeight()) { |
||||
break; |
||||
} |
||||
g.setColor(Color.RED); |
||||
g.drawImage(arrow_img2, initialP.x+128+n.direction.xoffset, initialP.y-(int)(notespd*((audioClip.getFramePosition()-n.framePosition)/44100d)), initialP.x+64+128+n.direction.xoffset, initialP.y+64-(int)(notespd*((audioClip.getFramePosition()-n.framePosition)/44100d)), n.direction.subimage*64, 0, n.direction.subimage*64+64, 64, new Color(0,0,0,0), sigIRC.window); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public void keypressed(KeyEvent ev) { |
||||
super.keypressed(ev); |
||||
if (ev.getKeyCode() == ev.VK_OPEN_BRACKET) { |
||||
JFileChooser song_choice = new JFileChooser(); |
||||
int val = song_choice.showOpenDialog(sigIRC.window); |
||||
if (val == JFileChooser.APPROVE_OPTION) { |
||||
System.out.println("Opening file "+song_choice.getSelectedFile().getAbsolutePath()); |
||||
} |
||||
JOptionPane bpm_pane = new JOptionPane(); |
||||
String input = bpm_pane.showInputDialog(sigIRC.window,"Input Song BPM:","180"); |
||||
if (input!=null && input.length()>0) { |
||||
bpm = Integer.parseInt(input); |
||||
System.out.println("BPM set to "+bpm); |
||||
try { |
||||
songStream = AudioSystem.getAudioInputStream(new File(song_choice.getSelectedFile().getAbsolutePath())); |
||||
try { |
||||
if (audioClip!=null && audioClip.isOpen()) { |
||||
audioClip.close(); |
||||
} |
||||
audioClip = AudioSystem.getClip(); |
||||
audioClip.open(songStream); |
||||
} catch (LineUnavailableException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} catch (UnsupportedAudioFileException e) { |
||||
e.printStackTrace(); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
bpm_pane.showMessageDialog(sigIRC.window,"Press the RIGHT BRACKET button to begin playing."); |
||||
} else |
||||
if (ev.getKeyCode() == ev.VK_1) { |
||||
if (audioClip.isOpen() && !audioClip.isRunning()) { |
||||
audioClip.start(); |
||||
framecounter = audioClip.getFramePosition(); |
||||
System.out.println("Audio Clip Started."); |
||||
lastsystemtime = audioClip.getFramePosition(); |
||||
lastnotetime = audioClip.getFramePosition(); |
||||
} |
||||
} else |
||||
if (ev.getKeyCode() == ev.VK_2) { |
||||
if (audioClip.isOpen() && audioClip.isRunning()) { |
||||
audioClip.stop(); |
||||
audioClip.setFramePosition(offset); |
||||
System.out.println("Audio Clip Stopped."); |
||||
} |
||||
} else |
||||
if (ev.getKeyCode() == ev.VK_3) { |
||||
if (audioClip.isOpen() && audioClip.isRunning()) { |
||||
offset = audioClip.getFramePosition(); |
||||
//audioClip.setMicrosecondPosition(offset);
|
||||
System.out.println("Set new Offset to "+offset); |
||||
} |
||||
} else |
||||
if (ev.getKeyCode() == ev.VK_4) { |
||||
if (audioClip.isOpen() && !audioClip.isRunning()) { |
||||
framecounter = 0; |
||||
audioClip.setFramePosition(0); |
||||
System.out.println("Reset offset to 0."); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,10 +0,0 @@ |
||||
package sig.modules; |
||||
|
||||
public class MapPoint { |
||||
int timer; |
||||
String player; |
||||
public MapPoint(int timer, String player) { |
||||
this.timer=timer; |
||||
this.player=player; |
||||
} |
||||
} |
@ -1,81 +0,0 @@ |
||||
package sig.modules.RabiRace; |
||||
|
||||
import java.awt.Color; |
||||
|
||||
public enum ColorLocation { |
||||
UNKNOWN(0,"Unknown",52,52,52), |
||||
STARTING_FOREST(1,"Starting Forest",110,181,103), |
||||
SPECTRAL_CAVE(2,"Spectral Cave",97,103,162), |
||||
FORGOTTEN_CAVE(3,"Forgotten Cave",135,110,75), |
||||
NATURAL_AQUARIUM(4,"Natural Aquarium",128,169,115), |
||||
DLC2BOSSARENA(5,"Boss Arena",255,255,255), |
||||
FORGOTTENCAVEII(6,"Forgotten Cave II",146,108,109), |
||||
UPPERFOREST(7,"Upper Forest",0,128,84), |
||||
BLANK(8,"???",52,52,52), |
||||
RABIRABIBEACH(9,"Rabi Rabi Beach",98,135,193), |
||||
GOLDENPYRAMID(10,"Golden Pyramid",198,161,75), |
||||
RABIRABIRAVINE(11,"Rabi Rabi Ravine",110,181,103), |
||||
RABIRABITOWN(12,"Rabi Rabi Town",217,145,126), |
||||
RABIRABIPARK(13,"Rabi Rabi Park",181,110,103), |
||||
UPRPRCBASE(14,"UPRPRC Base",110,110,181), |
||||
SKYISLANDTOWN(15,"Sky Island Town",142,105,150), |
||||
AZURESNOWLAND(16,"Azure Snowland",142,105,235), |
||||
SYSTEMINTERIORI(17,"System Interior I",104,156,207), |
||||
EVERNIGHTPEAK(18,"Evernight Peak",75,97,210), |
||||
EXOTICLAB(19,"Exotic Laboratory",175,103,134), |
||||
GOLDENRIVERBANK(20,"Golden Riverbank",206,156,105), |
||||
FLOATINGGRAVEYARD(21,"Floating Graveyard",180,59,54), |
||||
SYSTEMINTERIORII(22,"System Interior II",212,77,86), |
||||
AURORAPALACE(23,"Aurora Palace",34,169,209), |
||||
FLOATINGLIBRARY(24,"Floating Library",118,198,166), |
||||
NATURALAQUARIUM(25,"Natural Aquarium",128,169,115), |
||||
SKYHIGHBRIDGE(26,"Sky-High Bridge",106,195,182), |
||||
WARPDESTINATION(27,"Warp Destination",138,178,88), |
||||
VOLCANICCAVERNS(28,"Volcanic Caverns",186,45,42), |
||||
PLURKWOOD(29,"Plurkwood",195,98,45), |
||||
HALLOFMEMORIES(30,"Hall of Memories",64,99,164), |
||||
ICYSUMMIT(31,"Icy Summit",45,104,146), |
||||
HALLOFMEMORIESII(32,"Hall of Memories II",220,143,64), |
||||
HALLOWEENAREA(34,"Halloween Area",121,55,53), |
||||
HOSPITAL(50,"Hospital",97,97,136), |
||||
RABIRABIRAVINEII(55,"Rabi Rabi Ravine II",42,184,120), |
||||
NOAH3BOSSARENA(81,"Noah 3 Boss Arena",52,52,52), |
||||
NOAH1BOSSARENA(83,"Noah 1 Boss Arena",52,52,52), |
||||
RUMIBOSSARENA(87,"Rumi Boss Arena",203,125,122), |
||||
HALLOFMEMORIES21(95,"Hall of Memories II",255,255,0), |
||||
HALLOFMEMORIES22(96,"Hall of Memories II",255,255,0), |
||||
HALLOFMEMORIES23(97,"Hall of Memories II",255,255,0), |
||||
HALLOFMEMORIES24(98,"Hall of Memories II",255,255,0), |
||||
|
||||
; |
||||
|
||||
int color; |
||||
String name; |
||||
Color colorval; |
||||
|
||||
ColorLocation(int val, String name, int r, int g, int b) { |
||||
|
||||
color = val; |
||||
this.name=name; |
||||
this.colorval = new Color(r,g,b); |
||||
|
||||
} |
||||
|
||||
public static Color getColor(int id) { |
||||
for (ColorLocation cl : ColorLocation.values()) { |
||||
if (cl.color == id) { |
||||
return cl.colorval; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public static String getLocationName(int id) { |
||||
for (ColorLocation cl : ColorLocation.values()) { |
||||
if (cl.color == id) { |
||||
return cl.name; |
||||
} |
||||
} |
||||
return ""; |
||||
} |
||||
} |
@ -1,26 +0,0 @@ |
||||
package sig.modules.RabiRace; |
||||
|
||||
import java.awt.Rectangle; |
||||
import java.awt.event.MouseEvent; |
||||
import java.io.File; |
||||
import java.io.IOException; |
||||
import java.net.MalformedURLException; |
||||
import java.net.URL; |
||||
|
||||
import sig.Module; |
||||
import sig.sigIRC; |
||||
import sig.modules.RabiRaceModule; |
||||
|
||||
public class MarkMapButton extends ClickableButton{ |
||||
|
||||
public MarkMapButton(Rectangle position, String button_label, RabiRaceModule module) { |
||||
super(position,button_label,module); |
||||
} |
||||
|
||||
public void onClickEvent(MouseEvent ev) { |
||||
if (RabiRaceModule.module.mySession!=null) { |
||||
//System.out.println("Mark Map.");
|
||||
RabiRaceModule.module.MarkCurrentPosition(); |
||||
} |
||||
} |
||||
} |