Füge unter PAC ein neues, leeres Script ein, und kopiere folgenden Code rein: Code: ###### # PAC - HP Bar Addon # Author: Linkey D. T. # Date: 08.03.2018 ###### class Scene_Menu < Scene_MenuBase alias ldt_create_command_window create_command_window def create_command_window(*args) ldt_create_command_window(*args) create_hp_bar_window end def create_hp_bar_window @hp_bar_window = LDT_Window_HPBar.new(@command_window.width,0,@command_window.height) end def update_hp_bar_window thp = $game_actors[1].hp thp_max = $game_actors[1].mhp @hp_bar_window.set_hp(thp,thp_max) end end #### # HP Bar Window # Author: Linkey D. T. # Date: 08.03.2018 #### class LDT_Window_HPBar < Window_Base HP_WIDTH = 20 HP_HEIGHT = 100 BORDER_WIDTH = 4 BORDER_COLOR = 1 HP_COLOR = 3 BACKGROUND_COLOR = 2 def initialize(x,y,th=nil) @hp_height = th ? th : HP_HEIGHT @hp_height = @hp_height - BORDER_WIDTH*2 super(x,y,HP_WIDTH+BORDER_WIDTH*2,@hp_height+BORDER_WIDTH*2) @hp = 0 @max_hp = 0 end def set_hp(hp,maxhp) trefresh = (hp != @hp || maxhp != @max_hp) ? true : false @hp = hp + 0.0 @max_hp = maxhp + 0.0 refresh if(trefresh) end def refresh contents.clear th = (@hp / @max_hp * @hp_height).to_i ty2 = @hp_height - th contents.fill_rect(BORDER_WIDTH, BORDER_WIDTH, HP_WIDTH, @hp_height, text_color(BACKGROUND_COLOR)) contents.fill_rect(BORDER_WIDTH, BORDER_WIDTH + ty2, HP_WIDTH, th, text_color(HP_COLOR)) end def standard_padding return 0 end end
###### # PAC - HP Bar Addon # Author: Linkey D. T. # Date: 08.03.2018 ###### class Scene_Menu < Scene_MenuBase alias ldt_create_command_window create_command_window def create_command_window(*args) ldt_create_command_window(*args) create_hp_bar_window end def create_hp_bar_window @hp_bar_window = LDT_Window_HPBar.new(@command_window.width,0,@command_window.height) end def update_hp_bar_window thp = $game_actors[1].hp thp_max = $game_actors[1].mhp @hp_bar_window.set_hp(thp,thp_max) end end #### # HP Bar Window # Author: Linkey D. T. # Date: 08.03.2018 #### class LDT_Window_HPBar < Window_Base HP_WIDTH = 20 HP_HEIGHT = 100 BORDER_WIDTH = 4 BORDER_COLOR = 1 HP_COLOR = 3 BACKGROUND_COLOR = 2 def initialize(x,y,th=nil) @hp_height = th ? th : HP_HEIGHT @hp_height = @hp_height - BORDER_WIDTH*2 super(x,y,HP_WIDTH+BORDER_WIDTH*2,@hp_height+BORDER_WIDTH*2) @hp = 0 @max_hp = 0 end def set_hp(hp,maxhp) trefresh = (hp != @hp || maxhp != @max_hp) ? true : false @hp = hp + 0.0 @max_hp = maxhp + 0.0 refresh if(trefresh) end def refresh contents.clear th = (@hp / @max_hp * @hp_height).to_i ty2 = @hp_height - th contents.fill_rect(BORDER_WIDTH, BORDER_WIDTH, HP_WIDTH, @hp_height, text_color(BACKGROUND_COLOR)) contents.fill_rect(BORDER_WIDTH, BORDER_WIDTH + ty2, HP_WIDTH, th, text_color(HP_COLOR)) end def standard_padding return 0 end end
--
Foren-Regeln