View Single Post
12/22/15, 05:10 PM   #18
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by Wandamey View Post
there is an example in votan's answer,I colored it, you'll have to temper with it a bit, he uses the var dirty to even tell if it was necessary to update or not. Now that your counting function is shortened to a minimum, you can run it each time you open the map.





maybe try this instead
but as I said, i can't test it and i'm the queen of typos. good luck

Code:
local function WorldMapStateChanged(oldState, newState)
    if (newState == SCENE_FRAGMENT_SHOWING) then
	UpdateBaitsCountFunction()
   end
end



WORLD_MAP_SCENE:RegisterCallback("StateChange", WorldMapStateChanged)
GAMEPAD_WORLD_MAP_SCENE:RegisterCallback("StateChange", WorldMapStateChanged)

Edit : and still a super slow typer.

It's not map change, it's Scene State change . just try it. or i'll check another example with the standard scene manager.

But anyway it's time for me to call it a day, and soon circonian will be there and make us all look like unwiped kids with a one line function that does everything you always dreamt of and even more.
I tried using the
Code:
local function WorldMapStateChanged(oldState, newState)
    if (newState == SCENE_FRAGMENT_SHOWING) then
	UpdateBaitsCountFunction()
   end
end



WORLD_MAP_SCENE:RegisterCallback("StateChange", WorldMapStateChanged)
GAMEPAD_WORLD_MAP_SCENE:RegisterCallback("StateChange", WorldMapStateChanged)
I fired up the game, checked the amount of bait by opening the map and pointed to a fishing pin.
I then closed the map and started fishing.
After catching one fish, I opened the map again and pointed to the fishing pin.
It still showed the same number as before.
BUT... After I zoomed to a city map and back out THEN it showed to correct amount.
So... Seems like it doesn't update when I need it to
  Reply With Quote