#=============================================================================== # # Yanfly Engine RD - Interface Fix # Last Date Updated: 2009.04.23 # Level: Easy # # Redone the drawing fixes from the prototype version for the current Yanfly # Engine. This one includes all the stuff you've seen before in the other fix # but this time, HP and MP bars that are below their base HP and base MP will # show another shade to indicate how much of them were shaved off. This also # makes a better check for what to draw and reduce the overall bitmap overload # from the interface itself. # # Status effects with an icon ID of zero will now be omitted. This is the # default clear icon and shouldn't have anything in its place anyway. States # with this empty icon will no longer clog up the limited area which states # can be shown. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.04.23 - Improved display for 0 MaxMP. # o 2009.04.17 - Started script. #=============================================================================== # Instructions #=============================================================================== # # Nothing to instruct, really. Just input this script somewhere and let it run # its stuff. Adjust the values down below for quicker access to text colours. # #=============================================================================== # # Compatibility # - Overwrites: Window_Base, *_color, draw_actor_state # - Overwrites: Window_Base, draw_actor_hp_gauge, draw_actor_mp_gauge # #=============================================================================== $imported = {} if $imported == nil $imported["InterfaceFix"] = true module YE module FIX module TEXT # This affects various colours used by the ingame system. NORMAL = 0 # This is the normal text colour. SYSTEM = 16 # This is the system text colour. CRISIS = 17 # This is the critical HP colour. LOW_MP = 17 # This is the low MP colour. KNOCKOUT = 18 # This is the knocked out colour. BACK_HP = 19 # This is the gauge background colour for HP. BACK_MP = 19 # This is the gauge background colour for HP. EXHAUST = 7 # This is the exhaust colour. HPGAUGE1 = 20 # This is the first HP gauge colour. HPGAUGE2 = 21 # This is the second HP gauge colour. MPGAUGE1 = 22 # This is the first MP gauge colour. MPGAUGE2 = 23 # This is the second MP gauge colour. POWER_UP = 24 # This is the equips boost a stat colour. POWER_DN = 25 # This is the equips nerf a stat colour. end #module TEXT module DRAW # This affects when crisis level HP and low MP colours appear. HP_UNDER = 25 # If Current HP is under this percent. MP_UNDER = 25 # If Current MP is under this percent. GAUGE_HEIGHT = 6 # This adjusts the gauge height. end #module DRAW end # module FIX end # module YE #=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #=============================================================================== #============================================================================== # Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # text colour overwrites #-------------------------------------------------------------------------- def normal_color; return text_color(YE::FIX::TEXT::NORMAL); end def system_color; return text_color(YE::FIX::TEXT::SYSTEM); end def crisis_color; return text_color(YE::FIX::TEXT::CRISIS); end def low_mp_color; return text_color(YE::FIX::TEXT::LOW_MP); end def knockout_color; return text_color(YE::FIX::TEXT::KNOCKOUT); end def gauge_back_color; return text_color(YE::FIX::TEXT::BACK_HP); end def gauge_back_color_mp; return text_color(YE::FIX::TEXT::BACK_MP); end def exhaust_color; return text_color(YE::FIX::TEXT::EXHAUST); end def hp_gauge_color1; return text_color(YE::FIX::TEXT::HPGAUGE1); end def hp_gauge_color2; return text_color(YE::FIX::TEXT::HPGAUGE2); end def mp_gauge_color1; return text_color(YE::FIX::TEXT::MPGAUGE1); end def mp_gauge_color2; return text_color(YE::FIX::TEXT::MPGAUGE2); end def power_up_color; return text_color(YE::FIX::TEXT::POWER_UP); end def power_down_color; return text_color(YE::FIX::TEXT::POWER_DN); end #-------------------------------------------------------------------------- # hp_colour and mp_colour #-------------------------------------------------------------------------- def hp_color(actor) return knockout_color if actor.hp == 0 per = YE::FIX::DRAW::HP_UNDER return crisis_color if actor.hp < (actor.maxhp * per / 100) return normal_color end def mp_color(actor) per = YE::FIX::DRAW::MP_UNDER return low_mp_color if actor.mp < (actor.maxmp * per / 100) return normal_color end #-------------------------------------------------------------------------- # Draw HP Gauge #-------------------------------------------------------------------------- def draw_actor_hp_gauge(actor, x, y, width = 120, height = nil) actor.hp = actor.maxhp if actor.hp > actor.maxhp gc0 = gauge_back_color gc1 = hp_gauge_color1 gc2 = hp_gauge_color2 if height == nil gh = YE::FIX::DRAW::GAUGE_HEIGHT else gh = height end gy = y + WLH - 8 - (gh - 6) if actor.maxhp < actor.base_maxhp and actor.base_maxhp > 0 gb = width * actor.maxhp / actor.base_maxhp self.contents.fill_rect(x, gy, width, gh, exhaust_color) else gb = width end self.contents.fill_rect(x, gy, gb, gh, gc0) if actor.maxhp <= 0 if actor.base_maxhp <= 0 gw = width else gw = 0 end else gw = gb * actor.hp / actor.maxhp self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2) end end #-------------------------------------------------------------------------- # Draw MP Gauge #-------------------------------------------------------------------------- def draw_actor_mp_gauge(actor, x, y, width = 120, height = nil) actor.mp = actor.maxmp if actor.mp > actor.maxmp gc0 = gauge_back_color_mp gc1 = mp_gauge_color1 gc2 = mp_gauge_color2 if height == nil gh = YE::FIX::DRAW::GAUGE_HEIGHT else gh = height end gy = y + WLH - 8 - (gh - 6) if actor.maxmp < actor.base_maxmp and actor.base_maxmp > 0 gb = width * actor.maxmp / actor.base_maxmp self.contents.fill_rect(x, gy, width, gh, exhaust_color) else gb = width end self.contents.fill_rect(x, gy, gb, gh, gc0) if actor.maxmp <= 0 if actor.base_maxmp <= 0 gw = width else gw = 0 end else gw = gb * actor.mp / actor.maxmp end self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2) end #-------------------------------------------------------------------------- # Draw State #-------------------------------------------------------------------------- def draw_actor_state(actor, x, y, width = 96) count = 0 for state in actor.states unless state.icon_index == 0 draw_icon(state.icon_index, x + 24 * count, y) count += 1 break if (24 * count > width - 24) end end end end #end Window_Base #=============================================================================== # # END OF FILE # #===============================================================================