mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixes wearable sprite offset and layering issues when autoscrolling the map
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,6 @@ class Sprite_Wearable < RPG::Sprite
|
|||||||
attr_accessor :filename
|
attr_accessor :filename
|
||||||
attr_accessor :action
|
attr_accessor :action
|
||||||
attr_accessor :sprite
|
attr_accessor :sprite
|
||||||
attr_accessor :must_adjust_scroll
|
|
||||||
|
|
||||||
def initialize(player_sprite, filename, action, viewport)
|
def initialize(player_sprite, filename, action, viewport)
|
||||||
@player_sprite = player_sprite
|
@player_sprite = player_sprite
|
||||||
@@ -17,8 +16,6 @@ class Sprite_Wearable < RPG::Sprite
|
|||||||
@frameHeight = 80 #@sprite.height / 4
|
@frameHeight = 80 #@sprite.height / 4
|
||||||
@sprite.z = 0
|
@sprite.z = 0
|
||||||
@relative_z=0 #relative to player
|
@relative_z=0 #relative to player
|
||||||
@map_scrolled=false #true if the map has scrolled, false if centered on the player
|
|
||||||
@must_adjust_scroll = false #todo temp fix for weird pokemart scrolling glitch
|
|
||||||
echoln(_INTL("init had at z = {1}, player sprite at {2}",@sprite.z,@player_sprite.z))
|
echoln(_INTL("init had at z = {1}, player sprite at {2}",@sprite.z,@player_sprite.z))
|
||||||
|
|
||||||
#Unused position offset
|
#Unused position offset
|
||||||
@@ -32,24 +29,24 @@ class Sprite_Wearable < RPG::Sprite
|
|||||||
end
|
end
|
||||||
|
|
||||||
def adjustPositionForScreenScrolling
|
def adjustPositionForScreenScrolling
|
||||||
return if !$game_map.scrolling? && !(@map_scrolled && @must_adjust_scroll)
|
return if !$game_map.scrolling? && !@was_just_scrolling
|
||||||
if $game_player.isCentered()
|
if $game_map.scrolling?
|
||||||
@map_scrolled=false
|
@was_just_scrolling=true
|
||||||
return
|
else
|
||||||
|
@was_just_scrolling=false
|
||||||
end
|
end
|
||||||
@map_scrolled=true if @must_adjust_scroll
|
|
||||||
offset_x = 0
|
offset_x = 0
|
||||||
offset_y = 0
|
offset_y = 0
|
||||||
@sprite.z+=10
|
|
||||||
case $game_map.scroll_direction
|
case $game_map.scroll_direction
|
||||||
when DIRECTION_RIGHT
|
when DIRECTION_RIGHT
|
||||||
offset_x=-8
|
offset_x=-8
|
||||||
when DIRECTION_LEFT
|
when DIRECTION_LEFT
|
||||||
offset_x=8
|
offset_x=8
|
||||||
when DIRECTION_UP
|
when DIRECTION_UP
|
||||||
offset_y=16
|
offset_y=8
|
||||||
|
@sprite.z+=50 #weird layering glitch for some reason otherwise. It's reset to the correct value in the next animation frame
|
||||||
when DIRECTION_DOWN
|
when DIRECTION_DOWN
|
||||||
offset_y=-16
|
offset_y=-8
|
||||||
end
|
end
|
||||||
@sprite.x+=offset_x
|
@sprite.x+=offset_x
|
||||||
@sprite.y+=offset_y
|
@sprite.y+=offset_y
|
||||||
@@ -125,8 +122,8 @@ class Sprite_Wearable < RPG::Sprite
|
|||||||
current_frame = @player_sprite.character.pattern if !frame
|
current_frame = @player_sprite.character.pattern if !frame
|
||||||
direction = @player_sprite.character.direction
|
direction = @player_sprite.character.direction
|
||||||
crop_spritesheet(direction)
|
crop_spritesheet(direction)
|
||||||
set_sprite_position(@action, direction, current_frame)
|
|
||||||
adjust_layer()
|
adjust_layer()
|
||||||
|
set_sprite_position(@action, direction, current_frame)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(action, filename,color)
|
def update(action, filename,color)
|
||||||
|
|||||||
@@ -17,10 +17,6 @@ class Sprite_Player < Sprite_Character
|
|||||||
getClothedPlayerSprite(true)
|
getClothedPlayerSprite(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def toggleWearableScrollAdjustments(value)
|
|
||||||
@hair.must_adjust_scroll = value
|
|
||||||
@hat.must_adjust_scroll = value
|
|
||||||
end
|
|
||||||
|
|
||||||
def updateCharacterBitmap
|
def updateCharacterBitmap
|
||||||
skinTone = $Trainer.skin_tone ? $Trainer.skin_tone : 0
|
skinTone = $Trainer.skin_tone ? $Trainer.skin_tone : 0
|
||||||
|
|||||||
@@ -236,7 +236,6 @@ class PokemonMart_Scene
|
|||||||
|
|
||||||
def pbStartBuyOrSellScene(buying, stock, adapter)
|
def pbStartBuyOrSellScene(buying, stock, adapter)
|
||||||
# Scroll right before showing screen
|
# Scroll right before showing screen
|
||||||
$scene.spritesetGlobal.playersprite.toggleWearableScrollAdjustments(true) # todo temp
|
|
||||||
scroll_map()
|
scroll_map()
|
||||||
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
||||||
@viewport.z = 99999
|
@viewport.z = 99999
|
||||||
@@ -278,8 +277,6 @@ class PokemonMart_Scene
|
|||||||
@buying = buying
|
@buying = buying
|
||||||
pbRefresh
|
pbRefresh
|
||||||
Graphics.frame_reset
|
Graphics.frame_reset
|
||||||
$scene.spritesetGlobal.playersprite.toggleWearableScrollAdjustments(false) # todo temp
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbStartBuyScene(stock, adapter)
|
def pbStartBuyScene(stock, adapter)
|
||||||
@@ -590,6 +587,7 @@ class PokemonMartScreen
|
|||||||
@scene.pbStartBuyScene(@stock,@adapter)
|
@scene.pbStartBuyScene(@stock,@adapter)
|
||||||
item=nil
|
item=nil
|
||||||
loop do
|
loop do
|
||||||
|
pbWait(4)
|
||||||
item=@scene.pbChooseBuyItem
|
item=@scene.pbChooseBuyItem
|
||||||
break if !item
|
break if !item
|
||||||
quantity=0
|
quantity=0
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user