Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==========================#
- # Z17 Alternate HUD v1.01 #
- #===#==================#===#
- # by: Zetu #
- #==================#
- class Scene_Battle < Scene_Base
- alias zreq_create_info_viewport create_info_viewport
- def create_info_viewport
- zreq_create_info_viewport
- @info_viewport.rect.y -= 128
- @info_viewport.rect.height += 128
- @status_window.x -= 128
- @status_window.width += 128
- @status_window.y += 128
- @status_window.refresh
- @party_command_window.y += 72
- @party_command_window.column_max = @party_command_window.item_max
- @party_command_window.height = 56
- @party_command_window.width *= @party_command_window.item_max
- @party_command_window.spacing = 0
- @party_command_window.create_contents
- @party_command_window.refresh
- end
- def start_target_enemy_selection
- @target_enemy_window = Window_TargetEnemy.new
- @target_enemy_window.y = @info_viewport.rect.y
- @actor_command_window.active = false
- @status_window.visible = false
- @target_enemy_window.width += 128
- @target_enemy_window.y += 128
- end
- def end_target_enemy_selection
- @status_window.visible = true
- @target_enemy_window.dispose
- @target_enemy_window = nil
- if @actor_command_window.index == 0
- @actor_command_window.active = true
- end
- end
- def start_target_actor_selection
- @target_actor_window = Window_BattleStatus.new
- @target_actor_window.index = 0
- @target_actor_window.active = true
- @target_actor_window.y = @info_viewport.rect.y + 128
- @target_actor_window.width += 128
- @target_actor_window.refresh
- @actor_command_window.active = false
- @status_window.visible = false
- end
- def end_target_actor_selection
- @target_actor_window.dispose
- @target_actor_window = nil
- @status_window.visible = true
- end
- def update_info_viewport
- @party_command_window.update
- @actor_command_window.update
- @status_window.update
- offset_party_window
- offset_command_window
- end
- def offset_party_window
- if @party_command_window.active and @party_command_window.x < 0
- @party_command_window.x += 16
- elsif @actor_command_window.active and @party_command_window.x > -@party_command_window.width
- @party_command_window.x -= 16
- end
- end
- def offset_command_window
- if @actor_command_window.active and @actor_command_window.x > 544 - @actor_command_window.width
- @actor_command_window.x -= 16
- elsif (@party_command_window.active or !@skill_window.nil?) and @actor_command_window.x < 544
- @actor_command_window.x += 16
- end
- end
- def set_offset_window(window, x1, x2, type = 0)
- case type
- when 0
- windowa = @party_command_window
- windowb = @actor_command_window
- when 1
- windowa = @actor_command_window
- windowb = @party_command_window
- end
- if @party_command_window.active and window.x < x1
- window.x -= 16
- elsif @actor_command_window.active and window.x > x2
- window.x += 16
- end
- end
- end
- class Window_Selectable < Window_Base
- attr_writer :column_max
- attr_writer :spacing
- end
- class Window_BattleStatus < Window_Selectable
- alias zreq_initialize initialize
- def initialize
- zreq_initialize
- @column_max = Game_Party::MAX_MEMBERS
- end
- def refresh
- self.contents.clear
- @item_max = $game_party.members.size
- create_contents
- for i in 0...@item_max
- draw_item(i)
- end
- end
- def draw_item(index)
- rect = Rect.new(index*128+4, 0, 120, 96)
- self.contents.clear_rect(rect)
- self.contents.font.color = normal_color
- actor = $game_party.members[index]
- x = rect.x
- y = rect.y
- draw_actor_face(actor, x+16, y, 64, 96)
- draw_actor_name(actor, x, y-6)
- draw_actor_state(actor, x, y+40, 48)
- draw_actor_hp(actor, x, y+58, 120)
- draw_actor_mp(actor, x, y+74, 120)
- end
- def update_cursor
- if @index < 0
- self.cursor_rect.empty
- else
- rect = Rect.new(index*128, 0, 128, 96)
- self.cursor_rect = rect
- end
- end
- end
- class Window_Base < Window
- def draw_face(face_name, face_index, x, y, size1 = 96, size2 = 96)
- bitmap = Cache.face(face_name)
- rect = Rect.new(0, 0, 0, 0)
- rect.x = face_index % 4 * 96 + (96 - size2) / 2
- rect.y = face_index / 4 * 96 + (96 - size1) / 2
- rect.width = size2
- rect.height = size1
- self.contents.blt(x, y, bitmap, rect)
- bitmap.dispose
- end
- def draw_actor_face(actor, x, y, size1 = 96, size2 = -1)
- size2 = size1 if size2 == -1
- draw_face(actor.face_name, actor.face_index, x, y, size1, size2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement