[XP] Mouse Map Menu

Started by nathmatt, August 07, 2010, 10:27:20 am

Previous topic - Next topic

nathmatt

August 07, 2010, 10:27:20 am Last Edit: July 09, 2011, 12:07:07 pm by nathmatt
Mouse Map Menu
Authors: Nathmatt
Version: 1.25
Type: Map Menu
Key Term: Custom Menu System



Introduction

allows you to create click able icons on the map to access any specified scene
requires Mouse_Controller &  Blizz-ABS, RMXOS, or Tons custom controls



Features


  • vertical or horizontal icon command list
  • Can place the command anywhere you want
  • Can change graphic while over an icon
  • can add pictures behind each icon
  • can add a picture to use as a window
  • Can disable and enable each command
  • Can disable entire menu
  • Can call commands with a defined key
  • Opacity will lower if you are under this menu
  • No limit on the commands



Screenshots

Maybe later


Demo

No demo


Script





Instructions

in the config of the script

to disable a command use $mouse_map_menu.disable(index)
to enable a command use $mouse_map_menu.enable(index)
to enable/disable the menu use $mouse_map_menu.menu_disabled = condition



Compatibility

no compatibility issues known



Credits and Thanks


  • Nathmatt



Author's Notes

if you have any issues / suggestions post here
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


legacyblade

This'll be great for making a mouse-only game menu system. Is there a way to make these carry over into the scenes you call? (so you can click on a dif icon and go to a dif scene)?

G_G

Looks good. I edited your post, you had a syntax error, forgot the last end in Scene_Map.

legacyblade

After playing around with it, I realized adding this to new scenes would be REALLY easy. I like that. However, I have a few suggestions. Feel free to ignore them if they aren't what you want your script to be like.

First, I want to be able to change the cursor graphic or the icon graphic when one of the icons is moused over. Not a real big feature, but it'd be nice. Second, I'd like the ability to define an icon back (like blizzABS hotkeys), or to have a picture drawn below the icons. Third, I'd like to be able to disable menu items, like in the default menu. The icon would be grayed out and unusable. When you click it, you'd get the error buzzer noise.

If you don't want to make those additions, I'll probably try to make an enhancement add-on for your mouse map menu. I love what you've been doing with blizz's mouse system, it's very useful.

P.S. I know it's kind of a given, but you might want to mention in your post that this requires blizz's mouse script.

G_G

Got bored. See if this works :P
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Mouse Map Menu by Nathmatt
# Version: 1.00
# Type: Menu
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#   
#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
module Mouse_Map_Menu
 
  Version = 1.00
  #============================================================================
  # Mouse_Map_Menu::Config
  #----------------------------------------------------------------------------
  #  This module performs the the configurations.
  #============================================================================
  module Config
    Condition = 0               # 0 for Horizontal 1 for Vertical
Icon_Back = "Background"    # Change it to "" if you do not want this option
# Displays a background behind each icon. Place
# In pictures folder
    Icons     = ['040-Item09']  # Array of menu icons
    Scenes    = ['Scene_Menu']  # Array of scenes
    X         = 0               # The x co-ordanance is by 32
    Y         = 14              # The y co-ordanance is by 32
  end
  #============================================================================
  # Mouse_Map_Menu::Processor
  #----------------------------------------------------------------------------
  #  This class performs the mouse processing.
  #============================================================================
  class Processor
   
    def main
      size = Config::Icons.size
      if size != Config::Scenes.size
        raise 'You must have the same amount of icons & scenes'
      end
  @enable = []
      @x = Config::X * 32
      @y = Config::Y * 32
      @screen_x = []
      @screen_y = []
      @sprite   = []
  @back     = []
      (0...size).each{|i|
  @back[i] = Sprite.new
  @back[i].bitmap = RPG::Cache.picture(Config::Icon_Back)
      @sprite[i] = Sprite.new
      @sprite[i].bitmap = RPG::Cache.icon(Config::Icons[i])
      if Config::Condition == 0
        @sprite[i].x = 4 + @x + i * 32
        @sprite[i].y = 4 + @y
      else
        @sprite[i].x = 4 + @x
        @sprite[i].y = 4 + @y + i * 32
      end
  @back[i].x = @sprite[i].x
  @back[i].y = @sprite[i].y
      @sprite[i].z = 100
      @screen_x[i] = (@sprite[i].x + $game_map.display_x / 4) / 32
      @screen_y[i] = (@sprite[i].y + $game_map.display_y / 4) / 32
  @enable[i] = true}
    end
   
    def update
      x,y = $mouse.pos
      (0...Config::Scenes.size).each{|i|
      if x == @screen_x[i] && y == @screen_y[i]
        if Input.trigger?(Input::Key['Mouse Left'])
  if @enable[i]
            $game_system.se_play($data_system.decision_se)
            eval("$scene = #{Config::Scenes[i]}.new")
            break
  end
else
  $game_system.se_play($data_system.buzzer_se)
  break
        end
      end}
     
    end
   
def disable_item(i)
  @enable[i] = false
end

def enable_item(i)
  @enable[i] = true
end

    def dispose
      (0...Config::Scenes.size).each{|i|@sprite[i].dispose if @sprite[i] != nil}
      @sprite.clear
    end
     
   
  end
 
