I was wondering how I can manually reinitialize a class within a script. I am trying to call a part of Khas sapphire engine to reinitialize because the normal means of how it works is never used. Pretty much, this class is used to change the graphic of weapon when it is equipped. (and going through the equip menu reinitialize it, unfortunately for me, all my equipping is done through script calls so the weapon graphic does not update).
So, in the script fragment below, how can I rerun initialize or refresh_weapon from a script call.
So, in the script fragment below, how can I rerun initialize or refresh_weapon from a script call.
Code:
...class Spriteset_Map alias sas_update update alias sas_initialize initialize alias sas_dispose dispose def initialize @trash = [] $game_map.show_particles $game_map.show_damage_sprites $game_map.sas_hud.show sas_initialize @weapon_graphic = Sprite.new(@viewport1) @weapon_graphic.ox = 22 @weapon_graphic.oy = 22 @attacking = false @attack_timer = 0 @angles = {2=>[80,110,140,170],4=>[340,10,40,70],6=>[290,260,230,200],8=>[290,320,350,20]} @correction = {2=>[-8,-10],4=>[0,-10],6=>[0,-4],8=>[4,-10]} @z_values = {2=>120,4=>50,6=>120,8=>50} refresh_weapon end def refresh_weapon @weapon_bitmap.dispose unless @weapon_bitmap.nil? @weapon_bitmap = nil return if $game_party.members.empty? index = ($game_party.members[0].weapons[0].icon_index rescue nil) unless index == nil temp = Cache.system("Iconset") @weapon_bitmap = Bitmap.new(24,24) @weapon_bitmap.blt(0,0,temp,Rect.new(index%16*24,index/16*24,24,24)) temp.dispose temp = nil end end...end