runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpState.java
/**
	 * Updates a skill with the current known XP.
	 * When the result of this operation is XpUpdateResult.UPDATED, the UI should be updated accordingly.
	 * This is to distinguish events that reload all the skill's current values (such as world hopping)
	 * and also first-login when the skills are not initialized (the start XP will be -1 in this case).
	 * @param skill Skill to update
	 * @param currentXp Current known XP for this skill
	 * @return Whether or not the skill has been initialized, there was no change, or it has been updated
	 */
Updates a skill with the current known XP.
When the result of this operation is XpUpdateResult.UPDATED, the UI should be updated accordingly.
This is to distinguish events that reload all the skill's current values (such as world hopping)
and also first-login when the skills are not initialized (the start XP will be -1 in this case).
@param skill Skill to update
@param currentXp Current known XP for this skill
@return Whether or not the skill has been initialized, there was no change, or it has been updated
Updates a skill with the current known XP . When the result of this operation is XpUpdateResult . UPDATED the UI should be updated accordingly . This is to distinguish events that reload all the skill ' s current values ( such as world hopping ) and also first - login when the skills are not initialized ( the start XP will be - 1 in this case ) . @param skill Skill to update @param currentXp Current known XP for this skill @return Whether or not the skill has been initialized there was no change or it has been updated
XpUpdateResult updateSkill(Skill skill, int currentXp)
	{
		XpStateSingle state = getSkill(skill);
		if (state.getStartXp() == -1)
		{
			if (currentXp > 0)
			{
				initializeSkill(skill, currentXp);
				return XpUpdateResult.INITIALIZED;
			}
			else
			{
				return XpUpdateResult.NO_CHANGE;
			}
		}
		else
		{
			int startXp = state.getStartXp();
			int gainedXp = state.getXpGained();
			if (startXp + gainedXp > currentXp)
			{
				initializeSkill(skill, currentXp);
				return XpUpdateResult.INITIALIZED;
			}
			else
			{
				return state.update(currentXp) ? XpUpdateResult.UPDATED : XpUpdateResult.NO_CHANGE;
			}
		}
	}
XpUpdateResult updateSkill ( Skill skill , int currentXp ) { XpStateSingle state = getSkill ( skill ) ; if ( state . getStartXp ( ) == - 1 ) { if ( currentXp > 0 ) { initializeSkill ( skill , currentXp ) ; return XpUpdateResult . INITIALIZED ; } else { return XpUpdateResult . NO_CHANGE ; } } else { int startXp = state . getStartXp ( ) ; int gainedXp = state . getXpGained ( ) ; if ( startXp + gainedXp > currentXp ) { initializeSkill ( skill , currentXp ) ; return XpUpdateResult . INITIALIZED ; } else { return state . update ( currentXp ) ? XpUpdateResult . UPDATED : XpUpdateResult . NO_CHANGE ; } } }
Updates a skill with the current known XP.
Updates a skill with the current known XP .
// Reinitialize with lesser currentXp, this can happen with negative xp lamps