Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Menu Final Fantasy IX [VX]
Autor Wiadomość
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Sob 24 Kwi, 2010 11:24
Menu Final Fantasy IX [VX]
~ Menu Final Fantasy IX [VX] ~

Krótki opis
Skrypt tworzy Menu na wzór menu z gry Final Fantasy IX [PSX] - patrz screenshot.

Autor skryptu
BigEd781 ~ PainHurt

Tłumaczenie i korekta
Ayene [yurika@o2.pl]

Kompatybilność
Tylko VX.

Skrypt
Spoiler:

Kod:
# ============================================================================ #
# Menu Final Fantasy IX [VX]
# by BigEd781 ~ PainHurt
# Tłumaczenie i korekta: Ayene
# Skrypt tworzy Menu na wzór menu z gry Final Fantasy IX [PSX].
# ============================================================================ #
# Do poprawnego działania niektórych funkcji skryptu wymagane jest użycie
# skryptu poszerzającego klasę 'Window'.
# ============================================================================ #

module FF9_Config 
   
  # Użycie własnego tła w menu (true / false) 
  USE_CUSTOM_BACK = false
 
  # Nazwa obrazka, które ma być tłem (gdy wybrano powyżej true).
  # Obrazek należy umieścić w folderze Graphics/Pictures.
  BACK_NAME = 'StoneBackground'
 
  # Jeśli wybrano 'true' w projekcie należy dodatkowo umieścić skrypt
  # poszerzający klasę 'Window'. Znaleźć go można na stronie:
  # http://www.rpgmakervx.net/index.php?showtopic=8042&hl=
  # lub na
  # http://www.ultimateam.pl/viewtopic.php?t=3274&p=26367#26367
  USE_TILED_WINDOW = true
 
  # Animowany kursor - do przodu i do tyłu (true / false)
  ANIMATE_CURSOR = false
 
  # Zarys osobnych paneli (true / false)
  DRAW_FOR_ALL = true
 
  # Nazwa czcionki (domyślna)
  # Jeśli chcesz ją zmienić zamiasta 'Font.default_name' wpisz nazwę czcionki,
  # np. 'Centaur'
  DEFAULT_FONT = Font.default_name
 
  # Ustala czcionkę i przezroczystość dla wszystkich okien. Zalecane 'true'.
  USE_FOR_ALL = true
 
  # ID ikonki złota w zestawie ikon.
  GOLD_ICON_ID = 194 
end


if FF9_Config::USE_FOR_ALL   
  Font.default_name = FF9_Config::DEFAULT_FONT
 
  class Window_Base < Window   
    alias :eds_pre_ff9_menu_base_initialize :initialize
    def initialize(*args)
      eds_pre_ff9_menu_base_initialize(*args) 
      self.stretch = false if FF9_Config::USE_TILED_WINDOW
      self.back_opacity = 255
    end   
  end 
end

class Window_Base < Window
 
  CAPTION_COLOR = Color.new(255,255,255)
  CAPTION_HEIGHT = 12
  X_OFFSET = 16
  Y_OFFSET = -5
 
  alias :eds_pre_window_caption_intialize :initialize
  def initialize(*args)     
    eds_pre_window_caption_intialize(*args)   
    @caption_sprite = Sprite_Base.new(self.viewport)
    create_caption_bitmap(1, CAPTION_HEIGHT)       
    @caption_sprite.x = self.x + X_OFFSET
    @caption_sprite.y = self.y + Y_OFFSET
    @caption_sprite.z = self.z + 1
  end
 
  def x=(value)
    super
    @caption_sprite.x = value + X_OFFSET unless @caption_sprite.nil?
  end
 
  def y=(value)
    super
    @caption_sprite.y = value + Y_OFFSET unless @caption_sprite.nil?
  end
 
  def z=(value)
    super
    @caption_sprite.z = value + 1 unless @caption_sprite.nil?
  end
 
  def caption=(text)
    return unless text.is_a?(String)
    return if text.empty?
    @caption = text
    width = @caption_sprite.bitmap.text_size(@caption).width
    create_caption_bitmap(width, CAPTION_HEIGHT)   
    draw_caption
  end 
 
  def create_caption_bitmap(w, h)
    @caption_sprite.bitmap = Bitmap.new(w, h)   
    @caption_sprite.bitmap.font.size = 12
    @caption_sprite.bitmap.font.color = CAPTION_COLOR
    @caption_sprite.bitmap.font.bold = true 
  end
 
  def draw_caption
    unless @caption.nil?
      h = @caption_sprite.bitmap.height
      w = @caption_sprite.bitmap.width
      rect = Rect.new( 0, h / 2, w, h / 4 )
      @caption_sprite.bitmap.fill_rect(rect, Color.new(0, 0, 0, 96))     
      @caption_sprite.bitmap.draw_text(@caption_sprite.src_rect, @caption)     
    end
  end
 
  alias :eds_pre_caption_window_dispose :dispose
  def dispose
    eds_pre_caption_window_dispose
    @caption_sprite.dispose
  end
 
  def find_window_width(text)             
    return Bitmap.new(544, 416).text_size(text).width + 32
  end   
 
end

class Window_TimeGold < Window_Base 
   
  def initialize(x, y) 
    width = find_window_width("9999999")
    width = 140 if width < 140
    super(x, y, width, WLH + 58)   
    self.back_opacity = 255
    self.stretch = false if FF9_Config::USE_TILED_WINDOW
    self.contents.font.name = FF9_Config::DEFAULT_FONT
    self.caption = "Czas i Złoto"
    @time_icon = Cache.picture('Timer') 
    @intern_frame_count = 0
    refresh
  end
 
  def draw_time
    sec = (Graphics.frame_count / 60) % 60
    min = (Graphics.frame_count / 3600) % 60
    hrs = Graphics.frame_count / 216000   
    self.contents.font.color = Color.new(255, 255, 255)   
    time = "%02d:%02d:%02d" % [hrs, min, sec]
    self.contents.draw_text(0, 0, self.contents.width, WLH, time, 2)   
  end 
 
  def refresh
    self.contents.clear
    self.contents.blt(0, 0, @time_icon, @time_icon.rect)
    draw_icon(FF9_Config::GOLD_ICON_ID, 2, WLH) 
    draw_currency_value($game_party.gold, 0, WLH, self.contents.width)
    draw_time
  end
 
  def draw_currency_value(value, x, y, width)
    gold_text = Vocab.gold
    cx = contents.text_size(gold_text[0,1]).width
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, width - cx - 2, WLH, value, 2)
    self.contents.font.color = system_color
    # just print the first character of Vocab::gold
    self.contents.draw_text(x, y, width, WLH, gold_text[0,1], 2)
  end
 
  def update
    super
    @intern_frame_count += 1
    return if (@intern_frame_count % 60) != 0         
    refresh
  end
 
  def find_window_width(text)             
    return Bitmap.new(544, 416).text_size(text).width + 80
  end
 
