Module:Sandbox/SkillTree: Difference between revisions

no edit summary
(on my evil arc)
No edit summary
Line 113: Line 113:
         ['width'] = '1000px', -- Adjust based on max width
         ['width'] = '1000px', -- Adjust based on max width
         ['height'] = (maxLevel + 1) * verticalSpacing .. 'px',  -- Adjust height dynamically
         ['height'] = (maxLevel + 1) * verticalSpacing .. 'px',  -- Adjust height dynamically
         ['margin'] = 'auto'
         ['margin'] = 'auto',
        ['border'] = '1px solid red' -- Debug border for the entire tree
     })
     })


Line 146: Line 147:
             ['background-color'] = '#f5f5f5',
             ['background-color'] = '#f5f5f5',
             ['border'] = '2px solid black',
             ['border'] = '2px solid black',
             ['text-align'] = 'center'
             ['text-align'] = 'center',
            ['debug'] = true -- Debug to check if nodes are placed correctly
         })
         })


Line 155: Line 157:
         }):done()
         }):done()


         -- Display modifiers (if present)
         -- Debug the positions of the nodes
         if node.modifiers then
         nodeDiv:tag('p'):wikitext('X: ' .. xPos .. ' Y: ' .. yPos):done()
            local modifierText = ""
            for modifier, data in pairs(node.modifiers) do
                if type(data) == "table" then
                    modifierText = modifierText .. modifier .. ": Skill: " .. (data.skillID or "N/A") .. ", Value: " .. (data.value or "N/A") .. "<br>"
                else
                    modifierText = modifierText .. modifier .. ": " .. tostring(data) .. "<br>"
                end
            end
            nodeDiv:tag('p'):wikitext(modifierText):done()
        end
 
        -- Display combat effects (if present)
        if node.combatEffects then
            local combatEffectText = ""
            for _, effect in pairs(node.combatEffects) do
                combatEffectText = combatEffectText .. "Effect ID: " .. (effect.effectID or "N/A") .. ", Chance: " .. (effect.chance or "N/A") .. "%<br>"
                if effect.condition then
                    combatEffectText = combatEffectText .. "Condition Type: " .. (effect.condition.type or "N/A") .. "<br>"
                end
            end
            nodeDiv:tag('p'):wikitext(combatEffectText):done()
        end


         -- Append nodeDiv to HTML
         -- Append nodeDiv to HTML
Line 210: Line 190:
     return tostring(html)
     return tostring(html)
end
end


return p
return p
393

edits