Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #420 from RMEx/dev
Browse files Browse the repository at this point in the history
Version 1.4.1
  • Loading branch information
BastienDuplessier authored Aug 4, 2018
2 parents c8a5fb2 + 2be2deb commit ea89f56
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 24 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# RME Changelog

## Release (1.4.1)

### Bug fixes
- Fix `spritesheet_erase` and `spritesheets_clear` (@BastienDuplessier, reported by @Princesseuh)
- Fix `event_look_towards?` and `event_look_towards_event?` (@BastienDuplessier, reported by @Azvnrd)
- Fix `pixel_in_event?` and `pixel_in_player?` (@BastienDuplessier, reported by @acs-l)
- Fix `page_runnable?` (@BastienDuplessier, reported by @acs-l)
- Fix `event_move_with`, move is not repeatable anymore (@BastienDuplessier, reported by @Zer0xxxxx)
- Fix `invoke_event` which was stopping animations when called (@BastienDuplessier, reported by @YendaHusk)
- Fix `switch_tileset`, now does not reset ox/oy of events sprites (@BastienDuplessier, reported by @YendaHusk)

## Release (1.4.0)

### Additions
Expand Down
71 changes: 59 additions & 12 deletions RME.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#==============================================================================
# ** RME v1.4.0
# ** RME v1.4.1
#------------------------------------------------------------------------------
# With :
# xvw
Expand Down Expand Up @@ -72,7 +72,7 @@ class << self
# * Version
# * With RMEPackage, it's seems useless ?
#--------------------------------------------------------------------------
def version; define_version(1,4,0); end
def version; define_version(1,4,1); end
#--------------------------------------------------------------------------
# * define Version
#--------------------------------------------------------------------------
Expand Down Expand Up @@ -7168,6 +7168,13 @@ def release?(key = :mouse_left, pr = false)
return false unless k_sprite
k_sprite.release?(key, pr)
end
#--------------------------------------------------------------------------
# * Is pixel in sprite ?
#--------------------------------------------------------------------------
def pixel_in?(x, y, precise = false)
return false unless k_sprite
precise ? k_sprite.precise_in?(x, y) : k_sprite.in?(x, y)
end
end
#==============================================================================
# ** API
Expand Down Expand Up @@ -7538,10 +7545,12 @@ class << self
attr_accessor :light_emitter
attr_accessor :tone
attr_accessor :allow_overlap
attr_accessor :changing_graphics
attr_reader :id

alias_method :allow_overlap?, :allow_overlap
alias_method :rme_collide_with_characters?, :collide_with_characters?
alias_method :rme_set_graphic, :set_graphic
#--------------------------------------------------------------------------
# * Initialisation du Buzzer
#--------------------------------------------------------------------------
Expand Down Expand Up @@ -7570,6 +7579,7 @@ def initialize
@rect = Rect.new(0,0,0,0)
@sprite_index
init_tone
@changing_graphics = false
end

#--------------------------------------------------------------------------
Expand Down Expand Up @@ -7764,6 +7774,13 @@ def collide_with_characters?(x, y)
return false if allow_overlap?
rme_collide_with_characters?(x, y)
end
#--------------------------------------------------------------------------
# * Change Graphics
#--------------------------------------------------------------------------
def set_graphic(character_name, character_index)
rme_set_graphic(character_name, character_index)
@changing_graphics = true
end

end

Expand Down Expand Up @@ -7997,8 +8014,14 @@ def initialize(viewport, character = nil)
#--------------------------------------------------------------------------
def set_character_bitmap
rm_extender_set_character_bitmap
character.ox = self.ox
character.oy = self.oy
if character.changing_graphics || (character.ox.nil? && character.oy.nil?)
character.ox = self.ox
character.oy = self.oy
else
self.ox = character.ox
self.oy = character.oy
end
character.changing_graphics = false
@old_buzz = 0
@origin_len_x = self.zoom_x
end
Expand Down Expand Up @@ -8843,6 +8866,12 @@ def refresh_message
@message_window.dispose
@message_window = Window_Message.new
end
#--------------------------------------------------------------------------
# * Add Event sprite into spriteset
#--------------------------------------------------------------------------
def add_event_sprite(event)
@spriteset.add_event_sprite(event)
end