end

class Window_MenuLocation < Window_Base
 
  def initialize(x, y)
    @map_name = load_data("Data/MapInfos.rvdata")[$game_map.map_id].name
    width = find_window_width(@map_name)
    super(x, y, width, WLH + 32)   
    self.stretch = false if FF9_Config::USE_TILED_WINDOW
    self.contents.font.name = FF9_Config::DEFAULT_FONT
    self.back_opacity = 255
    self.caption = "LOKACJA"
    refresh
  end
 
  def refresh
    self.contents.clear   
    self.contents.draw_text(0, 0, self.contents.width, WLH,  @map_name, 1)
  end
 
  def find_window_width(text)             
    return Bitmap.new(544, 416).text_size(text).width + 48
  end
 
end

class Window_Command < Window_Selectable
 
  alias :eds_pre_ff9_menu_win_command_init :initialize
  def initialize(*args)
    @font_name = Font.default_name   
    eds_pre_ff9_menu_win_command_init(*args)   
  end
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear   
    self.contents.font.name = @font_name
    for i in 0...@item_max
      draw_item(i)
    end
  end
 
  def font_name=(name)
    @font_name = name   
  end
 
end

class Window_Uses < Window_Base 
 
  def initialize(right, y, item)   
    @remaining_text = "Remaining: #{$game_party.item_number(item)}"
    w = 160
    x = right ? (544 - w) : 0   
    super(x, y, w, WLH + 32)   
    self.stretch = false if FF9_Config::USE_TILED_WINDOW
    self.contents.font.name = FF9_Config::DEFAULT_FONT
    refresh
  end
 
  def item=(item)   
    return unless item.is_a?(RPG::Item)
    @remaining_text = "Remaining: #{$game_party.item_number(item)}"     
    refresh
  end
 
  def visible=(value)
    super
    refresh if value
  end
 
  def refresh
    self.contents.clear
    self.contents.draw_text(self.contents.rect, @remaining_text, 1)
  end
 
end

class Window_SkillUses < Window_Base 
 
  def initialize(right, y, actor, skill)   
    @remaining_text = make_info_string(actor, skill)
    w = 182
    x = right ? (544 - w) : 0       
    super(x, y, w, WLH + 32) 
    self.stretch = false if FF9_Config::USE_TILED_WINDOW
    self.contents.font.name = FF9_Config::DEFAULT_FONT
    refresh
  end
 
  def make_info_string(actor, skill)
    return if actor.nil? || skill.nil?
    cost = actor.calc_mp_cost(skill)
    return "Unlimited" if cost < 1
    return "Remaining: #{actor.mp / cost}"
  end
 
  def set_skill(actor, skill)
    return if actor.nil? || skill.nil?
    return unless skill.is_a?(RPG::Skill)
    @remaining_text = make_info_string(actor, skill)   
    refresh
  end
 
  def visible=(value)
    super
    refresh if value
  end
 
  def refresh   
    self.contents.clear
    self.contents.draw_text(self.contents.rect, @remaining_text, 1)
  end
 
end

class Window_MenuStatus < Window_Selectable
   
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 452, 352)     
    @bg_image = Cache.picture('FF9_MenuBar') 
    @arrow_image = Cache.picture('Pointer')
    create_arrow_sprites
    @sprite_last_draw_x = 0
    @sprite_inc_x = 1
    @intern_frame_count = 0   
    self.stretch = false if FF9_Config::USE_TILED_WINDOW
    self.contents.font.name = FF9_Config::DEFAULT_FONT
    self.opacity = 0   
    self.z = 99       
    self.active = false
    self.index = -1
    refresh
  end
  #--------------------------------------------------------------------------
  # * create_arrow_sprites
  #--------------------------------------------------------------------------
  def create_arrow_sprites 
    @arrow_sprites = []
    for i in 0..3
      @arrow_sprites << Sprite.new
      @arrow_sprites[i].bitmap = Bitmap.new(@arrow_image.width + 7, @arrow_image.height)
      @arrow_sprites[i].x = self.x
      @arrow_sprites[i].y = (i * 80) + self.y + 40     
      @arrow_sprites[i].z = 999       
    end
  end
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    draw_background_windows if FF9_Config::DRAW_FOR_ALL
    for actor in $game_party.members
      x = 104
      y = actor.index * 80     
      y_offset = 6     
      draw_background_window(0, y) unless FF9_Config::DRAW_FOR_ALL
      draw_actor_face(actor, 19, y + 4, 73)
      draw_actor_name(actor, x, y + y_offset)
      draw_actor_class(actor, x + 125, y + y_offset) if actor.states.empty?
      draw_actor_level(actor, x, y + WLH * 1)     
      draw_actor_state(actor, x + 125, y + y_offset)
      draw_actor_hp(actor, x, ((y) + (WLH * 2) - 5))
      draw_actor_mp(actor, x + 125, ((y) + (WLH * 2) - 5))
    end
  end 
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def update_cursor             
    if @index < 0       
      @arrow_sprites.each { |sprite| sprite.bitmap.clear }
      return
    end
    @intern_frame_count += 1
    return unless (@intern_frame_count % 5) == 0
    if @sprite_last_draw_x >= 7     
      @sprite_inc_x = -1
    elsif @sprite_last_draw_x <= 0
      @sprite_inc_x = 1
    end
    update_arrow_sprites
  end
  #--------------------------------------------------------------------------
  # * update_arrow_sprites
  #--------------------------------------------------------------------------
  def update_arrow_sprites   
    @arrow_sprites.each { |sprite| sprite.bitmap.clear }   
    if @index == 99   # all selected       
      return unless (@intern_frame_count % 10) == 0
      draw_arrow_sprites(@arrow_sprites, false)     
    else
      draw_arrow_sprites([@arrow_sprites[@index]], FF9_Config::ANIMATE_CURSOR)     
    end
  end
  #--------------------------------------------------------------------------
  # * draw_arrow_sprites
  #--------------------------------------------------------------------------
  def draw_arrow_sprites(sprites, animated=true)
    for sprite in sprites         
      image_x = animated ? @sprite_last_draw_x + @sprite_inc_x : 0
      @sprite_last_draw_x = image_x           
      sprite.bitmap.blt(image_x, 0, @arrow_image, @arrow_image.rect)
    end
  end
  #--------------------------------------------------------------------------
  # * y=
  #--------------------------------------------------------------------------
  def y=(value)
    super
    unless @arrow_sprites.nil?
      for i in 0..3
        @arrow_sprites[i].y = (i * 80) + value + 40
      end
    end
  end
  #--------------------------------------------------------------------------
  # * x=
  #--------------------------------------------------------------------------
  def x=(value)
    super
    unless @arrow_sprites.nil?
      @arrow_sprites.each { |sprite| sprite.x = value }
    end
  end
  #--------------------------------------------------------------------------
  # * draw_background_windows
  #--------------------------------------------------------------------------
  def draw_background_windows 
    self.contents.blt(0, 0, @bg_image, @bg_image.rect)   
    self.contents.blt(0, 80, @bg_image, @bg_image.rect)   
    self.contents.blt(0, 160, @bg_image, @bg_image.rect)   
    self.contents.blt(0, 240, @bg_image, @bg_image.rect)   
  end 
  #--------------------------------------------------------------------------
  # * draw_background_window (single)
  #--------------------------------------------------------------------------
  def draw_background_window(x, y)
    self.contents.blt(x, y, @bg_image, @bg_image.rect)   
  end
  #--------------------------------------------------------------------------
  # * visible
  #--------------------------------------------------------------------------
  def visible=(value)
    super
    @arrow_sprites.each { |sprite| sprite.visible = value }
  end
  #--------------------------------------------------------------------------
  # * dispose
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_win_stat_dispose :dispose
  def dispose
    eds_pre_ff9_win_stat_dispose
    @arrow_sprites.each { |sprite| sprite.dispose }
  end
 
  def enable_cursor?(rect=nil)   
    return false
  end     
