inne menu i punkt za poziom
Aktualny czas: 28-04-26, 21:07 Witaj! Przejdź do zakładki Logowanie lub Rejestracja


Wątek zamknięty 
[VX] inne menu i punkt za poziom
szevaa Offline
*


Liczba postów: 24
Dołączył: 28-11-13

Pomógł: 3



Post: #1
inne menu i punkt za poziom

HEJ!

Mam pytanie ponieważ mam skrypt zmieniajacy troche moje menu i chcialem doinstalowac punkt za poziom niestety gryza sie one ;/ mogl by ktos je zedytowac ?

#===============================================================================​
# * Main Menu Evo II *Version 3*
# * Successor to Main Menu EVO
# * By Crazyninjaguy
# * http://www.planetdev.co.uk
# * Part of CNG Engine Evolution
#  ---------------------------------------------------------------------------
# * Version 3 Changelog
#  ---------------------------------------------------------------------------
# * Added support for 640 x 480 resolution
#===============================================================================​
# * Compatible With:
#  ---------------------------------------------------------------------------
# * Battle/Map BGM Selector Evo
#===============================================================================​

$imported = {} if $imported == nil
$imported["CEE-MainMenuEvoII"] = true

module CngEvo
  module Menu
    #==========================================================================​=
    # * Load System data to prevent errors when loading Vocab terms
    #==========================================================================​=
    $data_system = load_data("Data/System.rvdata")
    #==========================================================================​=
    # * Menu Commands, seperate each value with a comma.
    # * To add new commands, either use a Vocab entry (See the Vocab Module),
    #   Or use a text string in quotes, example: "Quests"
    #==========================================================================​=
    COMMANDS = [
    Vocab::item,
    Vocab::skill,
    Vocab::equip,
    Vocab::status,
    Vocab::save,
    Vocab::game_end]
    #==========================================================================​=
    # * These are the icons that display next to the command option in the menu.
    # * The best way to find the number of the icon is to use Yanfly's
    #   YEM IconView Melody, and look for the ID number.
    # * Seperate each number with a comma.
    #==========================================================================​=
    ICONS = [
    144,
    128,
    32,
    106,
    141,
    142]
    #==========================================================================​=
    # * These are the scenes to call for each menu command.
    # * Copy the existing examples to add new ones.
    # * The last value (True/False) is whether or not you need to select an
    #   an actor to continue onto that scene.
    # * True = Select an Actor.
    # * False = Don't select one.
    #==========================================================================​=
    SCENES = [
    [Scene_Item, false],
    [Scene_Skill, true],
    [Scene_Equip, true],
    [Scene_Status, true],
    [Scene_File, false],
    [Scene_End, false]]
    #==========================================================================​=
    # * These are the Playtime, Steps, Map Name and Gold icons.
    # * As with the others, seperate with a comma
    #==========================================================================​=
    INFO_ICONS = [
    188,
    48,
    153,
    205]
  end # Menu
end # CngEvo

#===============================================================================​
# * Scene_Menu Class, Processes the main menu.
#===============================================================================​
class Scene_Menu < Scene_Base
  #==========================================================================​===
  # * Include the Menu module and initialize the command_window index
  #==========================================================================​===
  include CngEvo::Menu
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end # initialize
  #==========================================================================​===
  # * Start the scene by creating windows etc
  #==========================================================================​===
  def start
    super
    create_menu_background
    create_command_window
    @status_window = Window_MenuEvoStatus.new
    @menuinfo = Window_MenuInfo.new
  end # start
  #==========================================================================​===
  # * End the scene and dispose windows etc
  #==========================================================================​===
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @status_window.dispose
    @menuinfo.dispose
  end # terminate
  #==========================================================================​===
  # * Update the scene's windows
  #==========================================================================​===
  def update
    super
    @menuinfo.update
    if @command_window.active
      @command_window.update
      update_command
    elsif @status_window.active
      @status_window.update
      update_actor_selection
    end
  end # update
  #==========================================================================​===
  # * Create the main command window
  #==========================================================================​===
  def create_command_window
    @command_window = Window_IconCommand.new(164, COMMANDS)
    @command_window.index = @menu_index
    if COMMANDS.size > 7
      @command_window.height = (Graphics.height - 192)
    end
  end # create_command_window
  #==========================================================================​===
  # * Update the command window, and process choices
  #==========================================================================​===
  def update_command
    if Input.trigger?(Input::C)
      Sound.play_decision
      if SCENES[@command_window.index][1] == false
        if SCENES[@command_window.index][0] == Scene_File
          $scene = SCENES[@command_window.index][0].new(true, false, false)
        else
          $scene = SCENES[@command_window.index][0].new
        end
      else
        start_actor_selection
      end
    elsif Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    end
  end # update_command
