Jump to content
NoctisFalco

ISWorldObjectContextMenu.onFitness function checks ISFishingUI instance

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

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...