end
   
class Mouse
     
  def pos
    return if $game_map.display_x == nil
    x, y = self.position
    x = ( x + $game_map.display_x / 4) / 32
    y = ( y + $game_map.display_y / 4) / 32
    return x, y
  end
end
     
$mouse_map_menu = Mouse_Map_Menu::Processor.new

class Scene_Map
 
  alias mouse_map_menu_main main
  def main
    $mouse_map_menu.main
    mouse_map_menu_main
    $mouse_map_menu.dispose
  end
 
  alias mouse_map_menu_update update
  def update
    $mouse_map_menu.update
    mouse_map_menu_update
  end

end

arialks

oh this scripit is so fken sexy :P
Ive been waiting for something like this for a long time
but i found a small bug, when I click on the center of the icon, it doesnt work, but it works if you click on the very very left of the Icon O:

G_G

Try this
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Mouse Map Menu by Nathmatt
# Version: 1.00
# Type: Menu
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#   
#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
module Mouse_Map_Menu
 
  Version = 1.00
  #============================================================================
  # Mouse_Map_Menu::Config
  #----------------------------------------------------------------------------
  #  This module performs the the configurations.
  #============================================================================
  module Config
    Condition = 0               # 0 for Horizontal 1 for Vertical
Icon_Back = "Background"    # Change it to "" if you do not want this option
# Displays a background behind each icon. Place
# In pictures folder
    Icons     = ['040-Item09']  # Array of menu icons
    Scenes    = ['Scene_Menu']  # Array of scenes
    X         = 0               # The x co-ordanance is by 32
    Y         = 14              # The y co-ordanance is by 32
  end
  #============================================================================
  # Mouse_Map_Menu::Processor
  #----------------------------------------------------------------------------
  #  This class performs the mouse processing.
  #============================================================================
  class Processor
   
    def main
      size = Config::Icons.size
      if size != Config::Scenes.size
        raise 'You must have the same amount of icons & scenes'
      end
  @enable = []
      @x = Config::X * 32
      @y = Config::Y * 32
      @screen_x = []
      @screen_y = []
      @sprite   = []
  @back     = []
      (0...size).each{|i|
  @back[i] = Sprite.new
  @back[i].bitmap = RPG::Cache.picture(Config::Icon_Back)
      @sprite[i] = Sprite.new
      @sprite[i].bitmap = RPG::Cache.icon(Config::Icons[i])
      if Config::Condition == 0
        @sprite[i].x = 4 + @x + i * 32
        @sprite[i].y = 4 + @y
      else
        @sprite[i].x = 4 + @x
        @sprite[i].y = 4 + @y + i * 32
      end
  @back[i].x = @sprite[i].x
  @back[i].y = @sprite[i].y
      @sprite[i].z = 100
      @screen_x[i] = (@sprite[i].x + $game_map.display_x / 4) / 32
      @screen_y[i] = (@sprite[i].y + $game_map.display_y / 4) / 32
  @enable[i] = true}
    end
   
    def update
      x,y = $mouse.pos
      (0...Config::Scenes.size).each{|i|
      if x >= @sprite[i].x && y >= @sprite[i].y && x <= @sprite[i].bitmap.width
  && y <= @sprite[i].bitmap.height
        if Input.trigger?(Input::Key['Mouse Left'])
  if @enable[i]
            $game_system.se_play($data_system.decision_se)
            eval("$scene = #{Config::Scenes[i]}.new")
            break
  end
else
  $game_system.se_play($data_system.buzzer_se)
  break
        end
      end}
     
    end
   
def disable_item(i)
  @enable[i] = false
end

def enable_item(i)
  @enable[i] = true
end

    def dispose
      (0...Config::Scenes.size).each{|i|@sprite[i].dispose if @sprite[i] != nil}
      @sprite.clear
    end
     
   
  end
 
end
   
class Mouse
     
  def pos
    return if $game_map.display_x == nil
    x, y = self.position
    x = ( x + $game_map.display_x / 4) / 32
    y = ( y + $game_map.display_y / 4) / 32
    return x, y
  end
end
     
$mouse_map_menu = Mouse_Map_Menu::Processor.new

class Scene_Map
 
  alias mouse_map_menu_main main
  def main
    $mouse_map_menu.main
    mouse_map_menu_main
    $mouse_map_menu.dispose
  end
 
  alias mouse_map_menu_update update
  def update
    $mouse_map_menu.update
    mouse_map_menu_update
  end

end

arialks


G_G

Not sure if this fixed it.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Mouse Map Menu by Nathmatt
# Version: 1.00
# Type: Menu
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#   
#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
module Mouse_Map_Menu
 
  Version = 1.00
  #============================================================================
  # Mouse_Map_Menu::Config
  #----------------------------------------------------------------------------
  #  This module performs the the configurations.
  #============================================================================
  module Config
    Condition = 0               # 0 for Horizontal 1 for Vertical
Icon_Back = "Background"    # Change it to "" if you do not want this option
# Displays a background behind each icon. Place
# In pictures folder
    Icons     = ['040-Item09']  # Array of menu icons
    Scenes    = ['Scene_Menu']  # Array of scenes
    X         = 0               # The x co-ordanance is by 32
    Y         = 14              # The y co-ordanance is by 32
  end
  #============================================================================
  # Mouse_Map_Menu::Processor
  #----------------------------------------------------------------------------
  #  This class performs the mouse processing.
  #============================================================================
  class Processor
   
    def main
      size = Config::Icons.size
      if size != Config::Scenes.size
        raise 'You must have the same amount of icons & scenes'
      end
  @enable = []
      @x = Config::X * 32
      @y = Config::Y * 32
      @screen_x = []
      @screen_y = []
      @sprite   = []
  @back     = []
      (0...size).each{|i|
  @back[i] = Sprite.new
  @back[i].bitmap = RPG::Cache.picture(Config::Icon_Back)
      @sprite[i] = Sprite.new
      @sprite[i].bitmap = RPG::Cache.icon(Config::Icons[i])
      if Config::Condition == 0
        @sprite[i].x = 4 + @x + i * 32
        @sprite[i].y = 4 + @y
      else
        @sprite[i].x = 4 + @x
        @sprite[i].y = 4 + @y + i * 32
      end
  @back[i].x = @sprite[i].x
  @back[i].y = @sprite[i].y
      @sprite[i].z = 100
      @screen_x[i] = (@sprite[i].x + $game_map.display_x / 4) / 32
      @screen_y[i] = (@sprite[i].y + $game_map.display_y / 4) / 32
  @enable[i] = true}
    end
   
    def update
      x,y = $mouse.pos
      (0...Config::Scenes.size).each{|i|
      if x >= @sprite[i].x && y >= @sprite[i].y && x <= @sprite[i].bitmap.width && y <= @sprite[i].bitmap.height
        if Input.trigger?(Input::Key['Mouse Left'])
  if @enable[i]
            $game_system.se_play($data_system.decision_se)
            eval("$scene = #{Config::Scenes[i]}.new")
            break
  end
else
  $game_system.se_play($data_system.buzzer_se)
  break
        end
      end}
     
    end
   
def disable_item(i)
  @enable[i] = false
end

def enable_item(i)
  @enable[i] = true
end

    def dispose
      (0...Config::Scenes.size).each{|i|@sprite[i].dispose if @sprite[i] != nil}
      @sprite.clear
    end
     
   
  end
 
end
   
class Mouse
     
  def pos
    return if $game_map.display_x == nil
    x, y = self.position
    x = ( x + $game_map.display_x / 4) / 32
    y = ( y + $game_map.display_y / 4) / 32
    return x, y
  end
end
     
$mouse_map_menu = Mouse_Map_Menu::Processor.new

class Scene_Map
 
  alias mouse_map_menu_main main
  def main
    $mouse_map_menu.main
    mouse_map_menu_main
    $mouse_map_menu.dispose
  end
 
  alias mouse_map_menu_update update
  def update
    $mouse_map_menu.update
    mouse_map_menu_update
  end

end


It'd help to know what the error said.

Shalaren

now the Icon doesnt do anything xD

G_G

I'll look into it, I'm not sure how he's actually drawing the sprites.

Shalaren


arialks

August 07, 2010, 05:39:32 pm #12 Last Edit: August 07, 2010, 06:04:06 pm by arialks
Quote from: Borat on August 07, 2010, 04:28:02 pm
Not sure if this fixed it.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Mouse Map Menu by Nathmatt
# Version: 1.00
# Type: Menu
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#   
#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
module Mouse_Map_Menu
 
  Version = 1.00
  #============================================================================
  # Mouse_Map_Menu::Config
  #----------------------------------------------------------------------------
  #  This module performs the the configurations.
  #============================================================================
  module Config
    Condition = 0               # 0 for Horizontal 1 for Vertical
Icon_Back = "Background"    # Change it to "" if you do not want this option
# Displays a background behind each icon. Place
# In pictures folder
    Icons     = ['040-Item09']  # Array of menu icons
    Scenes    = ['Scene_Menu']  # Array of scenes
    X         = 0               # The x co-ordanance is by 32
    Y         = 14              # The y co-ordanance is by 32
  end
  #============================================================================
  # Mouse_Map_Menu::Processor
  #----------------------------------------------------------------------------
  #  This class performs the mouse processing.
  #============================================================================
  class Processor
   
    def main
      size = Config::Icons.size
      if size != Config::Scenes.size
        raise 'You must have the same amount of icons & scenes'
      end
  @enable = []
      @x = Config::X * 32
      @y = Config::Y * 32
      @screen_x = []
      @screen_y = []
      @sprite   = []
  @back     = []
      (0...size).each{|i|
  @back[i] = Sprite.new
  @back[i].bitmap = RPG::Cache.picture(Config::Icon_Back)
      @sprite[i] = Sprite.new
      @sprite[i].bitmap = RPG::Cache.icon(Config::Icons[i])
      if Config::Condition == 0
        @sprite[i].x = 4 + @x + i * 32
        @sprite[i].y = 4 + @y
      else
        @sprite[i].x = 4 + @x
        @sprite[i].y = 4 + @y + i * 32
      end
  @back[i].x = @sprite[i].x
  @back[i].y = @sprite[i].y
      @sprite[i].z = 100
      @screen_x[i] = (@sprite[i].x + $game_map.display_x / 4) / 32
      @screen_y[i] = (@sprite[i].y + $game_map.display_y / 4) / 32
  @enable[i] = true}
    end
   
    def update
      x,y = $mouse.pos
      (0...Config::Scenes.size).each{|i|
      if x >= @sprite[i].x && y >= @sprite[i].y && x <= @sprite[i].bitmap.width && y <= @sprite[i].bitmap.height
        if Input.trigger?(Input::Key['Mouse Left'])
  if @enable[i]
            $game_system.se_play($data_system.decision_se)
            eval("$scene = #{Config::Scenes[i]}.new")
            break
  end
else
  $game_system.se_play($data_system.buzzer_se)
  break
        end
      end}
     
    end
   
def disable_item(i)
  @enable[i] = false
end

def enable_item(i)
  @enable[i] = true
end

    def dispose
      (0...Config::Scenes.size).each{|i|@sprite[i].dispose if @sprite[i] != nil}
      @sprite.clear
    end
     
   
  end
 
end
   
class Mouse
     
  def pos
    return if $game_map.display_x == nil
    x, y = self.position
    x = ( x + $game_map.display_x / 4) / 32
    y = ( y + $game_map.display_y / 4) / 32
    return x, y
  end
end
     
$mouse_map_menu = Mouse_Map_Menu::Processor.new

class Scene_Map
 
  alias mouse_map_menu_main main
  def main
    $mouse_map_menu.main
    mouse_map_menu_main
    $mouse_map_menu.dispose
  end
 
  alias mouse_map_menu_update update
  def update
    $mouse_map_menu.update
    mouse_map_menu_update
  end

end


It'd help to know what the error said.

yeah now when I click the icon, nothing happens X:
and how do I add more Icons? instead of just one.
me and Kyle tried to pu more icons in so many ways X:

G_G

Fixed I think
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Mouse Map Menu by Nathmatt
# Version: 1.00
# Type: Menu
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#   
#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
module Mouse_Map_Menu
 
  Version = 1.00
  #============================================================================
  # Mouse_Map_Menu::Config
  #----------------------------------------------------------------------------
  #  This module performs the the configurations.
  #============================================================================
  module Config
    Condition = 0               # 0 for Horizontal 1 for Vertical
Icon_Back = "Background"    # Change it to "" if you do not want this option
# Displays a background behind each icon. Place
# In pictures folder
    Icons     = ['040-Item09']  # Array of menu icons
    Scenes    = ['Scene_Menu']  # Array of scenes
    X         = 0               # The x co-ordanance is by 32
    Y         = 14              # The y co-ordanance is by 32
  end
  #============================================================================
  # Mouse_Map_Menu::Processor
  #----------------------------------------------------------------------------
  #  This class performs the mouse processing.
  #============================================================================
  class Processor
   
    def main
      size = Config::Icons.size
      if size != Config::Scenes.size
        raise 'You must have the same amount of icons & scenes'
      end
  @enable = []
      @x = Config::X * 32
      @y = Config::Y * 32
      @screen_x = []
      @screen_y = []
      @sprite   = []
  @back     = []
      (0...size).each{|i|
  @back[i] = Sprite.new
  @back[i].bitmap = RPG::Cache.picture(Config::Icon_Back)
      @sprite[i] = Sprite.new
      @sprite[i].bitmap = RPG::Cache.icon(Config::Icons[i])
      if Config::Condition == 0
        @sprite[i].x = 4 + @x + i * 32
        @sprite[i].y = 4 + @y
      else
        @sprite[i].x = 4 + @x
        @sprite[i].y = 4 + @y + i * 32
      end
  @back[i].x = @sprite[i].x
  @back[i].y = @sprite[i].y
      @sprite[i].z = 100
      @screen_x[i] = (@sprite[i].x + $game_map.display_x / 4) / 32
      @screen_y[i] = (@sprite[i].y + $game_map.display_y / 4) / 32
  @enable[i] = true}
    end
   
    def update
      x,y = $mouse.pos
      (0...Config::Scenes.size).each{|i|
      if x >= @sprite[i].x && y >= @sprite[i].y && x <= @sprite[i].bitmap.width + @sprite[i].x && y <= @sprite[i].bitmap.height + @sprite[i].y
        if Input.trigger?(Input::Key['Mouse Left'])
  if @enable[i]
            $game_system.se_play($data_system.decision_se)
            eval("$scene = #{Config::Scenes[i]}.new")
            break
  end
else
  $game_system.se_play($data_system.buzzer_se)
  break
        end
      end}
     
    end
   
def disable_item(i)
  @enable[i] = false
end

def enable_item(i)
  @enable[i] = true
end

    def dispose
      (0...Config::Scenes.size).each{|i|@sprite[i].dispose if @sprite[i] != nil}
      @sprite.clear
    end
     
   
  end
 
end
   
class Mouse
     
  def pos
    return if $game_map.display_x == nil
    x, y = self.position
    x = ( x + $game_map.display_x / 4) / 32
    y = ( y + $game_map.display_y / 4) / 32
    return x, y
  end
end
     
$mouse_map_menu = Mouse_Map_Menu::Processor.new

class Scene_Map
 
  alias mouse_map_menu_main main
  def main
    $mouse_map_menu.main
    mouse_map_menu_main
    $mouse_map_menu.dispose
  end
 
  alias mouse_map_menu_update update
  def update
    $mouse_map_menu.update
    mouse_map_menu_update
  end

end

arialks

no  :^_^': still not working,
but what nathmatt gave is better then nothing  :wacko:

any Idea how to put more then 1 Icon?

Shalaren

August 07, 2010, 10:18:09 pm #15 Last Edit: August 07, 2010, 10:19:27 pm by Protoss
Quote from: arialks on August 07, 2010, 03:36:16 pm
oh this scripit is so fken sexy :P
Ive been waiting for something like this for a long time
but i found a small bug, when I click on the center of the icon, it doesnt work, but it works if you click on the very very left of the Icon O:

is there a chance its like that because we use Blizz-Abs?
does that change anything? because we use the special mouse system that is made for those who use
blizz abs

Quote from: arialks on August 07, 2010, 06:26:48 pm
no  :^_^': still not working,
but what nathmatt gave is better then nothing  :wacko:

any Idea how to put more then 1 Icon?

you just put more icons like that
    Icons= ['040-Item09','039-Item08']
    Scenes= ['Scene_Menu','Scene_Hotkeys']

nathmatt

update 1.10 added change the mouse graphic while over a command ,disable/enable commands, and fixed alignment bug

@legacyblade about the graphic behind it you wanted was you wanting an actual picture or just the colored box
like Blizz Abs
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

Alright so. X: I was exploring the scripit, didnt find how to fix it.
so Ill just tell you what I found, A WIERD BUG THAT MAKES A WIERD SOUND
I like rhyming :D
ok to topic
i found 2 bugs, one of them is
test it your self, make a big map
make the icon
try clicking it
it works
but if you move and the map scrolls, the link of the Icon does not scrolls with it xD!
and then the icon is unclickble O:!

nathmatt

update 1:11 now fixed alignment bug  :^_^':
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


legacyblade

@nath, I personally want the picture behind it. But I think, to add some extra flexibility, you should allow for picture backs for each icon. (so you could simulate having a picture back for a menu with a non predefined amount of options). Thanks for the updates though, now the script is that much more epic. *levels up*

*cues a level up for later*

Shalaren

August 07, 2010, 11:28:05 pm #20 Last Edit: August 07, 2010, 11:36:18 pm by Protoss
Its pefect now!!! its Great! :D!
*Lvl up*
Oh man Ive been waiting for this.
if I'll have any suggestions or I'll find a bug I'll let ya know

Edit:
ok i got a small suggestion (idk if its actually small)
umm so the icon lets me get to the scenes with an Icon click
is there a way to put a "exit" Icon on every scene?
if you get what I mean, like you go into Items and in Items there will appear an exit icon that if I click on it it'll be back to scene_map.

nathmatt

update 1.11 fixed the opacity change on icons when disabled and added the ability to add a picture behind the commands
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


arialks

im getting an error, and im guessing its because I dont have the background picture :shy:
but what name does the background have?? o-o

p.s,
for background i though its like putting one pictur only
like here

its made in paint  :^_^':, but u get my point

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


arialks

Scripit 'IconMouse' line 87: NoMethodError Occurred.
undefined method '[]' for true:TrueClass

nathmatt

thats becase you dont set it to true to use it you put the graphic and it creates a picture for each command to use just would require a 1 little editing
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


arialks

August 08, 2010, 01:46:19 am #26 Last Edit: August 08, 2010, 02:29:55 am by arialks
idk what did you do in the editing scripit, but now im unable to add more icons
i mean more then 1, more icons wont be displayed..

and because your taking off the previouse versions, I dont have the 1.11 one, which is good X:
X: which means im screwed until you logon again D:

Shalaren

Quote from: arialks on August 08, 2010, 01:46:19 am
idk what did you do in the editing scripit, but now im unable to add more icons
i mean more then 1, more icons wont be displayed..

and because your taking off the previouse versions, I dont have the 1.11 one, which is good X:
X: which means im screwed until you logon again D:

Yep I should of just stayed with the 1.11 too  :^_^':
meh,
anyway as for the backgeound, did you test the scripit? did it work for you? S:

nathmatt

update: 1:13 fixed dispose bug & added the ability to use a picture window
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


arialks

Alright cool, *lvl up*
though I just dont seem to find how to make the window work now :P
and another thing if possible, instead of each icon to have its own background, to put one background for all icons,
besically it works just like that if there was a way to put a background only for the first Icon
and this way it feets for all

Shalaren

Man I'm probably pissing you off now arent I? S:
I found a bug
the background is displayed in side the other Scenes without the icons

nathmatt

August 08, 2010, 12:26:23 pm #31 Last Edit: August 08, 2010, 02:45:22 pm by nathmatt
no its my fault for not disposing them im on my psp will fix as soon as i can


edit: update: 1.14 fixed the where background pictures wouldn't dispose

edit2: sorry about the double post just noticed it
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

lvl up
:urgh: but I have another suggestion
put an exit Icon in all the scenes other than the Scene_map
so if you get into lets say
the Scene_Item so you'll have an Icon that will get you to Scene_Map

legacyblade

That's something you'd do in a CMS. This isn't a CMS, but the base for one. It'd be pretty easy to add an exit icon into the icons during the setup of the scene, and remove it once it's clicked and you're returning to scene_map.

arialks

and um S: how do I do that when you get into a Scene, once u exit it it wont go to Menu? X:

Shalaren

look at the Scene's pages and look for
"    # Switch to map screen
    $scene = Scene_Menu.new"
change the Menu to Map

nathmatt

if you would have read the scenes instructions you would no creating a scene named Back goes to scene map when ur not in it and when you are calls Scene_End
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

Is there a way you can make it so that you can call the scenes not only by clicking on them but also by lets say press 'I' on the keyboard and opening Items scene?

nathmatt

update: 1.15 improved the code a bit and added ability to call the scenes with a defined key
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Wizered67

Its not that big of a deal, but whenever you click to select one of these, it will trigger events in front of you....

nathmatt

update 1:16 fixed event trigger error
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

Returns errors if you use it with ABS and RMX-OS can't call scene with direct keys either just makes a noise and doesn't do anything. Tried to fix it with no luck.

nathmatt

the errors you get might help ?
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

Quote from: ojp2010 on August 28, 2010, 09:47:12 pm
Returns errors if you use it with ABS and RMX-OS can't call scene with direct keys either just makes a noise and doesn't do anything. Tried to fix it with no luck.

he's not getting any errors,
I know what he has, when he's clicking the icons, instead of moving to the scene
its just makes the "fail" sound track, is if its blocked.
I have that too. I would say its a bug.

Wizered67

I'm having no problems, and I'm using Blizz-ABS and RMX-OS.

nathmatt

update 1.17 fixed where i forgot to add the scene call to the scene call keys

try it now tell me if that fixed it
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren


ojp2010

Sorry I wasn't clear in my early post, script works great. However, is there anyway to make it so once the you click or use a direct hotkey to call a scene that you can just the direct hotkey to then return to the map scene?  Example, Press 'I' to call Items scene then press 'I' to close the item scene and return to the map scene.

nathmatt

that's something you add to the scene it self
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

Quote from: nathmatt on August 29, 2010, 06:12:57 pm
that's something you add to the scene it self


That would make sense, thanks.

ojp2010

Is there a way to make it so the buttons fade a little bit when the player moves under them at the edge of the screen?

nathmatt

update 1.18 reworked the code and made the menu fade when under it like Blizzards hud
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

September 07, 2010, 09:03:12 am #52 Last Edit: September 07, 2010, 09:23:31 am by ojp2010
Lvl up! Great add and thanks for the quick response.


Edit: Only problem now it that when I set X = 0 and Y = 5 it only shows the first two buttons and doesn't even show the background image I am using for the buttons. I copy and pasted, re-entered my scenes, hotkeys, and images. Did I do something wrong?

nathmatt

September 07, 2010, 10:46:40 am #53 Last Edit: September 07, 2010, 10:54:47 am by nathmatt
i will look into it it might have happened when i reworked the code

update 1:18 fixed alignment bug
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

Fixed alignment issue, but still only show a background for the first button.

nathmatt

update 1.20 fixed where the back picture would only be displayed on button
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

I got an error in game when I moved the character under the buttons


Spoiler: ShowHide
Line 195 
        @back.opacity -= 25 if @back.opacity.opacity > 80 if @back != nil


Spoiler: ShowHide




nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

Quote from: nathmatt on September 07, 2010, 06:48:37 pm
update 1.21 fixed above bug


Copied the new script added my buttons and custom stuff to the configuration part and still got the same error returned? Did I not do something right?

nathmatt

sorry about that i had .opacity.opacity that is what was causing your error it should be fixed now

update 1:22 fixed bug
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ojp2010

Works great, thanks again for the fix and so fast. <3

ranmaranma

I really need help with this. I have all the scripts installed and it seems to be working. I just don't know how to get things set up. Please help.

nathmatt

what do you need help setting up

Quote from: First Postmodule Config
    Condition = 0               # 0 for Horizontal 1 for Vertical
    Icons     = ['040-Item09']  # Array of menu icons
    Key       = ['M']           # Array of keys that will call the scene
    Scenes    = ['Scene_Menu']  # Array of scenes add Back to to return to map
                                # when not on map Scene_End if you are
    Mouse     = false           # The mouse graphic while over a command
                                # or false for none
    Back      = 'Back'          # The picture back for each icon or false for none
    Window    = false           # The picture used like a window for the icons
                                # or false for none
    X         = 0               # The x co-ordanance is by 32
    Y         = 0               # The y co-ordanance is by 32
  end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


karldaylo

wooohoohooo!

nathmatt the best hud scripter ever....


theres only one thing problem here..

i dunno if just me or not... but the mouse cursor graphics only changes at the last icon of the hud

and how to disable it ( not yet sure how to do it with global variable thingie,... i dun wanna mess up with your script... cuz its too awesome to modify) cuz im disabling all the hud on a scene (my game includes a child hood scene... hud arent that required on that scene.. since there are no enemys up ahead :D)

sorry for the english
RESPECT LIST:Blizzard, Game_guy, Foreverzer0, Winkio, Nathmatt

Shalaren

I was about to request that too, a way to disable the hud menu with a script call,
because you are able to cut a cutscene (Ironic) when its displayed, like if you made a cut scene, in the middle of it you can randomly go to the equipment menu... so a way to disable the menu with a script call that will be called at cutscenes.

nathmatt

update: 1.23 added a way to disable/remove the menu and should have fixed graphic error
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

I get
Quoteundefined local variable or method 'conditon' for #<Interpreter:0x65d6570>

when i call
Quote$mouse_map_menu.menu_disabled = condition

nathmatt

the condition is supposed to be true to disable it and false to re enable it
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Shalaren

WOOPS! PEFECT THEN! LVL UP

karldaylo

Quote from: nathmatt on May 10, 2011, 12:35:24 pm
update: 1.23 added a way to disable/remove the menu and should have fixed graphic error


omg! i worship you! best HUD scripter indeed!
RESPECT LIST:Blizzard, Game_guy, Foreverzer0, Winkio, Nathmatt

chaucer

the link leads to your mouse controller enhancement script xP i checked out all your files and mouse map menu and MCES contain the same script lol.

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

fixed compatibility issue with my MCES
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


RPGManiac3030

July 08, 2011, 02:34:33 am #73 Last Edit: July 09, 2011, 01:23:02 am by RPGManiac3030
EDIT: I get this error when I try to disable the menu



Official Gio website:
gioadventures.freehostingcloud.com (under construction)

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


RPGManiac3030

I'm getting a different error now



Official Gio website:
gioadventures.freehostingcloud.com (under construction)

nathmatt

just fixed that error let's hope there is no more
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


RPGManiac3030



Official Gio website:
gioadventures.freehostingcloud.com (under construction)

Shalaren

sorry for Necro posting
but I have a question I need help with
I'm using the achievement script
http://forum.chaos-project.com/index.php/topic,3330.0.html
I tried having one of the buttons going into Scene_Achievements but I keep getting an error
Script 'Mouse map menu' line 54: NameError occurred.
uninitialized constant Mouse_Map_Menu::Config::Scene_Achievements

KK20

Post your Mouse Map Menu script. Something's not written correctly.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Mouse Map Menu by Nathmatt
# Version: 1.26
# Type: Menu
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# # 
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# # 
# #  You are free:
# # 
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# # 
# #  Under the following conditions:
# # 
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# # 
# #  Noncommercial. You may not use this work for commercial purposes.
# # 
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# # 
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# # 
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# # 
# #  - Nothing in this license impairs or restricts the author's moral rights.
# # 
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
module Mouse_Map_Menu

  Version = 1.26
  #============================================================================
  # Mouse_Map_Menu::Config
  #----------------------------------------------------------------------------
  #  This module performs the the configurations.
  #============================================================================
  module Config
    Condition = 0               # 0 for Horizontal 1 for Vertical
    Icons     = ['040-Item09', '040-Item09']  # Array of menu icons
    Key       = ['M', 'N']           # Array of keys that will call the scene
    Scenes    = [Scene_Item, Scene_Achievements]    # Array of scenes add Back to to return to map
                                # when not on map Scene_End if you are
    Mouse     = false           # The mouse graphic while over a command
                                # or false for none
    Back      = false           # The picture back for each icon or false for none
    Window    = false           # The picture used like a window for the icons
                                # or false for none
    X         = 0               # The x co-ordanance is by 32
    Y         = 14              # The y co-ordanance is by 32
  end
  #============================================================================
  # Mouse_Map_Menu::Processor
  #----------------------------------------------------------------------------
  #  This class performs the mouse processing.
  #============================================================================
  class Processor
   
    attr_reader   :event_disabled
    attr_accessor :menu_disabled
   
    CON    = Config::Condition
    ICONS  = Config::Icons
    KEY    = Config::Key
    SCENES = Config::Scenes
    MOUSE  = Config::Mouse
    BACK   = Config::Back
    WINDOW = Config::Window
    SIZE   = ICONS.size
    X      = Config::X * 32
    Y      = Config::Y * 32
    W      = (CON == 0 ? SIZE * 32 : 32)
    H      = (CON == 1 ? SIZE * 32 : 32)
   
    def main
      return if @window != nil
      @window,@back,@menu = Sprite.new,Sprite.new,Sprite.new
      @window.z,@back.z,@menu.z = 100,150,200
      @window.x = @back.x = @menu.x = X
      @window.y = @back.y = @menu.y = Y
      @window.bitmap = RPG::Cache.picture(WINDOW) if WINDOW != false
      @back.bitmap = Bitmap.new(W,H)
      @menu.bitmap = Bitmap.new(W,H)
      @disabled = []
      (0...SIZE).each{|i|draw_command(i)}
    end
   
    def draw_command(i)
      x,y = (CON == 0 ? (i * 32) : 0),(CON == 1 ? (i * 32) : 0)
      rect = Rect.new(x,y,32,32)
      @menu.bitmap.fill_rect(rect,Color.new(0,0,0,0))
      if BACK != false
        item = RPG::Cache.picture(BACK)
        @back.bitmap.stretch_blt(rect,item,Rect.new(0,0,item.width,item.height))
      end
      item = RPG::Cache.icon(ICONS[i])
      opacity = (@disabled[i] ? 128 : 255)
      @menu.bitmap.fill_rect(rect,Color.new(0,0,0,0))
      @menu.bitmap.blt(x+4,y+4,item,Rect.new(0,0,24,24),opacity)
    end
   
    def update
      dispose if @menu_disabled
      main    if !@menu_disabled
      return if @menu == nil
      check_mouse
      check_opacity
      i = check_keys
      @event_disabled = (i != false)
      if i != false
        if SCENES[i] == 'Back'
          $scene = ($scene.is_a?(Scene_Map) ? Scene_End.new : Scene_Map.new)
          return
        end
        $scene = SCENES[i].new
      end
    end
     
    def check_mouse
      return if MOUSE == false
      i = over_button?
      if $MCES != nil
        $MCES.mouse_menu = (i != false)
        return
      end
      if i != false
        $mouse.set_cursor(MOUSE)
      else
        $mouse.set_cursor(Mouse::MOUSE_ICON)
      end
    end
   
    def check_keys
      return over_button? if Input.trigger?(Input::Key['Mouse Left'])
      (0...SIZE).each{|i|
      return i if Config::Key[i] != nil &&
        Input.trigger?(Input::Key[Config::Key[i]])}
      return false
    end
   
    def over_button?
      (0...SIZE).each{|i|
      x,y = (CON == 0 ? (X + i * 32) : X),(CON == 1 ? (Y + i * 32) : Y)
      if $mouse.x >= x && $mouse.y >= y && $mouse.x <= x + 32 && $mouse.y <= y + 32
        return i
      end}
      return false
    end

    def dispose
      [@window,@back,@menu].each{|s|s.dispose if s != nil && !s.disposed?}
      @window = @back = @menu = nil
    end
    def mouse_in_area?
      return false if @menu == nil || @menu.disposed?
      s = @menu
      b = s.bitmap
      return $game_player.screen_x <= s.x + b.width &&
         $game_player.screen_y <= s.y + b.height &&
         $game_player.screen_x >= s.x && $game_player.screen_y >= s.y
    end
   
   
    def check_opacity
      if mouse_in_area?
        @menu.opacity -= 25 if @menu.opacity > 80
      elsif @menu.opacity <= 255
        @menu.opacity += 25
      end
      [@window,@back,@menu].each{|s|s.opacity = @menu.opacity if !s.disposed?}
    end
   
  end

end

$mouse_map_menu = Mouse_Map_Menu::Processor.new

class Scene_Map

  alias mouse_map_menu_main main
  def main
    $mouse_map_menu.main
    mouse_map_menu_main
    $mouse_map_menu.dispose
  end

  alias mouse_map_menu_update update
  def update
    $mouse_map_menu.update
    mouse_map_menu_update
  end

end

class Game_Event < Game_Character

  alias start_event_menu start
  def start
    return if $mouse_map_menu.event_disabled
    start_event_menu
  end

end

if $MCES != nil
class MCES::Processor

  attr_accessor :mouse_menu

  alias mouse_menu_check_mouse check_mouse
  def check_mouse
    if @mouse_menu
      $mouse.set_cursor(Mouse_Map_Menu::Config::Mouse)
      return
    end
    mouse_menu_check_mouse
  end

end
end

KK20

August 09, 2013, 08:42:48 pm #81 Last Edit: August 09, 2013, 08:43:58 pm by KK20
Is the achievements script located above this script?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

I like how something as simple as that causes a problem. yeah it is now and its working! thanks :)

KK20

No problem. When you start up the game, it will run through all your scripts in your database in order and essentially 'load' them. When you put the achievements script above this script, the game knows there is a class called Scene_Achievements (because it loaded the achievements script before loading this script). When you swap the scripts' positions, the game has no idea that there is a class Scene_Achievements--it doesn't exist in memory yet. Instead, the game will now treat Scene_Achievements as a constant variable, hence the error 'uninitialized constant'.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

so to disable the menu by a script call I called
$mouse_map_menu.menu_disabled = 1

which worked, but how do I enable the menu now?
I tried
$mouse_map_menu.menu_enabled = 1

which crashed so then I tried
$mouse_map_menu.menu_disabled = enable

which crashed too so I tried changing the number up to 10... nothing worked

what script call am I looking for?

Wizered67

I didn't look at it too much, but I think it would be $mouse_map_menu.menu_disabled = 0 (or false).

Shalaren

I'm on my phone right now, but I'm pretty sure I tried that too and it didn't work, he game didn't crah but it didn't return the menu

KK20


...
    def update
      dispose if @menu_disabled
      main    if !@menu_disabled
...

Wouldn't you just use true/false?
$mouse_map_menu.menu_disabled =
false


Commence facepalming?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shalaren

*bangs head against wall upon realizing how obvious that it*
level of embarrassment: 9001

Wizered67

Ha ha isn't that exactly what I said? :P