- XandiarMembre
- Nombre de messages : 497
Age : 28
Localisation : Suisse
Distinction : aucune
Date d'inscription : 12/10/2013
[résolu]Problème avec le script "mouse" de Jet
Mer 26 Mar 2014 - 15:57
Plop les gens !
J'ai un petit problème avec le script de Jet qui permet d'utiliser la souris, à chaque fois que le personnage passe au niveau de la souris il... saute. Il disparait quand il passe au même niveau que la souris.
Vous pourriez m'aider ?
Voila le script :
J'ai un petit problème avec le script de Jet qui permet d'utiliser la souris, à chaque fois que le personnage passe au niveau de la souris il... saute. Il disparait quand il passe au même niveau que la souris.
Vous pourriez m'aider ?
Voila le script :
- Script:
#===============================================================================
# Mouse System
# By Jet10985(Jet)
# Some code by Daniel Martin
#===============================================================================
# This script will allow full use of the mouse inside of Ace for various
# purposes.
# This script has: 11 customization options.
#===============================================================================
# Overwritten Methods:
# Game_Player: move_by_input
# Window_NameInput: item_max
#-------------------------------------------------------------------------------
# Aliased methods:
# Scene_Map: update, terminate, update_transfer_player
# Input: update, trigger?, press?, repeat?, dir8/dir4
# Window_Selectable: update
# Scene_File: update, top_index=
# Game_Event: update, setup_page
# Game_Player: check_action_event, get_on_off_vehicle
# Game_System: initialize
#===============================================================================
=begin
Showing text above event when mouse hovers:
If you want a message to appear over an event's head if the mouse is hovering
over the event, put this comment in the event:
MOUSE TEXT MESSAGE HERE
everything after TEXT will be the hovering display.
--------------------------------------------------------------------------------
Change mouse picture above event when mouse hovers:
If you want the mouse's picture to temporarily change whne over an event, put
this comment in the event
MOUSE PIC NAME/NUMBER
if you put a name, the mouse will become that picture, but if you put a number
then the mouse will become the icon that is the id number
--------------------------------------------------------------------------------
Specific mouse click movement routes:
If you want the player to land specifically in a square around an event when
they click to move on the event, put one of these comments in the event:
MOUSE MOVE UP/LEFT/RIGHT/DOWN
only put the direction that you want the player to land on.
--------------------------------------------------------------------------------
Click to activate:
If you want an event to automatically start when it is clicked on, place
this in an event comment:
MOUSE CLICK
--------------------------------------------------------------------------------
Ignore Events:
To have an event be ignored when the mouse makes it's movement path(as if the
event isn't there), put this comment in the event:
MOUSE THROUGH
--------------------------------------------------------------------------------
You can do some extra things with the mouse using event "Script..." commands:
Mouse.set_pos(x, y) will set the mouse's position to the x and y specified.
Mouse.area?(x, y, width, height) will check if the mouse is inside the given
rectangle, on-screen. This does not account for a scrolled map.
Mouse.grid will return where on the screen the mouse is, not accounting for
a scrolled map. Returns an array: [x, y]
Mouse.true_grid will return where on the map the mouse is, accounting for a
scrolled map. Returns an array: [x, y]
Mouse.click?(1 or 2) will return true/false depending on if a mouse button was
clicked, in only the current frame. Use 1 for left-click, 2 for right-click.
Mouse.press?(1 or 2) will return true/false depending on if a mouse button is
currently being pressed. Use 1 for left-click, 2 for right-click.
--------------------------------------------------------------------------------
Extra Notes:
You can activate action button events by standing next to the event and clicking
on it with the mouse.
=end
module Jet
module MouseSystem
# This is the image used to display the cursor in-game.
CURSOR_IMAGE = "cursor-picture"
# If the above image does not exist, the icon at this index will be used.
CURSOR_ICON = 147
# turning this switch on will completely disable the mouse.
TURN_MOUSE_OFF_SWITCH = 99
# Do you want the player to be able to move using the mouse?
# This can be changed in-game using toggle_mouse_movement(true/false)
ALLOW_MOUSE_MOVEMENT = false
# Do you want to check for diagonal movement as well? Please note this
# enables regular diagonal movement with the keyboard as well.
DO_DIAGONAL_MOVEMENT = false
# If the tile they click on for movement is not passable, do you want
# to check the surround tiles for a movable area?
CHECK_FOR_MOVES = true
# Would you like a black box to outline the exact tile the mouse is over?
DEV_OUTLINE = false
end
module HoverText
# This is the font for the hovering mouse text.
FONT = "Verdana"
# This is the font color for hovering mouse text.
COLOR = Color.new(255, 255, 255, 255)
# This is the font size for hovering mouse text.
SIZE = 20
end
module Pathfinder
# While mainly for coders, you may change this value to allow the
# pathfinder more time to find a path. 1000 is default, as it is enough for
# a 100x100 maze.
MAXIMUM_ITERATIONS = 1000
end
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
module Mouse
Get_Message = Win32API.new('user32', 'GetMessage', 'plll', 'l')
GetAsyncKeyState = Win32API.new("user32", "GetAsyncKeyState", 'i', 'i')
GetKeyState = Win32API.new("user32", "GetKeyState", 'i', 'i')
GetCursorPo = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
SetCursorPos = Win32API.new('user32', 'SetCursorPos', 'nn', 'n')
ScreenToClient = Win32API.new('user32', 'ScreenToClient', 'lp', 'i')
GetClientRect = Win32API.new('user32', 'GetClientRect', 'lp', 'i')
GetWindowRect = Win32API.new('user32', 'GetWindowRect', 'lp', 'i')
a = Win32API.new('kernel32', 'GetPrivateProfileString', 'pppplp', 'l')
b = Win32API.new('user32', 'FindWindow', 'pp', 'i')
a.call("Game", "Title", "", title = "\0" * 256, 256, ".//Game.ini")
@handle = b.call("RGSS Player", title.unpack("C*").collect {|a| a.chr }.join.delete!("\0"))
Win32API.new('user32', 'ShowCursor', 'i', 'i').call(0)
module_function
def click?(button)
return true if @keys.include?(button)
return false
end
def press?(button)
return true if @press.include?(button)
return false
end
def set_pos(x_pos = 0, y_pos = 0)
width,height = client_size
if (x_pos.between?(0, width) && y_pos.between?(0, height))
SetCursorPos.call(client_pos[0] + x_pos,client_pos[1] + y_pos)
end
end
def moved?
@pos != @old_pos
end
def set_cursor(image)
(@cursor ||= Sprite_Cursor.new).set_cursor(image)
end
def revert_cursor
(@cursor ||= Sprite_Cursor.new).revert
end
def update
if !$game_switches.nil?
if $game_switches[Jet::MouseSystem::TURN_MOUSE_OFF_SWITCH]
@keys, @press = [], []
@pos = [-1, -1]
@cursor.update
return
end
end
@old_pos = @pos.dup
@pos = Mouse.pos
@keys.clear
@press.clear
@keys.push(1) if GetAsyncKeyState.call(1)&0x01 == 1
@keys.push(2) if GetAsyncKeyState.call(2)&0x01 == 1
@keys.push(3) if GetAsyncKeyState.call(4)&0x01 == 1
@press.push(1) if pressed?(1)
@press.push(2) if pressed?(2)
@press.push(3) if pressed?(4)
@cursor.update rescue @cursor = Sprite_Cursor.new
end
def init
@keys = []
@press = []
@pos = Mouse.pos
@cursor = Sprite_Cursor.new
end
def pressed?(key)
return true unless GetKeyState.call(key).between?(0, 1)
return false
end
def global_pos
pos = [0, 0].pack('ll')
GetCursorPo.call(pos) != 0 ? (return pos.unpack('ll')) : (return [0, 0])
end
def pos
x, y = screen_to_client(*global_pos)
width, height = client_size
begin
x = 0 if x <= 0; y = 0 if y <= 0
x = width if x >= width; y = height if y >= height
return x, y
end
end
def screen_to_client(x, y)
return nil unless x && y
pos = [x, y].pack('ll')
if ScreenToClient.call(@handle, pos) != 0
return pos.unpack('ll')
else
return [0, 0]
end
end
def client_size
rect = [0, 0, 0, 0].pack('l4')
GetClientRect.call(@handle, rect)
right,bottom = rect.unpack('l4')[2..3]
return right, bottom
end
def client_pos
rect = [0, 0, 0, 0].pack('l4')
GetWindowRect.call(@handle, rect)
left, upper = rect.unpack('l4')[0..1]
return left + 4, upper + 30
end
def grid
[(@pos[0]/32),(@pos[1]/32)]
end
def true_grid
xy = @pos
x = ((xy[0] + ($game_map.display_x * 32)) / 32).floor
y = ((xy[1] + ($game_map.display_y * 32)) / 32).floor
[x, y]
end
def grid_by_pos
[pos[0] / 32, pos[1] / 32]
end
def true_grid_by_pos
xy = pos
x = ((xy[0] + ($game_map.display_x * 32)) / 32).floor
y = ((xy[1] + ($game_map.display_y * 32)) / 32).floor
[x, y]
end
def area?(x, y, width, height)
@pos[0].between?(x, width + x) && @pos[1].between?(y, height + y)
end
class Sprite_Cursor < Sprite
def initialize
super(nil)
self.z = 50000
@bitmap_cache = initial_bitmap
if Jet::MouseSystem::DEV_OUTLINE
@outline = Sprite.new(nil)
@outline.bitmap = Bitmap.new(32, 32)
@outline.bitmap.fill_rect(0, 0, 32, 32, Color.new(0, 0, 0, 190))
@outline.bitmap.fill_rect(1, 1, 30, 30, Color.new(0, 0, 0, 0))
end
end
def initial_bitmap
begin
self.bitmap = Cache.picture(Jet::MouseSystem::CURSOR_IMAGE)
rescue
self.bitmap = Bitmap.new(24, 24)
icon_index = Jet::MouseSystem::CURSOR_ICON
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
self.bitmap.blt(0, 0, Cache.system("Iconset"), rect, 255)
end
self.bitmap.dup
end
def set_cursor(image)
if image.is_a?(Integer)
self.bitmap = Bitmap.new(24, 24)
icon_index = image
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
self.bitmap.blt(0, 0, Cache.system("Iconset"), rect, 255)
else
self.bitmap = Cache.picture(image)
end
end
def revert
self.bitmap = @bitmap_cache.dup
end
def update
super
self.x, self.y = *Mouse.pos
self.visible = !$game_switches[Jet::MouseSystem::TURN_MOUSE_OFF_SWITCH]
if !@outline.nil?
@outline.visible = SceneManager.scene_is?(Scene_Map)
x = Mouse.true_grid_by_pos[0] * 32
x -= $game_map.display_x.floor * 32
x -= ($game_map.display_x % 1) * 32
y = Mouse.true_grid_by_pos[1] * 32
y -= $game_map.display_y.floor * 32
y -= ($game_map.display_y % 1) * 32
@outline.x = x
@outline.y = [y, 1].max
end
end
end
end
Mouse.init
class << Input
alias jet5888_press? press?
def press?(arg)
if arg == Input::C
return true if Mouse.press?(1)
elsif arg == Input::B
return true if Mouse.press?(2)
end
jet5888_press?(arg)
end
alias jet5888_repeat? repeat?
def repeat?(arg)
if arg == Input::C
return true if Mouse.click?(1)
elsif arg == Input::B
return true if Mouse.click?(2)
end
jet5888_repeat?(arg)
end
alias jet5888_trigger? trigger?
def trigger?(arg)
if arg == Input::C
return true if Mouse.click?(1)
elsif arg == Input::B
return true if Mouse.click?(2)
end
jet5888_trigger?(arg)
end
if Jet::MouseSystem::DO_DIAGONAL_MOVEMENT
alias jet3845_dir8 dir8
def dir8(*args, &block)
if (orig = jet3845_dir8(*args, &block)) == 0
if !$game_temp.nil? && SceneManager.scene_is?(Scene_Map)
if !(a = $game_temp.mouse_character).nil? && a.movable?
if !$game_temp.mouse_path.nil? && !$game_temp.mouse_path.empty?
return $game_temp.mouse_path.shift
end
end
end
end
$game_temp.mouse_path = nil if !$game_temp.nil?
return orig
end
else
alias jet3845_dir4 dir4
def dir4(*args, &block)
if (orig = jet3845_dir4(*args, &block)) == 0
if !$game_temp.nil? && SceneManager.scene_is?(Scene_Map)
if !(a = $game_temp.mouse_character).nil? && a.movable?
if !$game_temp.mouse_path.nil? && !$game_temp.mouse_path.empty?
return $game_temp.mouse_path.shift
end
end
end
end
$game_temp.mouse_path = nil if !$game_temp.nil?
return orig
end
end
alias jet8432_update update
def update(*args, &block)
jet8432_update(*args, &block)
Mouse.update
end
end
class Window_Selectable
alias jet1084_update update
def update(*args, &block)
jet1084_update(*args, &block)
update_mouse if self.active && self.visible && Mouse.moved?
end
def update_mouse
return if $game_switches[Jet::MouseSystem::TURN_MOUSE_OFF_SWITCH]
orig_index = @index
rects = []
add_x = self.x + 16 - self.ox
add_y = self.y + 16 - self.oy
if !self.viewport.nil?
add_x += self.viewport.rect.x - self.viewport.ox
add_y += self.viewport.rect.y - self.viewport.oy
end
self.item_max.times {|i|
@index = i
mouse_update_cursor
rects << cursor_rect.dup
}
@index = orig_index
rects.each_with_index {|rect, i|
if Mouse.area?(rect.x + add_x, rect.y + add_y, rect.width, rect.height)
@index = i
end
}
update_cursor
call_update_help
end
def mouse_update_cursor
if @cursor_all
cursor_rect.set(0, 0, contents.width, row_max * item_height)
elsif @index < 0
cursor_rect.empty
else
cursor_rect.set(item_rect(@index))
end
end
end
class Window_NameInput
def item_max
90
end
end
class Scene_File
alias jet3467_update update
def update(*args, &block)
update_mouse if Mouse.moved?
jet3467_update(*args, &block)
end
alias jet7222_top_index top_index=
def top_index=(*args, &block)
@last_cursor_move = 0 if @last_cursor_move.nil?
@last_cursor_move -= 1
return if @last_cursor_move > 0 && Mouse.moved?
jet7222_top_index(*args, &block)
@last_cursor_move = 10
end
def update_mouse
self.item_max.times {|i|
ix = @savefile_windows[i].x
iy = @savefile_windows[i].y + 48 - @savefile_viewport.oy
iw = @savefile_windows[i].width
ih = @savefile_windows[i].height
if Mouse.area?(ix, iy, iw, ih)
@savefile_windows[@index].selected = false
@savefile_windows[i].selected = true
@index = i
end
}
ensure_cursor_visible
end
end
class Game_Temp
attr_accessor :mouse_character, :mouse_movement, :mouse_path
end
class Game_CharacterBase
def mouse_path(target_x, target_y, did_dir = false)
return if target_x == self.x && target_y == self.y
f = $game_map.find_path(target_x.to_i, target_y.to_i, @x.to_i, @y.to_i, self)
if f.empty? && !did_dir && Jet::MouseSystem::CHECK_FOR_MOVES
[[0, 1], [0, -1], [1, 0], [-1, 0]].each {|a|
next if !f.empty?
f = $game_map.find_path(target_x.to_i + a[0], target_y.to_i + a[1],
@x.to_i, @y.to_i, self)
}
end
$game_temp.mouse_path = f
end
end
class Game_Player
def move_by_input
return if !movable? || $game_map.interpreter.running?
dir = (Jet::MouseSystem::DO_DIAGONAL_MOVEMENT ? Input.dir8 : Input.dir4)
if dir % 2 == 0 || !Jet::MouseSystem::DO_DIAGONAL_MOVEMENT
move_straight(dir) if dir > 0 && dir % 2 == 0
else
horz = case dir; when 1,7; 4; when 3,9; 6; end
vert = case dir; when 7,9; 8; when 1,3; 2; end
move_diagonal(horz, vert)
end
end
alias jet3745_check_action_event check_action_event
def check_action_event(*args, &block)
return false unless Input.jet5888_trigger?(:C)
jet3745_check_action_event(*args, &block)
end
alias jet3745_get_on_off_vehicle get_on_off_vehicle
def get_on_off_vehicle(*args, &block)
if !Input.jet5888_trigger?(:C)
[:boat, :ship, :airship].each {|a|
if $game_map.send(a).pos?(*Mouse.true_grid)
jet3745_get_on_off_vehicle(*args, &block)
return
end
}
elsif Input.jet5888_trigger?(:C)
jet3745_get_on_off_vehicle(*args, &block)
end
end
def get_on_vehicle_mouse(veh)
return if vehicle
@vehicle_type = veh.type
if vehicle
turn_toward_character(veh)
@vehicle_getting_on = true
force_move_forward unless in_airship?
@followers.gather
end
@vehicle_getting_on
end
end
class Window_MousePopUp < Window_Base
def initialize(event, text)
rect = Bitmap.new(1, 1).text_size(text)
width = rect.width
height = rect.height
super(event.screen_x - width / 2, event.screen_y - 48, width + 32, height + 32)
self.opacity = 0
self.contents.font.name = Jet::HoverText::FONT
self.contents.font.color = Jet::HoverText::COLOR
self.contents.font.size = Jet::HoverText::SIZE
@text = text
@event = event
refresh
end
def refresh
contents.clear
draw_text(0, 0, contents.width, contents.height, @text)
end
def update
super
self.visible = !@event.erased? && Mouse.true_grid_by_pos == [@event.x, @event.y]
self.x = @event.screen_x - contents.width / 2 - 8
self.y = @event.screen_y - 64
end
end
class Game_Event
attr_accessor :text_box
def check_for_comment(regexp)
return false if empty?
for item in @list
if item.code == 108 or item.code == 408
if !item.parameters[0][regexp].nil?
return $1.nil? ? true : $1
end
end
end
return false
end
def mouse_empty?
return true if empty?
return @list.reject {|a| [108, 408].include?(a.code) }.size <= 1
end
alias jet3745_setup_page setup_page
def setup_page(*args, &block)
jet3745_setup_page(*args, &block)
@text_box = nil
@mouse_activated = nil
@mouse_cursor = nil
end
def mouse_activated?
@mouse_activated ||= check_for_comment(/MOUSE[ ]*CLICK/i)
end
def text_box
@text_box ||= (
if (a = check_for_comment(/MOUSE[ ]*TEXT[ ]*(.+)/i))
Window_MousePopUp.new(self, a)
else
false
end
)
end
def through
if $game_temp.mouse_movement && check_for_comment(/MOUSE[ ]*THROUGH/i)
true
else
super
end
end
def mouse_cursor
@mouse_cursor ||= (
if (a = check_for_comment(/MOUSE[ ]*PIC[ ]*(\d+)/i))
a.to_i
elsif (a = check_for_comment(/MOUSE[ ]*PIC[ ]*(.+)/i))
a
else
false
end
)
end
def erased?
@erased
end
def movable?
return false if moving?
return false if $game_message.busy? || $game_message.visible
return true
end
def check_mouse_change
if mouse_cursor
Mouse.set_cursor(@mouse_cursor)
return true
end
return false
end
alias jet3845_update update
def update(*args, &block)
jet3845_update(*args, &block)
@text_box.update if text_box
end
end
class Game_Vehicle
attr_reader :type
end
class Game_System
attr_accessor :mouse_movement
alias jet2735_initialize initialize
def initialize(*args, &block)
jet2735_initialize(*args, &block)
@mouse_movement = Jet::MouseSystem::ALLOW_MOUSE_MOVEMENT
end
end
class Game_Interpreter
def toggle_mouse_movement(bool)
$game_system.mouse_movement = bool
end
end
class Scene_Map
alias jet3745_update update
def update(*args, &block)
jet3745_update
check_mouse_movement
check_mouse_icon_change
end
alias jet5687_terminate terminate
def terminate(*args, &block)
$game_map.events.values.each {|a|
a.text_box.dispose if a.text_box
a.text_box = nil
}
Mouse.update
jet5687_terminate(*args, &block)
end
def mouse_char
$game_temp.mouse_character
end
def check_mouse_icon_change
changed_mouse = false
$game_map.events_xy(*Mouse.true_grid_by_pos).each {|event|
changed_mouse = changed_mouse || event.check_mouse_change
}
Mouse.revert_cursor unless changed_mouse
end
def check_mouse_movement
$game_temp.mouse_character ||= $game_player
if Mouse.click?(1)
dont_move = false
x, y = *Mouse.true_grid_by_pos
evs = $game_map.events_xy(x, y)
(evs + $game_map.vehicles).each {|event|
if event.is_a?(Game_Vehicle)
if (event.x - mouse_char.x).abs + (event.y - mouse_char.y).abs == 1
mouse_char.get_on_vehicle_mouse(event)
dont_move = true
end
elsif !!!mouse_char.vehicle
if event.mouse_activated?
event.start
dont_move = true
elsif (event.x - mouse_char.x).abs + (event.y - mouse_char.y).abs == 1
if !event.mouse_empty? && [0, 1, 2].include?(event.trigger)
mouse_char.turn_toward_character(event)
event.start
dont_move = true
end
else
{UP: [0, -1], DOWN: [0, 1], LEFT: [-1, 0], RIGHT: [1, 0]}.each {|d, a|
if event.check_for_comment(/MOUSE[ ]*MOVE[ ]*#{d.to_s}/i)
x += a[0]; y += a[1]
did_dir = true
end
}
end
end
} if $game_system.mouse_movement
if $game_system.mouse_movement
mouse_char.mouse_path(x, y, did_dir ||= false) unless dont_move
else
evs.each {|event|
if event.mouse_activated?
event.start
end
}
end
end
end
end
class Game_Map
class Astar
class PriorityQueue
def initialize
@list = []
end
def add(priority, item)
@list << [priority, @list.length, item]
@list.sort!
self
end
def <<(pritem)
add(*pritem)
end
def next
@list.shift[2]
end
def empty?
@list.empty?
end
end
def initialize(map)
@map = map
end
def do_find_path(goal, start, char)
been_there = {}
pqueue = PriorityQueue.new
pqueue << [1, [start, [], 1]]
iters = 0
while !pqueue.empty?
iters += 1
return [] if iters > Jet::Pathfinder::MAXIMUM_ITERATIONS
spot, path_so_far, cost_so_far = pqueue.next
next if been_there[spot]
newpath = [path_so_far, spot]
if (spot == goal)
path = []
newpath.flatten.each_slice(2) {|i,j| path << [i,j]}
return recreate_path(path)
end
been_there[spot] = 1
spotsfrom(spot, char).each {|newspot|
next if been_there[newspot]
newcost = cost_so_far + 1
pqueue << [newcost + estimate(newspot, goal), [newspot,newpath,newcost]]
}
end
return []
end
def estimate(spot, goal)
[(spot[0] - goal[0]).abs, (spot[1] - goal[1]).abs].max
end
def spotsfrom(spot, char)
neighbors = []
4.times {|i|
i += 1
new_x = @map.round_x_with_direction(spot[0], i * 2)
new_y = @map.round_y_with_direction(spot[1], i * 2)
next unless char.passable?(spot[0], spot[1], i * 2)
neighbors << [new_x, new_y]
}
if Jet::MouseSystem::DO_DIAGONAL_MOVEMENT
[2, 8].each {|a|
[4, 6].each {|b|
new_x = @map.round_x_with_direction(spot[0], b)
new_y = @map.round_y_with_direction(spot[1], a)
next unless char.diagonal_passable?(spot[0], spot[1], b, a)
neighbors << [new_x, new_y]
}
}
end
neighbors
end
def recreate_path(path)
rec_path = []
hash = {[1, 0] => 6, [-1, 0] => 4, [0, 1] => 2, [0, -1] => 8,
[-1, 1] => 1, [-1, -1] => 7, [1, 1] => 3, [1, -1] => 9}
until path.empty?
pos = path.shift
nex = path[0]
next if path.empty?
ar = [nex[0] <=> pos[0], nex[1] <=> pos[1]]
rec_path << hash[ar]
end
return rec_path
end
end
def find_path(t_x, t_y, x, y, char = $game_player)
@astar ||= Astar.new(self)
@astar.do_find_path([t_x, t_y], [x, y], char)
end
end
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: [résolu]Problème avec le script "mouse" de Jet
Mer 26 Mar 2014 - 16:47
Essaies peut être cette version :
http://pastebin.com/raw.php?i=K1hGYjr6
Je l'utilise également dans mon projet et beaucoup, je n'ai pas constaté ce soucis.
http://pastebin.com/raw.php?i=K1hGYjr6
Je l'utilise également dans mon projet et beaucoup, je n'ai pas constaté ce soucis.
- XandiarMembre
- Nombre de messages : 497
Age : 28
Localisation : Suisse
Distinction : aucune
Date d'inscription : 12/10/2013
Re: [résolu]Problème avec le script "mouse" de Jet
Mer 26 Mar 2014 - 17:25
Maintenant à chaque fois que je passe devant un évent, l'évente se déplace d'une case dans la même direction que moi xD.
Je comprend pas pourquoi ça fait sa. Je commence à a peine à apprendre le ruby, j'ai pas encore les connaissance suffisante pour corriger se bug :/
Je comprend pas pourquoi ça fait sa. Je commence à a peine à apprendre le ruby, j'ai pas encore les connaissance suffisante pour corriger se bug :/
- InvitéInvité
Re: [résolu]Problème avec le script "mouse" de Jet
Mer 26 Mar 2014 - 17:28
C'est eut etre dans la configuration de l'évènement, non ?
- XandiarMembre
- Nombre de messages : 497
Age : 28
Localisation : Suisse
Distinction : aucune
Date d'inscription : 12/10/2013
Re: [résolu]Problème avec le script "mouse" de Jet
Mer 26 Mar 2014 - 17:31
Non c'est pas sa, j'ai mis un évènement tout simple, complètement vide, j'ai juste mis un chara
- InvitéInvité
Re: [résolu]Problème avec le script "mouse" de Jet
Mer 26 Mar 2014 - 17:38
Je ne saurais pas te dire dans ce cas, désolée :/
- XandiarMembre
- Nombre de messages : 497
Age : 28
Localisation : Suisse
Distinction : aucune
Date d'inscription : 12/10/2013
Re: [résolu]Problème avec le script "mouse" de Jet
Mer 26 Mar 2014 - 17:39
Pas de soucis
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: [résolu]Problème avec le script "mouse" de Jet
Mer 26 Mar 2014 - 18:25
Tu as d'autres scripts dans ton projet ?
C'est vraiment très étrange ton bug, je n'ai jamais eu ce genre de problème.
C'est vraiment très étrange ton bug, je n'ai jamais eu ce genre de problème.
- XandiarMembre
- Nombre de messages : 497
Age : 28
Localisation : Suisse
Distinction : aucune
Date d'inscription : 12/10/2013
Re: [résolu]Problème avec le script "mouse" de Jet
Mer 26 Mar 2014 - 18:36
J'ai :
- une série de 7 scripts qui modifies mon menu
- un script qui permet au joueur de régler le volume du jeu
- le script de quête de Modern Algebra
- un script de Yanfly qui permet d'ajouter des truques dans les conversation
je ne vois pas lequel de ses script pourrais embêter :/
EDIT:
J'ai essayer, c'est un des scripts que j'utilise pour le menu qui fait ch*** >.<
EDIT 2:
C'est se script qui pose problème
- une série de 7 scripts qui modifies mon menu
- un script qui permet au joueur de régler le volume du jeu
- le script de quête de Modern Algebra
- un script de Yanfly qui permet d'ajouter des truques dans les conversation
je ne vois pas lequel de ses script pourrais embêter :/
EDIT:
J'ai essayer, c'est un des scripts que j'utilise pour le menu qui fait ch*** >.<
EDIT 2:
C'est se script qui pose problème
- Script:
- Code:
[color=#000000]#==============================================================================
# Hirion Engine - Core
# Author: Nicke
# Created: 22/10/2013
# Edited: 10/11/2013
# Version: 1.0b
#==============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#==============================================================================
# Required scripts (Added above this script):
# Hirion Engine - Settings
#==============================================================================
#
# Core script for Hirion Engine.
#
# *** Only for RPG Maker VX Ace. ***
#==============================================================================
($imported ||= {})["HIRION-ENGINE-CORE"] = true
# // Check if required scripts are imported properly.
ERROR.imported?("HIRION-ENGINE-SETTINGS", "Hirion Engine - Core")
# // Set graphic resolution.
Graphics.resize_screen(HIRION::SETTINGS::RESOLUTION[0], HIRION::SETTINGS::RESOLUTION[1])
# *** Don't edit below unless you know what you are doing. ***
#==============================================================================#
# ** String
#==============================================================================#
class String
def to_class(parent = Kernel)
# // Method to convert string to class.
chain = self.split "::"
klass = parent.const_get chain.shift
return chain.size < 1 ? (klass.is_a?(Class) ? klass : nil) : chain.join("::").to_class(klass)
rescue
nil
end
def slice_char(char)
# // Method to slice char.
self.split(char).map {|w| w.sub(char, " ") }.join(" ")
end
end
#==============================================================================#
# ** Numeric
#==============================================================================#
class Numeric
def round_to(places)
power = 10.0 ** places
(self * power).round / power
end
def percent_of(n)
self.to_f / n.to_f * 100.0
end
def percents
self * 100
end
end
#==============================================================================
# ** Vocab
#==============================================================================
class << Vocab
def create(name, value=nil, &block)
# // Method to create a new vocab method.
return if respond_to?(name)
if block_given?
define_method(name, &block)
else
define_method(name) { value }
end
module_function name
end
end
#==============================================================================
# ** Sound
#==============================================================================
class << Sound
def play(name, volume, pitch, type = :se)
# // Method to play a sound. If specified name isn't valid throw an error.
case type
when :se ; RPG::SE.new(name, volume, pitch).play rescue valid?(name)
when :me ; RPG::ME.new(name, volume, pitch).play rescue valid?(name)
when :bgm ; RPG::BGM.new(name, volume, pitch).play rescue valid?(name)
when :bgs ; RPG::BGS.new(name, volume, pitch).play rescue valid?(name)
end
end
def valid?(name)
# // Method to raise error if specified sound name is invalid.
raise("Unable to find sound file: #{name}")
exit
end
end
#==============================================================================#
# ** Game_BattlerBase
#==============================================================================#
class Game_BattlerBase
def exp_rate
# // Method to set exp rate.
x, x2 = exp.to_f - current_level_exp.to_f, next_level_exp.to_f - current_level_exp.to_f
return x / x2
end
end
#==============================================================================#
# ** Sprite_Particle
#==============================================================================#
class Sprite_Particle < Sprite
attr_reader :done
def initialize(particle, x, y, z, opacity, angle, blend_type)
# // Method to initialize sprite.
super()
self.bitmap = Cache.picture(particle)
self.x = x
self.y = y
self.z = z
self.ox = self.bitmap.width
self.oy = self.bitmap.height
self.blend_type = blend_type
@angle = angle
@opacity = opacity
@done = false
end
def update
# // Method to update sprite.
self.opacity -= @opacity
self.angle += rand(@angle)
if self.opacity <= 0
self.bitmap = nil
dispose
end
end
def dispose
# // Method to dispose sprite.
super
@done = true
end
end
#==============================================================================#
# ** Window_Base
#==============================================================================#
class Window_Base < Window
def center(type = :both)
# // Method to center the window.
case type
when :both
self.x = (Graphics.width - self.width) / 2
self.y = (Graphics.height - self.height) / 2
when :x
self.x = (Graphics.width - self.width) / 2
when :y
self.y = (Graphics.height - self.height) / 2
end
end
def draw_str(str, x, y, w, alg, f, sz, c, oc = Color.new(0,0,0,255), b = true, s = true, i = false)
# // Method to draw text.
contents.font.name = f
contents.font.size = sz
contents.font.color = c
contents.font.bold = b
contents.font.shadow = s
contents.font.italic = i
contents.font.out_color = oc
draw_text(x, y, w, calc_line_height(str), str, alg)
reset_font_settings
end
def draw_str_ex(str, x, y, f, sz, c, oc = Color.new(0,0,0,255), b = true, s = true, i = false)
# // Method to draw text ex.
contents.font.name = f
contents.font.size = sz
contents.font.color = c
contents.font.bold = b
contents.font.shadow = s
contents.font.italic = i
contents.font.out_color = oc
str = convert_escape_characters(str)
pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(str)}
process_character(str.slice!(0, 1), str, pos) until str.empty?
reset_font_settings
end
def draw_bar(x, y, width, height, rate, c1, c2, s1 = Color.new(255,255,255,128), s2 = Color.new(0,0,0,64))
# // Method to draw a bar gauge.
fill_w = ((width - 4) * rate).to_i
gauge_y = y + line_height - 8
contents.fill_rect(x, gauge_y, width, height, s1)
contents.fill_rect(x + 1, gauge_y + 1, width - 2, height - 2, s2)
contents.gradient_fill_rect(x + 2, gauge_y + 2, fill_w, height - 4, c1, c2)
end
def draw_bar_param(actor, x, y, width, param_id, font, bar_color1, bar_color2)
# // Method to draw actor bar parameters.
case param_id
when 2 ; param_rate = actor.param(2) / actor.param_max(2).to_f
when 3 ; param_rate = actor.param(3) / actor.param_max(3).to_f
when 4 ; param_rate = actor.param(4) / actor.param_max(4).to_f
when 5 ; param_rate = actor.param(5) / actor.param_max(5).to_f
when 6 ; param_rate = actor.param(6) / actor.param_max(6).to_f
when 7 ; param_rate = actor.param(7) / actor.param_max(7).to_f
end
draw_bar(x, y - 15, width, 20, param_rate, bar_color1, bar_color2)
param = "#{sprintf("%03d", actor.param(param_id))}"
draw_str(Vocab::param(param_id), x + 6, y, width, 0, font[0], font[1], font[2], font[3], font[4], font[5], font[6])
draw_str(param, x - 6, y, width, 2, font[0], font[1], font[2], font[3], font[4], font[5], font[6])
end
def draw_shadow_line(x, y, color, shadow, width = 2, height = 2, type = :h)
# // Method to draw line with a shadow.
case type
when :h
line_y = y + line_height / 2 - 1
contents.fill_rect(x, line_y, width, height, color)
line_y += 1
contents.fill_rect(x, line_y, width, height, shadow)
when :v
line_x = x + line_height / 2 - 1
contents.fill_rect(line_x, y, width, height, color)
line_x += 1
contents.fill_rect(line_x, y, width, height, shadow)
end
end
def draw_rect(x, y, width, height, color, shadow)
# // Method to draw a rectangle with shadow.
contents.fill_rect(x, y, width, height, color)
contents.fill_rect(x + 1, y + 1, width - 2, height - 2, shadow)
end
def draw_actor_stats(actor, stat, x, y, stat_x, stat_y, color1, color2, width, height, vocab, vocab_x, vocab_y, font)
# // Method to draw actor stats.
case stat
when :hp ; rate = actor.hp_rate ; values = [actor.hp, actor.mhp]
when :mp ; rate = actor.mp_rate ; values = [actor.mp, actor.mmp]
when :exp ; rate = actor.exp_rate ; values = [actor.exp, actor.next_level_exp]
when :tp ; rate = actor.tp_rate ; values = [actor.tp, actor.max_tp]
end
# // Draw guage.
draw_bar(x, y - 8, width, height, rate, color1, color2)
# // Draw stats and vocab.
str = "#{values[0]} / #{values[1]}"
draw_str(str, x + stat_x, y + stat_y, width, 1, font[0], font[1], font[2], font[3], font[4], font[5], font[6])
draw_str(vocab, x + vocab_x, y + vocab_y, width, 0, font[0], font[1], font[2], font[3], font[4], font[5], font[6])
end
def draw_scope(item, text, x, y, font, alg)
# // Method to draw scope for item.
case @text.scope
when 0 ; str = "None"
when 1 ; str = "Un ennemi"
when 2 ; str = "Tout les ennemis"
when 3 ; str = "Un ennemi aléatoire"
when 4 ; str = "Deux ennemis aléatoire"
when 5 ; str = "trois ennemis aléatoire"
when 6 ; str = "Quatre ennemis aléatoire"
when 7 ; str = "Un allié"
when 8 ; str = "Tout les alliés"
when 9 ; str = "Un allié mort"
when 10 ; str = "Tout les alliers mort"
when 11 ; str = "L'utilisateur"
end
draw_str("#{text} #{str}.", x, y, contents_width, alg, font[0], font[1], font[2], font[3], font[4], font[5], font[6])
end
def draw_occasion(item, text, x, y, font, alg)
# // Method to draw scope for item.
case @text.occasion
when 0 ; str = "Toujours"
when 1 ; str = "Uniquement en combat"
when 2 ; str = "Uniquement depuis le menu"
when 3 ; str = "Jamais"
end
draw_str("#{text} #{str}.", x, y, contents_width, alg, font[0], font[1], font[2], font[3], font[4], font[5], font[6])
end
def draw_icon_ex(icon_index, x, y, alpha)
# // Method to draw icon.
bitmap = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
contents.blt(x, y, bitmap, rect, alpha)
end
end # END OF FILE
#=*==========================================================================*=#
# ** END OF FILE
#=*==========================================================================*=#[/color]
Re: [résolu]Problème avec le script "mouse" de Jet
Sam 29 Mar 2014 - 13:02
Utilise cette version du Core de Nicke et tu n'auras pas de problème avec le Jet Mouse. Je les utilise depuis un moment déjà et ça fonctionne impec.
- Code:
#==============================================================================
# XaiL System - Core
# Author: Nicke
# Created: 07/01/2012
# Edited: 28/01/2013
# Version: 2.1e
#==============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#
# Core script for XaiL System.
# Caution! This needs to be located before any other XS scripts.
#
# *** Only for RPG Maker VX Ace. ***
#==============================================================================
($imported ||= {})["XAIL-XS-CORE"] = true
module Colors
#--------------------------------------------------------------------------#
# * Colors
#--------------------------------------------------------------------------#
White = Color.new(255,255,255)
LightRed = Color.new(255,150,150)
LightGreen = Color.new(150,255,150)
LightBlue = Color.new(150,150,255)
DarkYellow = Color.new(225,225,20)
Alpha = Color.new(0,0,0,128)
AlphaMenu = 100
end
module XAIL
module CORE
#--------------------------------------------------------------------------#
# * Settings
#--------------------------------------------------------------------------#
# Graphics.resize_screen(width, height )
Graphics.resize_screen(544, 416)
# FONT DEFAULTS:
Font.default_name = ["Augusta"]
Font.default_size = 18
Font.default_bold = true
Font.default_italic = false
Font.default_shadow = false
Font.default_outline = true
Font.default_color = Colors::White
Font.default_out_color = Colors::Alpha
# USE_TONE = true/false:
# Window tone for all windows ingame. Default: true.
USE_TONE = false
# SAVE
SAVE_MAX = 6 # Default 16.
SAVE_FILE_VIS = 4 # Default 4.
# JAPANESE = true/false
JAPANESE = false
end
end
# *** Don't edit below unless you know what you are doing. ***
#==============================================================================#
# ** Game_System
#==============================================================================#
class Game_System
# // Method to determine japanese game.
def japanese? ; return XAIL::CORE::JAPANESE ; end
end
#==============================================================================#
# ** String
#==============================================================================#
class String
def to_class(parent = Kernel)
# // Method to convert string to class.
chain = self.split "::"
klass = parent.const_get chain.shift
return chain.size < 1 ? (klass.is_a?(Class) ? klass : nil) : chain.join("::").to_class(klass)
rescue
nil
end
def cap_words
# // Method to capitalize every word.
self.split(' ').map {|w| w.capitalize }.join(' ')
end
def slice_char(char)
# // Method to slice char.
self.split(char).map {|w| w.sub(char, " ") }.join(" ")
end
end
#==============================================================================#
# ** Vocab
#==============================================================================#
class << Vocab
def xparam(id)
# // Method to return xparam name.
case id
when 0 ; "Hit Chance"
when 1 ; "Evasion"
when 2 ; "Critical Chance"
when 3 ; "Critical Evasion"
when 4 ; "Magic Evasion"
when 5 ; "Magic Reflection"
when 6 ; "Counter Attack"
when 7 ; "HP Regeneration"
when 8 ; "MP Regeneration"
when 9 ; "TP Regeneration"
end
end
end
#==============================================================================
# ** Sound
#==============================================================================
class << Sound
def play(name, volume, pitch, type = :se)
# // Method to play a sound. If specified name isn't valid throw an error.
case type
when :se ; RPG::SE.new(name, volume, pitch).play rescue valid?(name)
when :me ; RPG::ME.new(name, volume, pitch).play rescue valid?(name)
when :bgm ; RPG::BGM.new(name, volume, pitch).play rescue valid?(name)
when :bgs ; RPG::BGS.new(name, volume, pitch).play rescue valid?(name)
end
end
def valid?(name)
# // Method to raise error if specified sound name is invalid.
msgbox("Error. Unable to find sound file: " + name)
exit
end
end
#==============================================================================
# ** DataManager
#==============================================================================
class << DataManager
def savefile_max
# // Method override, save file max.
return XAIL::CORE::SAVE_MAX
end
end
#==============================================================================
# ** DataManager
#==============================================================================
class << SceneManager
def call_ext(scene_class, args = nil)
# // Method to call a scene with arguments.
@stack.push(@scene)
@scene = scene_class.new(args)
end
end
#==============================================================================
# ** Scene_File
#==============================================================================
class Scene_File < Scene_MenuBase
def visible_max
# // Method override, visible_max for save files.
return XAIL::CORE::SAVE_FILE_VIS
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# Importing font fix that will remove weird characters.
# Adding new methods such as new gauge, actor param, font text, icon drawing,
# big icon drawing and a line with a shadow.
#==============================================================================
class Window_Base < Window
# // Importing Custom font fix. (Credit Lone Wolf).
alias :process_normal_character_vxa :process_normal_character
def process_normal_character(c, pos)
return unless c >= ' '
process_normal_character_vxa(c, pos)
end unless method_defined? :process_normal_character
def draw_text_ex_no_reset(x, y, text)
# // Method to draw ex text without resetting the font.
text = convert_escape_characters(text)
pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
process_character(text.slice!(0, 1), text, pos) until text.empty?
end
alias xail_core_winbase_upt_tone update_tone
def update_tone(*args, &block)
# // Method to change tone of the window.
return unless XAIL::CORE::USE_TONE
xail_core_winbase_upt_tone(*args, &block)
end
def draw_gauge_ex(x, y, width, height, rate, color1, color2)
# // Method to draw a gauge.
fill_w = (width * rate).to_i
gauge_y = y + line_height - 8
contents.fill_rect(x, gauge_y, width + 1, height + 1, Color.new(255,255,255,64))
contents.fill_rect(x, gauge_y, width, height, Color.new(0,0,0,100))
contents.gradient_fill_rect(x, gauge_y, fill_w, height, color1, color2)
end
def draw_actor_param_gauge(actor, x, y, width, param_id, font, size, bar_color1, bar_color2, txt_color1, txt_color2)
# // Method to draw actor parameters with a gauge.
case param_id
when 2 ; param_rate = actor.param(2) / actor.param_max(2).to_f
when 3 ; param_rate = actor.param(3) / actor.param_max(3).to_f
when 4 ; param_rate = actor.param(4) / actor.param_max(4).to_f
when 5 ; param_rate = actor.param(5) / actor.param_max(5).to_f
when 6 ; param_rate = actor.param(6) / actor.param_max(6).to_f
when 7 ; param_rate = actor.param(7) / actor.param_max(7).to_f
end
contents.font.name = font
contents.font.size = size
contents.font.bold = true
contents.font.shadow = false
draw_gauge_ex(x, y - 14, width, 20, param_rate, bar_color1, bar_color2)
contents.font.color = txt_color1
draw_text(x + 10, y, 120, line_height, Vocab::param(param_id))
contents.font.color = txt_color2
draw_text(x + width - 38, y, 36, line_height, actor.param(param_id), 2)
reset_font_settings
end
def draw_actor_xparam_gauge(actor, x, y, width, xparam_id, font, size, bar_color1, bar_color2, txt_color1, txt_color2)
# // Method to draw actor xparameters with a gauge.
case xparam_id
when 0
xparam_rate = actor.xparam(0) / 100.to_f
xparam_name = Vocab.xparam(0)
when 1
xparam_rate = actor.xparam(1) / 100.to_f
xparam_name = Vocab.xparam(1)
when 2
xparam_rate = actor.xparam(2) / 100.to_f
xparam_name = Vocab.xparam(2)
when 3
xparam_rate = actor.xparam(3) / 100.to_f
xparam_name = Vocab.xparam(3)
when 4
xparam_rate = actor.xparam(4) / 100.to_f
xparam_name = Vocab.xparam(4)
when 5
xparam_rate = actor.xparam(5) / 100.to_f
xparam_name = Vocab.xparam(5)
when 6
xparam_rate = actor.xparam(6) / 100.to_f
xparam_name = Vocab.xparam(6)
when 7
xparam_rate = actor.xparam(7) / 100.to_f
xparam_name = Vocab.xparam(7)
when 8
xparam_rate = actor.xparam(8) / 100.to_f
xparam_name = Vocab.xparam(8)
when 9
xparam_rate = actor.xparam(9) / 100.to_f
xparam_name = Vocab.xparam(9)
end
contents.font.name = font
contents.font.size = size
contents.font.bold = true
contents.font.shadow = false
draw_gauge_ex(x, y - 14, width, 20, xparam_rate, bar_color1, bar_color2)
contents.font.color = txt_color1
draw_text(x + 10, y, 120, line_height, xparam_name)
contents.font.color = txt_color2
draw_text(x + width - 38, y, 36, line_height, "#{actor.xparam(xparam_id)}%", 2)
reset_font_settings
end
def draw_line_ex(x, y, color, shadow)
# // Method to draw a line with a shadow.
line_y = y + line_height / 2 - 1
contents.fill_rect(x, line_y, contents_width, 2, color)
line_y += 1
contents.fill_rect(x, line_y, contents_width, 2, shadow)
end
def draw_icons(icons, alignment, x = 0, y = 0, offset_icon = [])
# // Method to draw icons in a horizonal or vertical alignment.
for i in icons
# // If included in offset do extra line_height.
for o in offset_icon
if i == o
y += line_height * 1 if alignment == :vertical
x += line_height * 1 if alignment == :horizontal
end
end
draw_icon(i.nil? ? nil : i, x.nil? ? 0 : x, y.nil? ? 0 : y) rescue nil
y += line_height if alignment == :vertical
x += line_height if alignment == :horizontal
next if i.nil?
end
end
def draw_big_icon(icon, x, y, width, height, opacity = 255)
# // Method to draw a big icon.
bitmap = Cache.system("Iconset")
rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
rect2 = Rect.new(x, y, width, height)
contents.stretch_blt(rect2, bitmap, rect, opacity)
end
def draw_font_text(text, x, y, width, alignment, font, size, color, bold = true, shadow = true)
# // Method to draw font text.
contents.font.name = font
contents.font.size = size
contents.font.color = color
contents.font.bold = bold
contents.font.shadow = shadow
contents.font.out_color = Color.new(0,0,0,255)
draw_text(x, y, width, calc_line_height(text), text, alignment)
reset_font_settings
end
def draw_font_text_ex(text, x, y, font, size, color, bold = true, shadow = true)
# // Method todraw font text. (Special)
contents.font.name = font
contents.font.size = size
contents.font.color = color
contents.font.bold = bold
contents.font.shadow = shadow
contents.font.out_color = Color.new(0,0,0,255)
text = convert_escape_characters(text)
pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
process_character(text.slice!(0, 1), text, pos) until text.empty?
reset_font_settings
end
end
#==============================================================================#
# ** Window_Selectable
#------------------------------------------------------------------------------
# Adding support for pageleft and pageright for window selectable.
#==============================================================================#
class Window_Selectable < Window_Base
def cursor_pageright ; end
def cursor_pageleft ; end
alias xail_core_winselect_process_cursor_move process_cursor_move
def process_cursor_move(*args, &block)
# // Method to process cursor movement.
xail_core_winselect_process_cursor_move(*args, &block)
cursor_pageright if !handle?(:pageright) && Input.trigger?(:RIGHT)
cursor_pageright if !handle?(:pageleft) && Input.trigger?(:LEFT)
end
alias xail_core_winselect_process_handling process_handling
def process_handling(*args, &block)
# // Method to process handling.
xail_core_winselect_process_handling(*args, &block)
return process_pageright if handle?(:pageright) && Input.trigger?(:RIGHT)
return process_pageleft if handle?(:pageleft) && Input.trigger?(:LEFT)
end
def process_pageright
# // Method to process page right.
Sound.play_cursor
Input.update
deactivate
call_handler(:pageright)
end
def process_pageleft
# // Method to process page left.
Sound.play_cursor
Input.update
deactivate
call_handler(:pageleft)
end
end
#==============================================================================#
# ** Window_Icon
#------------------------------------------------------------------------------
# New Window :: Window_Icon - A window for drawing icon(s).
#==============================================================================#
class Window_Icon < Window_Base
attr_accessor :enabled
attr_accessor :alignment
def initialize(x, y, window_width, hsize)
# // Method to initialize the icon window.
super(0, 0, window_width, window_height(hsize))
@icons = []
@index = 0
@enabled = true
@alignment = 0
refresh
end
def window_height(hsize)
# // Method to return the height.
fitting_height(hsize)
end
def refresh
# // Method to refresh the icon window.
contents.clear
end
def draw_cmd_icons(icons, index)
# // Draw all of the icons.
return if !@enabled
count = 0
for i in icons
align = 0
x = 110
next if i[index].nil?
case @alignment
when 1, 2 ; align = -110
end
draw_icon(i[index], x + align, 24 * count)
count += 1
break if (24 * count > height - 24)
end
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# Adding check item method to return a item based on the type.
#==============================================================================
class Game_Party < Game_Unit
def check_item?(item, type)
# // Method to return a item based on the type.
case type
when :items ; $data_items[item]
when :weapons ; $data_weapons[item]
when :armors ; $data_armors[item]
when :gold ; item
when :exp ; item
end
end
end
#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
# Adding methods to check for comments on events.
#==============================================================================
class Game_Event < Game_Character
def comment?(comment)
# // Method to check if comment is included in event.
unless empty? or @list.nil?
for evt in @list
if evt.code == 108 or evt.code == 408
if evt.parameters[0].include?(comment)
return true
end
end
end
end
return false
end
def comment_int?(comment)
# // Method to check for a integer in event.
unless empty? or @list.nil?
for evt in @list
if evt.code == 108 or evt.code == 408
if evt.parameters[0] =~ /<#{comment}:[ ]?(\d*)>?/
return ($1.to_i > 0 ? $1.to_i : 0)
end
end
end
end
end
def comment_string?(comment)
# // Method to check for a string in event.
unless empty? or @list.nil?
for evt in @list
if evt.code == 108 or evt.code == 408
if evt.parameters[0] =~ /<#{comment}:[ ]?(\w*)>?/
return $1.to_s
end
end
end
end
end
end # END OF FILE
#=*==========================================================================*=#
# ** END OF FILE
#=*==========================================================================*=#
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: [résolu]Problème avec le script "mouse" de Jet
Dim 30 Mar 2014 - 19:31
Ton problème est il résolu Xandiar ?
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|