• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

PokeMenu Update!

Blizzy

me = Scripter.new("Noob")
492
Posts
19
Years
  • ok, here's a update for people who are using my menu!
    instead of switches, it now uses a global variable
    (a variable which can be acces everywhere)
    it saves 3 switches, what a relief :P

    ok, now for the script, just overwrite it with scene menu:
    Code:
    #=================================
    #  Scene_Menu
    #------------------------------------------------------------------
    #=================================
    class Scene_Menu
    #-----------------------------------------------------------------
    #menu_index 
    #-----------------------------------------------------------------
    def initialize(menu_index = 0)
     @menu_index = menu_index
    end
    
    #--------------------------------------------------------------------------
    def main
     s1 = "Bag"
     s2 = " "
     s3 = "Save"
     s4 = "Options"
     s5 = "Exit"
     s6 = "Pokemon"
     s7 = "Pokedex"
     commands = [s1,s2,s3,s4,s5]
     y = 100
     if $menu == 1
     commands = [s1,s2,s3,s4,s5]
     y = 100
     end
     if $menu == 2
       commands = [s6, s1, s2, s3, s4, s5]
       y = 80
     end
     if $menu == 3
      commands = [s7, s6,s1, s2, s3, s4, s5]
      y = 60
    end
     if $game_system.save_disabled
       commands.delete!("Save")
     end
    
     @commands = Window_Command.new(160, commands)
     @commands.index = @menu_index
     @commands.x = 560 - @commands.width / 2
     @commands.y = y
     if $game_party.actors.size == 0
       @command_window.disable_item(0)
       @command_window.disable_item(1)
       @command_window.disable_item(2)
       @command_window.disable_item(3)
     end
     @spriteset = Spriteset_Map.new
     @heroname = Window_Heroname.new
     @playtime_window = Window_PlayTime.new
     @playtime_window.x = 0
     @playtime_window.y = 0
     
     Graphics.transition
     loop do
       Graphics.update
       Input.update
       update
       if $scene != self
         break
       end
     end 
     Graphics.freeze
     @heroname.dispose
     @commands.dispose
     @playtime_window.dispose
     @spriteset.dispose
    end
    
    #--------------------------------------------------------------------------
    def update
     @heroname.update
     @commands.update
     @playtime_window.update
     @spriteset.update
     if @commands.active
       update_command
       return
     end
    end
    #--------------------------------------------------------------------------
    def update_command
       if Input.trigger?(Input::B)
         $game_system.se_play($data_system.cancel_se)
         $scene = Scene_Map.new
         return
       end
       if Input.trigger?(Input::C)
        if $game_party.actors.size == 0 and @commands.index < 4
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        case @commands.commands[@commands.index]
        when "Bag"
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Item.new
        when " "
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Map.new
        when "Save"
          if $game_system.save_disabled
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Save.new
        when "Options"
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Map.new
        when  "Exit"
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Map.new            
        when "Pokemon"
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Map.new
        when  "Pokedex"
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Map.new
        end # of case
      end # of conditional
    end # of method
    #--------------------------------------------------------------------------
    end # of Scene_Menu class definition
    
    class Window_Heroname < Window_Base
    
    
    def initialize
      super(0, 0, 640,480)
      self.opacity = 0
      self.back_opacity = 0
      self.contents = Bitmap.new(width-32, height-32)
      self.contents.font.name = "Comic Sans MS"  
      self.contents.font.size = 28
      self.contents.font.color = text_color(8)
      refresh
    end
    
    def refresh
     for i in 0...$game_party.actors.size
       actor = $game_party.actors[i]
       x = i * 200 + 484
       if $menu == 1
         y = 132
       end
       if $menu == 2
         y = 144
       end
       if $menu == 3
         y = 156
       end
       self.contents.draw_text(x, y, 200, 32, actor.name)
     end # of for loop
    end # of method
    
    end # of class

    Window_Command
    Code:
    #==============================================================================
    # ■ Window_Command
    #------------------------------------------------------------------------------
    #  一般的なコマンド選択を行うウィンドウです。
    #==============================================================================
    
    class Window_Command < Window_Selectable
      attr_reader  :commands
      #--------------------------------------------------------------------------
      # ● def initialize
      #--------------------------------------------------------------------------
      def initialize(width, commands)
        # コマンドの個数からウィンドウの高さを算出
        super(0, 0, width, commands.size * 32 + 32)
        @item_max = commands.size
        @commands = commands
        self.contents = Bitmap.new(width - 32, @item_max * 32)
        self.contents.font.name = $fontface
        self.contents.font.size = $fontsize
        refresh
        self.index = 0
      end
      #--------------------------------------------------------------------------
      # ● refresh
      #--------------------------------------------------------------------------
      def refresh
        self.contents.clear
        for i in 0...@item_max
          draw_item(i, normal_color)
        end
      end
      #--------------------------------------------------------------------------
      # ● draw item
      #--------------------------------------------------------------------------
      def draw_item(index, color)
        self.contents.font.color = color
        rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
        self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
        self.contents.draw_text(rect, @commands[index])
      end
      #--------------------------------------------------------------------------
      # ● index
      #--------------------------------------------------------------------------
      def disable_item(index)
        draw_item(index, disabled_color)
      end
    end
    the global variables are:
    $menu = 1 (small)
    $menu = 2 (medium)
    $menu = 3 (full menu)
    (instead of $game_switches[1 or 2 or 3] = true)
    enjoy...! :P ;)

    comments & questions are welcome
    you can also pm me or add me to msn if you have any questions. ;)

    I want to know who is using my menu...
    everybody who is using it, please pm me.
    so i could make a list with the names.
    (i know it from the folowing people: rm2k3kid, esai, peekimon)
     
    Last edited:

    funnybunny

    Advanced RM2k(3) Coder
    178
    Posts
    19
    Years
  • Isn't this supose to be in the totorial subforum?

    Anyway, cool. To bad I am not using RMXP :P. Else I would be using you menu.
     

    Blizzy

    me = Scripter.new("Noob")
    492
    Posts
    19
    Years
  • funnybunny said:
    Isn't this supose to be in the totorial subforum?

    Anyway, cool. To bad I am not using RMXP :P. Else I would be using you menu.
    ummm, no...
    this isn't a toturial, but a script :\
    anyway, thanks for the comments
     

    Esai

    &#9829;&#9829;&#9829; With Bubbleicious &#9829;&#9
    1,434
    Posts
    19
    Years
  • Yes, But it doesnt waste the switches, which are used alot in Pokemon Games, oh and to change the global variable use this:

    new event
    Call Script:
    $menu = 1, 2 or 3

    thats it ;)
     

    Blizzy

    me = Scripter.new("Noob")
    492
    Posts
    19
    Years
  • esai is correct.

    i choiced for a global variable, so you change it in any script! ;)
    (you could try, if you don't believe it)

    and, I want to know who is using my menu...
    everybody who is using it, plz pm me.
    so i could make a list to remember it
    i'll put this in the first post too
     
    Last edited:

    Esai

    &#9829;&#9829;&#9829; With Bubbleicious &#9829;&#9
    1,434
    Posts
    19
    Years
  • Well, Whats the code on line 154 of Scene_Menu?
     

    rm2kdude

    Advanced Pixel-Artist
    358
    Posts
    19
    Years
    • Age 34
    • usa
    • Seen Oct 30, 2022
    I have no I dea I somehow cannot reach it its like its not big enough to fit on my screen.
     

    Blizzy

    me = Scripter.new("Noob")
    492
    Posts
    19
    Years
  • rm2kdude said:
    I have no I dea I somehow cannot reach it its like its not big enough to fit on my screen.
    you can download a patch at www.dubealex.com for the resolution
    "rmxp enhanched"

    and for that error,
    overwrite the following with Window_Command
    Code:
    #==============================================================================
    # ■ Window_Command
    #------------------------------------------------------------------------------
    #  一般的なコマンド選択を行うウィンドウです。
    #==============================================================================
    
    class Window_Command < Window_Selectable
      attr_reader  :commands
      #--------------------------------------------------------------------------
      # ● def initialize
      #--------------------------------------------------------------------------
      def initialize(width, commands)
        # コマンドの個数からウィンドウの高さを算出
        super(0, 0, width, commands.size * 32 + 32)
        @item_max = commands.size
        @commands = commands
        self.contents = Bitmap.new(width - 32, @item_max * 32)
        self.contents.font.name = $fontface
        self.contents.font.size = $fontsize
        refresh
        self.index = 0
      end
      #--------------------------------------------------------------------------
      # ● refresh
      #--------------------------------------------------------------------------
      def refresh
        self.contents.clear
        for i in 0...@item_max
          draw_item(i, normal_color)
        end
      end
      #--------------------------------------------------------------------------
      # ● draw item
      #--------------------------------------------------------------------------
      def draw_item(index, color)
        self.contents.font.color = color
        rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
        self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
        self.contents.draw_text(rect, @commands[index])
      end
      #--------------------------------------------------------------------------
      # ● index
      #--------------------------------------------------------------------------
      def disable_item(index)
        draw_item(index, disabled_color)
      end
    end
     

    rm2kdude

    Advanced Pixel-Artist
    358
    Posts
    19
    Years
    • Age 34
    • usa
    • Seen Oct 30, 2022
    awesome I got it now can't wait for the menu to be finished.
     
    Last edited:
    401
    Posts
    19
    Years
    • Age 29
    • Seen Dec 4, 2016
    help, still when i right over window_command i still get that error that rm2kdude gets
     

    Blizzy

    me = Scripter.new("Noob")
    492
    Posts
    19
    Years
  • agentalexandre12 said:
    help, still when i right over window_command i still get that error that rm2kdude gets
    this is line 154:
    self.contents.draw_text(x, y, 200, 32, actor.name)
    i don't have any idea what's the prob with this.
    it does work okay for me
     
    401
    Posts
    19
    Years
    • Age 29
    • Seen Dec 4, 2016
    i finally got it to work: i just deleted that line of code and it works fine
    but i do have a nother problem no matter which menu i choose i still get Bag,Save,Options and Exit
     

    Blizzy

    me = Scripter.new("Noob")
    492
    Posts
    19
    Years
  • agentalexandre12 said:
    i finally got it to work: i just deleted that line of code and it works fine
    but i do have a nother problem no matter which menu i choose i still get Bag,Save,Options and Exit
    shouldn't have removed that line :\
    the problem is, you haven't set the type!
    in scene_title, add above $scene = Scene_Map.new:
    $menu = 1
    around line 160
    it will work!
     

    Ravecat

    I'm Right.
    1,238
    Posts
    18
    Years
  • ADd me to the list, this menu is great... But are you going to make the Options and Save (Pokemon Saving Style) ect, Or do we have to do that? Oh, and the Trainer Card...? Thanks anyway
     

    Blizzy

    me = Scripter.new("Noob")
    492
    Posts
    19
    Years
  • Emerald Ex said:
    ADd me to the list, this menu is great... But are you going to make the Options and Save (Pokemon Saving Style) ect, Or do we have to do that? Oh, and the Trainer Card...? Thanks anyway
    that's all up to you guys
    well, you can't use my options now, because my resolution is different,
    but apart from that i wouldn't give them out
     
    Back
    Top