parameters: ()
return_statement: return
docstring: Saves the new HLAs and closes the HLA selection window.
docstring_summary: Saves the new HLAs and closes the HLA selection window.
docstring_tokens: Saves the new HLAs and closes the HLA selection window .
function: def HLADonePress ():
  	"""Saves the new HLAs and closes the HLA selection window."""
  
  	# save all of our HLAs
  	for i in range (len (HLANewAbilities)):
  		# see if we're going to learn this ability
  		if HLANewAbilities[i] == 0:
  			continue
  
  		# figure out the ability type
  		HLARef = HLAAbilities[i][0]
  		HLAType = HLARef[5:7]
  		if HLAType == "PR":
  			HLAType = IE_SPELL_TYPE_PRIEST
  			HLALevel = int(HLARef[7])-1
  		elif HLAType == "WI":
  			HLAType = IE_SPELL_TYPE_WIZARD
  			HLALevel = int(HLARef[7])-1
  		else:
  			HLAType = IE_SPELL_TYPE_INNATE
  			HLALevel = 0
  
  		# do we need to apply or learn it?
  		if HLARef[:2] == "AP":
  			GemRB.ApplySpell(pc, HLARef[3:])
  		elif HLARef[:2] == "GA":
  			# learn it or memorize another one
  			Spellbook.LearnSpell (pc, HLARef[3:], HLAType, HLALevel, 1, LS_MEMO)
  
  		#save the number of this HLA memorized
  		#TODO: check param2 (0 seems to work ok)
  		GemRB.ApplyEffect(pc, "HLA", HLAAbilities[i][2], 0, HLARef[3:])
  
  	# close the window
  	if HLAWindow:
  		HLAWindow.Unload ()
  
  	# so redraw skills knows we're done
  	GemRB.SetVar ("HLACount", 0)
  
  	return
function_tokens: def HLADonePress ( ) : # save all of our HLAs for i in range ( len ( HLANewAbilities ) ) : # see if we're going to learn this ability if HLANewAbilities [ i ] == 0 : continue # figure out the ability type HLARef = HLAAbilities [ i ] [ 0 ] HLAType = HLARef [ 5 : 7 ] if HLAType == "PR" : HLAType = IE_SPELL_TYPE_PRIEST HLALevel = int ( HLARef [ 7 ] ) - 1 elif HLAType == "WI" : HLAType = IE_SPELL_TYPE_WIZARD HLALevel = int ( HLARef [ 7 ] ) - 1 else : HLAType = IE_SPELL_TYPE_INNATE HLALevel = 0 # do we need to apply or learn it? if HLARef [ : 2 ] == "AP" : GemRB . ApplySpell ( pc , HLARef [ 3 : ] ) elif HLARef [ : 2 ] == "GA" : # learn it or memorize another one Spellbook . LearnSpell ( pc , HLARef [ 3 : ] , HLAType , HLALevel , 1 , LS_MEMO ) #save the number of this HLA memorized #TODO: check param2 (0 seems to work ok) GemRB . ApplyEffect ( pc , "HLA" , HLAAbilities [ i ] [ 2 ] , 0 , HLARef [ 3 : ] ) # close the window if HLAWindow : HLAWindow . Unload ( ) # so redraw skills knows we're done GemRB . SetVar ( "HLACount" , 0 ) return