Touhou Mother Fixes

dev
sigonasr2 7 years ago
parent 72c10519cf
commit 967c66040c
  1. BIN
      sigIRCv2.jar
  2. 20
      src/sig/modules/TouhouMother/UpdateButton.java
  3. 6
      src/sig/modules/TouhouMotherModule.java
  4. 4
      src/sig/modules/utils/SemiValidInteger.java
  5. 2
      src/sig/modules/utils/SemiValidString.java

Binary file not shown.

@ -11,6 +11,7 @@ import java.util.Arrays;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import sig.MyPanel;
import sig.sigIRC; import sig.sigIRC;
import sig.modules.TouhouMotherModule; import sig.modules.TouhouMotherModule;
import sig.utils.DrawUtils; import sig.utils.DrawUtils;
@ -21,6 +22,8 @@ public class UpdateButton extends TouhouMotherButton{
String[] data; String[] data;
int currentselection=4; int currentselection=4;
boolean buttonEnabled = false; boolean buttonEnabled = false;
int displaytime=0;
String message = "";
public UpdateButton(TouhouMotherModule parentmodule, File filename, int x, int y) { public UpdateButton(TouhouMotherModule parentmodule, File filename, int x, int y) {
super(parentmodule,filename,x,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) { public void draw(Graphics g) {
if (buttonEnabled) { 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.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]); 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); super.draw(g);
} }
} }
@ -71,6 +83,9 @@ public class UpdateButton extends TouhouMotherButton{
int nextselection = currentselection+(int)Math.signum(ev.getWheelRotation()); int nextselection = currentselection+(int)Math.signum(ev.getWheelRotation());
nextselection = LoopSelectionAround(nextselection); nextselection = LoopSelectionAround(nextselection);
currentselection=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; return nextselection;
} }
private void TriggerNewMessage(String string, int time) {
message = string;
displaytime = time;
}
private int findLastNonBlankLine() { private int findLastNonBlankLine() {
for (int i=data.length-2;i>=0;i++) { for (int i=data.length-2;i>=0;i++) {
if (data[i].length()>0) { if (data[i].length()>0) {

@ -105,6 +105,8 @@ public class TouhouMotherModule extends Module implements ActionListener{
data_display_toggle=0; data_display_toggle=0;
} }
swapButton.run(); swapButton.run();
updateButton.run();
killButton.run();
} }
@ -255,7 +257,7 @@ public class TouhouMotherModule extends Module implements ActionListener{
return tmbd; 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; return null;
} }
@ -264,7 +266,7 @@ public class TouhouMotherModule extends Module implements ActionListener{
if (GetBossData(bossID.getValidInteger())!=null) { if (GetBossData(bossID.getValidInteger())!=null) {
bossHP = new SemiValidInteger(Arrays.copyOfRange(memory, 0, 8),GetBossData(bossID.getValidInteger()).getHP(),currentBoss!=null,(bossHP!=null)?bossHP.getTrustedSlot():-1); 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)); 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_bossHP = bossHP.getValidInteger();
real_bossID = bossID.getValidInteger(); real_bossID = bossID.getValidInteger();
real_gameData = gameData.getValidString(); 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() { 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; return ERROR_VALUE;
} }

@ -18,7 +18,7 @@ public class SemiValidString {
return val; 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; return ERROR_VALUE;
} }

Loading…
Cancel
Save