示例#1
0
 def on_entry_sitrus_berry_changed(self, widget, *args):
     try:
         val = u16_checked(int(widget.get_text()))
     except ValueError:
         return
     static_data = self.module.project.get_rom_module().get_static_data()
     self.module.project.modify_binary(BinaryName.OVERLAY_10, lambda bin: HardcodedHpItems.set_sitrus_berry_hp(val, bin, static_data))
     self.module.mark_misc_settings_as_modified()
示例#2
0
    def _init_values(self):
        arm9 = self.module.project.get_binary(BinaryName.ARM9)
        ov00 = self.module.project.get_binary(BinaryName.OVERLAY_00)
        ov10 = self.module.project.get_binary(BinaryName.OVERLAY_10)
        ov29 = self.module.project.get_binary(BinaryName.OVERLAY_29)
        static_data = self.module.project.get_rom_module().get_static_data()

        self.builder.get_object('entry_text_speed').set_text(
            str(HardcodedTextSpeed.get_text_speed(arm9, static_data)))
        self.builder.get_object('cb_main_menu_music').set_active(
            HardcodedMainMenuMusic.get_main_menu_music(ov00, static_data))
        self.builder.get_object('entry_normal_spawn_delay').set_text(
            str(HardcodedSpawnRate.get_normal_spawn_rate(ov10, static_data)))
        self.builder.get_object('entry_stolen_spawn_delay').set_text(
            str(HardcodedSpawnRate.get_stolen_spawn_rate(ov10, static_data)))
        self.builder.get_object('entry_belly_lost').set_text(
            str(HardcodedDungeonMisc.get_belly_loss_turn(ov29, static_data)))
        self.builder.get_object('entry_belly_lost_wtw').set_text(
            str(
                HardcodedDungeonMisc.get_belly_loss_walk_through_walls(
                    ov29, static_data)))
        self.builder.get_object('entry_belly_lost_wtw_1000').set_text(
            str(
                HardcodedDungeonMisc.get_belly_loss_1000ile_walk_through_walls(
                    ov29, static_data)))
        self.builder.get_object('entry_ginseng_3_chance').set_text(
            str(
                HardcodedDungeonMisc.get_ginseng_increase_by_3_chance(
                    ov10, static_data)))
        self.builder.get_object('entry_life_seed').set_text(
            str(HardcodedHpItems.get_life_seed_hp(ov10, static_data)))
        self.builder.get_object('entry_oran_berry').set_text(
            str(HardcodedHpItems.get_oran_berry_hp(ov10, static_data)))
        self.builder.get_object('entry_sitrus_berry').set_text(
            str(HardcodedHpItems.get_sitrus_berry_hp(ov10, static_data)))
        self.builder.get_object('entry_burn_damage_delay').set_text(
            str(HardcodedDungeonMisc.get_burn_damage_delay(ov10, static_data)))
        self.builder.get_object('entry_poison_damage_delay').set_text(
            str(HardcodedDungeonMisc.get_poison_damage_delay(
                ov10, static_data)))
        self.builder.get_object('entry_bad_poison_damage_delay').set_text(
            str(
                HardcodedDungeonMisc.get_bad_poison_damage_delay(
                    ov10, static_data)))