end # Scene_Menu

#===============================================================================​
# * Window_MenuEvoStatus, this window is a Window_MenuStatus Replacement
#===============================================================================​
class Window_MenuEvoStatus < Window_Selectable
  #==========================================================================​===
  # * Initialize the window, ans setup values
  #==========================================================================​===
  def initialize
    super(0, (Graphics.height - 192), Graphics.width, 192)
    refresh
    self.active = false
    self.index = -1
  end # initialize
  #==========================================================================​===
  # * Draw window contents
  #==========================================================================​===
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    @facesprites = []
    for actor in $game_party.members
      x = actor.index * 128 + 16
      draw_actor_evoface(actor, x, 64)
      draw_actor_graphic(actor, x + 14, 158)
      draw_actor_name(actor, x - 12, 0)
      draw_actor_level(actor, x - 12, 32)
      draw_actor_state(actor, x + 80, 0)
      draw_actor_hp(actor, x - 12, 64)
      draw_actor_mp(actor, x - 12, 96)
    end
  end # refresh
  #==========================================================================​===
  # * Update cursor
  #==========================================================================​===
  def update_cursor
    if @index < 0               # No cursor
      self.cursor_rect.empty
    elsif @index < @item_max    # Normal
      self.cursor_rect.set((@index * ((Graphics.width - 32) / 4)), 0, ((Graphics.width - 32) / 4), 160)
    elsif @index >= 100         # Self
      self.cursor_rect.set((@index * ((Graphics.width - 32) / 4)), 0, ((Graphics.width - 32) / 4), 160)
    else                        # All
      self.cursor_rect.set(0, 0, contents.width, 160)
    end
  end # update_cursor
  #==========================================================================​===
  # * Add support for horizontal scrolling
  #==========================================================================​===
  def update
    super
    if cursor_movable?
      last_index = @index
      if Input.repeat?(Input::RIGHT)
        if @index == 0
          if $game_party.members.size > 1
            @index = 1
          end
        elsif @index == 1
          if $game_party.members.size > 2
            @index = 2
          end
        elsif @index == 2
          if $game_party.members.size > 3
            @index = 3
          end
        elsif @index == 3
          if $game_party.members.size >= 4
            @index = 0
          end
        end
      elsif Input.repeat?(Input::LEFT)
        if @index == 0
          if $game_party.members.size >= 4
            @index = 3
          end
        elsif @index == 1
          @index = 0
        elsif @index == 2
          @index = 1
        elsif @index == 3
          @index = 2
        end
      end
      if @index != last_index
        Sound.play_cursor
      end
    end
    update_cursor
    call_update_help
  end # update
end # Window_MenuEvoStatus

#===============================================================================​
# * Window_MenuInfo class, this window draws Playtime, Steps etc.
#===============================================================================​
class Window_MenuInfo < Window_Base
  #==========================================================================​===
  # * Include the Menu module and setup window size
  #==========================================================================​===
  include CngEvo::Menu
  def initialize
    super((Graphics.width - 260), 0, 260, 128)
    refresh
  end # initialize
  #==========================================================================​===
  # * Draw Window contents
  #==========================================================================​===
  def refresh
    self.contents.clear
    draw_icon(INFO_ICONS[1], 0, 24) # Steps
    draw_icon(INFO_ICONS[2], 0, 48) # Map Name
    draw_icon(INFO_ICONS[3], 0, 72) # Area
    draw_time
    self.contents.draw_text(0, 24, width - 32, WLH, $game_party.steps, 2)
    @map_name = load_data("Data/MapInfos.rvdata")[$game_map.map_id].name
    self.contents.draw_text(0, 48, width - 32, WLH, @map_name, 2)
    self.contents.draw_text(0, 72, width - 32, WLH, $game_party.gold, 2)
  end # refresh
  #==========================================================================​===
  # * Check if Playtime is different from last check
  #==========================================================================​===
  def update
    if @text != (Graphics.frame_count / Graphics.frame_rate)
      draw_time
    end
    super
  end # update
  #==========================================================================​===
  # * Draw playtime info
  #==========================================================================​===
  def draw_time
    self.contents.clear_rect(Rect.new(0, 0, (260 - 32), 24))
    draw_icon(INFO_ICONS[0], 0, 0) # Playtime
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    @hour = @total_sec / 60 / 60
    @min = @total_sec / 60 % 60
    @sec = @total_sec % 60
    @text = sprintf("%02d:%02d:%02d", @hour, @min, @sec)
    self.contents.draw_text(0, 0, width - 32, WLH, @text, 2)
  end # draw_time