end

class Scene_Menu
     
  #--------------------------------------------------------------------------
  # * create_menu_background (only if USE_CUSTOM_BACK == true)
  #--------------------------------------------------------------------------
  if FF9_Config::USE_CUSTOM_BACK
   
    def create_menu_background
      @menuback_sprite = Sprite.new
      @menuback_sprite.bitmap = Cache.picture(FF9_Config::BACK_NAME)
      @menuback_sprite.color.set(16, 16, 16, 128)
      update_menu_background
    end
   
  end
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------   
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = Vocab::game_end   
    @command_window = Window_Command.new(155, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    @command_window.stretch = false if FF9_Config::USE_TILED_WINDOW
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)     # Disable item
      @command_window.draw_item(1, false)     # Disable skill
      @command_window.draw_item(2, false)     # Disable equipment
      @command_window.draw_item(3, false)     # Disable status
    end
    if $game_system.save_disabled             # If save is forbidden
      @command_window.draw_item(4, false)     # Disable save
    end     
    # new stuff here   
    @command_window.font_name = FF9_Config::DEFAULT_FONT
    @command_window.x = 528 - @command_window.width
    @command_window.y = 16
    @command_window.back_opacity = 255
  end
  #--------------------------------------------------------------------------
  # * This method is intended to fix some compatibility problems
  #   that scripts run into when they change the command window
  #   in some way.  So, we let them override "create_command_window"
  #   and we simply don't call it from the "start" method.
  #   Instead, we call this method which does some extra checking.
  #--------------------------------------------------------------------------
  def eds_create_command_window
    create_command_window
    old_commands = @command_window.commands
    return if old_commands == [ Vocab::item,
                                Vocab::skill,
                                Vocab::equip,
                                Vocab::status,
                                Vocab::save,
                                Vocab::game_end ]

    # so we know that the default command window is not being used
    # we don't want to create another window, so we manually resize it
    # before the player can see. 
    long = ''
    # dynamically size the width based on the longest command
    old_commands.each { |command| long = command if command.length > long.length }
    # set the index to -1 so that the rectangle disappears.
    # if we don't do this, you can see the selection rectangle resize.
    @command_window.index = -1
    @command_window.width = @command_window.contents.text_size(long).width + 42
    @command_window.contents = Bitmap.new( @command_window.width - 32,
                                           @command_window.height - 32 )   
    @command_window.font_name = FF9_Config::DEFAULT_FONT
    @command_window.x = 528 - @command_window.width
    @command_window.y = 16
    @command_window.back_opacity = 255       
    @command_window.refresh
    @command_window.index = @menu_index
  end
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    #call this method for compatibility
    eds_create_command_window
    @gold_window = Window_TimeGold.new(372, 342)
    @gold_window.y -= @gold_window.height
    @gold_window.x = 528 - @gold_window.width
    @status_window = Window_MenuStatus.new(0, 12)
    @location_window = Window_MenuLocation.new(0, 0)
    @location_window.x = 528 - @location_window.width 
    @location_window.y = 398 - @location_window.height
  end
 
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_menu_terminate :terminate
  def terminate
    eds_pre_ff9_menu_scene_menu_terminate
    @location_window.dispose
  end
 
end

class Scene_Item < Scene_Base
 
  #--------------------------------------------------------------------------
  # * start
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_item_start :start
  def start       
    eds_pre_ff9_menu_scene_item_start
    @target_window.y = 58   
    @uses_window = Window_Uses.new(true, @help_window.height, nil)
    @uses_window.visible = false
  end 
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #   - right-align flag ignored
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_win_stat_show_target_window :show_target_window
  def show_target_window(right) 
    @uses_window.item = @item_window.item
    @uses_window.visible = true   
    @item_window.visible = false   
    @item_window.active = false   
    @target_window.visible = true
    @target_window.active = true 
    @viewport.rect.set(0, 0, 544, 416)
    @viewport.ox = 0
  end
  #--------------------------------------------------------------------------
  # * hide_target_window
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_item_hide_target_window :hide_target_window
  def hide_target_window
    eds_pre_ff9_menu_scene_item_hide_target_window 
    @uses_window.visible = false unless @uses_window.nil?
    @item_window.visible = true       
  end
  #--------------------------------------------------------------------------
  # * determine_target
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_item_determine_target :determine_target
  def determine_target   
    eds_pre_ff9_menu_scene_item_determine_target
    @uses_window.item = @item_window.item
  end   
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_item_terminate :terminate
  def terminate
    eds_pre_ff9_menu_scene_item_terminate
    @uses_window.dispose
  end
 
end

class Scene_Skill < Scene_Base
 
  #--------------------------------------------------------------------------
  # * start
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_skill_start :start
  def start       
    eds_pre_ff9_menu_scene_skill_start
    @target_window.y = 58         
    @uses_window = Window_SkillUses.new(true, @help_window.height, nil, nil)
    @uses_window.visible = false
  end 
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #   - right-align flag ignored
  #--------------------------------------------------------------------------
  def show_target_window(right)
    @uses_window.set_skill($game_party.members[@actor_index], @skill_window.skill)
    @uses_window.visible = true
    @status_window.visible = false
    @skill_window.visible = false
    @skill_window.active = false   
    @target_window.visible = true
    @target_window.active = true 
    @viewport.rect.set(0, 0, 544, 416)
    @viewport.ox = 0
  end
  #--------------------------------------------------------------------------
  # * hide_target_window
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_skill_hide_target_window :hide_target_window
  def hide_target_window
    eds_pre_ff9_menu_scene_skill_hide_target_window 
    @uses_window.visible = false unless @uses_window.nil?
    @skill_window.visible = true
    @status_window.visible = true
  end
  #--------------------------------------------------------------------------
  # * determine_target
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_skill_determine_target :determine_target
  def determine_target   
    eds_pre_ff9_menu_scene_skill_determine_target
    @uses_window.set_skill($game_party.members[@actor_index], @skill_window.skill)
  end   
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_item_terminate :terminate
  def terminate
    eds_pre_ff9_menu_scene_item_terminate
    @uses_window.dispose
  end
 
