Touhou Mother Fixes
This commit is contained in:
parent
72c10519cf
commit
967c66040c
BIN
sigIRCv2.jar
BIN
sigIRCv2.jar
Binary file not shown.
@ -11,6 +11,7 @@ import java.util.Arrays;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import sig.MyPanel;
|
||||
import sig.sigIRC;
|
||||
import sig.modules.TouhouMotherModule;
|
||||
import sig.utils.DrawUtils;
|
||||
@ -21,6 +22,8 @@ public class UpdateButton extends TouhouMotherButton{
|
||||
String[] data;
|
||||
int currentselection=4;
|
||||
boolean buttonEnabled = false;
|
||||
int displaytime=0;
|
||||
String message = "";
|
||||
|
||||
public UpdateButton(TouhouMotherModule parentmodule, File filename, int x, int y) {
|
||||
super(parentmodule,filename,x,y);
|
||||
@ -30,10 +33,19 @@ public class UpdateButton extends TouhouMotherButton{
|
||||
}
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if (displaytime>0) {
|
||||
displaytime--;
|
||||
}
|
||||
}
|
||||
|
||||
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),
|
||||
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);
|
||||
}
|
||||
super.draw(g);
|
||||
}
|
||||
}
|
||||
@ -71,6 +83,9 @@ public class UpdateButton extends TouhouMotherButton{
|
||||
int nextselection = currentselection+(int)Math.signum(ev.getWheelRotation());
|
||||
nextselection = LoopSelectionAround(nextselection);
|
||||
currentselection=nextselection;
|
||||
if (ev.getWheelRotation()!=0) {
|
||||
TriggerNewMessage(data[currentselection].split(",")[0],30*3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,6 +99,11 @@ public class UpdateButton extends TouhouMotherButton{
|
||||
return nextselection;
|
||||
}
|
||||
|
||||
private void TriggerNewMessage(String string, int time) {
|
||||
message = string;
|
||||
displaytime = time;
|
||||
}
|
||||
|
||||
private int findLastNonBlankLine() {
|
||||
for (int i=data.length-2;i>=0;i++) {
|
||||
if (data[i].length()>0) {
|
||||
|
||||
@ -105,6 +105,8 @@ public class TouhouMotherModule extends Module implements ActionListener{
|
||||
data_display_toggle=0;
|
||||
}
|
||||
swapButton.run();
|
||||
updateButton.run();
|
||||
killButton.run();
|
||||
}
|
||||
|
||||
|
||||
@ -255,7 +257,7 @@ public class TouhouMotherModule extends Module implements ActionListener{
|
||||
return tmbd;
|
||||
}
|
||||
}
|
||||
System.out.println("Invalid boss ID specified! Could not find boss with ID "+bossID+"!");
|
||||
//System.out.println("Invalid boss ID specified! Could not find boss with ID "+bossID+"!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -264,7 +266,7 @@ public class TouhouMotherModule extends Module implements ActionListener{
|
||||
if (GetBossData(bossID.getValidInteger())!=null) {
|
||||
bossHP = new SemiValidInteger(Arrays.copyOfRange(memory, 0, 8),GetBossData(bossID.getValidInteger()).getHP(),currentBoss!=null,(bossHP!=null)?bossHP.getTrustedSlot():-1);
|
||||
gameData = new SemiValidString(Arrays.copyOfRange(memory, 9, 13));
|
||||
System.out.println(bossHP.toString()+";"+bossID.toString()+";"+gameData.toString());
|
||||
//System.out.println(bossHP.toString()+";"+bossID.toString()+";"+gameData.toString());
|
||||
real_bossHP = bossHP.getValidInteger();
|
||||
real_bossID = bossID.getValidInteger();
|
||||
real_gameData = gameData.getValidString();
|
||||
|
||||
@ -41,7 +41,7 @@ public class SemiValidInteger {
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.print("Test values: "+Arrays.toString(vals));
|
||||
//System.out.print("Test values: "+Arrays.toString(vals));
|
||||
}
|
||||
|
||||
public int getValidInteger() {
|
||||
@ -63,7 +63,7 @@ public class SemiValidInteger {
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("WARNING! Could not find valid value for SemiValidInteger["+values.length+"]!");
|
||||
//System.out.println("WARNING! Could not find valid value for SemiValidInteger["+values.length+"]!");
|
||||
return ERROR_VALUE;
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ public class SemiValidString {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
System.out.println("WARNING! Could not find valid value for SemiValidString["+values.length+"]!");
|
||||
//System.out.println("WARNING! Could not find valid value for SemiValidString["+values.length+"]!");
|
||||
return ERROR_VALUE;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user