mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixes quest icon lingering on map transfers
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -81,6 +81,14 @@ class Scene_Map
|
||||
$game_switches[SWITCH_ILEX_FOREST_SPOOKED_POKEMON] = false
|
||||
end
|
||||
|
||||
def clear_quest_icons()
|
||||
for sprite in $scene.spriteset.character_sprites
|
||||
if sprite.is_a?(Sprite_Character) && sprite.questIcon
|
||||
sprite.removeQuestIcon
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def transfer_player(cancelVehicles = true)
|
||||
reset_switches_for_map_transfer()
|
||||
$game_temp.player_transferring = false
|
||||
@@ -88,6 +96,7 @@ class Scene_Map
|
||||
autofade($game_temp.player_new_map_id)
|
||||
pbBridgeOff
|
||||
@spritesetGlobal.playersprite.clearShadows
|
||||
clear_quest_icons()
|
||||
if $game_map.map_id != $game_temp.player_new_map_id
|
||||
$MapFactory.setup($game_temp.player_new_map_id)
|
||||
end
|
||||
|
||||
@@ -507,4 +507,14 @@ def new_spritepack_was_released()
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_spritecharacter_for_event(event_id)
|
||||
for sprite in $scene.spriteset.character_sprites
|
||||
if sprite.character.id == event_id
|
||||
return sprite
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ QUESTS = {
|
||||
11 => Quest.new(11, "Powering the Lighthouse", "Catch some Voltorb to power up the lighthouse", QuestBranchHotels, "BW (43)", "Vermillion City", HotelQuestColor),
|
||||
"vermillion_3" => Quest.new("vermillion_3", "Seafood Cocktail ", "Get some steamed Krabby legs from the S.S. Anne's kitchen and bring them back to the hotel before they get cold", QuestBranchHotels, "BW (36)", "Vermillion City", HotelQuestColor),
|
||||
"vermillion_field_1" => Quest.new("vermillion_field_1", "Building Materials ", "Get some wooden planks from Viridian City and some Bricks from Pewter City.", QuestBranchField, "BW (36)", "Vermillion City", FieldQuestColor),
|
||||
64 => Quest.new(64, "Waiter on the Water", "The S.S. Anne waiter wants you to take restaurant orders while he went to get a replacement cake.", QuestBranchField, "BW (53)", "S.S. Anne", FieldQuestColor),
|
||||
"vermillion_field_2" => Quest.new("vermillion_field_2", "Waiter on the Water", "The S.S. Anne waiter wants you to take restaurant orders while he went to get a replacement cake.", QuestBranchField, "BW (53)", "S.S. Anne", FieldQuestColor),
|
||||
|
||||
#Celadon City
|
||||
14 => Quest.new(14, "Sun or Moon", "Show the Pokémon that Eevee evolves when exposed to a Moon or Sun stone to help the scientist with her research.", QuestBranchHotels, "BW (82)", "Celadon City", HotelQuestColor),
|
||||
@@ -203,6 +203,8 @@ def pbAcceptNewQuest(id, bubblePosition = 20, show_description=true)
|
||||
title = QUESTS[id].name
|
||||
description = QUESTS[id].desc
|
||||
showNewQuestMessage(title,description,show_description)
|
||||
character_sprite = get_spritecharacter_for_event(@event_id)
|
||||
character_sprite.removeQuestIcon if character_sprite
|
||||
|
||||
pbAddQuest(id)
|
||||
end
|
||||
@@ -238,6 +240,9 @@ def finishQuest(id, silent=false)
|
||||
pbSetQuest(id, true)
|
||||
|
||||
|
||||
character_sprite = get_spritecharacter_for_event(@event_id)
|
||||
character_sprite.removeQuestIcon if character_sprite
|
||||
|
||||
# character_sprite = $scene.spriteset.character_sprites[@event_id]
|
||||
# echoln character_sprite
|
||||
# if character_sprite
|
||||
|
||||
@@ -9,9 +9,9 @@ class Sprite_Character
|
||||
alias questIcon_init initialize
|
||||
def initialize(viewport, character = nil)
|
||||
questIcon_init(viewport,character)
|
||||
@quest_switch = detectQuestSwitch(character)
|
||||
if @quest_switch
|
||||
echoln "balablbi #{@quest_switch}"
|
||||
quest_id = detectQuestSwitch(character)
|
||||
if quest_id
|
||||
echoln "balablbi #{quest_id}"
|
||||
addQuestMarkerToSprite
|
||||
end
|
||||
end
|
||||
@@ -20,7 +20,7 @@ class Sprite_Character
|
||||
def update
|
||||
questIcon_update
|
||||
positionQuestIndicator if @questIcon
|
||||
removeQuestIcon if @questIcon && isQuestAlreadyAccepted?(@quest_switch)
|
||||
#removeQuestIcon if @questIcon && isQuestAlreadyAccepted?(@quest_switch)
|
||||
end
|
||||
|
||||
# Event name must contain questNPC(x) for a quest icon to be displayed
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user