Menu Problem :/

DerKIAS

Demon Lord
Veteran
Joined
Sep 19, 2016
Messages
57
Reaction score
40
First Language
German
Primarily Uses
RMVXA
Hey there! Im new to this Forum and I could use some help from you guys :)

Im using this Menu Script:

Code:
#==============================================================================
#   ▼  Tales of Vesperia CMS
#   -- Autor: eugene222
#   -- Version: 1.11
#   -- Date Last Updated:   29.09.2013
#   -- Date Created:        27.09.2013
#   -- Credits: eugene222, Valentine if you use his "status_bg.png"
#   
#   -- Note: Do not use the Icons included in the Demo, make your owns
#            I don't know who made these, so I cant give Credit. If somebody
#            know, please PM me.
#
#            I don't know who made the Background Picture. I have it from this
#            site: http://hdnaturepictures.com/anime-nature-wild-jungle.html
#
#   -- Thanks to: Reedo, who helped me with fixing some bug
#
#==============================================================================
#   ▼ Changelog
#==============================================================================
#  Versipm 1.11 : Added the Option to de/activate Custom_Commands per Script-Call
#  Version 1.1  : Fixed some bugs, and added the Option to use Custom Faces
#  Version 1.0a : Fixed a Bug when you Close the Window with no Layout Graphic
#  Version 1.0  : Created the Script
#==============================================================================
#   ▼ Instructions
#==============================================================================
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# You need the following files in Graphics/Menu:
#
#  Icons:
#   item.png, skill.png equip.png, status.png formation.png, save.png, game_end.png
#   custom1-3.png if you use custom scenes and none.png
#
#  Background:
#   menu_bg.jpg, menu.layout.png, status.png
#
#  See in the Demo how big the Pictures have to be.
#
#
#  Use the Config-Section below to Config the Mini-Icons and the Commands.
#
#  Only edit the the first three elements( enabled?, Name, Helptext)
#
#  For CustomCommands look below.
#
#==============================================================================
module Eugene222
  module MConfig
    #---------------------------------------------------------------------------
    #   *CONFIG START*
    #
    #
    #   *Configure Icon Index*
    #---------------------------------------------------------------------------
    
    LocationIcon =  231
    GoldIcon =      361
    StepIcon =      467
    BattleIcon =    131
    TimeIcon =      280
    
    #---------------------------------------------------------------------------
    #  *Do you want to use Custom Facesets?*
    #
    #   Set to true if yes and to false if not
    #   The Custom Faceset should be 100x188
    #   
    #   The Facegraphic should be in the folder /Menu
    #   The name should be: Actorname_face.png
    #   eg.: "Eric_face.png" if the actors name is "Eric"
    #---------------------------------------------------------------------------
    
    CustomFace = false
    
    #---------------------------------------------------------------------------
    #   *Default Menu Commands*
    #---------------------------------------------------------------------------
    DC = { # Don't touch this line!
    #---------------------------------------------------------------------------
    # Key         enabled?,  Name,         Helptext   
    #---------------------------------------------------------------------------
    
    :item       => [ true, "Item",     "Choose items",         
                     :command_item],
    
    :skill      => [ true, "Skill",     "Choose skills",         
                     :command_personal],
    
    :equip      => [ true, "Equipment",   "Change equipment",
                     :command_personal],
    
    :status     => [ true, "Status",    "View your status",   
                     :command_personal],
    
    :formation  => [ true, "Formation",   "Change formation",
                     :command_formation],   
                    
    #---------------------------------------------------------------------------
    #   *Custom Menu Commands*
    # Key         enabled?,  Name, Helptext, :Symbol, Scene_Name 
    #
    #
    # The Menu can handle 3 Custom Scenes. You have to set the Classname of
    # the Custom Scene after the Symbol. All custom Scenes have to be on top
    # of this Script.
    #
    # If you want to change if the Command should be shown ingame you need to make
    # a Scriptcall: custom_command_access(key, enabled?)
    #
    # e.g. you want to disable Custom Command 1:
    #
    # custom_command_access(:custom1, false)
    #
    # e.g. you want to enable Custom Command 2:
    #
    # custom_command_access(:custom2, true)
    #
    # But they have to be set to "true" below if you want to use them generally.
    # If you set below to false, the scriptcall wont change anything.
    #
    # Example:
    # :custom1   => [ true,  "Example", "Exampletext",   
    #                :custom_command, Scene_Example],
    #
    #---------------------------------------------------------------------------
    
    :custom1   => [ false,  "Bestiary",  "Exampletext",
                    :custom_command, ],
  
    :custom2   => [ false,  "Aufgaben", "",   
                    :custom_command, ],
                    
    :custom3   => [ false,  "", "",   
                   :custom_command, ],
    
    #---------------------------------------------------------------------------
    #   *Save And Game_END Commands* 
    #---------------------------------------------------------------------------
    :save       => [ true,   "Speichern",  "Save your progress",         
                     :command_save],     
    :game_end   => [ true,  "Ende",        "End the game",           
                     :command_game_end],       
    #---------------------------------------------------------------------------
    } # Don't touch this line!
    #
    #
    #   *Config* END
    #---------------------------------------------------------------------------
  end
