Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Help with my Menu

Hello, I need some help.

I was wondering if somebody could make it so that when I click [End Game] on the menu, the [End Game] Box pops up on top of the shown menu, not in its own space (Where u get the box in the center and black around it, i dont want that. I want where u see the normal menu in the background).

Code:
#Party option by: Yargovish (Found at phylomortis.com)
# http://www.phylomortis.com/resource/script/scr018.html
#Other modifications by: Lord_Yousef

class Scene_Menu
# --------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
    @changer = 0
    @where = 0
    @checker = 0
  end
# --------------------------------
  def main
    @spriteset = Spriteset_Map.new
    s1 = "Inventory"
    s2 = "Techniques"
    s3 = "Equipment"
    s4 = "Information"
    s5 = "Save"
    s6 = "Quit"
    s7 = "Party"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    @command_window.x = 480
    @command_window.y = 0
    @command_window.back_opacity = 160
    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
    if $game_system.save_disabled
      @command_window.disable_item(4)
    end
    if $game_party.actors.size == 1
      @command_window.disable_item(6)
    end
    @info_window = Window_Information.new
    @info_window.x = 480
    @info_window.y = 368
    @info_window.back_opacity = 160
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 0
    @status_window.back_opacity = 160
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @command_window.dispose
    @info_window.dispose
    @status_window.dispose
  end
# --------------------------------
  def update
    @spriteset.update
    @command_window.update
    @info_window.update
    @status_window.update
    if @command_window.active
      update_command
      return
    end
    if @status_window.active
      update_status
      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 @command_window.index < 4
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.actors.size == 1 and @command_window.index ==6
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Item.new
      when 1
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4
        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 5
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_End.new
      when 6
        $game_system.se_play($data_system.decision_se)
        @checker = 0
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      end
      return
    end
  end
# --------------------------------
  def update_status
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 1
        if $game_party.actors[@status_window.index].restriction >= 2
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Skill.new(@status_window.index)
      when 2
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Equip.new(@status_window.index)
      when 3
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Status.new(@status_window.index)
      when 6
        $game_system.se_play($data_system.decision_se)
        if @checker == 0
          @changer = $game_party.actors[@status_window.index]
          @where = @status_window.index
          @checker = 1
        else
          $game_party.actors[@where] = $game_party.actors[@status_window.index]
          $game_party.actors[@status_window.index] = @changer
          @checker = 0
          @status_window.refresh
        end
      end
      return
    end
  end
end

If somebody could please modify it so it does that it would be great. Thanks in advanced.
 
You probably would want to include the entire script, as when I edit, I like to look at these scripts, but whatever. I tried, and if it doesn't work, post your Window_Information, and maybe it will work with a tad of further editing. But this is what I got: I tried to mimic the style of the menu:
Code:
#Party option by: Yargovish (Found at phylomortis.com)
# http://www.phylomortis.com/resource/script/scr018.html
#Other modifications by: Lord_Yousef

class Scene_Menu
# --------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
    @changer = 0
    @where = 0
    @checker = 0
  end
# --------------------------------
  def main
    @spriteset = Spriteset_Map.new
    s1 = "Inventory"
    s2 = "Techniques"
    s3 = "Equipment"
    s4 = "Information"
    s5 = "Save"
    s6 = "Quit"
    s7 = "Party"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    @command_window.x = 480
    @command_window.y = 0
    @command_window.back_opacity = 160
    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
    if $game_system.save_disabled
      @command_window.disable_item(4)
    end
    if $game_party.actors.size == 1
      @command_window.disable_item(6)
    end
    @info_window = Window_PlayTime.new
    @info_window.x = 480
    @info_window.y = 368
    @info_window.back_opacity = 160
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 0
    @status_window.back_opacity = 160
    #----------------------------------------------------------------
    # Edit
    e1 = "To Title"
    e2 = "Shut Down"
    @confirm_window = Window_Command.new(160, [e1, e2])
    @confirm_window.x = 640 - 160
    @confirm_window.y = 256
    @confirm_window.active
    @confirm_window.visible = false
    @confirm_window.back_opacity = 160
    # End Edit
    #---------------------------------------------------------
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @command_window.dispose
    @info_window.dispose
    @status_window.dispose
    @confirm_window.dispose
  end
# --------------------------------
  def update
    @spriteset.update
    @command_window.update
    @info_window.update
    @status_window.update
    @confirm_window.update
    if @command_window.active
      update_command
      return
    end
    if @status_window.active
      update_status
      return
    end
    if @confirm_window.active
      update_confirm
      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 @command_window.index < 4
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.actors.size == 1 and @command_window.index ==6
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Item.new
      when 1
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4
        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 5
        $game_system.se_play($data_system.decision_se)
        #---------------------------------------------------------
        # Edit
        @command_window.active = false
        @confirm_window.active = true
        @confirm_window.visible = true
        @confirm_window.index = 0
        # To remove edit: uncomment this line:
        # $scene = Scene_End.new
        # And remove all other lines
        # End Edit
        #---------------------------------------------------------
      when 6
        $game_system.se_play($data_system.decision_se)
        @checker = 0
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      end
      return
    end
  end
# --------------------------------
  def update_status
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 1
        if $game_party.actors[@status_window.index].restriction >= 2
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Skill.new(@status_window.index)
      when 2
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Equip.new(@status_window.index)
      when 3
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Status.new(@status_window.index)
      when 6
        $game_system.se_play($data_system.decision_se)
        if @checker == 0
          @changer = $game_party.actors[@status_window.index]
          @where = @status_window.index
          @checker = 1
        else
          $game_party.actors[@where] = $game_party.actors[@status_window.index]
          $game_party.actors[@status_window.index] = @changer
          @checker = 0
          @status_window.refresh
        end
      end
      return
    end
  end
# --------------------------------
# Edit
  def update_confirm
    if Input.trigger?(Input::C)
      case @confirm_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        # Fade out BGM, BGS, and ME
        Audio.bgm_fade(800)
        Audio.bgs_fade(800)
        Audio.me_fade(800)
        # Switch to title screen
        $scene = Scene_Title.new
      when 1
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Fade out BGM, BGS, and ME
        Audio.bgm_fade(800)
        Audio.bgs_fade(800)
        Audio.me_fade(800)
        # Shutdown
        $scene = nil
      end
    end
    if Input.trigger?(Input::B)
      @confirm_window.active = false
      @command_window.active = true
      @confirm_window.visible = false
      @confirm_window.index = -1
      @command_window.active = true
      return
    end
  end
  # End Edit
  #-----------------------------------
end

Replace Scene_Menu with that :D

Also, I took out the "Cancel" option, and replaced it with just pressing ESC/X, as the next option made it cover your other window. :P
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top