display soul shard fragments for destro warlocks #234


  • Enhancement
Closed
Assigned to parnic
  • Turducken_McNugget created this issue Jun 16, 2017

    I coded up the changes needed to have the partial soul shard count displayed in destro spec so that the player knows how close they are to their next shard.  The basic change is just to have shouldShowUnmodified set to true for destruction but there were two complications which arose in IceClassPowerCounter.prototype:UpdateRunePower that I had to work around which I did by adding two class values.

     

    The first problem was that a whole number of shards was displayed as an integer (3 instead of 3.0) and I feel like that is visually annoying as it swaps back and forth between integers and floats. So I added support for numericFormat value. If set it will be used to format the output string; otherwise we'll continue to just use tostring.

     

    The second was that ceil is used for the graphical representation so if you had 3.2 shards 4 crystals were lit. The change there is to replace ceil with self.round where round is a new class member defaulting to ceil.

     

    In shards.lua change from

    function ShardCounter.prototype:Enable(core)
    	if IceHUD.WowVer >= 70000 then
    		self.numRunes = UnitPowerMax(self.unit, self.unitPower)
    	end
    

     to

    function ShardCounter.prototype:Enable(core)
    	if IceHUD.WowVer >= 70000 then
    		self.numRunes = UnitPowerMax(self.unit, self.unitPower)
    		
    		if GetSpecialization() == SPEC_WARLOCK_DESTRUCTION then
    			self.shouldShowUnmodified = true
    			self.numericFormat = "%.1f"
    			self.round = floor
    		else
    			self.shouldShowUnmodified = nil
    			self.numericFormat = nil
    			self.round = nil
    		end
    	end

     

    In ClassPowerCounter.lua, at the top of the file,  add the following to the prototype default values

    IceClassPowerCounter.prototype.round = ceil

     

     

    In ClassPowerCounter.lua, in the function IceClassPowerCounter.prototype:UpdateRunePower, change from

    	if self:GetRuneMode() == "Numeric" or self.moduleSettings.alsoShowNumeric then
    		self.frame.numeric:SetText(tostring(percentReady))		
    		self.frame.numeric:SetTextColor(self:GetColor(self.numericColor))
    	end
    
    	if self:GetRuneMode() ~= "Numeric" then
    		for i=1, self.numRunes do
    			if i <= ceil(percentReady) then

     to

    	if self:GetRuneMode() == "Numeric" or self.moduleSettings.alsoShowNumeric then
    		if self.numericFormat then
    			self.frame.numeric:SetText(format("%.1f", percentReady))
    		else
    			self.frame.numeric:SetText(tostring(percentReady))
    		end
    		self.frame.numeric:SetTextColor(self:GetColor(self.numericColor))
    	end
    
    	if self:GetRuneMode() ~= "Numeric" then
    		for i=1, self.numRunes do
    			if i <= self.round(percentReady) then

     

     

     

  • Turducken_McNugget added a tag Enhancement Jun 16, 2017
  • Parnic self-assigned this issue Jun 17, 2017
  • Parnic closed issue Jun 17, 2017
  • Parnic posted a comment Jun 17, 2017

    Thanks! Pushed in commit aa55911


To post a comment, please login or register a new account.