end

#==============================================================================
# ** new Window_Menu
# methods: initialize, set_text, create_bg, draw_location, refresh, dispose,
#          dispose_icons, dispose_bg, dispose_bg1
#==============================================================================
class Window_Menu < Window_Help
  #-----------------------------------------------------------------------------
  include Eugene222::MConfig
  #-----------------------------------------------------------------------------
  # * initialize
  #-----------------------------------------------------------------------------
  def initialize(*args)
    super(*args)
    create_bg
  end
  #-----------------------------------------------------------------------------
  # * set_text
  #-----------------------------------------------------------------------------
  def set_text(line1, line2)
    unless line1 == @line1
      @line1 = line1
      @line2 = line2
      refresh
    end
  end
  #-----------------------------------------------------------------------------
  # * create_bg
  #-----------------------------------------------------------------------------
  def create_bg
    @bg = Sprite.new
    @bg.bitmap = Cache.menu("") rescue nil
    @bg.zoom_x = zoom_x(@bg.width)
    @bg.zoom_y = zoom_y(@bg.height)
    @bg1 = Sprite.new
    @bg1.bitmap = Cache.menu("menu_layout") rescue nil
  end
  def zoom_x(width)
    Graphics.width.to_f / width
  end
  def zoom_y(height)
    Graphics.height.to_f / height
  end
  #-----------------------------------------------------------------------------
  # * draw_location
  #-----------------------------------------------------------------------------
  def draw_location
    rect = Rect.new(contents.width/2,0, contents.width/2 - 26,line_height)
    contents.font.color = hp_gauge_color1
    draw_text(rect,$game_map.display_name,2)
    draw_icon(LocationIcon, contents_width - 25, 0) unless $game_map.display_name == ""
  end 
  #-----------------------------------------------------------------------------
  # * refresh
  #-----------------------------------------------------------------------------
  def refresh
    contents.clear
    contents.font.bold = true
    contents.font.color = system_color
    rect = Rect.new(0,0,contents.width/2, line_height)
    draw_text(rect,@line1)
    draw_location
    reset_font_settings
    rect = Rect.new(0,line_height, contents.width, line_height)
    draw_text(rect,@line2)
  end
  #-----------------------------------------------------------------------------
  # * dispose
  #-----------------------------------------------------------------------------
  def dispose
    super
    dispose_bg
    dispose_bg1
    dispose_icons
  end
  #-----------------------------------------------------------------------------
  # * dispose_icons
  #-----------------------------------------------------------------------------
  def dispose_icons
    return unless @icon
    @icon.dispose
  end
  #-----------------------------------------------------------------------------
  # * dispose_bg
  #-----------------------------------------------------------------------------
  def dispose_bg
    return unless @bg
    @bg.bitmap.dispose if @bg.bitmap
    @bg.dispose
  end
  #-----------------------------------------------------------------------------
  # * dispose_bg1
  #-----------------------------------------------------------------------------
  def dispose_bg1
    return unless @bg1
    @bg1.bitmap.dispose if @bg1.bitmap
    @bg1.dispose
  end
  #-----------------------------------------------------------------------------
