Jump to content

ISWorldObjectContextMenu.onFitness function checks ISFishingUI instance


NoctisFalco

Recommended Posts

ISWorldObjectContextMenu.onFitness function duplicates the first lines from ISWorldObjectContextMenu.onFishing. I suppose it was a copy-paste and shouldn't be like that, right?

ISWorldObjectContextMenu.onFishing = function(worldobjects, player)
	if ISFishingUI.instance and ISFishingUI.instance[player:getPlayerNum()+1] then
		ISFishingUI.instance[player:getPlayerNum()+1]:removeFromUIManager();
	end
	local modal = ISFishingUI:new(0,0, 450, 270, player, worldobjects[1]);
	modal:initialise()
	modal:addToUIManager()
	if JoypadState.players[player:getPlayerNum()+1] then
		setJoypadFocus(player:getPlayerNum(), modal)
	end
end

ISWorldObjectContextMenu.onFitness = function(worldobjects, player)
	if ISFishingUI.instance and ISFishingUI.instance[player:getPlayerNum()+1] then
		ISFishingUI.instance[player:getPlayerNum()+1]:removeFromUIManager();
	end
	if ISFitnessUI.instance and ISFitnessUI.instance[player:getPlayerNum()+1] and ISFitnessUI.instance[player:getPlayerNum()+1]:isVisible() then
		return;
	end
	local modal = ISFitnessUI:new(0,0, 600, 350, player);
	modal:initialise()
	modal:addToUIManager()
	if JoypadState.players[player:getPlayerNum()+1] then
		setJoypadFocus(player:getPlayerNum(), modal)
	end
end

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...