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
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)
Compatibility
no compatibility issues known
Credits and Thanks
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 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
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Mouse Map Menu by Nathmatt
# Version: 1.21
# 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.22
#============================================================================
# Mouse_Map_Menu::Config
#----------------------------------------------------------------------------
# This module performs the the configurations.
#============================================================================
module 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
#============================================================================
# Mouse_Map_Menu::Processor
#----------------------------------------------------------------------------
# This class performs the mouse processing.
#============================================================================
class Processor
attr_reader :event_disabled
def main
@size = Config::Icons.size
if @size != Config::Scenes.size
raise 'You must have the same amount of icons & scenes'
end
@x = Config::X * 32
@y = Config::Y * 32
@c = Config::Condition
@disabled = []
if Config::Window != false
@window = Sprite.new
@window.bitmap = RPG::Cache.picture(Config::Window)
@window.x = @x
@window.y = @y
@window.z = 100
end
@sprite = Sprite.new
@sprite.x = @x
@sprite.y = @y
@sprite.z = 200
@sprite.bitmap = Bitmap.new((@c == 0 ? @size * 32 : 32),
(@c == 1 ? @size * 32 : 32))
if Config::Back != false
@back = Sprite.new
@back.x = @x
@back.y = @y
@back.z = 150
@back.bitmap = Bitmap.new((@c == 0 ? @size * 32 : 32),
(@c == 1 ? @size * 32 : 32))
end
(0...@size).each{|i|draw_command(i)}
end
def draw_command(i)
rect = Rect.new((@c == 0 ? (i * 32) : 0),
(@c == 1 ? (i * 32) : 0),32,32)
@sprite.bitmap.fill_rect(rect, Color.new(0, 0, 0, 0))
if @back != nil
b = RPG::Cache.picture(Config::Back)
@back.bitmap.blt((@c == 0 ? i * 32 : 0),(@c == 1 ? i * 32: 0),
b ,Rect.new(0, 0, 32, 32))
end
opacity = 255
opacity = 128 if @disabled[i]
b = RPG::Cache.icon(Config::Icons[i])
@sprite.bitmap.blt((@c == 0 ? (i * 32) + 4 : 4),
(@c == 1 ? (i * 32) + 4 : 4), b ,Rect.new(0, 0, 24, 24),opacity)
end
def update
(0...Config::Scenes.size).each{|i|
check_opacity
if Config::Key[i] != nil && Input.trigger?(Input::Key[Config::Key[i]])
if @disabled[i]
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if Config::Scenes[i] == 'Back'
$scene = ($scene.is_a?(Scene_Map) ? Scene_End.new : Scene_Map.new)
return
end
eval("$scene = #{Config::Scenes[i]}.new")
end
if over_button?(i)
@event_disabled = true
$mouse.change_graphic(Config::Mouse) if Config::Mouse != false
$MCES.wait = 1 if $MCES != nil
if Input.trigger?(Input::Key['Mouse Left'])
$MCES.wait = 5 if $MCES != nil
if @disabled[i]
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if Config::Scenes[i] == 'Back'
$scene = ($scene.is_a?(Scene_Map) ? Scene_End.new : Scene_Map.new)
return
end
eval("$scene = #{Config::Scenes[i]}.new")
return
end
else
@event_disabled = false
$mouse.change_graphic
end}
end
def over_button?(i)
x = (Config::Condition == 0 ? (@x + i * 32) : @x)
y = (Config::Condition == 1 ? (@y + i * 32) : @y)
return $mouse.x >= x && $mouse.y >= y && $mouse.x <= x + 32 &&
$mouse.y <= y + 32
end
def disable(i)
return if i > Config::Scenes.size - 1
@disabled[i] = true
draw_command(i)
end
def enable(i)
return if i > Config::Scenes.size - 1
@disabled[i] = false
draw_command(i)
end
def dispose
@sprite.dispose
@back.dispose if @back != nil
@window.dispose if @window != nil
end
def check_opacity
s = @sprite
b = @sprite.bitmap
if $game_player.screen_x <= s.x + b.width + 16 &&
$game_player.screen_y <= s.y + b.height + 16 &&
$game_player.screen_x >= s.x && $game_player.screen_y >= s.y
s.opacity -= 25 if s.opacity > 80
@window.opacity -= 25 if @window != nil && @window.opacity > 80
@back.opacity -= 25 if @back != nil && @back.opacity > 80
elsif s.opacity <= 255 || @window != nil && @window.opacity <= 255 ||
@back != nil && @back.opacity <= 255
@back.opacity += 25 if @back != nil
@window.opacity += 25 if @window != nil
s.opacity += 25
end
end
end
end
class Mouse
def change_graphic(image = nil)
if image != nil && @image != image
set_cursor(image)
@image = image
elsif @cursor.bitmap != RPG::Cache.picture(MOUSE_ICON)
set_cursor(MOUSE_ICON)
@image = MOUSE_ICON
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
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)
Compatibility
no compatibility issues known
Credits and Thanks
- Nathmatt
[สคริปต์] Mouse Map Menu