end
#==============================================================================
# ** Window_MenuCommand
# new methods: init_commands, text
#==============================================================================
class Window_MenuCommand < Window_Command
  #-----------------------------------------------------------------------------
  include Eugene222::MConfig
  #-----------------------------------------------------------------------------
  # * initialize
  #-----------------------------------------------------------------------------
  def initialize(x,y)
    init_commands
    super(x,y)
    self.width = 24 + item_max * (48+spacing)
    self.height = 72
    self.opacity = 0
    select_last
    update
    
  end
  #-----------------------------------------------------------------------------
  # * Settings
  #-----------------------------------------------------------------------------
  def contents_width;(item_width + spacing) * item_max - spacing; end;
  def contents_height; 0; end;   
  def item_height; 48; end;
  def col_max; item_max;; end;
  def spacing; 4; end;
  #-----------------------------------------------------------------------------
  # * make_command_list
  #-----------------------------------------------------------------------------
  def make_command_list
    DC.each do |k, v|
      case k
       when :save
        add_command(v[1], k, true,v[4]) if save_enabled
       when :formation
        add_command(v[1], k, true, v[4]) if formation_enabled
       else
        add_command(v[1], k, true,v[4]) if check_active(k)
       end
    end
  end
  def check_active(key)
    c_cmd = $game_system.custom_command[key]
    enabled = key.to_s.include?("custom") ? c_cmd : true
    DC[key][0] && enabled ? true : false
  end
  #-----------------------------------------------------------------------------
  # * init_commands
  #-----------------------------------------------------------------------------
  def init_commands
    @commands = []
    DC.each do |k,v|
      case k
       when :save
        @commands << k if save_enabled
       when :formation
        @commands << k if formation_enabled
       else
        @commands << k if check_active(k)
       end     
    end
  end
  #-----------------------------------------------------------------------------
  # * draw_all_items
  #-----------------------------------------------------------------------------
  def draw_all_items
    @sprite_items = []
     @commands.each_with_index do |command,index|
      icon = Cache.menu(command.to_s) rescue Cache.menu("none")
      sprite = Sprite.new
      sprite.bitmap = icon
      sprite.x = index * (48 + spacing) + self.x + 12
      sprite.y = self.y + 12
      sprite.z = self.z + 1
      sprite.opacity = 155
      @sprite_items << sprite
    end
  end
  #-----------------------------------------------------------------------------
  # * item_rect
  #-----------------------------------------------------------------------------
  def item_rect(index)
    rect = super
    rect.x = index * (48 + spacing)
    rect.y = 0
    rect.width = 48
    rect.height = 48
    rect
  end
  #-----------------------------------------------------------------------------
  # * update
  #-----------------------------------------------------------------------------
  def update
    super
    unless @index == @s_index
      @s_index == @index
      @sprite_items.each {|sprite| sprite.opacity = 155}
      @sprite_items[@index].opacity = 255
    end
  end
  #-----------------------------------------------------------------------------
  # * update_help
  #-----------------------------------------------------------------------------
  def update_help; @help_window.set_text(command_name(index),text(index)) end;
  #-----------------------------------------------------------------------------
  # * text
  #----------------------------------------------------------------------------- 
  def text(index); DC[@list[index][:symbol]][2] end;
  #-----------------------------------------------------------------------------
  # * dispose
  #----------------------------------------------------------------------------- 
  def dispose
    super
    return unless @sprite_items
    @sprite_items.each {|sprite| sprite.bitmap.dispose; sprite.dispose}
    @sprite_items = nil
  end
  #-----------------------------------------------------------------------------