end # Window_MenuInfo

#===============================================================================​
# * Window_Base Edits to allow for face opacity changing
#===============================================================================​
class Window_Base < Window
  #==========================================================================​===
  # * Draw the character's face graphic
  #==========================================================================​===
  def draw_evoface(face_name, face_index, x, y, size = 96)
    opacity = 100
    bitmap = Cache.face(face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * 96 + (96 - size) / 2
    rect.y = face_index / 4 * 96 + (96 - size) / 2
    rect.width = size
    rect.height = size
    self.contents.blt(x, y, bitmap, rect, opacity)
    bitmap.dispose
  end # draw_evoface
  #==========================================================================​===
  # * Call the draw_evoface method with the relevant arguments
  #==========================================================================​===
  def draw_actor_evoface(actor, x, y, size = 96)
    draw_evoface(actor.face_name, actor.face_index, x, y, size)
  end # draw_actor_evoface
end # Window_Base

#===============================================================================​
# * Scene_File edit for returning to the right menu option
#===============================================================================​
class Scene_File < Scene_Base
  #==========================================================================​===
  # * Return to the previous scene
  #==========================================================================​===
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(5)
    end
  end # return_scene
end # Scene_File

#===============================================================================​
# * Window_Command clone to support icon drawing and scrolling with commands
#===============================================================================​
class Window_IconCommand < Window_Selectable
  #==========================================================================​===
  # * Include the menu module, and initialize the window
  #==========================================================================​===
  include CngEvo::Menu
  attr_reader   :commands                 # command
  def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
    if row_max == 0
      row_max = (commands.size + column_max - 1) / column_max
    end
    super(0, 0, width, row_max * WLH + 32, spacing)
    @commands = commands
    @item_max = commands.size
    @column_max = column_max
    refresh
    self.index = 0
  end # initialize
  #==========================================================================​===
  # * Draw window options
  #==========================================================================​===
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end # refresh
  #==========================================================================​===
  # * Draw the text, and icon.
  #==========================================================================​===
  def draw_item(index)
    icon = ICONS[index]
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = true ? 255 : 128
    self.contents.draw_text(rect.x + 24, rect.y, rect.width, rect.height, @commands[index])
    draw_icon(icon, rect.x - 2, rect.y)
  end # draw_item
end # Window_IconCommand
to jest menu

#==============================================================================
# Requiem Upgrade
# Autor: Requiem
# Zamieścił: Karsznickus
# Modyfikacja z samowyskakującym oknem: Ayene
# Modyfikacja z ikoną awansu pobrana od Blizzarda
#==============================================================================

module Ayene
  
  # Samowyświetlające się okno - przy każdym następnym awansie okno samo będzie
  # się pojawiać
  OKNO_UP = false    # true / false
  
  # Ikona sygnalizująca awans na poziom
  LEVEL_UP_ICON = true  # true / false
  
  # Parametry ikony [x, y, opacity]
  ICON_DATA = [510, 380, 200]
  
end

Points_Gained = 5 # liczba punktów co poziom

#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  
  attr_accessor :points
  
  alias requiem_upgwnd_initialize initialize
  alias requiem_upgwnd_lvlup level_up
  
  def initialize(actor_id)
    requiem_upgwnd_initialize(actor_id)
    @points = 0
  end
  
  def level_up
    requiem_upgwnd_lvlup
    @points += Points_Gained
    # gdy awans na poziom następuje poprzez bezpośrednie dodanie exp drużynie
    if Ayene::OKNO_UP == true
      $scene = Scene_RequiemUpgrade.new(0,false) unless $game_temp.in_battle == true      
    end
  end
end

#------------------------------------------------------------------------------
# by Ayene
# okno ze statystykami wyświetla się po walce, gdy ktoś z drużyny ma awans
if Ayene::OKNO_UP
  class Scene_Battle < Scene_Base    
    alias ayene_proc_vic process_victory
    def process_victory
      ayene_proc_vic    
      if $game_party.members.any? {|actor| actor.points > 0}
        $scene = Scene_RequiemUpgrade.new(0,false)
      else
       battle_end(0)
      end
    end
  end
end
#koniec

#------------------------------------------------------------------------------
# by Ayene
class Scene_Map < Scene_Base
  alias terminate_sds_later terminate
  def terminate
    terminate_sds_later
    @notify.dispose unless @notify.nil?
  end
  
  alias upd_sds_later update
  def update
    upd_sds_later
    check_icon if Ayene::LEVEL_UP_ICON
  end
  
  def check_icon
    if $game_party.members.any? {|actor| actor.points > 0}
      if @notify == nil
        @notify = Sprite.new
      else        
        @notify.bitmap = Bitmap.new(24, 24)
        @notify.bitmap.fill_rect(0, 0, 24, 24, Color.new(255, 255, 255))
        @notify.bitmap.fill_rect(22, 1, 2, 23, Color.new(0, 0, 0))
        @notify.bitmap.fill_rect(1, 22, 23, 2, Color.new(0, 0, 0))
        @notify.bitmap.set_pixel(23, 0, Color.new(0, 0, 0))
        @notify.bitmap.set_pixel(0, 23, Color.new(0, 0, 0))
        @notify.bitmap.fill_rect(2, 2, 20, 20, Color.new(0, 0, 224))
        @notify.bitmap.fill_rect(4, 10, 16, 4, Color.new(255, 255, 255))
        @notify.bitmap.fill_rect(10, 4, 4, 16, Color.new(255, 255, 255))
        @notify.opacity = Ayene::ICON_DATA[2]
      end  
      @notify.x, @notify.y = Ayene::ICON_DATA[0, 2]
      @notify.z = 5000
    end
    @notify.update unless @notify.nil?
  end
end
#koniec

#------------------------------------------------------------------------------
class Requiem_UpgradeWindow < Window_Base
  
  def initialize(actor)
    super(0,65,320,320)
    @actor = actor
    update
  end
  
  def update
    self.contents.clear
    draw_actor_face(@actor,0,0,92)
    draw_actor_name(@actor,160,0)
    self.contents.font.color = normal_color
    self.contents.draw_text(224,28,64,WLH,@actor.level)
    self.contents.draw_text(224,26*2,64,WLH,@actor.points)
    self.contents.draw_text(128,24*5,96,WLH,@actor.maxhp)
    self.contents.draw_text(128,24*6,96,WLH,@actor.maxmp)
    self.contents.draw_text(128,24*7,96,WLH,@actor.atk)
    self.contents.draw_text(128,24*8,96,WLH,@actor.def)
    self.contents.draw_text(128,24*9,96,WLH,@actor.spi)
    self.contents.draw_text(128,24*10,96,WLH,@actor.agi)
    refresh
  end
  
  def refresh
    self.contents.font.color = system_color
    self.contents.draw_text(128,28,128,WLH,Vocab::level+":")
    self.contents.draw_text(128,26*2,128,WLH,"Punkty:")
    self.contents.draw_text(0,24*5,128,WLH,Vocab::hp_a+":")
    self.contents.draw_text(0,24*6,128,WLH,Vocab::mp_a+":")
    self.contents.draw_text(0,24*7,128,WLH,Vocab::atk+":")
    self.contents.draw_text(0,24*8,128,WLH,Vocab::def+":")
    self.contents.draw_text(0,24*9,128,WLH,Vocab::spi+":")
    self.contents.draw_text(0,24*10,128,WLH,Vocab::agi+":")
  end
  
end

# by Ayene
# Niewielka modyfikacja Window_Help
class Window_Help < Window_Base
  def initialize (y = 0, width = 544)
    super(0, y, width, WLH + 32)
  end
end
# koniec
#------------------------------------------------------------------------------
class Scene_RequiemUpgrade < Scene_Base
  
  def initialize(actor_index=0, from_menu=false)
    create_menu_background
    @actor_index = actor_index
    @from_menu = from_menu
  end
  
  def start
    super
    create_menu_background    
    @actor = $game_party.members[@actor_index]
    @requiem_upgwindow = Requiem_UpgradeWindow.new(@actor)
    @requiem_upgwindow.x = (544 - @requiem_upgwindow.width) / 2
    @requiem_upgcmdwnd  = Window_Command.new(64,[" +"," +"," +"," +"," +"," +"])
    @requiem_upgcmdwnd.index = 0
    @requiem_upgcmdwnd.x = @requiem_upgwindow.x + 192
    @requiem_upgcmdwnd.y = @requiem_upgwindow.y + 120
    @requiem_upgcmdwnd.opacity = 0
    # by Ayene
    # Dodany Window_Help
    @help_window = Window_Help.new (10, 320)
    @help_window.x = (544 - @requiem_upgwindow.width) / 2
    @help_window.set_text("L/R - Zmiana bohatera",1)
    # koniec
  end

# by Ayene
# następny / poprzedni bohater
  def next_actor
    @actor_index += 1
    @actor_index %= $game_party.members.size
    if @from_menu == true
    $scene = Scene_RequiemUpgrade.new(@actor_index,true)
    else
    $scene = Scene_RequiemUpgrade.new(@actor_index,false)
    end
  end
  
  def prev_actor
    @actor_index += $game_party.members.size - 1
    @actor_index %= $game_party.members.size
    if @from_menu == true
    $scene = Scene_RequiemUpgrade.new(@actor_index,true)
    else
    $scene = Scene_RequiemUpgrade.new(@actor_index,false)
    end
  end
# koniec
  
  def update
    super
    update_menu_background
    @requiem_upgwindow.update
    @requiem_upgcmdwnd.update
    @help_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      if @from_menu
        $scene = Scene_Menu.new(4)
      else
        $scene = Scene_Map.new
      end
    # by Ayene
    # następny / poprzedni bohater
    elsif Input.trigger?(Input::R)
      Sound.play_cursor
      next_actor
    elsif Input.trigger?(Input::L)
      Sound.play_cursor
      prev_actor
    # koniec    
    elsif Input.trigger?(Input::C)
      if @actor.points > 0
        Sound.play_decision
      else
        Sound.play_buzzer
        return
      end
      case @requiem_upgcmdwnd.index
      when 0
        @actor.points -= 1
        @actor.maxhp += 10
      when 1
        @actor.points -= 1
        @actor.maxmp += 10
      when 2
        @actor.points -= 1
        @actor.atk += 1
      when 3
        @actor.points -= 1
        @actor.def += 1
      when 4
        @actor.points -= 1
        @actor.spi += 1
      when 5
        @actor.points -= 1
        @actor.agi += 1
      end      
    end
  end
  
  def terminate
    super
    dispose_menu_background
    @requiem_upgwindow.dispose
    @requiem_upgcmdwnd.dispose
    @help_window.dispose
  end
    
end

#------------------------------------------------------------------------------
class Scene_Menu < Scene_Base
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = "Poziom plus"
    s6 = Vocab::save
    s7 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7])
    @command_window.index = @menu_index
    if $game_party.members.size == 0
      @command_window.draw_item(0, false)
      @command_window.draw_item(1, false)
      @command_window.draw_item(2, false)
      @command_window.draw_item(3, false)
    end
    if $game_system.save_disabled
      @command_window.draw_item(4, false)
    end
  end
  
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0
        $scene = Scene_Item.new
      when 1,2,3,4
        start_actor_selection
      when 5
        $scene = Scene_File.new(true, false, false)
      when 6
        $scene = Scene_End.new
      end
    end
  end
  
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1
        $scene = Scene_Skill.new(@status_window.index)
      when 2
        $scene = Scene_Equip.new(@status_window.index)
      when 3
        $scene = Scene_Status.new(@status_window.index)
      when 4
        $scene = Scene_RequiemUpgrade.new(@status_window.index,true)
      end
    end
  end