end


Skrypt dodatkowy
Należy go umieścić na samej górze sekcji "Materials".
Spoiler:

Kod:
# Skrypt należy umieścić na samej górze sekcji Materials.

class WindowCursorRect < Rect

  attr_reader :x
  attr_reader :y
  attr_reader :width
  attr_reader :height
 
  def initialize(window)
    @window = window
    @x = 0
    @y = 0
    @width = 0
    @height = 0
  end
 
  def empty
    needupdate = (@x != 0) || (@y != 0) || (@width != 0) || (@height != 0)
    if needupdate
      @x = 0
      @y = 0
      @width = 0
      @height = 0
      @window.width = @window.width
    end
  end
 
  def isEmpty?
    return @x == 0 && @y == 0 && @width == 0 && @height == 0
  end
 
  def set(x,y,width,height)
    needupdate=@x!=x || @y!=y || @width!=width || @height!=height
    if needupdate
      @x=x
      @y=y
      @width=width
      @height=height
      @window.width=@window.width
    end
  end
 
  def height=(value)
    @height=value; @window.width=@window.width
  end
 
  def width=(value)
    @width=value; @window.width=@window.width
  end
   
  def x=(value)
    @x=value; @window.width=@window.width
  end
 
  def y=(value)
    @y=value; @window.width=@window.width
  end
end

