Skrypt zmniejszenia menu
Aktualny czas: 17-02-20, 02:16 Witaj! Przejdź do zakładki Logowanie lub Rejestracja


Odpowiedz 
[VX] Skrypt zmniejszenia menu
ADI Offline
*


Liczba postów: 274
Dołączył: 09-12-13

Pomógł: 12



Post: #11
RE: Skrypt zmniejszenia menu

Mój działa poprawnie :D

Po prostu nie wykasowałeś odnośników a pozamieniałeś kolejność (a raczej zamieniłeś nazwę XD)

#==============================================================================
#  Compact Custom Menu System
#         RMVX Version
#            v1.0
#         by  Rubymatt
#############################
##  Mały Edit by ADI   :D
#==============================================================================
#==============================================================================
#
#
# ** NEW Window_Gold
#==============================================================================
#
#
class Window_Gold < Window_Base
  def initialize(x, y)
    super(x, y, 160, WLH + 32)
    refresh
  end
  def refresh
    self.contents.clear
    draw_currency_value($game_party.gold, 4, 0, 120)
  end
end

#==============================================================================
# ** NEW Window_MenuStatus
#==============================================================================

class Window_NewMenuStatus < Window_Selectable
  def initialize(x, y)
    super(0, 0, 64, $game_party.members.size * 36 + 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      x = 66
      y = actor.index * 36
      draw_actor_graphic(actor, x - 51, y + 32)
    end
  end
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(-2, @index * 36 - 2, 36, 36)
    end
  end
end

#==============================================================================
# ** NEW Scene_Menu
#==============================================================================

class Scene_Menu < Scene_Base
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(160, 225)
    @status_window = Window_NewMenuStatus.new(150, 50)
    @status_window.x = 320
    if $game_party.members.size == 4
      @status_window.y = 87
    elsif $game_party.members.size == 3
      @status_window.y = 97
    elsif $game_party.members.size == 2
      @status_window.y = 107
    elsif $game_party.members.size == 1
      @status_window.y = 120
    else
      @status_window.y = 72
    end
  end
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  def update
    super
    update_menu_background
    @command_window.update
    @gold_window.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
    @command_window.x = 160
    @command_window.y = 72
    @command_window.height = 155
    @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
  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
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # End Game
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = 0
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  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  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end
A tutaj jeszcze screen jak to wygląda obecnie:
Spoiler: (Otwórz)
Ogarnij, porównaj do swojego kodu.
Może dasz radę obczaić co i jak działa :D
Ja się tak właśnie uczę...

Admini mnie obserwują XD

[Obrazek: rm1ftf.png]
(Ten post był ostatnio modyfikowany: 07-05-15 18:26 przez ADI.)
07-05-15 17:44
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
"Pomógł" przyznał(a): krakoman
Odpowiedz 


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.