end

#------------------------------------------------------------------------------
class Scene_File < Scene_Base
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(5)
    end
  end
end

#------------------------------------------------------------------------------
class Scene_End < Scene_Base
  def return_scene
    $scene = Scene_Menu.new(6)
  end
end
To jest punkt za poziom

Z góry dziekuje :)
01-12-13 22:13
Znajdź wszystkie posty użytkownika
"Pomógł" przyznał(a):
DiqDiq Offline
*


Liczba postów: 1
Dołączył: 08-12-13

Pomógł: 0



Post: #2
RE: inne menu i punkt za poziom

Na serio? 10 sekund roboty -,-
pod
Vocab::status,
dodajesz
"dodaj punktasy",
pod
106,
dodajesz
104,
pod
[Scene_Status, true],
dodajesz
[SceneRequiemUpgrade_, true],

medżik.
08-12-13 16:41
Znajdź wszystkie posty użytkownika
"Pomógł" przyznał(a):
szevaa Offline
*


Liczba postów: 24
Dołączył: 28-11-13

Pomógł: 3



Post: #3
RE: inne menu i punkt za poziom

echm Hmm no ja się nie znam jestem "zielony" wiec ...

możesz podać kod bo nie do końca rozumiem :)

ZGD
08-12-13 17:35
Znajdź wszystkie posty użytkownika
"Pomógł" przyznał(a):
Ayene Offline
*