class Window
  attr_reader :tone
  attr_reader :color
  attr_reader :blend_type
  attr_reader :contents_blend_type
  attr_reader :viewport
  attr_reader :contents
  attr_reader :ox
  attr_reader :oy
  attr_reader :x
  attr_reader :y
  attr_reader :z
  attr_reader :width
  attr_reader :active
  attr_reader :pause
  attr_reader :height
  attr_reader :opacity
  attr_reader :back_opacity
  attr_reader :contents_opacity
  attr_reader :visible
  attr_reader :cursor_rect
  attr_reader :openness

  def windowskin
    return @_windowskin
  end
 
  def initialize(viewport=nil)
    @sprites={}
    @spritekeys=
    [
    "back",
    "corner0","side0","scroll0",
    "corner1","side1","scroll1",
    "corner2","side2","scroll2",
    "corner3","side3","scroll3",
    "cursor","contents","pause"
    ]
    @sidebitmaps=[nil,nil,nil,nil]
    @cursorbitmap=nil
    @bgbitmap=nil
    @viewport=viewport
    @spritekeys.each { |key| @sprites[key]=Sprite.new(@viewport) }
    @disposed=false
    @tone=Tone.new(0,0,0)
    @color=Color.new(0,0,0,0)
    @blankcontents=Bitmap.new(1,1) # RGSS2 requires this
    @contents=@blankcontents
    @_windowskin=nil
    @rpgvx=false
    @x=0
    @y=0
    @width=0
    @openness=255
    @height=0
    @ox=0
    @oy=0
    @z=0
    @stretch=true
    @visible=true
    @active=true
    @blend_type=0
    @contents_blend_type=0
    @opacity=255
    @back_opacity=255
    @contents_opacity=255
    @cursor_rect=WindowCursorRect.new(self)
    @cursorblink=0
    @cursoropacity=255
    @pause=false
    @pauseopacity=255
    @pauseframe=0
    privRefresh(true)
  end
 
  def dispose
    if !self.disposed?
      for i in @sprites
        i[1].dispose if i[1]
        @sprites[i[0]]=nil
      end
      for i in 0...@sidebitmaps.length
        @sidebitmaps[i].dispose if @sidebitmaps[i]
        @sidebitmaps[i]=nil
      end
      @blankcontents.dispose
      @cursorbitmap.dispose if @cursorbitmap
      @backbitmap.dispose if @backbitmap
      @sprites.clear
      @sidebitmaps.clear
      @_windowskin=nil
      @_contents=nil
      @disposed=true
    end
  end
 
  def openness=(value)
    @openness=value
    @openness=0 if @openness<0
    @openness=255 if @openness>255
    privRefresh
  end
 
  def stretch=(value)
    @stretch=value
    privRefresh(true)
  end
 
  def visible=(value)
    @visible=value
    privRefresh
  end
 
  def viewport=(value)
    @viewport=value
    for i in @spritekeys
      @sprites[i].dispose
      if @sprites[i].is_a?(Sprite)
        @sprites[i] = Sprite.new(@viewport)
      elsif @sprites[i].is_a?(Plane)
        @sprites[i] = Plane.new(@viewport)
      else
        @sprites[i] = nil
      end
    end
    privRefresh(true)
  end
 
  def z=(value)
    @z=value
    privRefresh
  end
 
  def disposed?
    return @disposed
  end
 
  def contents=(value)
    @contents=value
    privRefresh
  end
 
  def windowskin=(value)
    @_windowskin=value
    if value && value.is_a?(Bitmap) && !value.disposed? && value.width==128
      @rpgvx=true
    else
      @rpgvx=false
    end
    privRefresh(true)
  end
 
  def ox=(value)
    @ox=value
    privRefresh
  end
 
  def active=(value)
    @active=value
    privRefresh(true)
  end
 
  def cursor_rect=(value)
    if !value
      @cursor_rect.empty
    else
      @cursor_rect.set(value.x,value.y,value.width,value.height)
    end
  end
 
  def oy=(value)
    @oy=value
    privRefresh
  end
 
  def width=(value)
    @width=value
    privRefresh(true)
  end
 
  def height=(value)
    @height=value
    privRefresh(true)
  end
 
  def pause=(value)
    @pause=value
    @pauseopacity=0 if !value
    privRefresh
  end
 
  def x=(value)
    @x=value
    privRefresh
  end

  def y=(value)
    @y=value
    privRefresh
  end
 
  def opacity=(value)
    @opacity=value
    @opacity=0 if @opacity<0
    @opacity=255 if @opacity>255
    privRefresh
  end
 
  def back_opacity=(value)
    @back_opacity=value
    @back_opacity=0 if @back_opacity<0
    @back_opacity=255 if @back_opacity>255
    privRefresh
  end
 
  def contents_opacity=(value)
    @contents_opacity=value
    @contents_opacity=0 if @contents_opacity<0
    @contents_opacity=255 if @contents_opacity>255
    privRefresh
  end
 
  def tone=(value)
    @tone=value
    privRefresh
  end
 
  def color=(value)
    @color=value
    privRefresh
  end
 
  def blend_type=(value)
    @blend_type=value
    privRefresh
  end
 
  def flash(color,duration)
    return if disposed?
    @sprites.each {|sprite| sprite[1].flash(color,duration)}
  end

  def update
    return if disposed?
    mustchange=false
    if @active
      if @cursorblink==0
      @cursoropacity-=8
      @cursorblink = 1 if @cursoropacity<=128
      else
      @cursoropacity+=8
      @cursorblink=0 if @cursoropacity>=255
      end
      mustchange=true if !@cursor_rect.isEmpty?
    else
      mustchange=true if @cursoropacity!=128
      @cursoropacity=128
    end
    if @pause
      @pauseframe=(Graphics.frame_count / 8) % 4
      @pauseopacity=[@pauseopacity+64,255].min
      mustchange=true
    end
    privRefresh if mustchange
    for i in @sprites
      i[1].update
    end
  end
 
  private
 
  def ensureBitmap(bitmap,dwidth,dheight)
    if !bitmap||bitmap.disposed?||bitmap.width<dwidth||bitmap.height<dheight
      bitmap.dispose if bitmap
      bitmap=Bitmap.new([1,dwidth].max,[1,dheight].max)
    end
    return bitmap
  end
 
  def tileBitmap(dstbitmap,dstrect,srcbitmap,srcrect)
    return if !srcbitmap || srcbitmap.disposed?
      left=dstrect.x
      top=dstrect.y
      y=0;loop do break unless y<dstrect.height
      x=0;loop do break unless x<dstrect.width
      dstbitmap.blt(x+left,y+top,srcbitmap,srcrect)
      x+=srcrect.width
    end
    y+=srcrect.height
    end
  end
 
  def privRefresh(changeBitmap=false)
    return if self.disposed?
    backopac = self.back_opacity * self.opacity / 255
    contopac = self.contents_opacity
    cursoropac = @cursoropacity * contopac / 255
    @sprites["contents"].bitmap = @contents
    unless @_windowskin.nil? || @_windowskin.disposed?
      for i in 0...4
        @sprites["corner#{i}"].bitmap = @_windowskin
        @sprites["corner#{i}"].opacity = @opacity
        @sprites["corner#{i}"].tone = @tone
        @sprites["corner#{i}"].color = @color
        @sprites["corner#{i}"].blend_type = @blend_type
        @sprites["corner#{i}"].visible = @visible
        @sprites["side#{i}"].opacity = @opacity
        @sprites["side#{i}"].tone = @tone
        @sprites["side#{i}"].color = @color
        @sprites["side#{i}"].blend_type = @blend_type
        @sprites["side#{i}"].visible = @visible
        @sprites["scroll#{i}"].bitmap = @_windowskin
        @sprites["scroll#{i}"].opacity = @opacity
        @sprites["scroll#{i}"].tone = @tone
        @sprites["scroll#{i}"].blend_type = @blend_type
        @sprites["scroll#{i}"].color = @color
        @sprites["scroll#{i}"].visible = @visible
      end
      @sprites["pause"].bitmap = @_windowskin
      for key in ["back", "cursor", "pause", "contents"]
        @sprites[key].color = @color
        @sprites[key].tone = @tone
        @sprites[key].blend_type = @blend_type
      end
      @sprites["contents"].blend_type = @contents_blend_type
      @sprites["contents"].opacity = contopac
      @sprites["contents"].visible = @visible && (@openness == 255)
      @sprites["cursor"].opacity = cursoropac
      @sprites["cursor"].visible = @visible && (@openness == 255)
      @sprites["pause"].visible = @visible && @pause
      @sprites["pause"].opacity = @pauseopacity
      @sprites["back"].opacity = backopac
      @sprites["back"].visible = @visible
      hascontents = (!@contents.nil? && !@contents.disposed?)
      @sprites["scroll0"].visible = @visible && hascontents && @oy > 0
      @sprites["scroll1"].visible = @visible && hascontents && @ox > 0
      @sprites["scroll2"].visible = @visible && hascontents && (@contents.width - @ox) > @width - 32
      @sprites["scroll3"].visible = @visible && hascontents && (@contents.height - @oy) > @height - 32
    else
      for i in 0...4
        @sprites["corner#{i}"].visible = false
        @sprites["side#{i}"].visible = false
        @sprites["scroll#{i}"].visible = false
      end
      @sprites["contents"].visible = @visible && @openness==255
      @sprites["contents"].color = @color
      @sprites["contents"].tone = @tone
      @sprites["contents"].blend_type = @contents_blend_type
      @sprites["contents"].opacity = contopac
      @sprites["back"].visible = false
      @sprites["pause"].visible = false
      @sprites["cursor"].visible = false
    end
    @sprites.each { |sprite| sprite[1].z = @z }
    if @rpgvx
      @sprites["cursor"].z = @z # For Compatibility
      @sprites["contents"].z = @z # For Compatibility
      @sprites["pause"].z = @z # For Compatibility
      trimX = 64
      backRect = Rect.new(0,0,64,64)
      blindsRect = Rect.new(0,64,64,64)
    else
      @sprites["cursor"].z = @z + 1 # For Compatibility
      @sprites["contents"].z = @z + 2 # For Compatibility
      @sprites["pause"].z = @z + 2 # For Compatibility
      trimX = 128
      backRect = Rect.new(0,0,128,128)
      blindsRect = nil
    end
    trimY = 0
    @sprites["corner0"].src_rect.set(trimX, trimY + 0, 16, 16);
    @sprites["corner1"].src_rect.set(trimX + 48, trimY + 0, 16, 16);
    @sprites["corner2"].src_rect.set(trimX, trimY + 48, 16, 16);
    @sprites["corner3"].src_rect.set(trimX + 48, trimY + 48, 16, 16);
    @sprites["scroll0"].src_rect.set(trimX + 24, trimY + 16, 16, 8) # up
    @sprites["scroll3"].src_rect.set(trimX + 24, trimY + 40, 16, 8) # down
    @sprites["scroll1"].src_rect.set(trimX + 16, trimY + 24, 8, 16) # left
    @sprites["scroll2"].src_rect.set(trimX + 40, trimY + 24, 8, 16) # right
    cursorX=trimX
    cursorY=trimY + 64
    sideRects= [ Rect.new(trimX + 16, trimY + 0, 32, 16),
    Rect.new(trimX, trimY + 16, 16, 32),
    Rect.new(trimX + 48, trimY + 16, 16, 32),
    Rect.new(trimX + 16, trimY + 48, 32, 16) ]
    if (@width > 32) && (@height > 32)
      @sprites["contents"].src_rect.set(@ox, @oy, @width - 32, @height - 32)
    else
      @sprites["contents"].src_rect.set(0,0,0,0)
    end
    pauseRects=[ trimX + 32, trimY + 64,
    trimX + 48, trimY + 64,
    trimX + 32, trimY + 80,
    trimX + 48, trimY + 80, ]
    pauseWidth = 16
    pauseHeight = 16
    @sprites["pause"].src_rect.set( pauseRects[@pauseframe*2],
    pauseRects[@pauseframe*2+1],
    pauseWidth,pauseHeight )
    @sprites["pause"].x = @x + (@width / 2) - (pauseWidth / 2)
    @sprites["pause"].y = @y + @height - 16 # 16 refers to skin margin
    @sprites["contents"].x = @x + 16
    @sprites["contents"].y = @y + 16
    @sprites["corner0"].x = @x
    @sprites["corner0"].y = @y
    @sprites["corner1"].x = @x + @width - 16
    @sprites["corner1"].y = @y
    @sprites["corner2"].x = @x
    @sprites["corner2"].y = @y + @height - 16
    @sprites["corner3"].x = @x + @width - 16
    @sprites["corner3"].y = @y + @height - 16
    @sprites["side0"].x = @x + 16
    @sprites["side0"].y = @y
    @sprites["side1"].x = @x
    @sprites["side1"].y = @y + 16
    @sprites["side2"].x = @x + @width - 16
    @sprites["side2"].y = @y + 16
    @sprites["side3"].x = @x + 16
    @sprites["side3"].y = @y + @height - 16
    @sprites["scroll0"].x = @x + @width / 2 - 8
    @sprites["scroll0"].y = @y + 8
    @sprites["scroll1"].x = @x + 8
    @sprites["scroll1"].y = @y + @height / 2 - 8
    @sprites["scroll2"].x = @x + @width - 16
    @sprites["scroll2"].y = @y + @height / 2 - 8
    @sprites["scroll3"].x = @x + @width / 2 - 8
    @sprites["scroll3"].y = @y + @height - 16
    @sprites["back"].x = @x + 2
    @sprites["back"].y = @y + 2
    @sprites["cursor"].x = @x + 16 + @cursor_rect.x
    @sprites["cursor"].y = @y + 16 + @cursor_rect.y
    if changeBitmap && !@_windowskin.nil? && !@_windowskin.disposed?
      width = @cursor_rect.width
      height = @cursor_rect.height
      if (width > 0) && (height > 0)
        cursorrects=[
        # sides
        Rect.new(cursorX+2, cursorY+0, 28, 2),
        Rect.new(cursorX+0, cursorY+2, 2, 28),
        Rect.new(cursorX+30, cursorY+2, 2, 28),
        Rect.new(cursorX+2, cursorY+30, 28, 2),
        # corners
        Rect.new(cursorX+0, cursorY+0, 2, 2),
        Rect.new(cursorX+30, cursorY+0, 2, 2),
        Rect.new(cursorX+0, cursorY+30, 2, 2),
        Rect.new(cursorX+30, cursorY+30, 2, 2),
        # back
        Rect.new(cursorX+2, cursorY+2, 28, 28)
        ]
        margin = 2
        fullmargin = 4
        @cursorbitmap = ensureBitmap(@cursorbitmap, width, height)
        @cursorbitmap.clear
        @sprites["cursor"].bitmap = @cursorbitmap
        @sprites["cursor"].src_rect.set(0, 0, width, height)
        rect = Rect.new(margin, margin, width - fullmargin, height - fullmargin)
        @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[8])
        @cursorbitmap.blt(0, 0, @_windowskin, cursorrects[4]) # top left
        @cursorbitmap.blt(width-margin, 0, @_windowskin, cursorrects[5]) # top right
        @cursorbitmap.blt(0, height-margin, @_windowskin, cursorrects[6])# bottom right
        @cursorbitmap.blt(width-margin, height-margin, @_windowskin, cursorrects[7]) # bottom left
        rect = Rect.new(margin, 0, width - fullmargin, margin)
        @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[0])
        rect = Rect.new(0, margin, margin, height - fullmargin)
        @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[1])
        rect = Rect.new(width - margin, margin, margin, height - fullmargin)
        @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[2])
        rect = Rect.new(margin, height-margin, width - fullmargin, margin)
        @cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[3])
      else
        @sprites["cursor"].visible = false
        @sprites["cursor"].src_rect.set(0, 0, 0, 0)
      end
      for i in 0..3
        dwidth = (i == 0 || i == 3) ? @width-32 : 16
        dheight = (i == 0 || i == 3) ? 16 : @height - 32
        @sidebitmaps[i] = ensureBitmap(@sidebitmaps[i], dwidth, dheight)
        @sprites["side#{i}"].bitmap = @sidebitmaps[i]
        @sprites["side#{i}"].src_rect.set(0, 0, dwidth, dheight)
        @sidebitmaps[i].clear
        if (sideRects[i].width > 0) && (sideRects[i].height > 0)
          @sidebitmaps[i].stretch_blt( @sprites["side#{i}"].src_rect,
          @_windowskin,sideRects[i] )
        end
      end
      backwidth = @width-4
      backheight = @height-4
      if (backwidth > 0) && (backheight > 0)
        @backbitmap = ensureBitmap(@backbitmap, backwidth, backheight)
        @sprites["back"].bitmap = @backbitmap
        @sprites["back"].src_rect.set(0, 0, backwidth, backheight)
        @backbitmap.clear
        if @stretch
          @backbitmap.stretch_blt(@sprites["back"].src_rect, @_windowskin,backRect)
        else
          tileBitmap(@backbitmap,@sprites["back"].src_rect, @_windowskin,backRect)
        end
        if blindsRect
          tileBitmap(@backbitmap,@sprites["back"].src_rect, @_windowskin,blindsRect)
        end
      else
        @sprites["back"].visible = false
        @sprites["back"].src_rect.set(0,0,0,0)
      end
    end
    if @openness != 255
      opn = @openness/255.0
      for key in @spritekeys
        sprite = @sprites[key]
        ratio = (@height <= 0) ? 0 : (sprite.y - @y) * 1.0 / @height
        sprite.zoom_y = opn
        sprite.oy = 0
        sprite.y = (@y + (@height / 2.0) + (@height * ratio * opn) - (@height / 2 * opn)).floor
        oldbitmap = sprite.bitmap
        oldsrcrect = sprite.src_rect.clone
      end
    else
      for key in @spritekeys
        sprite = @sprites[key]
        sprite.zoom_y = 1.0
      end
    end
    i = 0
    for key in @spritekeys
      sprite = @sprites[key]
      y = sprite.y
      sprite.y = i
      sprite.oy = (sprite.zoom_y <= 0) ? 0 : (i - y) / sprite.zoom_y
    end
  end
