diff --git a/RabiTracker/.classpath b/RabiTracker/.classpath index a02fbb3..b446eeb 100644 --- a/RabiTracker/.classpath +++ b/RabiTracker/.classpath @@ -1,6 +1,7 @@ + diff --git a/RabiTracker/RabiTracker.jar b/RabiTracker/RabiTracker.jar index f79ed8b..52a4ef3 100644 Binary files a/RabiTracker/RabiTracker.jar and b/RabiTracker/RabiTracker.jar differ diff --git a/RabiTracker/memoryData b/RabiTracker/memoryData index 835bfef..5d4b4a3 100644 --- a/RabiTracker/memoryData +++ b/RabiTracker/memoryData @@ -79,6 +79,7 @@ BADGE_HEALTH_SURGE:1.851;True;1.881;True;1.90;True BADGE_MANA_PLUS:1.851;True;1.881;True;1.90;True BADGE_MANA_SURGE:1.851;True;1.881;True;1.90;True BADGE_CRISIS_BOOST:1.851;True;1.881;True;1.90;True +BADGE_ATK_GROW:1.851;True;1.881;True;1.90;True BADGE_DEF_GROW:1.851;True;1.881;True;1.90;True BADGE_ATK_TRADE:1.851;True;1.881;True;1.90;True BADGE_DEF_TRADE:1.851;True;1.881;True;1.90;True diff --git a/RabiTracker/rabi-ribi/characters/small_aruraune.png b/RabiTracker/rabi-ribi/characters/small_aruraune.png new file mode 100644 index 0000000..62e8751 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_aruraune.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_ashuri.png b/RabiTracker/rabi-ribi/characters/small_ashuri.png new file mode 100644 index 0000000..82ee13a Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_ashuri.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_blue_kotri.png b/RabiTracker/rabi-ribi/characters/small_blue_kotri.png new file mode 100644 index 0000000..d15a2f9 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_blue_kotri.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_cicini.png b/RabiTracker/rabi-ribi/characters/small_cicini.png new file mode 100644 index 0000000..ee42f9a Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_cicini.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_cocoa.png b/RabiTracker/rabi-ribi/characters/small_cocoa.png new file mode 100644 index 0000000..2d5bab2 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_cocoa.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_erina.png b/RabiTracker/rabi-ribi/characters/small_erina.png new file mode 100644 index 0000000..abf9a48 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_erina.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_green_kotri.png b/RabiTracker/rabi-ribi/characters/small_green_kotri.png new file mode 100644 index 0000000..432db58 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_green_kotri.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_illusion_alius.png b/RabiTracker/rabi-ribi/characters/small_illusion_alius.png new file mode 100644 index 0000000..ce7938c Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_illusion_alius.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_irisu.png b/RabiTracker/rabi-ribi/characters/small_irisu.png new file mode 100644 index 0000000..2fbf975 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_irisu.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_keke_bunny.png b/RabiTracker/rabi-ribi/characters/small_keke_bunny.png new file mode 100644 index 0000000..f23d21d Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_keke_bunny.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_kotri.png b/RabiTracker/rabi-ribi/characters/small_kotri.png new file mode 100644 index 0000000..329e58b Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_kotri.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_lilith.png b/RabiTracker/rabi-ribi/characters/small_lilith.png new file mode 100644 index 0000000..6ed446d Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_lilith.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_lilli.png b/RabiTracker/rabi-ribi/characters/small_lilli.png new file mode 100644 index 0000000..9e7c73d Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_lilli.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_miriam.png b/RabiTracker/rabi-ribi/characters/small_miriam.png new file mode 100644 index 0000000..21d6080 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_miriam.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_miru.png b/RabiTracker/rabi-ribi/characters/small_miru.png new file mode 100644 index 0000000..0333dfc Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_miru.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_nieve.png b/RabiTracker/rabi-ribi/characters/small_nieve.png new file mode 100644 index 0000000..7303f5f Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_nieve.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_nixie.png b/RabiTracker/rabi-ribi/characters/small_nixie.png new file mode 100644 index 0000000..9d2b8db Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_nixie.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_noah.png b/RabiTracker/rabi-ribi/characters/small_noah.png new file mode 100644 index 0000000..5dfd40e Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_noah.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_pandora.png b/RabiTracker/rabi-ribi/characters/small_pandora.png new file mode 100644 index 0000000..0363a6f Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_pandora.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_pixie.png b/RabiTracker/rabi-ribi/characters/small_pixie.png new file mode 100644 index 0000000..1d99508 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_pixie.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_ribbon.png b/RabiTracker/rabi-ribi/characters/small_ribbon.png new file mode 100644 index 0000000..14e5b22 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_ribbon.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_rita.png b/RabiTracker/rabi-ribi/characters/small_rita.png new file mode 100644 index 0000000..c081de2 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_rita.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_rumi.png b/RabiTracker/rabi-ribi/characters/small_rumi.png new file mode 100644 index 0000000..075250d Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_rumi.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_saya.png b/RabiTracker/rabi-ribi/characters/small_saya.png new file mode 100644 index 0000000..8395d8a Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_saya.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_seana.png b/RabiTracker/rabi-ribi/characters/small_seana.png new file mode 100644 index 0000000..72c7e9f Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_seana.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_shadow_pandora.png b/RabiTracker/rabi-ribi/characters/small_shadow_pandora.png new file mode 100644 index 0000000..1dd72d5 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_shadow_pandora.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_shadow_rita.png b/RabiTracker/rabi-ribi/characters/small_shadow_rita.png new file mode 100644 index 0000000..22ac97e Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_shadow_rita.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_syaro.png b/RabiTracker/rabi-ribi/characters/small_syaro.png new file mode 100644 index 0000000..325e036 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_syaro.png differ diff --git a/RabiTracker/rabi-ribi/characters/small_vanilla.png b/RabiTracker/rabi-ribi/characters/small_vanilla.png new file mode 100644 index 0000000..5dfcfc2 Binary files /dev/null and b/RabiTracker/rabi-ribi/characters/small_vanilla.png differ diff --git a/RabiTracker/rabi-ribi/items/air_dash.png b/RabiTracker/rabi-ribi/items/air_dash.png new file mode 100644 index 0000000..40288bd Binary files /dev/null and b/RabiTracker/rabi-ribi/items/air_dash.png differ diff --git a/RabiTracker/rabi-ribi/items/air_jump.png b/RabiTracker/rabi-ribi/items/air_jump.png new file mode 100644 index 0000000..481d1c6 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/air_jump.png differ diff --git a/RabiTracker/rabi-ribi/items/arm_strength.png b/RabiTracker/rabi-ribi/items/arm_strength.png new file mode 100644 index 0000000..d55e01e Binary files /dev/null and b/RabiTracker/rabi-ribi/items/arm_strength.png differ diff --git a/RabiTracker/rabi-ribi/items/armored.png b/RabiTracker/rabi-ribi/items/armored.png new file mode 100644 index 0000000..55d58cc Binary files /dev/null and b/RabiTracker/rabi-ribi/items/armored.png differ diff --git a/RabiTracker/rabi-ribi/items/atk_grow.png b/RabiTracker/rabi-ribi/items/atk_grow.png new file mode 100644 index 0000000..220f02a Binary files /dev/null and b/RabiTracker/rabi-ribi/items/atk_grow.png differ diff --git a/RabiTracker/rabi-ribi/items/atk_trade.png b/RabiTracker/rabi-ribi/items/atk_trade.png new file mode 100644 index 0000000..41e1928 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/atk_trade.png differ diff --git a/RabiTracker/rabi-ribi/items/attack_up.png b/RabiTracker/rabi-ribi/items/attack_up.png new file mode 100644 index 0000000..fa72a6b Binary files /dev/null and b/RabiTracker/rabi-ribi/items/attack_up.png differ diff --git a/RabiTracker/rabi-ribi/items/auto_earrings.png b/RabiTracker/rabi-ribi/items/auto_earrings.png new file mode 100644 index 0000000..9f68cad Binary files /dev/null and b/RabiTracker/rabi-ribi/items/auto_earrings.png differ diff --git a/RabiTracker/rabi-ribi/items/auto_trigger.png b/RabiTracker/rabi-ribi/items/auto_trigger.png new file mode 100644 index 0000000..aef9ca5 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/auto_trigger.png differ diff --git a/RabiTracker/rabi-ribi/items/blessed.png b/RabiTracker/rabi-ribi/items/blessed.png new file mode 100644 index 0000000..a9ca10c Binary files /dev/null and b/RabiTracker/rabi-ribi/items/blessed.png differ diff --git a/RabiTracker/rabi-ribi/items/book_of_carrot.png b/RabiTracker/rabi-ribi/items/book_of_carrot.png new file mode 100644 index 0000000..593b18b Binary files /dev/null and b/RabiTracker/rabi-ribi/items/book_of_carrot.png differ diff --git a/RabiTracker/rabi-ribi/items/bunny_amulet.png b/RabiTracker/rabi-ribi/items/bunny_amulet.png new file mode 100644 index 0000000..a02efd6 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/bunny_amulet.png differ diff --git a/RabiTracker/rabi-ribi/items/bunny_clover.png b/RabiTracker/rabi-ribi/items/bunny_clover.png new file mode 100644 index 0000000..7f76255 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/bunny_clover.png differ diff --git a/RabiTracker/rabi-ribi/items/bunny_memories.png b/RabiTracker/rabi-ribi/items/bunny_memories.png new file mode 100644 index 0000000..b6411e8 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/bunny_memories.png differ diff --git a/RabiTracker/rabi-ribi/items/bunny_strike.png b/RabiTracker/rabi-ribi/items/bunny_strike.png new file mode 100644 index 0000000..ece384b Binary files /dev/null and b/RabiTracker/rabi-ribi/items/bunny_strike.png differ diff --git a/RabiTracker/rabi-ribi/items/bunny_whirl.png b/RabiTracker/rabi-ribi/items/bunny_whirl.png new file mode 100644 index 0000000..68c4363 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/bunny_whirl.png differ diff --git a/RabiTracker/rabi-ribi/items/carrot_bomb.png b/RabiTracker/rabi-ribi/items/carrot_bomb.png new file mode 100644 index 0000000..6a12db8 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/carrot_bomb.png differ diff --git a/RabiTracker/rabi-ribi/items/carrot_boost.png b/RabiTracker/rabi-ribi/items/carrot_boost.png new file mode 100644 index 0000000..d0d5b2c Binary files /dev/null and b/RabiTracker/rabi-ribi/items/carrot_boost.png differ diff --git a/RabiTracker/rabi-ribi/items/carrot_shooter.png b/RabiTracker/rabi-ribi/items/carrot_shooter.png new file mode 100644 index 0000000..dd8a387 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/carrot_shooter.png differ diff --git a/RabiTracker/rabi-ribi/items/cashback.png b/RabiTracker/rabi-ribi/items/cashback.png new file mode 100644 index 0000000..0765d06 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/cashback.png differ diff --git a/RabiTracker/rabi-ribi/items/chaos_rod.png b/RabiTracker/rabi-ribi/items/chaos_rod.png new file mode 100644 index 0000000..6d24b1f Binary files /dev/null and b/RabiTracker/rabi-ribi/items/chaos_rod.png differ diff --git a/RabiTracker/rabi-ribi/items/charge_ring.png b/RabiTracker/rabi-ribi/items/charge_ring.png new file mode 100644 index 0000000..7a45cd9 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/charge_ring.png differ diff --git a/RabiTracker/rabi-ribi/items/crisis_boost.png b/RabiTracker/rabi-ribi/items/crisis_boost.png new file mode 100644 index 0000000..3001a94 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/crisis_boost.png differ diff --git a/RabiTracker/rabi-ribi/items/cyber_flower.png b/RabiTracker/rabi-ribi/items/cyber_flower.png new file mode 100644 index 0000000..1f2d767 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/cyber_flower.png differ diff --git a/RabiTracker/rabi-ribi/items/def_grow.png b/RabiTracker/rabi-ribi/items/def_grow.png new file mode 100644 index 0000000..42316c4 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/def_grow.png differ diff --git a/RabiTracker/rabi-ribi/items/def_trade.png b/RabiTracker/rabi-ribi/items/def_trade.png new file mode 100644 index 0000000..169145f Binary files /dev/null and b/RabiTracker/rabi-ribi/items/def_trade.png differ diff --git a/RabiTracker/rabi-ribi/items/easter_egg.png b/RabiTracker/rabi-ribi/items/easter_egg.png new file mode 100644 index 0000000..df138d7 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/easter_egg.png differ diff --git a/RabiTracker/rabi-ribi/items/erina_badge.png b/RabiTracker/rabi-ribi/items/erina_badge.png new file mode 100644 index 0000000..4151599 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/erina_badge.png differ diff --git a/RabiTracker/rabi-ribi/items/explode_shot.png b/RabiTracker/rabi-ribi/items/explode_shot.png new file mode 100644 index 0000000..aef6b0a Binary files /dev/null and b/RabiTracker/rabi-ribi/items/explode_shot.png differ diff --git a/RabiTracker/rabi-ribi/items/fairy_s_flute.png b/RabiTracker/rabi-ribi/items/fairy_s_flute.png new file mode 100644 index 0000000..8ff8391 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/fairy_s_flute.png differ diff --git a/RabiTracker/rabi-ribi/items/fire_orb.png b/RabiTracker/rabi-ribi/items/fire_orb.png new file mode 100644 index 0000000..f784845 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/fire_orb.png differ diff --git a/RabiTracker/rabi-ribi/items/frame_cancel.png b/RabiTracker/rabi-ribi/items/frame_cancel.png new file mode 100644 index 0000000..788c9df Binary files /dev/null and b/RabiTracker/rabi-ribi/items/frame_cancel.png differ diff --git a/RabiTracker/rabi-ribi/items/gold_carrot.png b/RabiTracker/rabi-ribi/items/gold_carrot.png new file mode 100644 index 0000000..d7c7d37 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/gold_carrot.png differ diff --git a/RabiTracker/rabi-ribi/items/hammer_roll.png b/RabiTracker/rabi-ribi/items/hammer_roll.png new file mode 100644 index 0000000..00a73b3 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/hammer_roll.png differ diff --git a/RabiTracker/rabi-ribi/items/hammer_wave.png b/RabiTracker/rabi-ribi/items/hammer_wave.png new file mode 100644 index 0000000..135dfc0 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/hammer_wave.png differ diff --git a/RabiTracker/rabi-ribi/items/healing_staff.png b/RabiTracker/rabi-ribi/items/healing_staff.png new file mode 100644 index 0000000..1741e38 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/healing_staff.png differ diff --git a/RabiTracker/rabi-ribi/items/health_plus.png b/RabiTracker/rabi-ribi/items/health_plus.png new file mode 100644 index 0000000..d8c3c10 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/health_plus.png differ diff --git a/RabiTracker/rabi-ribi/items/health_surge.png b/RabiTracker/rabi-ribi/items/health_surge.png new file mode 100644 index 0000000..8a0be09 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/health_surge.png differ diff --git a/RabiTracker/rabi-ribi/items/health_up.png b/RabiTracker/rabi-ribi/items/health_up.png new file mode 100644 index 0000000..767f6c2 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/health_up.png differ diff --git a/RabiTracker/rabi-ribi/items/health_wager.png b/RabiTracker/rabi-ribi/items/health_wager.png new file mode 100644 index 0000000..3c04cd9 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/health_wager.png differ diff --git a/RabiTracker/rabi-ribi/items/hex_cancel.png b/RabiTracker/rabi-ribi/items/hex_cancel.png new file mode 100644 index 0000000..7cfa1b1 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/hex_cancel.png differ diff --git a/RabiTracker/rabi-ribi/items/hitbox_down.png b/RabiTracker/rabi-ribi/items/hitbox_down.png new file mode 100644 index 0000000..c50b43f Binary files /dev/null and b/RabiTracker/rabi-ribi/items/hitbox_down.png differ diff --git a/RabiTracker/rabi-ribi/items/hourglass.png b/RabiTracker/rabi-ribi/items/hourglass.png new file mode 100644 index 0000000..3b539fc Binary files /dev/null and b/RabiTracker/rabi-ribi/items/hourglass.png differ diff --git a/RabiTracker/rabi-ribi/items/light_orb.png b/RabiTracker/rabi-ribi/items/light_orb.png new file mode 100644 index 0000000..e6571a5 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/light_orb.png differ diff --git a/RabiTracker/rabi-ribi/items/lilith_s_gift.png b/RabiTracker/rabi-ribi/items/lilith_s_gift.png new file mode 100644 index 0000000..b32a5b4 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/lilith_s_gift.png differ diff --git a/RabiTracker/rabi-ribi/items/lucky_seven.png b/RabiTracker/rabi-ribi/items/lucky_seven.png new file mode 100644 index 0000000..56f2317 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/lucky_seven.png differ diff --git a/RabiTracker/rabi-ribi/items/mana_plus.png b/RabiTracker/rabi-ribi/items/mana_plus.png new file mode 100644 index 0000000..d369eca Binary files /dev/null and b/RabiTracker/rabi-ribi/items/mana_plus.png differ diff --git a/RabiTracker/rabi-ribi/items/mana_surge.png b/RabiTracker/rabi-ribi/items/mana_surge.png new file mode 100644 index 0000000..33b046a Binary files /dev/null and b/RabiTracker/rabi-ribi/items/mana_surge.png differ diff --git a/RabiTracker/rabi-ribi/items/mana_up.png b/RabiTracker/rabi-ribi/items/mana_up.png new file mode 100644 index 0000000..b03f632 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/mana_up.png differ diff --git a/RabiTracker/rabi-ribi/items/mana_wager.png b/RabiTracker/rabi-ribi/items/mana_wager.png new file mode 100644 index 0000000..eca3068 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/mana_wager.png differ diff --git a/RabiTracker/rabi-ribi/items/max_bracelet.png b/RabiTracker/rabi-ribi/items/max_bracelet.png new file mode 100644 index 0000000..748a6aa Binary files /dev/null and b/RabiTracker/rabi-ribi/items/max_bracelet.png differ diff --git a/RabiTracker/rabi-ribi/items/nature_orb.png b/RabiTracker/rabi-ribi/items/nature_orb.png new file mode 100644 index 0000000..b06c963 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/nature_orb.png differ diff --git a/RabiTracker/rabi-ribi/items/p_hairpin.png b/RabiTracker/rabi-ribi/items/p_hairpin.png new file mode 100644 index 0000000..cc9c29f Binary files /dev/null and b/RabiTracker/rabi-ribi/items/p_hairpin.png differ diff --git a/RabiTracker/rabi-ribi/items/pack_up.png b/RabiTracker/rabi-ribi/items/pack_up.png new file mode 100644 index 0000000..0ab3022 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/pack_up.png differ diff --git a/RabiTracker/rabi-ribi/items/piko_hammer.png b/RabiTracker/rabi-ribi/items/piko_hammer.png new file mode 100644 index 0000000..560bb5e Binary files /dev/null and b/RabiTracker/rabi-ribi/items/piko_hammer.png differ diff --git a/RabiTracker/rabi-ribi/items/plus_necklace.png b/RabiTracker/rabi-ribi/items/plus_necklace.png new file mode 100644 index 0000000..c2ddec8 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/plus_necklace.png differ diff --git a/RabiTracker/rabi-ribi/items/pure_love.png b/RabiTracker/rabi-ribi/items/pure_love.png new file mode 100644 index 0000000..e83a620 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/pure_love.png differ diff --git a/RabiTracker/rabi-ribi/items/quick_barrette.png b/RabiTracker/rabi-ribi/items/quick_barrette.png new file mode 100644 index 0000000..def5b6c Binary files /dev/null and b/RabiTracker/rabi-ribi/items/quick_barrette.png differ diff --git a/RabiTracker/rabi-ribi/items/rabi_slippers.png b/RabiTracker/rabi-ribi/items/rabi_slippers.png new file mode 100644 index 0000000..20fcbb2 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/rabi_slippers.png differ diff --git a/RabiTracker/rabi-ribi/items/regen_up.png b/RabiTracker/rabi-ribi/items/regen_up.png new file mode 100644 index 0000000..d082f50 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/regen_up.png differ diff --git a/RabiTracker/rabi-ribi/items/ribbon.png b/RabiTracker/rabi-ribi/items/ribbon.png new file mode 100644 index 0000000..053b05a Binary files /dev/null and b/RabiTracker/rabi-ribi/items/ribbon.png differ diff --git a/RabiTracker/rabi-ribi/items/ribbon_badge.png b/RabiTracker/rabi-ribi/items/ribbon_badge.png new file mode 100644 index 0000000..cbde669 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/ribbon_badge.png differ diff --git a/RabiTracker/rabi-ribi/items/self_defense.png b/RabiTracker/rabi-ribi/items/self_defense.png new file mode 100644 index 0000000..ba39068 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/self_defense.png differ diff --git a/RabiTracker/rabi-ribi/items/sliding_powder.png b/RabiTracker/rabi-ribi/items/sliding_powder.png new file mode 100644 index 0000000..f4ab88a Binary files /dev/null and b/RabiTracker/rabi-ribi/items/sliding_powder.png differ diff --git a/RabiTracker/rabi-ribi/items/soul_heart.png b/RabiTracker/rabi-ribi/items/soul_heart.png new file mode 100644 index 0000000..5f3eb71 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/soul_heart.png differ diff --git a/RabiTracker/rabi-ribi/items/speed_boost.png b/RabiTracker/rabi-ribi/items/speed_boost.png new file mode 100644 index 0000000..ca20732 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/speed_boost.png differ diff --git a/RabiTracker/rabi-ribi/items/spike_barrier.png b/RabiTracker/rabi-ribi/items/spike_barrier.png new file mode 100644 index 0000000..2699692 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/spike_barrier.png differ diff --git a/RabiTracker/rabi-ribi/items/stamina_plus.png b/RabiTracker/rabi-ribi/items/stamina_plus.png new file mode 100644 index 0000000..ad7bcd4 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/stamina_plus.png differ diff --git a/RabiTracker/rabi-ribi/items/strange_box.png b/RabiTracker/rabi-ribi/items/strange_box.png new file mode 100644 index 0000000..9f30082 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/strange_box.png differ diff --git a/RabiTracker/rabi-ribi/items/sunny_beam.png b/RabiTracker/rabi-ribi/items/sunny_beam.png new file mode 100644 index 0000000..6639373 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/sunny_beam.png differ diff --git a/RabiTracker/rabi-ribi/items/super_carrot.png b/RabiTracker/rabi-ribi/items/super_carrot.png new file mode 100644 index 0000000..c51eae1 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/super_carrot.png differ diff --git a/RabiTracker/rabi-ribi/items/survival.png b/RabiTracker/rabi-ribi/items/survival.png new file mode 100644 index 0000000..3bdefff Binary files /dev/null and b/RabiTracker/rabi-ribi/items/survival.png differ diff --git a/RabiTracker/rabi-ribi/items/top_form.png b/RabiTracker/rabi-ribi/items/top_form.png new file mode 100644 index 0000000..39aae5b Binary files /dev/null and b/RabiTracker/rabi-ribi/items/top_form.png differ diff --git a/RabiTracker/rabi-ribi/items/tough_skin.png b/RabiTracker/rabi-ribi/items/tough_skin.png new file mode 100644 index 0000000..c90722c Binary files /dev/null and b/RabiTracker/rabi-ribi/items/tough_skin.png differ diff --git a/RabiTracker/rabi-ribi/items/toxic_strike.png b/RabiTracker/rabi-ribi/items/toxic_strike.png new file mode 100644 index 0000000..4403de5 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/toxic_strike.png differ diff --git a/RabiTracker/rabi-ribi/items/wall_jump.png b/RabiTracker/rabi-ribi/items/wall_jump.png new file mode 100644 index 0000000..6a654e5 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/wall_jump.png differ diff --git a/RabiTracker/rabi-ribi/items/water_orb.png b/RabiTracker/rabi-ribi/items/water_orb.png new file mode 100644 index 0000000..32b26c6 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/water_orb.png differ diff --git a/RabiTracker/rabi-ribi/items/weaken.png b/RabiTracker/rabi-ribi/items/weaken.png new file mode 100644 index 0000000..b5a1d5a Binary files /dev/null and b/RabiTracker/rabi-ribi/items/weaken.png differ diff --git a/RabiTracker/rabi-ribi/items/wind_blessing.png b/RabiTracker/rabi-ribi/items/wind_blessing.png new file mode 100644 index 0000000..75eafe6 Binary files /dev/null and b/RabiTracker/rabi-ribi/items/wind_blessing.png differ diff --git a/RabiTracker/rabi-ribi/unknown.png b/RabiTracker/rabi-ribi/unknown.png new file mode 100644 index 0000000..b10a0f0 Binary files /dev/null and b/RabiTracker/rabi-ribi/unknown.png differ diff --git a/RabiTracker/resources/CP_Font.ttf b/RabiTracker/resources/CP_Font.ttf new file mode 100644 index 0000000..5de09e1 Binary files /dev/null and b/RabiTracker/resources/CP_Font.ttf differ diff --git a/RabiTracker/src/RabiTracker/DrawingPanel.java b/RabiTracker/src/RabiTracker/DrawingPanel.java new file mode 100644 index 0000000..ff14f7c --- /dev/null +++ b/RabiTracker/src/RabiTracker/DrawingPanel.java @@ -0,0 +1,21 @@ +package RabiTracker; + +import java.awt.Graphics; + +import javax.swing.JPanel; + +public class DrawingPanel extends JPanel { + Window parent; + + public DrawingPanel(Window parent) { + this.parent = parent; + } + + public void paintComponent(Graphics g) { + super.paintComponent(g); + + parent.drawGUI(g); + + parent.frames++; + } +} \ No newline at end of file diff --git a/RabiTracker/src/RabiTracker/MemoryData.java b/RabiTracker/src/RabiTracker/MemoryData.java index b9fb73d..5128143 100644 --- a/RabiTracker/src/RabiTracker/MemoryData.java +++ b/RabiTracker/src/RabiTracker/MemoryData.java @@ -1,5 +1,6 @@ package RabiTracker; +import java.awt.Image; import java.io.File; import java.io.FileReader; import java.util.HashMap; @@ -11,7 +12,7 @@ public enum MemoryData { MONEY(0xD654CC), PLAYTIME(0xD642D8), HEALTHUP_START(0xD6342C), - HEALTHUP_END(0xD6342C), + HEALTHUP_END(0xD63528), ATTACKUP_START(0xD6352C), ATTACKUP_END(0xD63628), MANAUP_START(0xD6362C), @@ -47,45 +48,45 @@ public enum MemoryData { GAME_DIFFICULTY(0xD64338), GAME_LOOP(0xD6D05C), - HAMMER(0xD632B0), - AIR_JUMP(0xD632B4), - SLIDING_POWDER(0xD632B8), - CARROT_BOMB(0xD632BC), - HOURGLASS(0xD632C0), - SPEED_BOOST(0xD632C4), - AUTO_EARRINGS(0xD632C8), - RIBBON(0xD632CC), - SOUL_HEART(0xD632D0), - RABI_SLIPPERS(0xD632D4), - BUNNY_WHIRL(0xD632D8), - QUICK_BARETTE(0xD632DC), - BOOK_OF_CARROT(0xD632E0), - CHAOS_ROD(0xD632E4), - HAMMER_WAVE(0xD632E8), - HAMMER_ROLL(0xD632EC), - LIGHT_ORB(0xD632F0), - WATER_ORB(0xD632F4), - FIRE_ORB(0xD632F8), - NATURE_ORB(0xD632FC), - P_HAIRPIN(0xD63300), - SUNNY_BEAM(0xD63304), - PLUS_NECKLACE(0xD63308), - CYBER_FLOWER(0xD6330C), - HEALING_STAFF(0xD63310), - MAX_BRACELET(0xD63314), - EXPLODE_SHOT(0xD63318), - AIR_DASH(0xD6331C), - BUNNY_STRIKE(0xD63320), - STRANGE_BOX(0xD63324), - WALL_JUMP(0xD63328), - SPIKE_BARRIER(0xD6332C), - BUNNY_AMULET(0xD63330), - CHARGE_RING(0xD63334), - CARROT_SHOOTER(0xD63338), - SUPER_CARROT(0xD6333C), + HAMMER(0xD632B0,"Hammer","piko_hammer.png",true), + AIR_JUMP(0xD632B4,"Air Jump","air_jump.png",true), + SLIDING_POWDER(0xD632B8,"Sliding Powder","sliding_powder.png",true), + CARROT_BOMB(0xD632BC,"Carrot Bomb","carrot_bomb.png",true), + HOURGLASS(0xD632C0,"Hourglass","hourglass.png",true), + SPEED_BOOST(0xD632C4,"Speed Boost","speed_boost.png",true), + AUTO_EARRINGS(0xD632C8,"Auto Earrings","auto_earrings.png",true), + RIBBON(0xD632CC,"Ribbon","ribbon.png",true), + SOUL_HEART(0xD632D0,"Soul Heart","soul_heart.png",true), + RABI_SLIPPERS(0xD632D4,"Rabi Slippers","rabi_slippers.png",true), + BUNNY_WHIRL(0xD632D8,"Bunny Whirl","bunny_whirl.png",true), + QUICK_BARETTE(0xD632DC,"Quick Barrette","quick_barrette.png",true), + BOOK_OF_CARROT(0xD632E0,"Book of Carrot","book_of_carrot.png",true), + CHAOS_ROD(0xD632E4,"Chaos Rod","chaos_rod.png",true), + HAMMER_WAVE(0xD632E8,"Hammer Wave","hammer_wave.png",true), + HAMMER_ROLL(0xD632EC,"Hammer Roll","hammer_roll.png",true), + LIGHT_ORB(0xD632F0,"Light Orb","light_orb.png",true), + WATER_ORB(0xD632F4,"Water Orb","water_orb.png",true), + FIRE_ORB(0xD632F8,"Fire Orb","fire_orb.png",true), + NATURE_ORB(0xD632FC,"Nature Orb","nature_orb.png",true), + P_HAIRPIN(0xD63300,"P. Hairpin","p_hairpin.png",true), + SUNNY_BEAM(0xD63304,"Sunny Beam","sunny_beam.png",true), + PLUS_NECKLACE(0xD63308,"Plus Necklace","plus_necklace.png",true), + CYBER_FLOWER(0xD6330C,"Cyber Flower","cyber_flower.png",true), + HEALING_STAFF(0xD63310,"Healing Staff","healing_staff.png",true), + MAX_BRACELET(0xD63314,"Max Bracelet","max_bracelet.png",true), + EXPLODE_SHOT(0xD63318,"Explode Shot","explode_shot.png",true), + AIR_DASH(0xD6331C,"Air Dash","air_dash.png",true), + BUNNY_STRIKE(0xD63320,"Bunny Strike","bunny_strike.png",true), + STRANGE_BOX(0xD63324,"Strange Box","strange_box.png",true), + WALL_JUMP(0xD63328,"Wall Jump","wall_jump.png",true), + SPIKE_BARRIER(0xD6332C,"Spike Barrier","spike_barrier.png",true), + BUNNY_AMULET(0xD63330,"Bunny Amulet","bunny_amulet.png",true), + CHARGE_RING(0xD63334,"Charge Ring","charge_ring.png",true), + CARROT_SHOOTER(0xD63338,"Carrot Shooter","carrot_shooter.png",true), + SUPER_CARROT(0xD6333C,"Super Carrot","super_carrot.png",true), RUMI_DONUT(0xD63340), RUMI_CAKE(0xD63344), - GOLD_CARROT(0xD63348), + GOLD_CARROT(0xD63348,"Gold Carrot","gold_carrot.png",true), COCOA_BOMB(0xD6334C), UNKNOWN_ITEM1(0xD63350), TROPHY(0xD63354), @@ -106,43 +107,43 @@ public enum MemoryData { UNKNOWN_ITEM14(0xD63390), /*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), - FAIRYS_FLUTE(0), - BUNNY_MEMORIES(0), - WIND_BLESSING(0), + BUNNY_CLOVER(0xD6339C,"Bunny Clover","bunny_clover.png",true), + FAIRYS_FLUTE(0xD643A4,"Fairy's Flute","fairy_s_flute.png",true), + BUNNY_MEMORIES(0xD623A8,"Bunny Memories","bunny_memories.png",true), + WIND_BLESSING(0xD623A0,"Wind Blessing","wind_blessing.png",true), DLC_ITEM4(0xD633A0), - BADGE_HEALTH_PLUS(0xD633AC), - BADGE_HEALTH_SURGE(0xD633B0), - BADGE_MANA_PLUS(0xD633B4), - BADGE_MANA_SURGE(0xD633B8), - BADGE_CRISIS_BOOST(0xD633BC), - BADGE_ATK_GROW(0xD633C0), - BADGE_DEF_GROW(0xD633C4), - BADGE_ATK_TRADE(0xD633C8), - BADGE_DEF_TRADE(0xD633CC), - BADGE_ARM_STRENGTH(0xD633D0), - BADGE_CARROT_BOOST(0xD633D4), - BADGE_WEAKEN(0xD633D8), - BADGE_SELF_DEFENSE(0xD633DC), - BADGE_ARMORED(0xD633E0), - BADGE_LUCKY_SEVEN(0xD633E4), - BADGE_HEX_CANCEL(0xD633E8), - BADGE_PURE_LOVE(0xD633EC), - BADGE_TOXIC_STRIKE(0xD633F0), - BADGE_FRAME_CANCEL(0xD633F4), - BADGE_HEALTH_WAGER(0xD633F8), - BADGE_MANA_WAGER(0xD633FC), - BADGE_STAMINA_PLUS(0xD63400), - BADGE_BLESSED(0xD63404), - BADGE_HITBOX_DOWN(0xD63408), - BADGE_CASHBACK(0xD6340C), - BADGE_SURVIVAL(0xD63410), - BADGE_TOP_FORM(0xD63414), - BADGE_TOUGH_SKIN(0xD63418), - BADGE_ERINA_BADGE(0xD6341C), - BADGE_RIBBON_BADGE(0xD63420), - BADGE_AUTO_TRIGGER(0xD63424), - BADGE_LILITHS_GIFT(0xD63428), + BADGE_HEALTH_PLUS(0xD633AC,"Health Plus","health_plus.png",false), + BADGE_HEALTH_SURGE(0xD633B0,"Health Surge","health_surge.png",false), + BADGE_MANA_PLUS(0xD633B4,"Mana Plus","mana_plus.png",false), + BADGE_MANA_SURGE(0xD633B8,"Mana Surge","mana_surge.png",false), + BADGE_CRISIS_BOOST(0xD633BC,"Crisis Boost","crisis_boost.png",false), + BADGE_ATK_GROW(0xD633C0,"ATK Grow","atk_grow.png",false), + BADGE_DEF_GROW(0xD633C4,"DEF Grow","def_grow.png",false), + BADGE_ATK_TRADE(0xD633C8,"ATK Trade","atk_trade.png",false), + BADGE_DEF_TRADE(0xD633CC,"DEF Trade","def_trade.png",false), + BADGE_ARM_STRENGTH(0xD633D0,"Arm Strength","arm_strength.png",false), + BADGE_CARROT_BOOST(0xD633D4,"Carrot Boost","carrot_boost.png",false), + BADGE_WEAKEN(0xD633D8,"Weaken","weaken.png",false), + BADGE_SELF_DEFENSE(0xD633DC,"Self Defense","self_defense.png",false), + BADGE_ARMORED(0xD633E0,"Armored","armored.png",false), + BADGE_LUCKY_SEVEN(0xD633E4,"Lucky Seven","lucky_seven.png",false), + BADGE_HEX_CANCEL(0xD633E8,"Hex Cancel","hex_cancel.png",false), + BADGE_PURE_LOVE(0xD633EC,"Pure Love","pure_love.png",false), + BADGE_TOXIC_STRIKE(0xD633F0,"Toxic Strike","toxic_strike.png",false), + BADGE_FRAME_CANCEL(0xD633F4,"Frame Cancel","frame_cancel.png",false), + BADGE_HEALTH_WAGER(0xD633F8,"Health Wager","health_wager.png",false), + BADGE_MANA_WAGER(0xD633FC,"Mana Wager","mana_wager.png",false), + BADGE_STAMINA_PLUS(0xD63400,"Stamina Plus","stamina_plus.png",false), + BADGE_BLESSED(0xD63404,"Blessed","blessed.png",false), + BADGE_HITBOX_DOWN(0xD63408,"Hitbox Down","hitbox_down.png",false), + BADGE_CASHBACK(0xD6340C,"Cashback","cashback.png",false), + BADGE_SURVIVAL(0xD63410,"Survival","survival.png",false), + BADGE_TOP_FORM(0xD63414,"Top Form","top_form.png",false), + BADGE_TOUGH_SKIN(0xD63418,"Tough Skin","tough_skin.png",false), + BADGE_ERINA_BADGE(0xD6341C,"Erina","erina_badge.png",false), + BADGE_RIBBON_BADGE(0xD63420,"Ribbon","ribbon_badge.png",false), + BADGE_AUTO_TRIGGER(0xD63424,"Auto Trigger","auto_trigger.png",false), + BADGE_LILITHS_GIFT(0xD63428,"Lilith's Gift","lilith_s_gift.png",false), //13413E8 ITEM_PERCENT(0), MAP_PERCENT(0), @@ -151,10 +152,22 @@ public enum MemoryData { ; HashMap memoryMap = new HashMap(); + String itemName = "[UNKNOWN]"; + String imgName = "unknown.png"; + boolean keyItem = false; //Whether or not item is a key item. + boolean isItem = false; //Whether or not this is an item. MemoryData(long baseAddress) { memoryMap.put("1.75", baseAddress); } + + MemoryData(long baseAddress, String itemName, String imgName, boolean keyItem) { + memoryMap.put("1.75", baseAddress); + this.itemName = itemName; + this.imgName = imgName; + this.keyItem = keyItem; + isItem = true; + } public static void loadMemoryData() { String[] contents = FileUtils.readFromFile("memoryData"); @@ -221,4 +234,16 @@ public enum MemoryData { return upgradeAddress; } } + + public boolean isItem() { + return isItem; + } + + public boolean isKeyItem() { + return keyItem; + } + + public Image getImage() { + return Window.MAIN_WINDOW.image_map.get(imgName); + } } \ No newline at end of file diff --git a/RabiTracker/src/RabiTracker/MemoryManager.java b/RabiTracker/src/RabiTracker/MemoryManager.java index 29c4990..b620332 100644 --- a/RabiTracker/src/RabiTracker/MemoryManager.java +++ b/RabiTracker/src/RabiTracker/MemoryManager.java @@ -52,7 +52,14 @@ public class MemoryManager { public void update() { if (foundRabiRibi) { - System.out.println("Game difficulty: "+readIntFromMemory(MemoryData.GAME_DIFFICULTY)); + //System.out.println("Game difficulty: "+readIntFromMemory(MemoryData.GAME_DIFFICULTY)); + /*for (MemoryData md : MemoryData.values()) { + if (md.isItem()) { + System.out.println(md+": "+Window.MAIN_WINDOW.mem.readIntFromMemory(md)+","); + } + }*/ + //System.out.println("Attack Grow: "+MemoryData.BADGE_ATK_GROW.getOffset()); + //System.out.print("Attack Grow: "+Window.MAIN_WINDOW.mem.readIntFromMemory(MemoryData.BADGE_DEF_GROW)+","); } } @@ -103,6 +110,10 @@ public class MemoryManager { } } + public boolean foundRabiRibi() { + return foundRabiRibi; + } + public int readIntFromMemory(long offset) { Memory mem = new Memory(4); Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(rabiRibiMemOffset+offset), mem, 4, null); @@ -173,7 +184,7 @@ public class MemoryManager { } } - int readItemCountFromMemory(MemoryData start_range, + public int readItemCountFromMemory(MemoryData start_range, MemoryData end_range) { int count=0; for (long i=start_range.getOffset();i<=end_range.getOffset();i++) { diff --git a/RabiTracker/src/RabiTracker/Window.java b/RabiTracker/src/RabiTracker/Window.java index 4959529..fe44dc1 100644 --- a/RabiTracker/src/RabiTracker/Window.java +++ b/RabiTracker/src/RabiTracker/Window.java @@ -1,55 +1,71 @@ package RabiTracker; import java.awt.Color; +import java.awt.Font; +import java.awt.FontFormatException; import java.awt.Graphics; +import java.awt.GraphicsEnvironment; +import java.awt.Image; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; import java.util.Calendar; +import java.util.HashMap; +import java.util.List; import java.util.Timer; +import javax.imageio.ImageIO; import javax.swing.JFrame; import javax.swing.JPanel; -class DrawingPanel extends JPanel { - Window parent; - - public DrawingPanel(Window parent) { - this.parent = parent; - } - - public void paintComponent(Graphics g) { - super.paintComponent(g); - - parent.drawGUI(g); - - parent.frames++; - } -} +import RabiTracker.data.RabiTracker; public class Window extends JFrame{ final static String WINDOW_TITLE = "Rabi Tracker v1.0"; public static int MAX_FPS = 60; public static int TICK = 0; + public static Font SYSTEM_FONT; + public static String USERNAME = "Sig"; //TODO Make a way for users to input their username. public static String RABI_RIBI_VERSION = "1.90"; //TODO Make a way to detect the version of the game. + public static Window MAIN_WINDOW; + JFrame window = new JFrame("Rabi Tracker v1.0"); - DrawingPanel panel = new DrawingPanel(this); + public DrawingPanel panel = new DrawingPanel(this); - MemoryManager mem = new MemoryManager(); + public MemoryManager mem = new MemoryManager(); + RabiTracker tracker = new RabiTracker(); int timer = Calendar.getInstance().get(Calendar.SECOND); public int frames = 0; + public static HashMap image_map = new HashMap(); + public void setTitle(String str) { window.setTitle(WINDOW_TITLE+" "+str); } public void drawGUI(Graphics g) { - + //g.drawImage(image_map.get("ribbon.png"), 32,32, window); + tracker.draw(g); } public void display() { + InputStream stream = Window.class.getResourceAsStream("/CP_Font.ttf"); + //File font = new File(sigIRC.BASEDIR+"sigIRC/CP_Font.ttf"); + + try { + SYSTEM_FONT = Font.createFont(Font.TRUETYPE_FONT,stream); + GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(SYSTEM_FONT); + SYSTEM_FONT = new Font("CP Font",0,16); + } catch (FontFormatException | IOException e) { + e.printStackTrace(); + } + window.setSize(640, 480); window.setResizable(true); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -61,6 +77,15 @@ public class Window extends JFrame{ window.setVisible(true); MemoryData.loadMemoryData(); + + AddImagesToImageMap(new File("./rabi-ribi/items"),"./rabi-ribi/items/"); + AddImagesToImageMap(new File("./rabi-ribi/characters"),"./rabi-ribi/characters/"); + System.out.println("Loaded unknown.png"); + try { + image_map.put("unknown.png", ImageIO.read(new File("./rabi-ribi/unknown.png"))); + } catch (IOException e) { + e.printStackTrace(); + } } private void runTick() { @@ -68,15 +93,20 @@ public class Window extends JFrame{ panel.repaint(); mem.update(); + tracker.update(); + } + + public void slowTick() { + tracker.slowTick(); } public void update() { int new_val = Calendar.getInstance().get(Calendar.SECOND); - int current_tick = Calendar.getInstance().get(Calendar.MILLISECOND); if (new_val!=timer) { setTitle("- "+frames+" FPS"); frames=0; timer = new_val; + slowTick(); } try { runTick(); @@ -90,9 +120,30 @@ public class Window extends JFrame{ System.setProperty("sun.java2d.opengl", "True"); Window program = new Window(); + MAIN_WINDOW = program; program.display(); while (true) { program.update(); } } + + private void AddImagesToImageMap(File dir, String DIRECTORY) { + String[] images = dir.list(); + List filtered_images = new ArrayList(); + for (String file : images) { + File f = new File(DIRECTORY+file); + if (!f.isDirectory()) { + filtered_images.add(file); + } + } + images = filtered_images.toArray(new String[filtered_images.size()]); + for (String image : images) { + try { + System.out.println("Loaded "+image); + image_map.put(image, ImageIO.read(new File(DIRECTORY+image))); + } catch (IOException e) { + e.printStackTrace(); + } + } + } } diff --git a/RabiTracker/src/RabiTracker/data/Avatar.java b/RabiTracker/src/RabiTracker/data/Avatar.java new file mode 100644 index 0000000..5d4ec57 --- /dev/null +++ b/RabiTracker/src/RabiTracker/data/Avatar.java @@ -0,0 +1,62 @@ +package RabiTracker.data; + +import java.awt.Image; + +import RabiTracker.Window; + + +public enum Avatar { + ERINA("Erina","small_erina.png",0), + RIBBON("Ribbon","small_ribbon.png",1), + IRISU("Irisu","small_irisu.png",2), + GREEN_KOTRI("Kotri (Green)","small_green_kotri.png",3), + BLUE_KOTRI("Kotri (Blue)","small_blue_kotri.png",4), + RED_KOTRI("Kotri (Red)","small_kotri.png",5), + ARURAUNE("Aruraune","small_aruraune.png",6), + ASHURI("Ashuri","small_ashuri.png",7), + CICINI("Cicini","small_cicini.png",8), + COCOA("Cocoa","small_cocoa.png",9), + ILLUSION_ALIUS("Illusion Alius","small_illusion_alius.png",10), + KEKE_BUNNY("Keke Bunny","small_keke_bunny.png",11), + LILITH("Lilith","small_lilith.png",12), + LILLI("Lilli","small_lilli.png",13), + MIRIAM("Miriam","small_miriam.png",14), + MIRU("Miru","small_miru.png",15), + NIEVE("Nieve","small_nieve.png",16), + NIXIE("Nixie","small_nixie.png",17), + NOAH("Noah","small_noah.png",18), + PANDORA("Pandora","small_pandora.png",19), + SHADOW_PANDORA("Pandora (Shadow)","small_shadow_pandora.png",20), + PIXIE("Pixie","small_pixie.png",21), + RITA("Rita","small_rita.png",22), + SHADOW_RITA("Rita (Shadow)","small_shadow_rita.png",23), + RUMI("Rumi","small_rumi.png",24), + SAYA("Saya","small_saya.png",25), + SEANA("Seana","small_seana.png",26), + SYARO("Syaro","small_syaro.png",27), + VANILLA("Vanilla","small_vanilla.png",28), + ; + + public String displayName; + public String fileName; + public int value; + + Avatar(String displayName, String fileName, int value) { + this.displayName = displayName; + this.fileName = fileName; + this.value = value; + } + + public static Avatar getAvatarFromID(int value) { + for (Avatar a : Avatar.values()) { + if (a.value == value) { + return a; + } + } + return ERINA; + } + + public Image getAvatarImage() { + return Window.MAIN_WINDOW.image_map.get(fileName); + } +} diff --git a/RabiTracker/src/RabiTracker/data/HelperFunctions.java b/RabiTracker/src/RabiTracker/data/HelperFunctions.java new file mode 100644 index 0000000..f2fed03 --- /dev/null +++ b/RabiTracker/src/RabiTracker/data/HelperFunctions.java @@ -0,0 +1,5 @@ +package RabiTracker.data; + +public class HelperFunctions { + +} diff --git a/RabiTracker/src/RabiTracker/data/Profile.java b/RabiTracker/src/RabiTracker/data/Profile.java new file mode 100644 index 0000000..6c249b7 --- /dev/null +++ b/RabiTracker/src/RabiTracker/data/Profile.java @@ -0,0 +1,275 @@ +package RabiTracker.data; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.lang.reflect.Field; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; + +import RabiTracker.MemoryData; +import RabiTracker.Window; +import RabiTracker.data.structures.DifficultyStruct; +import sig.utils.DrawUtils; +import sig.utils.JavaUtils; +import sig.utils.TextUtils; + +public class Profile { + public String username = Window.USERNAME.toLowerCase(); + public String displayName = Window.USERNAME; + public Avatar avatar; + public int playtime = 0; + public int healthUps = 0; + public int attackUps = 0; + public int manaUps = 0; + public int regenUps = 0; + public int packUps = 0; + public int rainbowEggCount = 0; + public boolean isPaused = false; + public int difficulty = 0; + public int loop = 0; + public float itempct = 0; + public float mappct = 0; + public LinkedHashMap key_items = new LinkedHashMap(); + public LinkedHashMap badges = new LinkedHashMap(); + public List updates = new ArrayList(); + public long lastWebUpdate = System.currentTimeMillis(); + DecimalFormat df = new DecimalFormat("0.0"); + Profile oldProfile; + public boolean isArchive = false; + final static Color TEAL = new Color(0,128,128); + final static Color TEAL_TRANSPARENT = new Color(255,255,0,210); + final static Color TRANSPARENT = new Color(0,0,0,0); + final static Color DEACTIVATED_ITEM = new Color(0,0,0,128); + public Image statUpdateCacheImage; + public Image imageDisplayUpdateImage; + public boolean stat_update_required = true; + public boolean image_display_update_required = true; + + public void update() { + + } + + public void slowTick() { + for (MemoryData md : MemoryData.values()) { + if (md.isItem()) { + Integer val = Window.MAIN_WINDOW.mem.readIntFromMemory(md); + if (md.isKeyItem()) { + if (key_items.containsKey(md)) { + if (key_items.get(md)!=val) { + if (val==0) { + key_items.remove(md); + } else { + key_items.put(md, val); + image_display_update_required=true; + } + } + } + else { + if (val!=0) { + key_items.put(md, val); + image_display_update_required=true; + } + } + } else { + if (badges.containsKey(md)) { + if (badges.get(md)!=val) { + if (val==0) { + badges.remove(md); + } else { + badges.put(md, val); + image_display_update_required=true; + } + } + } else { + if (val!=0) { + badges.put(md, val); + image_display_update_required=true; + } + } + } + } else { + int val = Window.MAIN_WINDOW.mem.readIntFromMemory(md); + float floatval = Window.MAIN_WINDOW.mem.readFloatFromMemory(md); + switch (md) { + case GAME_DIFFICULTY: + if (difficulty!=val) { + difficulty = val; + image_display_update_required=true; + } + break; + case GAME_LOOP: + if (loop!=val) { + loop = val; + image_display_update_required=true; + } + break; + case ITEM_PERCENT: + if (itempct!=floatval) { + itempct = floatval; + image_display_update_required=true; + } + break; + case MAP_PERCENT: + if (mappct!=floatval) { + mappct = floatval; + image_display_update_required=true; + } + break; + case MONEY: + //TODO Not implemented. + break; + case PAUSED: + if (((isPaused)?1:0)!=val) { + isPaused = (val==1)?true:false; + image_display_update_required=true; + } + break; + case PLAYTIME: + if (playtime!=val) { + playtime = val; + image_display_update_required=true; + } + break; + } + } + } + + int healthUpCount = Window.MAIN_WINDOW.mem.readItemCountFromMemory(MemoryData.HEALTHUP_START,MemoryData.HEALTHUP_END); + int manaUpCount = Window.MAIN_WINDOW.mem.readItemCountFromMemory(MemoryData.MANAUP_START,MemoryData.MANAUP_END); + int attackUpCount = Window.MAIN_WINDOW.mem.readItemCountFromMemory(MemoryData.ATTACKUP_START,MemoryData.ATTACKUP_END); + int regenUpCount = Window.MAIN_WINDOW.mem.readItemCountFromMemory(MemoryData.REGENUP_START,MemoryData.REGENUP_END); + int packUpCount = Window.MAIN_WINDOW.mem.readItemCountFromMemory(MemoryData.PACKUP_START,MemoryData.PACKUP_END); + int rainbowEggs = Window.MAIN_WINDOW.mem.readIntFromMemory(MemoryData.RAINBOW_EGG_COUNT); + if (healthUpCount!=healthUps) { + healthUps = healthUpCount; + image_display_update_required=true; + } + if (manaUpCount!=manaUps) { + manaUps = manaUpCount; + image_display_update_required=true; + } + if (attackUpCount!=attackUps) { + attackUps = attackUpCount; + image_display_update_required=true; + } + if (regenUpCount!=regenUps) { + regenUps = regenUpCount; + image_display_update_required=true; + } + if (packUpCount!=packUps) { + packUps = packUpCount; + image_display_update_required=true; + } + if (rainbowEggs!=rainbowEggCount) { + rainbowEggCount=rainbowEggs; + image_display_update_required=true; + } + + System.out.println(this); + } + + public void draw(Graphics g,Session s) { + if (image_display_update_required) { + imageDisplayUpdateImage = getStatPanel(Window.MAIN_WINDOW.panel.getWidth(),s); + image_display_update_required=false; + } + g.drawImage(imageDisplayUpdateImage, 0, 0, Window.MAIN_WINDOW); + } + + private Image getStatPanel(int w, Session session) { + BufferedImage tmp = new BufferedImage(w,175,BufferedImage.TYPE_INT_ARGB); + Graphics g = tmp.createGraphics(); + switch (session.gamemode) { + case EGGMODE:{ + + }break; + case ITEMMODE:{ + + }break; + case BINGO:{ + + }break; + case TENTM:{ + + }break; + case MARATHON:{ + + }break; + case POSTGAME:{ + + }break; + } + + final int font_height = (int)TextUtils.calculateStringBoundsFont(Window.USERNAME, Window.MAIN_WINDOW.SYSTEM_FONT).getHeight(); + DifficultyStruct diff = DifficultyStruct.GetDifficulty(difficulty); + final int difficulty_width = (int)TextUtils.calculateStringBoundsFont(diff.getDifficultyName(), Window.MAIN_WINDOW.SYSTEM_FONT).getWidth(); + + + DrawUtils.drawOutlineText(g, Window.MAIN_WINDOW.SYSTEM_FONT, 0, (font_height+4)*1, 2, Color.WHITE, Color.BLACK, Window.USERNAME); + DrawUtils.drawOutlineText(g, Window.MAIN_WINDOW.SYSTEM_FONT, 0, (font_height+4)*2, 2, diff.getDifficultyColor(), Color.WHITE, diff.getDifficultyName()); + if (loop>1) { + DrawUtils.drawOutlineText(g, Window.MAIN_WINDOW.SYSTEM_FONT, difficulty_width+8, (font_height+4)*2, 2, diff.getDifficultyColor(), Color.WHITE, "Loop "+loop); + } + //DrawUtils.drawTextFont(g, Window.MAIN_WINDOW.SYSTEM_FONT, 0, font_height+(1*2), diff.getDifficultyColor(), diff.getDifficultyName()); + + int yoffset = (font_height+4)*2; + int keyItemCount = key_items.size(); + int badgeItemCount = badges.size(); + int keyItemsPlaced = 0; + int badgesPlaced = 0; + final int icon_size = 24; + int icon_spacing = Math.min((int)(w/(double)keyItemCount),icon_size+2); + int badge_icon_spacing = Math.min((int)(w/(double)badgeItemCount),icon_size+2); + + for (MemoryData md : key_items.keySet()) { + //g.drawImage(img, x, y, observer) + DrawUtils.drawImageScaled(g, md.getImage(), (icon_spacing*keyItemsPlaced), yoffset+icon_size*1.5, icon_size, icon_size, (key_items.get(md)<0)?DEACTIVATED_ITEM:TRANSPARENT, Window.MAIN_WINDOW); + keyItemsPlaced++; + } + yoffset+=32; + for (MemoryData md : badges.keySet()) { + //g.drawImage(img, x, y, observer) + if (badges.get(md)==2) { + g.setColor(TEAL_TRANSPARENT); + g.drawOval((int)((badge_icon_spacing*badgesPlaced)), (int)(yoffset+icon_size*1.5), 23, 23); + g.setColor(Color.BLACK); + } + DrawUtils.drawImageScaled(g, md.getImage(), (badge_icon_spacing*badgesPlaced), yoffset+icon_size*1.5, icon_size, icon_size, TRANSPARENT, Window.MAIN_WINDOW); + badgesPlaced++; + } + + return tmp.getScaledInstance(w, -1, Image.SCALE_AREA_AVERAGING); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(this.getClass().getName()+"("); + boolean first=false; + for (Field f : this.getClass().getDeclaredFields()) { + if (!first) { + try { + sb.append(f.getName()+"="+f.get(this)); + first=true; + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } else { + try { + sb.append(","+f.getName()+"="+f.get(this)); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + sb.append(")"); + return sb.toString(); + } +} diff --git a/RabiTracker/src/RabiTracker/data/RabiTracker.java b/RabiTracker/src/RabiTracker/data/RabiTracker.java new file mode 100644 index 0000000..ad57ce4 --- /dev/null +++ b/RabiTracker/src/RabiTracker/data/RabiTracker.java @@ -0,0 +1,36 @@ +package RabiTracker.data; + +import java.awt.Graphics; +import java.util.HashMap; +import RabiTracker.Window; + +public class RabiTracker { + Profile myProfile; + HashMap profile_list = new HashMap(); + /*LinkedHashMap key_items = new LinkedHashMap(); + LinkedHashMap badges = new LinkedHashMap();*/ + Session mySession; + + public RabiTracker() { + myProfile = new Profile(); + mySession = new Session(); + } + + public void update() { + if (Window.MAIN_WINDOW.mem.foundRabiRibi()) { + myProfile.update(); + } + } + + public void slowTick() { + if (Window.MAIN_WINDOW.mem.foundRabiRibi()) { + myProfile.slowTick(); + } + } + + public void draw(Graphics g) { + if (Window.MAIN_WINDOW.mem.foundRabiRibi()) { + myProfile.draw(g,mySession); + } + } +} diff --git a/RabiTracker/src/RabiTracker/data/Session.java b/RabiTracker/src/RabiTracker/data/Session.java new file mode 100644 index 0000000..bcd9c24 --- /dev/null +++ b/RabiTracker/src/RabiTracker/data/Session.java @@ -0,0 +1,19 @@ +package RabiTracker.data; + +import java.util.ArrayList; +import java.util.List; + + +public class Session { + long creationTime = 0; + long updateTime = 0; + String name = ""; + int maxPlayers = 0; + String password = ""; + float difficulty = -1; + SessionType gamemode = SessionType.EGGMODE; //0 = Egg Mode, 1 = Item Hunt Mode + String[] itemHuntData; + int eggCount = 0; + int id = 0; + List players = new ArrayList(); +} diff --git a/RabiTracker/src/RabiTracker/data/SessionType.java b/RabiTracker/src/RabiTracker/data/SessionType.java new file mode 100644 index 0000000..ed532af --- /dev/null +++ b/RabiTracker/src/RabiTracker/data/SessionType.java @@ -0,0 +1,20 @@ +package RabiTracker.data; + +public enum SessionType { + EGGMODE(0), + ITEMMODE(1), + BINGO(2), + TENTM(3), + MARATHON(4), + POSTGAME(5); + + int id; + + SessionType(int id) { + this.id=id; + } + + public int getID() { + return id; + } +} diff --git a/RabiTracker/src/RabiTracker/data/structures/DifficultyStruct.java b/RabiTracker/src/RabiTracker/data/structures/DifficultyStruct.java new file mode 100644 index 0000000..966c594 --- /dev/null +++ b/RabiTracker/src/RabiTracker/data/structures/DifficultyStruct.java @@ -0,0 +1,76 @@ +package RabiTracker.data.structures; + +import java.awt.Color; + +public enum DifficultyStruct { + CASUAL(new Color(99, 159, 255),"Casual"), + NOVICE(new Color(119, 98, 255),"Novice"), + NORMAL(new Color(60, 201, 112),"Normal"), + HARD(new Color(200, 209, 100),"Hard"), + HELL(new Color(209, 159, 12),"Hell"), + BEX(new Color(209, 54, 11),"BEX"), + UNKNOWN(new Color(68, 24, 12),"Unknown"), + IMPOSSIBLE(new Color(12, 24, 68),"Impossible"), + EXTRA(new Color(64, 64, 64),"Extra"), + ; + + DifficultyStruct(Color col, String name) { + this.color = col; + this.name = name; + } + + public String getDifficultyName() { + return name; + } + + public Color getDifficultyColor() { + return color; + } + + Color color; + String name; + + public static DifficultyStruct GetDifficulty(int difficulty) { + switch (difficulty) { + case 0:{ + return CASUAL; + } + case 1:{ + return NOVICE; + } + case 2:{ + return NORMAL; + } + case 3:{ + return HARD; + } + case 4:{ + return HELL; + } + case 5:{ + return BEX; + } + case 6:{ + return UNKNOWN; + } + case 7:{ + return IMPOSSIBLE; + } + default:{ + return EXTRA; + } + } + } + + /* + * Color[] color_list = new Color[]{ + new Color(99, 159, 255), + new Color(119, 98, 255), + new Color(60, 201, 112), + new Color(200, 209, 100), + new Color(209, 159, 12), + new Color(209, 54, 11), + new Color(68, 24, 12), + }; + */ +} diff --git a/RabiTracker/src/sig/utils/DrawUtils.java b/RabiTracker/src/sig/utils/DrawUtils.java new file mode 100644 index 0000000..cc621fd --- /dev/null +++ b/RabiTracker/src/sig/utils/DrawUtils.java @@ -0,0 +1,146 @@ +package sig.utils; + +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.font.TextAttribute; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.text.AttributedString; + +import RabiTracker.Window; + +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) { + drawOutlineText(g,font,x,y,0,0,outline_size,text_color,shadow_color,message); + } + static void drawOutlineText(Graphics g, Font font, double x, double y, double xoffset, double yoffset, int outline_size, Color text_color, Color shadow_color, String message) { + AttributedString as = new AttributedString(message); + as.addAttribute(TextAttribute.FONT, font); + g.setColor(shadow_color); + Graphics2D g2 = (Graphics2D) g; + if (message.length()>200) { + g2.setColor(shadow_color); + g2.drawString(as.getIterator(),(int)(x+outline_size+xoffset),(int)(y+outline_size+yoffset)); + } else { + FontRenderContext frc = g2.getFontMetrics(font).getFontRenderContext(); + GlyphVector gv = font.createGlyphVector(frc, message); + Rectangle2D box = gv.getVisualBounds(); + Shape shape = gv.getOutline((int)(x+xoffset),(int)(y+yoffset)); + g2.setClip(shape); + g2.drawString(as.getIterator(),(int)(x+xoffset),(int)(y+yoffset)); + g2.setClip(null); + g2.setStroke(new BasicStroke(outline_size*2)); + g2.setColor(shadow_color); + g2.setRenderingHint( + RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2.draw(shape); + } + g2.setColor(text_color); + g2.drawString(as.getIterator(),(int)(x+xoffset),(int)(y+yoffset)); + } + public static void drawCenteredOutlineText(Graphics g, Font font, double x, double y, int outline_size, Color text_color, Color shadow_color, String message) { + Rectangle2D textBounds = TextUtils.calculateStringBoundsFont(message, font); + drawOutlineText(g,font,x,y,-textBounds.getWidth()/2,-textBounds.getHeight()/2,outline_size,text_color,shadow_color,message); + } + 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, Window.SYSTEM_FONT); + g.setColor(color); + g.drawString(as.getIterator(),(int)x,(int)y); + } + } + public static void drawTextFont(Graphics g, Font font, double x, double y, Color color, String message) { + if (message.length()>0) { + AttributedString as = new AttributedString(message); + as.addAttribute(TextAttribute.FONT, font); + g.setColor(color); + g.drawString(as.getIterator(),(int)x,(int)y); + } + } + public static void drawHealthbar(Graphics g, Rectangle bounds, double pct, Color healthbarcol) { + g.setColor(Color.BLACK); + g.draw3DRect((int)bounds.getX(), (int)bounds.getY(), (int)bounds.getWidth(), (int)bounds.getHeight(), true); + g.setColor(healthbarcol); + g.fill3DRect((int)bounds.getX()+1, (int)bounds.getY()+1, (int)(bounds.getWidth()*pct)-1, (int)bounds.getHeight()-1, true); + } + /** + * Centers the text along the X Axis. + */ + public static void drawCenteredText(Graphics g, Font font, int x, int y, Color color, String text) { + AttributedString as = new AttributedString(text); + as.addAttribute(TextAttribute.FONT, font); + g.setColor(color); + Rectangle2D textBounds = TextUtils.calculateStringBoundsFont(text, font); + g.drawString(as.getIterator(),(int)(x-textBounds.getWidth()/2),(int)(y+textBounds.getHeight())); + } + + public static Color convertStringToColor(String s) { + String[] split = s.split(","); + if (split.length==3) { + return new Color( + Math.min(Math.abs(Integer.parseInt(split[0])),255), + Math.min(Math.abs(Integer.parseInt(split[1])),255), + Math.min(Math.abs(Integer.parseInt(split[2])),255)); + } else + if (split.length==4) { + return new Color( + Math.min(Math.abs(Integer.parseInt(split[0])),255), + Math.min(Math.abs(Integer.parseInt(split[1])),255), + Math.min(Math.abs(Integer.parseInt(split[2])),255), + Math.min(Math.abs(Integer.parseInt(split[3])),255)); + } else { + System.out.println("WARNING! Invalid Color string specified ("+s+")."); + return null; + } + } + + 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(); + 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(); + 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) { + 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(); + g.drawImage(tmp.getScaledInstance((int)xsize, (int)ysize, Image.SCALE_AREA_AVERAGING),(int)x,(int)y,(int)xsize,(int)ysize,null); + } + + public static Color invertColor(Color c) { + return new Color(255-c.getRed(),255-c.getGreen(),255-c.getBlue(),255); + } +} diff --git a/RabiTracker/src/sig/utils/JavaUtils.java b/RabiTracker/src/sig/utils/JavaUtils.java new file mode 100644 index 0000000..23a76d6 --- /dev/null +++ b/RabiTracker/src/sig/utils/JavaUtils.java @@ -0,0 +1,34 @@ +package sig.utils; + +import java.lang.reflect.Field; + +public class JavaUtils { + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(this.getClass().getName()+"("); + boolean first=false; + for (Field f : this.getClass().getDeclaredFields()) { + if (!first) { + try { + sb.append(f.getName()+"="+f.get(this)); + first=true; + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } else { + try { + sb.append(","+f.getName()+"="+f.get(this)); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + } + sb.append(")"); + return sb.toString(); + } +} diff --git a/RabiTracker/src/sig/utils/TextUtils.java b/RabiTracker/src/sig/utils/TextUtils.java new file mode 100644 index 0000000..b49e648 --- /dev/null +++ b/RabiTracker/src/sig/utils/TextUtils.java @@ -0,0 +1,131 @@ +package sig.utils; + +import java.awt.Color; +import java.awt.Font; +import java.awt.font.FontRenderContext; +import java.awt.geom.Rectangle2D; +import java.util.ArrayList; +import java.util.List; + +import RabiTracker.Window; + +public class TextUtils { + + public static Rectangle2D calculateStringBoundsFont(String msg, Font font) { + //System.out.println(sigIRC.loadingdialog); + FontRenderContext frc = Window.MAIN_WINDOW.getFontMetrics(font).getFontRenderContext(); + return font.getStringBounds(msg, frc); + } + + public static String replaceFirst(String sourcestring, String findstring, String replacestring) { + int pos = sourcestring.indexOf(findstring); + if (pos>=0) { + String piece1 = sourcestring.substring(0,pos); + String piece2 = sourcestring.substring(pos+findstring.length(),sourcestring.length()); + //basemsg = basemsg.replaceFirst(e.getEmoteName(),e.getSpaceFiller()); + sourcestring = piece1+replacestring+piece2; + } + return sourcestring; + } + + public static boolean isAlphanumeric(String str) { + return str.matches("^[a-zA-Z0-9!\\-.?'\":,\\+ ]+$"); + } + + public static boolean isNumeric(String str) + { + return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal. + } + + public static boolean isInteger(String s, int radix) { + if(s.isEmpty()) return false; + for(int i = 0; i < s.length(); i++) { + if(i == 0 && s.charAt(i) == '-') { + if(s.length() == 1) return false; + else continue; + } + if(Character.digit(s.charAt(i),radix) < 0) return false; + } + return true; + } + + public static String convertSecondsToTimeFormat(int seconds) { + StringBuilder sb = new StringBuilder(); + int sec = seconds%60; + int min = (seconds/60)%60; + int hrs = (seconds/3600)%24; + if (hrs>0) { + if (hrs>=10) { + sb.append(hrs); + } else { + sb.append(0); + sb.append(hrs); + } + sb.append(":"); + } + if (min>=10) { + sb.append(min); + } else { + sb.append(0); + sb.append(min); + } + sb.append(":"); + if (sec>=10) { + sb.append(sec); + } else { + sb.append(0); + sb.append(sec); + } + return sb.toString(); + } + + /** + * Converts a three CSV value to RGB value. + */ + public static Color convertStringToColor(String col) { + String[] split = col.split(","); + return new Color(Integer.parseInt(split[0]),Integer.parseInt(split[1]),Integer.parseInt(split[2])); + } + + public static List WrapText(String msg, Font font, double width) { + List displayMessage = new ArrayList(); + String rawmessage = msg; + int textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, font).getWidth(); + int maxWidth = (int)width; + do { + rawmessage = BreakTextAtNextSection(rawmessage+" ",font,displayMessage,maxWidth); + textWidth = (int)TextUtils.calculateStringBoundsFont(rawmessage, font).getWidth(); + } while (textWidth>maxWidth); + if (rawmessage.length()>0) { + displayMessage.add(rawmessage); + } + return displayMessage; + //System.out.println(displayMessage+": "+messageDisplaySize); + } + + private static String BreakTextAtNextSection(String msg, Font font, List list, int maxWidth) { + int marker = 1; + int textWidth = (int)TextUtils.calculateStringBoundsFont(msg.substring(0, marker), font).getWidth(); + while (textWidth