Liczba postów: 758
Dołączył: 09-04-13

Pomógł: 112



Post: #4
RE: inne menu i punkt za poziom

Podmień skrypt na Menu:
#===============================================================================​​
# * Main Menu Evo II *Version 3*
# * Successor to Main Menu EVO
# * By Crazyninjaguy
# * http://www.planetdev.co.uk
# * Part of CNG Engine Evolution
#  ---------------------------------------------------------------------------
# * Version 3 Changelog
#  ---------------------------------------------------------------------------
# * Added support for 640 x 480 resolution
#===============================================================================​​
# * Compatible With:
#  ---------------------------------------------------------------------------
# * Battle/Map BGM Selector Evo
#===============================================================================​​

$imported = {} if $imported == nil
$imported["CEE-MainMenuEvoII"] = true

module CngEvo
  module Menu
    #==========================================================================​​=
    # * Load System data to prevent errors when loading Vocab terms
    #==========================================================================​​=
    $data_system = load_data("Data/System.rvdata")
    #==========================================================================​​=
    # * Menu Commands, seperate each value with a comma.
    # * To add new commands, either use a Vocab entry (See the Vocab Module),
    #   Or use a text string in quotes, example: "Quests"
    #==========================================================================​​=
    COMMANDS = [
    Vocab::item,
    Vocab::skill,
    Vocab::equip,
    Vocab::status,
    "Punkty",
    Vocab::save,
    Vocab::game_end]
    #==========================================================================​​=
    # * These are the icons that display next to the command option in the menu.
    # * The best way to find the number of the icon is to use Yanfly's
    #   YEM IconView Melody, and look for the ID number.
    # * Seperate each number with a comma.
    #==========================================================================​​=
    ICONS = [
    144,
    128,
    32,
    106,
    110,
    141,
    142]
    #==========================================================================​​=
    # * These are the scenes to call for each menu command.
    # * Copy the existing examples to add new ones.
    # * The last value (True/False) is whether or not you need to select an
    #   an actor to continue onto that scene.
    # * True = Select an Actor.
    # * False = Don't select one.
    #==========================================================================​​=
    SCENES = [
    [Scene_Item, false],
    [Scene_Skill, true],
    [Scene_Equip, true],
    [Scene_Status, true],
    [Scene_RequiemUpgrade, true, true],
    [Scene_File, false],
    [Scene_End, false]]
    #==========================================================================​​=
    # * These are the Playtime, Steps, Map Name and Gold icons.
    # * As with the others, seperate with a comma
    #==========================================================================​​=
    INFO_ICONS = [
    188,
    48,
    153,
    205]
  end # Menu