end


Dodatki konieczne
Umieść w folderze Graphics/Pictures
Spoiler:


Wybierz którąś z poniższych strzałek i zapisz jako 'Pointer'











___________________________


Zapisz jako 'Timer'

___________________________


Zapisz jako 'StoneBackground'

___________________________


Zapisz jako 'FF9_MenuBar'


Dodatki opcjonalne
Umieść w folderze Graphics/System
Spoiler:


Zapisz jako 'Window'


Demo
niepotrzebne

Screenshot
Spoiler:


Instrukcja
1. Wklej oba skrypty nad "Main" w Edytorze Skryptu. Skrypt poszerzający klasę 'Window' powinien być na samej górze sekcji.
2. Reszta instrukcji znajduje się w treści skryptu.

Piszcie w razie problemów.
________________________


 
 
 
Amelanduil 




Preferowany:
RPG Maker VXAce

Pomógł: 3 razy
Dołączył: 28 Wrz 2011
Posty: 464
Wysłany: Pon 02 Sie, 2010 17:29
A jest może skrypt na menu jak z FF 7 ? :D bo wiem że jest materia system z tego.
________________________
(╯°□°)╯︵ ┻━┻
"A jeśli... Boga nie ma, to co z ciebie za szatan?"
 
 
 
radek02 