#--------------------------------------------------------------------------
# * Update All Windows
Expand Down Expand Up @@ -9164,14 +9193,15 @@ def add_event(map_id, event_id, new_id,x=nil,y=nil)
return unless event
event.id = new_id
clone_events = @events.clone
clone_events.store(new_id, Game_Event.new(@map_id, event))
new_event = Game_Event.new(@map_id, event)
clone_events.store(new_id, new_event)
x ||= event.x
y ||= event.y
@events = clone_events
@events[new_id].moveto(x, y)
@need_refresh = true
@max_event_id = [@max_event_id, new_id].max
SceneManager.scene.refresh_spriteset
SceneManager.scene.add_event_sprite(new_event)
end
#--------------------------------------------------------------------------
# * Clear parallaxes
Expand Down Expand Up @@ -9954,6 +9984,14 @@ def show(name, rows, columns, index, origin, x, y, zoom_x, zoom_y, opacity, blen
self.current = index
@dirty = true
end
#--------------------------------------------------------------------------
# * Erase Picture
#--------------------------------------------------------------------------
def erase
super
@dirty = true
end

end

#==============================================================================
Expand Down Expand Up @@ -10204,6 +10242,13 @@ def update_parallax
end
rm_extender_update_parallax
end
#--------------------------------------------------------------------------
# * Add Event Sprite to Characters
#--------------------------------------------------------------------------
def add_event_sprite(event)
sp = Sprite_Character.new(@viewport1, event)
@character_sprites.push(sp)
end
end

#==============================================================================
Expand Down Expand Up @@ -11580,7 +11625,7 @@ def get_tileset_id
end

def switch_tileset(tileset_id)
$game_map.tileset_id = tileset_id
$game_map.change_tileset(tileset_id)
end

def set_tile(value, x, y, layer)
Expand Down Expand Up @@ -12850,7 +12895,7 @@ def fresh_event_id(erased = false)
#--------------------------------------------------------------------------
def page_runnable?(map_id, ev_id, page, context=false)
return unless self.class == Game_Interpreter
page = Game_Interpreter.get_page(map_id, ev_id, p_id) if page.is_a?(Fixnum)
page = Game_Interpreter.get_page(map_id, ev_id, page) if page.is_a?(Fixnum)
return unless page
return Game_Interpreter.conditions_met?(map_id, ev_id, page) if context
c_map_id = Game_Interpreter.current_map_id
Expand Down Expand Up @@ -13461,13 +13506,13 @@ def event_look_towards?(source, x, y, scope)
ex, ey = event_x(source), event_y(source)
case event_direction(source)
when Direction::UP
distance = ey - y
x_axis = (ex >= x - distance) && (ex <= x + distance)
y_axis = ey > y
when Direction::DOWN
distance = y - ey
x_axis = (ex >= x - distance) && (ex <= x + distance)
y_axis = ey < y
when Direction::DOWN
distance = ey - y
x_axis = (ex >= x - distance) && (ex <= x + distance)
y_axis = ey > y
when Direction::LEFT
distance = ex - x
x_axis = ex > x
Expand Down Expand Up @@ -13828,7 +13873,9 @@ def player_opacity(value = nil)

def event_move_with(id, *code)
route = RPG::MoveRoute.new
route.repeat = false
route.list = code.map {|i| RPG::MoveCommand.new(i)}
route.list << RPG::MoveCommand.new(0)
event(id).force_move_route(route)
end

Expand Down
14 changes: 8 additions & 6 deletions src/Commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def get_tileset_id
end

def switch_tileset(tileset_id)
$game_map.tileset_id = tileset_id
$game_map.change_tileset(tileset_id)
end

def set_tile(value, x, y, layer)
Expand Down Expand Up @@ -1491,7 +1491,7 @@ def fresh_event_id(erased = false)
#--------------------------------------------------------------------------
def page_runnable?(map_id, ev_id, page, context=false)
return unless self.class == Game_Interpreter
page = Game_Interpreter.get_page(map_id, ev_id, p_id) if page.is_a?(Fixnum)
page = Game_Interpreter.get_page(map_id, ev_id, page) if page.is_a?(Fixnum)
return unless page
return Game_Interpreter.conditions_met?(map_id, ev_id, page) if context
c_map_id = Game_Interpreter.current_map_id
Expand Down Expand Up @@ -2102,13 +2102,13 @@ def event_look_towards?(source, x, y, scope)
ex, ey = event_x(source), event_y(source)
case event_direction(source)
when Direction::UP
distance = ey - y
x_axis = (ex >= x - distance) && (ex <= x + distance)
y_axis = ey > y
when Direction::DOWN
distance = y - ey
x_axis = (ex >= x - distance) && (ex <= x + distance)
y_axis = ey < y
when Direction::DOWN
distance = ey - y
x_axis = (ex >= x - distance) && (ex <= x + distance)
y_axis = ey > y
when Direction::LEFT
distance = ex - x
x_axis = ex > x
Expand Down Expand Up @@ -2469,7 +2469,9 @@ def player_opacity(value = nil)

def event_move_with(id, *code)
route = RPG::MoveRoute.new
route.repeat = false
route.list = code.map {|i| RPG::MoveCommand.new(i)}
route.list << RPG::MoveCommand.new(0)
event(id).force_move_route(route)
end

Expand Down
53 changes: 49 additions & 4 deletions src/EvEx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,13 @@ def release?(key = :mouse_left, pr = false)
return false unless k_sprite
k_sprite.release?(key, pr)
end
#--------------------------------------------------------------------------
# * Is pixel in sprite ?
#--------------------------------------------------------------------------
def pixel_in?(x, y, precise = false)
return false unless k_sprite
precise ? k_sprite.precise_in?(x, y) : k_sprite.in?(x, y)
end
end
#==============================================================================
# ** API
Expand Down Expand Up @@ -1428,10 +1435,12 @@ class << self
attr_accessor :light_emitter
attr_accessor :tone
attr_accessor :allow_overlap
attr_accessor :changing_graphics
attr_reader :id

alias_method :allow_overlap?, :allow_overlap
alias_method :rme_collide_with_characters?, :collide_with_characters?
alias_method :rme_set_graphic, :set_graphic
#--------------------------------------------------------------------------
# * Initialisation du Buzzer
#--------------------------------------------------------------------------
Expand Down Expand Up @@ -1460,6 +1469,7 @@ def initialize
@rect = Rect.new(0,0,0,0)
@sprite_index
init_tone
@changing_graphics = false
end

#--------------------------------------------------------------------------
Expand Down Expand Up @@ -1654,6 +1664,13 @@ def collide_with_characters?(x, y)
return false if allow_overlap?
rme_collide_with_characters?(x, y)
end
#--------------------------------------------------------------------------
# * Change Graphics
#--------------------------------------------------------------------------
def set_graphic(character_name, character_index)
rme_set_graphic(character_name, character_index)
@changing_graphics = true
end

end

Expand Down Expand Up @@ -1887,8 +1904,14 @@ def initialize(viewport, character = nil)
#--------------------------------------------------------------------------
def set_character_bitmap
rm_extender_set_character_bitmap
character.ox = self.ox
character.oy = self.oy
if character.changing_graphics || (character.ox.nil? && character.oy.nil?)
character.ox = self.ox
character.oy = self.oy
else
self.ox = character.ox
self.oy = character.oy
end
character.changing_graphics = false
@old_buzz = 0
@origin_len_x = self.zoom_x
end
Expand Down Expand Up @@ -2733,6 +2756,12 @@ def refresh_message
@message_window.dispose
@message_window = Window_Message.new
end
#--------------------------------------------------------------------------
# * Add Event sprite into spriteset
#--------------------------------------------------------------------------
def add_event_sprite(event)
@spriteset.add_event_sprite(event)
end

#--------------------------------------------------------------------------
# * Update All Windows
Expand Down Expand Up @@ -3054,14 +3083,15 @@ def add_event(map_id, event_id, new_id,x=nil,y=nil)
return unless event
event.id = new_id
clone_events = @events.clone
clone_events.store(new_id, Game_Event.new(@map_id, event))
new_event = Game_Event.new(@map_id, event)
clone_events.store(new_id, new_event)
x ||= event.x
y ||= event.y
@events = clone_events
@events[new_id].moveto(x, y)
@need_refresh = true
@max_event_id = [@max_event_id, new_id].max
SceneManager.scene.refresh_spriteset
SceneManager.scene.add_event_sprite(new_event)
end
#--------------------------------------------------------------------------
# * Clear parallaxes
Expand Down Expand Up @@ -3844,6 +3874,14 @@ def show(name, rows, columns, index, origin, x, y, zoom_x, zoom_y, opacity, blen
self.current = index
@dirty = true
end
#--------------------------------------------------------------------------
# * Erase Picture
#--------------------------------------------------------------------------
def erase
super
@dirty = true
end

end

#==============================================================================
Expand Down Expand Up @@ -4094,6 +4132,13 @@ def update_parallax
end
rm_extender_update_parallax
end
#--------------------------------------------------------------------------
# * Add Event Sprite to Characters
#--------------------------------------------------------------------------
def add_event_sprite(event)
sp = Sprite_Character.new(@viewport1, event)
@character_sprites.push(sp)
end
end

#==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/SDK.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class << self
# * Version
# * With RMEPackage, it's seems useless ?
#--------------------------------------------------------------------------
def version; define_version(1,4,0); end
def version; define_version(1,4,1); end
#--------------------------------------------------------------------------
# * define Version
#--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/package.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Package description
Package.new(
name: 'RME',
version: vsn(1, 4, 0),
version: vsn(1, 4, 1),
authors: {
'xvw' => '[email protected]',
'Grim' => '[email protected]',
Expand Down

0 comments on commit ea89f56

Please sign in to comment.