end
#==============================================================================
# ** new Window_NewMenuStatus
# methods: initialize, [...], top_col=, calc_new_x ensure_cursor_visible,
#          item_rect, draw_item, draw_actor_simple_status, draw_actor_level,
#          draw_actor_exp, draw_layout, dispose
#==============================================================================
class Window_NewMenuStatus < Window_MenuStatus
  include Eugene222::MConfig
  #-----------------------------------------------------------------------------
  attr_reader   :pending_index
  #-----------------------------------------------------------------------------
  # * initialize
  #-----------------------------------------------------------------------------
  def initialize(x, y)
    @layout = []
    @face = []
    super(x, y)
    self.opacity = 0
    self.ox = 0
    @pending_index = -1
  end
  #-----------------------------------------------------------------------------
  # * settings
  #-----------------------------------------------------------------------------
  def window_width; Graphics.width; end;
  def window_height; Graphics.height - 72*2.5; end;
  def contents_width; (item_width + spacing) * item_max - spacing; end;
  def contents_height; item_height; end; 
  def spacing; 24; end;
  def visible_line_number; 0; end;
  def item_height; height - standard_padding * 2; end;   
  def col_max; 4; end;
  def top_col; ox / (item_width + spacing); end;
  #-----------------------------------------------------------------------------
  # * top_col=
  #-----------------------------------------------------------------------------
  def top_col=(col)
    col = 0 if col < 0
    col = col_max - 1 if col > col_max - 1
    self.ox = (index / col_max).ceil * (item_width + spacing) * col_max
    calc_new_x
  end
  #-----------------------------------------------------------------------------
  # * calc_new_x
  #-----------------------------------------------------------------------------
  def calc_new_x
    return if self.ox == @temp_ox
    @temp_ox = self.ox
    @layout.each do |layout|
      layout.ox = self.ox
    end
    @face.each do |face|
      face.ox = self.ox
    end
  end
  #-----------------------------------------------------------------------------
  # * ensure_cursor_visible
  #-----------------------------------------------------------------------------
  def ensure_cursor_visible
    self.top_col = ((index + 1) / col_max).floor * col_max
  end
  #-----------------------------------------------------------------------------
  # * item_rect
  #-----------------------------------------------------------------------------
  def item_rect(index)
    rect = super
    rect.x = index * (item_width + spacing)
    rect.y = 0
    rect
  end
  #-----------------------------------------------------------------------------
  # * draw_item
  #-----------------------------------------------------------------------------
  def draw_item(index)
    draw_layout(index)
    actor = $game_party.members[index]
    enabled = $game_party.battle_members.include?(actor)
    rect = item_rect(index)
    draw_item_background(index)
    x = rect.x + (rect.width-96)/2
    y = rect.y - 4
    color = Color.new(0,0,0,140)
    color2 =Color.new(0,0,0,200)
    #Fill Rect behind Name
    contents.fill_rect(x-4, y + line_height / 3 + 4, 104, 22, color)
    #Make Border around Face
    contents.fill_rect(x-4, rect.y + line_height * 1 + 8, 104, 100, color2)
    contents.clear_rect(x-2, rect.y + line_height * 1 + 10, 100, 96)
    #Fill Rect behind the Gauges
    contents.fill_rect(x-4, y +line_height * 1.5 + 102, 104, 66, color)
    #Draw the things
     if Eugene222::MConfig::CustomFace
      draw_actor_custom_face(index, actor)
     else
      draw_actor_face(actor, x, rect.y + line_height * 1 + 10, enabled)
     end
    draw_actor_simple_status(actor, x , y)
  end
  #-----------------------------------------------------------------------------
  # * draw_actor_custom_face
  #-----------------------------------------------------------------------------
  def draw_actor_custom_face(index, actor)
    @face[index].dispose if @face[index]
    enabled = $game_party.battle_members.include?(actor)
    @face[index] = Sprite.new
    @face[index].bitmap = Cache.menu("#{actor.name}_face") rescue nil
    @face[index].x = index * (item_width + spacing) + 18
    @face[index].ox = self.ox
    @face[index].opacity = enabled ? 255 : translucent_alpha
    @face[index].y = self.y + 1 / col_max * item_height + 22
    @face[index].z = self.z - 1
    p("face")
  end
  #-----------------------------------------------------------------------------
  # * draw_layout
  #-----------------------------------------------------------------------------
  def draw_layout(index)
     @layout[index].dispose if @layout[index]
     @layout[index] = Sprite.new
     @layout[index].bitmap = Cache.menu("status_bg") rescue nil
     zoom = calc_width(@layout[index].width)
     @layout[index].ox = self.ox
     @layout[index].zoom_x = zoom
     @layout[index].x = index  * (item_width + spacing) + new_padding(zoom)
     @layout[index].y = self.y + 1 / col_max * item_height + 4
     @layout[index].z = self.z - 3
     p("layout")
  end
  #-----------------------------------------------------------------------------
  # * draw_actor_simple_status
  #-----------------------------------------------------------------------------
  def draw_actor_simple_status(actor, x, y)
    draw_actor_name(actor, x-2, y + line_height / 3 +4, 102)
    draw_actor_icons(actor, x, y + line_height* 1.5 + 104, 96)
    contents.font.size = 20
    draw_actor_hp(actor, x-2, y + line_height * 2.5 + 102, 100)
    draw_actor_mp(actor, x-2, y + line_height * 3.25 + 102, 100)
    draw_actor_exp(actor,x-2, y + line_height * 1.0 + 90, 100)
  end
  #-----------------------------------------------------------------------------
  # * new_padding
  #-----------------------------------------------------------------------------
  def new_padding(zoom)
    if zoom == 1
      return standard_padding/3
    else
      return standard_padding
    end
  end
  #-----------------------------------------------------------------------------
  # * draw_actor_level
  #-----------------------------------------------------------------------------
  def draw_actor_level(actor, x, y)
    change_color(system_color)
    draw_text(x, y, 24, line_height, Vocab::level_a)
    change_color(normal_color)
    draw_text(x + 24, y, 16, line_height, actor.level, 2)
  end
  #-----------------------------------------------------------------------------
  # * draw_current_and_max_values
  #-----------------------------------------------------------------------------
  def draw_current_and_max_values(x, y, width, current, max, color1, color2)
    change_color(color1)
    xr = x + width
    draw_text(xr - 84, y, 42, line_height, current, 2)
    change_color(color2)
    draw_text(xr - 46, y, 12, line_height, "/", 2)
    draw_text(xr - 42, y, 42, line_height, max, 2)
  end
  #-----------------------------------------------------------------------------
  # * calc_width
  #-----------------------------------------------------------------------------
  def calc_width(width)
    zoom = (item_width.to_f / width) < 1 ? 1 : (item_width.to_f / width)
    return zoom
  end
  #-----------------------------------------------------------------------------
  # * draw_actor_exp
  #-----------------------------------------------------------------------------
  def draw_actor_exp(actor, x, y, width = 124)
    exp_now = actor.exp-actor.current_level_exp
    exp_need  = actor.next_level_exp.to_f-actor.current_level_exp
    exp = (exp_now.to_f/100)/(exp_need.to_f/100)
    unless actor.max_level? 
      exp_rate = exp
      exp_text = "#{(exp*100).to_i}%"
    else
      exp_rate = 1
      exp_text = "MAX"
    end
    draw_gauge(x, y, width, exp_rate, tp_gauge_color1, tp_gauge_color2)
    draw_actor_level(actor, x, y)
    draw_text(x + width - 42, y, 42, line_height, exp_text , 2)
  end
  #-----------------------------------------------------------------------------
  # * draw_gauge
  #-----------------------------------------------------------------------------
  def draw_gauge(x, y, width, rate, color1, color2)
    fill_w = (width * rate).to_i
    gauge_y = y + line_height - 8
    contents.fill_rect(x, gauge_y, width, 4, gauge_back_color)
    contents.gradient_fill_rect(x, gauge_y, fill_w, 4, color1, color2)
  end
  #-----------------------------------------------------------------------------
  # * dispose
  #-----------------------------------------------------------------------------
  def dispose
    super
    dispose_face
    dispose_layout
  end
  #-----------------------------------------------------------------------------
  # * dispose_layout
  #-----------------------------------------------------------------------------
  def dispose_layout
    return unless @layout
    @layout.each do |layout|
      layout.bitmap.dispose if layout.bitmap.dispose
      layout.dispose
    end
    @layout = nil
  end
  #-----------------------------------------------------------------------------
  # * dispose_face
  #-----------------------------------------------------------------------------
  def dispose_face
    return unless @face
    @face.each do |face|
      face.bitmap.dispose if face.bitmap
      face.dispose
    end
    @face = nil
  end
  #-----------------------------------------------------------------------------
end
#==============================================================================
# ** new Window_Information
# methods: initialize, draw_gold, draw_steps, draw_battle_won, draw_time,
#          update
#==============================================================================
class Window_Information < Window_Base
  #-----------------------------------------------------------------------------
  include Eugene222::MConfig
  #-----------------------------------------------------------------------------
  # * initialize
  #-----------------------------------------------------------------------------
  def initialize
    super(0,Graphics.height-136,Graphics.width, 72)
    self.opacity = 0
    draw_all
    update
  end
  #-----------------------------------------------------------------------------
  # * draw_gold
  #-----------------------------------------------------------------------------
  def draw_gold
    draw_text(0, 12, contents_width/4 - 46, line_height, $game_party.gold, 2)
    draw_icon(GoldIcon, contents_width/4 - 45, 12)
  end
  #-----------------------------------------------------------------------------
  # * draw_steps
  #-----------------------------------------------------------------------------
  def draw_steps
    draw_text(contents_width/4, 12, contents_width/4-46, line_height, $game_party.steps, 2)
    draw_icon(StepIcon, contents_width*2/4 - 45, 12)
  end
  #-----------------------------------------------------------------------------
  # * draw_battle_won
  #-----------------------------------------------------------------------------
  def draw_battle_won
    draw_text(contents_width*2/4, 12, contents_width/4-46, line_height, $game_system.battle_won_count, 2)
    draw_icon(BattleIcon, contents_width*3/4 - 45, 12)
  end
  #-----------------------------------------------------------------------------
  # * draw_time
  #-----------------------------------------------------------------------------
  def draw_time
    rect = Rect.new(contents_width*3/4, 12, contents_width/4-26,line_height)
    contents.clear_rect(rect)
    draw_text(rect, $game_system.playtime_s, 2)
    draw_icon(TimeIcon, contents_width - 25, 12)
  end
  def draw_all
    draw_gold
    draw_steps
    draw_battle_won
  end
  #-----------------------------------------------------------------------------
  # * update
  #-----------------------------------------------------------------------------
  def update
    super
    draw_time
  end
  #-----------------------------------------------------------------------------
end
#==============================================================================
# ** Scene_Menu
# new_methods: create_information_window, custom_command
#==============================================================================
class Scene_Menu < Scene_MenuBase
  #-----------------------------------------------------------------------------
  # * start
  #-----------------------------------------------------------------------------
  def start
    super
    @info = Eugene222::MConfig::DC
    @help_window = Window_Menu.new(2)
    @help_window.opacity = 0
    create_command_window
    create_status_window
    create_information_window
  end
  #-----------------------------------------------------------------------------
  # * create_command_window
  #-----------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_MenuCommand.new(0,@help_window.height-12)
    @command_window.help_window = @help_window
    @info.each do |k,v|
      @command_window.set_handler(k, method(v[3])) if check_active(k)
    end
    @command_window.set_handler(:cancel,    method(:return_scene))
  end
  #-----------------------------------------------------------------------------
  # * create_information_window
  #-----------------------------------------------------------------------------
  def create_information_window
    @information_window = Window_Information.new
  end
  #-----------------------------------------------------------------------------
  # * create_status_window
  #-----------------------------------------------------------------------------
  def create_status_window
    @status_window = Window_NewMenuStatus.new(0, @command_window.height*2 - 24 )
  end
  #-----------------------------------------------------------------------------
  # * custom_command
  #-----------------------------------------------------------------------------
  def custom_command
    SceneManager.call(@command_window.current_ext)
  end
  def check_active(key)
    c_cmd = $game_system.custom_command[key]
    enabled = key.to_s.include?("custom") ? c_cmd : true
    @info[key][0] && enabled ? true : false
  end
  #-----------------------------------------------------------------------------
end
#==============================================================================
# ** Cache
# new method: self.menu
#==============================================================================
module Cache
  #-----------------------------------------------------------------------------
  # * self.menu
  #-----------------------------------------------------------------------------
  def self.menu(filename)
    load_bitmap("Graphics/Menu/", filename)
  end
  #-----------------------------------------------------------------------------
end
#==============================================================================
# ** BattleManager
# alias Method: self.process_victory
#==============================================================================
module BattleManager
  class << self
    alias eugene222_process_victory process_victory
    #---------------------------------------------------------------------------
    # * self.process_victory
    #---------------------------------------------------------------------------
    def process_victory
    $game_system.battle_won_count += 1
    eugene222_process_victory
    end
  end
  #-----------------------------------------------------------------------------
end
#==============================================================================
# ** Game_System
# alias Method: initialize
# new attr_accessor: battle_won_count, custom_command
#==============================================================================
class Game_System
  #-----------------------------------------------------------------------------
  attr_accessor   :battle_won_count
  attr_accessor   :custom_command
  #-----------------------------------------------------------------------------
  alias eugene222_game_system_initialize initialize
  #-----------------------------------------------------------------------------
  # * initialize
  #-----------------------------------------------------------------------------
  def initialize
    @battle_won_count = 0
    @custom_command = {custom1: true, custom2: true, custom3: true}
    eugene222_game_system_initialize
  end
  #-----------------------------------------------------------------------------
end
#==============================================================================
# ** Game_Interpreter
# new method: custom_command_access
#==============================================================================
class Game_Interpreter
  def custom_command_access(command, check)
    $game_system.custom_command[command] = check
  end
  #-----------------------------------------------------------------------------
end
#===============================================================================
#-------------------------------------------------------------------------------
# ** SCRIPT END **
#-------------------------------------------------------------------------------
#===============================================================================

The Main Menu was made with pictures and was made for the default 544x416 resolution.
Im using "Graphics.resize_screen(640 , 480)" to increase the resolution to 640x480.. this is what I get then:


As you can see the Menu looses its beauty on the higher resolution.

So my questions are:

Is there a way that allows me to keep the Menu (Main Menu) resolution at 544x416 while the game resolution is 640x480?

Or

can the Menu (Main Menu) code be altered in a way that the Menu looks exactly the same on the higher resolution?

Im no scripter at all and would really appreciate any help to solve this :)

Thank you in advance!

Greetings, DerKIAS
 

vFoggy

Veteran
Veteran
Joined
Nov 3, 2012
Messages
71
Reaction score
31
Primarily Uses
This script will fix these issues:
Code:
#===============================================================================
# This script fixes visual issues with larger than 544x416 resolution in
# eugene222's Tales of Vesperia CMS.
#
# -------------------
# Script by: vFoggy
#===============================================================================

class Window_Base
  def zoom_x
    Graphics.width.to_f / 544
  end
  def zoom_y
    Graphics.height.to_f / 416
  end
end

class Window_Menu < Window_Help
  def create_bg
    @bg = Sprite.new
    @bg.bitmap = Cache.menu("") rescue nil
    @bg.zoom_x = zoom_x(@bg.width)
    @bg.zoom_y = zoom_y(@bg.height)
    @bg1 = Sprite.new
    @bg1.bitmap = Cache.menu("menu_layout") rescue nil
    @bg1.zoom_x = zoom_x(@bg1.width)
    @bg1.zoom_y = zoom_y(@bg1.height)
  end
end

class Window_MenuCommand < Window_Command
  include Eugene222::MConfig
  def initialize(x,y)
    init_commands
    x *= zoom_x
    y *= zoom_y
    super(x,y)
    w = (24 + item_max * (48+spacing))*zoom_x
    h = 72 * zoom_y
    self.width = w
    self.height = h
    self.opacity = 0
    select_last
    update
  end
  def contents_width
    ((item_width + spacing) * item_max - spacing)*zoom_x
  end
  def item_width;48*zoom_x;end
  def item_height;48*zoom_y;end
  def spacing;4*zoom_x;end
 
  def draw_all_items
    @sprite_items = []
     @commands.each_with_index do |command,index|
      icon = Cache.menu(command.to_s) rescue Cache.menu("none")
      sprite = Sprite.new
      sprite.bitmap = icon
      sprite.x = index * (48*zoom_x + spacing) + self.x + self.padding
      sprite.y = self.y + self.padding
      sprite.zoom_x = zoom_x
      sprite.zoom_y = zoom_y
      sprite.z = self.z + 1
      sprite.opacity = 155
      @sprite_items << sprite
    end
  end
 
  def item_rect(index)
    rect = super
    rect.x = index * (48*zoom_x + spacing)
    rect.y = 0
    rect.width = 48 * zoom_x
    rect.height = 48 * zoom_y
    rect
  end
end


class Window_NewMenuStatus < Window_MenuStatus
  def initialize(x, y)
    @layout = []
    @face = []
    @y = y
    super(x, y)
    self.opacity = 0
    self.ox = 0
    self.oy = 0
    @pending_index = -1
  end
  def item_height
    (line_height + 20)*3 + 48 + 24
  end
  def window_height
    (Graphics.height - @y - 48*zoom_y)
  end
end

class Window_Information < Window_Base
  include Eugene222::MConfig
  def initialize
    w = Graphics.width
    h = 72 * zoom_y
    y = Graphics.height-h
    super(0, y, w, h)
    self.opacity = 0
    draw_all
    update
  end
end

class Scene_Menu < Scene_MenuBase
  def create_status_window
    y =  (@command_window.height*2 - 24)*(Graphics.height/416)
    @status_window = Window_NewMenuStatus.new(0, y)
  end
end
 

DerKIAS

Demon Lord
Veteran
Joined
Sep 19, 2016
Messages
57
Reaction score
40
First Language
German
Primarily Uses
RMVXA
Perfect! Thank you very much!! :D :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top