end # CngEvo

#===============================================================================​​
# * Scene_Menu Class, Processes the main menu.
#===============================================================================​​
class Scene_Menu < Scene_Base
  #==========================================================================​​===
  # * Include the Menu module and initialize the command_window index
  #==========================================================================​​===
  include CngEvo::Menu
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end # initialize
  #==========================================================================​​===
  # * Start the scene by creating windows etc
  #==========================================================================​​===
  def start
    super
    create_menu_background
    create_command_window
    @status_window = Window_MenuEvoStatus.new
    @menuinfo = Window_MenuInfo.new
  end # start
  #==========================================================================​​===
  # * End the scene and dispose windows etc
  #==========================================================================​​===
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @status_window.dispose
    @menuinfo.dispose
  end # terminate
  #==========================================================================​​===
  # * Update the scene's windows
  #==========================================================================​​===
  def update
    super
    @menuinfo.update
    if @command_window.active
      @command_window.update
      update_command
    elsif @status_window.active
      @status_window.update
      update_actor_selection
    end
  end # update
  #==========================================================================​​===
  # * Create the main command window
  #==========================================================================​​===
  def create_command_window
    @command_window = Window_IconCommand.new(164, COMMANDS)
    @command_window.index = @menu_index
    if COMMANDS.size > 7
      @command_window.height = (Graphics.height - 192)
    end
  end # create_command_window
  
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      if SCENES[@command_window.index][2].nil?
        $scene = SCENES[@command_window.index][0].new(@status_window.index)
      else
        $scene = SCENES[@command_window.index][0].new(@status_window.index, SCENES[@command_window.index][2])
      end
    end  
  end  
  #==========================================================================​​===
  # * Update the command window, and process choices
  #==========================================================================​​===
  def update_command
    if Input.trigger?(Input::C)
      Sound.play_decision
      if SCENES[@command_window.index][1] == false
        if SCENES[@command_window.index][0] == Scene_File
          $scene = SCENES[@command_window.index][0].new(true, false, false)
        else
          $scene = SCENES[@command_window.index][0].new
        end
      else
        start_actor_selection
      end
    elsif Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    end
  end # update_command
end # Scene_Menu

#===============================================================================​​
# * Window_MenuEvoStatus, this window is a Window_MenuStatus Replacement
#===============================================================================​​
class Window_MenuEvoStatus < Window_Selectable
  #==========================================================================​​===
  # * Initialize the window, ans setup values
  #==========================================================================​​===
  def initialize
    super(0, (Graphics.height - 192), Graphics.width, 192)
    refresh
    self.active = false
    self.index = -1
  end # initialize
  #==========================================================================​​===
  # * Draw window contents
  #==========================================================================​​===
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    @facesprites = []
    for actor in $game_party.members
      x = actor.index * 128 + 16
      draw_actor_evoface(actor, x, 64)
      draw_actor_graphic(actor, x + 14, 158)
      draw_actor_name(actor, x - 12, 0)
      draw_actor_level(actor, x - 12, 32)
      draw_actor_state(actor, x + 80, 0)
      draw_actor_hp(actor, x - 12, 64)
      draw_actor_mp(actor, x - 12, 96)
    end
  end # refresh
  #==========================================================================​​===
  # * Update cursor
  #==========================================================================​​===
  def update_cursor
    if @index < 0               # No cursor
      self.cursor_rect.empty
    elsif @index < @item_max    # Normal
      self.cursor_rect.set((@index * ((Graphics.width - 32) / 4)), 0, ((Graphics.width - 32) / 4), 160)
    elsif @index >= 100         # Self
      self.cursor_rect.set((@index * ((Graphics.width - 32) / 4)), 0, ((Graphics.width - 32) / 4), 160)
    else                        # All
      self.cursor_rect.set(0, 0, contents.width, 160)
    end
  end # update_cursor
  #==========================================================================​​===
  # * Add support for horizontal scrolling
  #==========================================================================​​===
  def update
    super
    if cursor_movable?
      last_index = @index
      if Input.repeat?(Input::RIGHT)
        if @index == 0
          if $game_party.members.size > 1
            @index = 1
          end
        elsif @index == 1
          if $game_party.members.size > 2
            @index = 2
          end
        elsif @index == 2
          if $game_party.members.size > 3
            @index = 3
          end
        elsif @index == 3
          if $game_party.members.size >= 4
            @index = 0
          end
        end
      elsif Input.repeat?(Input::LEFT)
        if @index == 0
          if $game_party.members.size >= 4
            @index = 3
          end
        elsif @index == 1
          @index = 0
        elsif @index == 2
          @index = 1
        elsif @index == 3
          @index = 2
        end
      end
      if @index != last_index
        Sound.play_cursor
      end
    end
    update_cursor
    call_update_help
  end # update
end # Window_MenuEvoStatus

#===============================================================================​​
# * Window_MenuInfo class, this window draws Playtime, Steps etc.
#===============================================================================​​
class Window_MenuInfo < Window_Base
  #==========================================================================​​===
  # * Include the Menu module and setup window size
  #==========================================================================​​===
  include CngEvo::Menu
  def initialize
    super((Graphics.width - 260), 0, 260, 128)
    refresh
  end # initialize
  #==========================================================================​​===
  # * Draw Window contents
  #==========================================================================​​===
  def refresh
    self.contents.clear
    draw_icon(INFO_ICONS[1], 0, 24) # Steps
    draw_icon(INFO_ICONS[2], 0, 48) # Map Name
    draw_icon(INFO_ICONS[3], 0, 72) # Area
    draw_time
    self.contents.draw_text(0, 24, width - 32, WLH, $game_party.steps, 2)
    @map_name = load_data("Data/MapInfos.rvdata")[$game_map.map_id].name
    self.contents.draw_text(0, 48, width - 32, WLH, @map_name, 2)
    self.contents.draw_text(0, 72, width - 32, WLH, $game_party.gold, 2)
  end # refresh
  #==========================================================================​​===
  # * Check if Playtime is different from last check
  #==========================================================================​​===
  def update
    if @text != (Graphics.frame_count / Graphics.frame_rate)
      draw_time
    end
    super
  end # update
  #==========================================================================​​===
  # * Draw playtime info
  #==========================================================================​​===
  def draw_time
    self.contents.clear_rect(Rect.new(0, 0, (260 - 32), 24))
    draw_icon(INFO_ICONS[0], 0, 0) # Playtime
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    @hour = @total_sec / 60 / 60
    @min = @total_sec / 60 % 60
    @sec = @total_sec % 60
    @text = sprintf("%02d:%02d:%02d", @hour, @min, @sec)
    self.contents.draw_text(0, 0, width - 32, WLH, @text, 2)
  end # draw_time
end # Window_MenuInfo

#===============================================================================​​
# * Window_Base Edits to allow for face opacity changing
#===============================================================================​​
class Window_Base < Window
  #==========================================================================​​===
  # * Draw the character's face graphic
  #==========================================================================​​===
  def draw_evoface(face_name, face_index, x, y, size = 96)
    opacity = 100
    bitmap = Cache.face(face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * 96 + (96 - size) / 2
    rect.y = face_index / 4 * 96 + (96 - size) / 2
    rect.width = size
    rect.height = size
    self.contents.blt(x, y, bitmap, rect, opacity)
    bitmap.dispose
  end # draw_evoface
  #==========================================================================​​===
  # * Call the draw_evoface method with the relevant arguments
  #==========================================================================​​===
  def draw_actor_evoface(actor, x, y, size = 96)
    draw_evoface(actor.face_name, actor.face_index, x, y, size)
  end # draw_actor_evoface
end # Window_Base

#===============================================================================​​
# * Scene_File edit for returning to the right menu option
#===============================================================================​​
class Scene_File < Scene_Base
  #==========================================================================​​===
  # * Return to the previous scene
  #==========================================================================​​===
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(5)
    end
  end # return_scene
end # Scene_File

#===============================================================================​​
# * Window_Command clone to support icon drawing and scrolling with commands
#===============================================================================​​
class Window_IconCommand < Window_Selectable
  #==========================================================================​​===
  # * Include the menu module, and initialize the window
  #==========================================================================​​===
  include CngEvo::Menu
  attr_reader   :commands                 # command
  def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
    if row_max == 0
      row_max = (commands.size + column_max - 1) / column_max
    end
    super(0, 0, width, row_max * WLH + 32, spacing)
    @commands = commands
    @item_max = commands.size
    @column_max = column_max
    refresh
    self.index = 0
  end # initialize
  #==========================================================================​​===
  # * Draw window options
  #==========================================================================​​===
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end # refresh
  #==========================================================================​​===
  # * Draw the text, and icon.
  #==========================================================================​​===
  def draw_item(index)
    icon = ICONS[index]
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = true ? 255 : 128
    self.contents.draw_text(rect.x + 24, rect.y, rect.width, rect.height, @commands[index])
    draw_icon(icon, rect.x - 2, rect.y)
  end # draw_item
end # Window_IconCommand

W skrypcie na rozdawanie punktów znajdź linijkę:
class Scene_Menu < Scene_Base
i usuń wszystko poniżej, łącznie z nią.

Pamiętaj jeszcze, że skrypt na rozdawanie punktów musi być nad skryptem na menu.

[Obrazek: aye_furniture_pres.png]
08-12-13 21:54
Znajdź wszystkie posty użytkownika
"Pomógł" przyznał(a):
Wątek zamknięty 


Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości

Kontakt | Ultima Forum | Wróć do góry | Wróć do forów | Wersja bez grafiki | RSS
Powered By MyBB. © 2013 MyBB Group. All Rights Reserved.
Skórka by Ayene.