Preferowany:
RPG Maker VX

Pomógł: 13 razy
Dołączył: 17 Lut 2010
Posty: 257
Skąd: klikasz ?
Wysłany: Wto 03 Sie, 2010 13:10
Amelanduil, "mena" są bardzo podobne . nie co szukac ..
________________________
2009-10-12 - dzień , od którego jestem uczestnikiem na polskiej scenie RPG Makera [/b]

Dołącz do grupy makerowiczów na nk ! http://nk.pl/#grupy/29610
 
 
 
Amelanduil 




Preferowany:
RPG Maker VXAce

Pomógł: 3 razy
Dołączył: 28 Wrz 2011
Posty: 464
Wysłany: Wto 03 Sie, 2010 13:29
A da się pod to podpiąć:
Materia System
ATB
w związku z tym, że zajmują one zbyt dużo, abym napisał je w wiadomości zamieszczę je w notatniku.
Nie potrzebuję game end, więc można to ominąć xP
________________________
(╯°□°)╯︵ ┻━┻
"A jeśli... Boga nie ma, to co z ciebie za szatan?"
 
 
 
GeimerShooter 




Preferowany:
RPG Maker VX

Dołączył: 03 Sie 2010
Posty: 9
Wysłany: Pią 06 Sie, 2010 13:00
Mam problem. Coś źle zrobiłem i gra mi się nie chce załączyć. ;-( Jakiś błąd wyskakuje.
Jak to naprawić? :-(
________________________
Śmierć to jedyna rzecz która zapobiegnie produkcji
 
 
Asantos 




Preferowany:
RPG Maker VX

Ranga RM:
1 gra

Pomógł: 15 razy
Dołączył: 31 Sty 2010
Posty: 236
Skąd: Gniezno
Wysłany: Pią 06 Sie, 2010 15:34
Musisz podać treść błędu. Nie jesteśmy jasnowidzami. Rodzajów błędów jest kilkanaście...
________________________
Rebelianci łączcie się!
 
 
GeimerShooter 




Preferowany:
RPG Maker VX

Dołączył: 03 Sie 2010
Posty: 9
Wysłany: Pią 06 Sie, 2010 16:36
OK.
?????'AAA' ? 592 ??? SyntaxError ????????
Dokładnie tak. :-(
________________________
Śmierć to jedyna rzecz która zapobiegnie produkcji
 
 
radek02 



Preferowany:
RPG Maker VX

Pomógł: 13 razy
Dołączył: 17 Lut 2010
Posty: 257
Skąd: klikasz ?
Wysłany: Nie 08 Sie, 2010 07:52
GeimerShooter, umieściłeś wszystkie skrypty i elementy graficzne ?
________________________
2009-10-12 - dzień , od którego jestem uczestnikiem na polskiej scenie RPG Makera [/b]

Dołącz do grupy makerowiczów na nk ! http://nk.pl/#grupy/29610
 
 
 
GeimerShooter 




Preferowany:
RPG Maker VX

Dołączył: 03 Sie 2010
Posty: 9
Wysłany: Nie 08 Sie, 2010 11:52
Tak. Skrypt i skrypt dodatkowy. Wszystkie dodatki konieczne( 1 strzałkę ). Podejrzewam że źle to umieściłem.
________________________
Śmierć to jedyna rzecz która zapobiegnie produkcji
 
 
MrDawnok 




Preferowany:
RPG Maker VX

Pomógł: 1 raz
Dołączył: 22 Maj 2010
Posty: 217
Wysłany: Czw 31 Maj, 2012 14:54
A można dodać ten
skrypt:
http://www.ultimateam.pl/viewtopic.php?t=2068

:?:
________________________



http://www.forumgalonum.pun.pl/viewtopic.php?id=5

"Bliski przyjaciel, czy to nie właściwe określenie dla kogoś, kto już przestał być bliski?"
 
 
 
aragorn7015 




Preferowany:
RPG Maker VXAce

Pomógł: 15 razy
Dołączył: 20 Kwi 2012
Posty: 186
Skąd: się biorą dzieci?
Wysłany: Czw 31 Maj, 2012 15:52
Mam problem. Gdy chce zapisać to się nie da, a jak chcę wyłączyć grę to się pokazuje okno zapisu, dlaczego? czyli nie da się wyłączyć a zapisuje się wciskając koniec! Dlaczego?
________________________
Jeśli pomogłem, daj
Spoiler:

POMÓGŁ



Uwielbiam się bawić na zdarzeniach w VX-ie... Więc jeśli masz jakieś pytanie jak coś zrobić na zdarzeniach to napisz. Jeśli będę wiedział to odpowiem
 
 
 
CrasheR 




Pomógł: 123 razy
Dołączył: 20 Gru 2010
Posty: 609
Skąd: Nibelheim
Wysłany: Czw 31 Maj, 2012 18:34
Widocznie rozwaliles cos w kodzie, albo kłóci sie z jakimś innym. Sam używałem tego skryptu i nawet przerobiłem go na kilka innych.
________________________



 
 
 
aragorn7015 




Preferowany:
RPG Maker VXAce

Pomógł: 15 razy
Dołączył: 20 Kwi 2012
Posty: 186
Skąd: się biorą dzieci?
Wysłany: Czw 31 Maj, 2012 19:48
Moje skrypty to:

Zapisy Gry

Nowy ekran tytułowy

Neo i Auto Save Woratana

Skrypt od Ayene:
Spoiler:

# by Ayene
# www.ultimateam.pl

module Ayene
DROP_TEXT = "Drużyna zdobyła:"
GOLD_ICON = 205
EXP_ICON = 204
LEVEL_UP_ICON = 142
WIDTH = 104
end

class Scene_Battle < Scene_Base
def display_exp_and_gold
@message_window.visible = false
skills = []
level_up = {}
exp = $game_troop.exp_total
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(exp, true)
(actor.skills - last_skills).each {|skill|
skills.push([skill, actor])
}
if last_level < actor.level
level_up[actor] = actor.level - last_level
else
level_up[actor] = 0
end
end
gold = $game_troop.gold_total
$game_party.gain_gold(gold)
drop_items = []
for item in $game_troop.make_drop_items
$game_party.gain_item(item, 1)
drop_items.push(item)
end
create_result_windows(exp, gold, drop_items, skills, level_up)
wait_for_result
@battle_result.dispose
@item_result.dispose
$game_message.texts.clear
end

def display_drop_items
end

def display_level_up
end

def create_result_windows(exp, gold, items, skills, level_up)
@battle_result = Window_Battle_Result.new(exp, level_up)
@item_result = Window_Result_Item.new(gold, items, exp, skills)
end

def wait_for_result
close = false
loop do
update_basic
@battle_result.update
break if @battle_result.stop
end
loop do
update_basic
if Input.trigger?(Input::C)
close = true
end
if close
@battle_result.opacity -= 10
@battle_result.contents_opacity -= 10
@item_result.opacity -= 10
@item_result.contents_opacity -= 10
end
break if @battle_result.opacity == 0
end
end
end

class Window_Battle_Result < Window_Base
attr_accessor :stop
include Ayene
def initialize(exp, level_up)
super(0, 0, 544, 224 + WLH)
@exp = exp
@level_up = level_up
@rate = {}
@max = []
for actor in $game_party.members
lv = actor.level - @level_up[actor]
s1 = actor.gained_exp(lv, actor.exp - @exp)
s2 = actor.needed_exp(lv)
gw = [s1 * WIDTH / s2, WIDTH].min
@rate[actor] = gw
end
@stop = false
refresh
end

def refresh
self.contents.clear
for actor in $game_party.members
draw_actor_face(actor, actor.index % 2 * 260, actor.index / 2 * 96 + WLH / 2, 92)
x = 114 + actor.index % 2 * 260
y = 10 + actor.index / 2 * 96 + WLH / 2
draw_actor_name(actor, x, y)
draw_actor_level(actor, x, y + WLH * 1)
draw_actor_graphic_exp(actor, x, 10 + y + WLH * 2)
end
end

def update_bars
for actor in $game_party.members
x = 114 + actor.index % 2 * 260
y = 10 + actor.index / 2 * 96 + WLH / 2
draw_actor_graphic_exp(actor, x, 10 + y + WLH * 2)
end
end

def draw_actor_graphic_exp(actor, x, y, width = WIDTH)
bitmap = Cache.system("hp_mp_bar")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
s1 = actor.gained_exp(actor.level, actor.exp)
s2 = actor.needed_exp(actor.level)
gw = [s1 * WIDTH / s2, WIDTH].min
gc1 = Color.new(38,101,131)
gc2 = Color.new(45,121,157)
@max.push(gw)
if @level_up[actor] > 0
w = [@rate[actor], width].min
if @rate[actor] == width
@level_up[actor] -= 1
@rate[actor] = 0
draw_icon(LEVEL_UP_ICON, 100 + x, y - WLH * 2)
self.contents.clear_rect(x, y - WLH * 1 - 10, 64, WLH)
draw_actor_level(actor, x, y - WLH * 1 - 10)
end
else
w = [@rate[actor], gw].min
if @rate[actor] == @max.max
@stop = true
end
end
self.contents.gradient_fill_rect(x+8, y+3, w, 6, gc1, gc2)
bitmap.dispose
end

def draw_actor_level(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, WLH, actor.level - @level_up[actor], 2)
end

def update
for actor in $game_party.members
@rate[actor] += 1
end
update_bars
end
end

class Window_Result_Item < Window_Base
include Ayene
def initialize(gold, items, exp, skills)
super(0, 248, 544, 144 + WLH)
@items = items
@gold = gold
@exp = exp
@skills = skills
refresh
end
def refresh
self.contents.clear
@skills.each_with_index {|tab, i|
actor = tab[1]
skill = tab[0]
text = sprintf("%s poznał - %s", actor.name, skill.name)
self.contents.draw_text(230, i * WLH, self.width, WLH, text)
break if i == 4
}
self.contents.draw_text(0, 0, self.width, WLH, DROP_TEXT)
draw_icon(EXP_ICON, 26, WLH)
self.contents.draw_text(50, WLH, self.width, WLH, @exp.to_s)
draw_icon(GOLD_ICON, 26, WLH * 2)
self.contents.draw_text(50, WLH * 2, self.width, WLH, @gold.to_s)
for i in 0...@items.size
draw_item_name(@items[i], 26, WLH * 3 + i * WLH)
end
end
end

class Game_Actor < Game_Battler
def gained_exp(current_level, current_exp)
return (current_exp - @exp_list[current_level])
end
def needed_exp(current_level)
return (@exp_list[current_level + 1] - @exp_list[current_level])
end
end



Auto walka

Prosty skrypt Sideview

Hp\Mp przeciwników

MOG Hud

Pisanie klawiaturą

Yanfly Engine RD

Nazwy lokacji

Użyj / Usuń Przedmiot (Ayene)

Zwierzątko (Pet)

Thomas Edison

Deriru's Simple Storage System

Dodatek do Menu Final Fantasy IX

I oczywiście Menu Final Fantasy IX

W kodzie nic nie zmieniałem, a gdy próbuje dać normalnie zapis słychać buczek...
________________________
Jeśli pomogłem, daj
Spoiler:

POMÓGŁ



Uwielbiam się bawić na zdarzeniach w VX-ie... Więc jeśli masz jakieś pytanie jak coś zrobić na zdarzeniach to napisz. Jeśli będę wiedział to odpowiem
 
 
 
CrasheR 




Pomógł: 123 razy
Dołączył: 20 Gru 2010
Posty: 609
Skąd: Nibelheim
Wysłany: Czw 31 Maj, 2012 21:26
Wiecej tego nie bylo? Wyrzuc neo, auto save i prawdz czy bedzie działać.
________________________



 
 
 
aragorn7015 




Preferowany:
RPG Maker VXAce

Pomógł: 15 razy
Dołączył: 20 Kwi 2012
Posty: 186
Skąd: się biorą dzieci?
Wysłany: Pią 01 Cze, 2012 19:08
Nie działa... Usunąłem Auto i Neo Save i nic.

Ayene
Spoiler:

lub ktoś inny

masz może jakiś pomysł na rozwiązanie problemu :?: Gdy dałem nowy projekt dokładnie to samo...
Spoiler:

Może to wina polskiego makera?

________________________
Jeśli pomogłem, daj
Spoiler:

POMÓGŁ



Uwielbiam się bawić na zdarzeniach w VX-ie... Więc jeśli masz jakieś pytanie jak coś zrobić na zdarzeniach to napisz. Jeśli będę wiedział to odpowiem
 
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene