Author Topic: [XP] Mouse Map Menu  (Read 20968 times)

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
[XP] Mouse Map Menu
« on: August 07, 2010, 04:27:20 PM »
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


(click to show/hide)

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
« Last Edit: July 09, 2011, 06:07:07 PM by 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
(click to show/hide)

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Re: [XP] Mouse Map Menu
« Reply #1 on: August 07, 2010, 05:28:00 PM »
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)?

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #2 on: August 07, 2010, 06:20:19 PM »
Looks good. I edited your post, you had a syntax error, forgot the last end in Scene_Map.

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Re: [XP] Mouse Map Menu
« Reply #3 on: August 07, 2010, 08:15:02 PM »
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.

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #4 on: August 07, 2010, 08:50:45 PM »
Got bored. See if this works :P
Code: [Select]
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 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

Offline arialks

  • Awakened Visionist
  • **
  • Posts: 53
  • LV: 1
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #5 on: August 07, 2010, 09: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:

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #6 on: August 07, 2010, 09:56:32 PM »
Try this
Code: [Select]
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 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

Offline arialks

  • Awakened Visionist
  • **
  • Posts: 53
  • LV: 1
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #7 on: August 07, 2010, 10:26:56 PM »
line 103 error

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #8 on: August 07, 2010, 10:28:02 PM »
Not sure if this fixed it.
Code: [Select]
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 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.

Offline Shalaren

  • Ethereal Devastator
  • ****
  • Posts: 442
  • LV: 46
  • Gender: Male
  • Also known as DexKyle
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #9 on: August 07, 2010, 10:29:14 PM »
now the Icon doesnt do anything xD

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #10 on: August 07, 2010, 10:55:54 PM »
I'll look into it, I'm not sure how he's actually drawing the sprites.

Offline Shalaren

  • Ethereal Devastator
  • ****
  • Posts: 442
  • LV: 46
  • Gender: Male
  • Also known as DexKyle
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #11 on: August 07, 2010, 11:18:18 PM »
Alright thanks ^^

Offline arialks

  • Awakened Visionist
  • **
  • Posts: 53
  • LV: 1
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #12 on: August 07, 2010, 11:39:32 PM »
Not sure if this fixed it.
Code: [Select]
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 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:
« Last Edit: August 08, 2010, 12:04:06 AM by arialks »

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #13 on: August 08, 2010, 12:06:02 AM »
Fixed I think
Code: [Select]
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 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

Offline arialks

  • Awakened Visionist
  • **
  • Posts: 53
  • LV: 1
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #14 on: August 08, 2010, 12:26:48 AM »
no  :^_^': still not working,
but what nathmatt gave is better then nothing  :wacko:

any Idea how to put more then 1 Icon?

Offline Shalaren

  • Ethereal Devastator
  • ****
  • Posts: 442
  • LV: 46
  • Gender: Male
  • Also known as DexKyle
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #15 on: August 08, 2010, 04:18:09 AM »
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

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
Code: [Select]
    Icons= ['040-Item09','039-Item08']
    Scenes= ['Scene_Menu','Scene_Hotkeys']
« Last Edit: August 08, 2010, 04:19:27 AM by Protoss »

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] Mouse Map Menu
« Reply #16 on: August 08, 2010, 04:34:12 AM »
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
(click to show/hide)

Offline Shalaren

  • Ethereal Devastator
  • ****
  • Posts: 442
  • LV: 46
  • Gender: Male
  • Also known as DexKyle
    • View Profile
Re: [XP] Mouse Map Menu
« Reply #17 on: August 08, 2010, 04:49:51 AM »
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:!

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] Mouse Map Menu
« Reply #18 on: August 08, 2010, 05:20:01 AM »
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
(click to show/hide)

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Re: [XP] Mouse Map Menu
« Reply #19 on: August 08, 2010, 05:26:39 AM »
@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*