fixes
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -260,3 +260,11 @@ ModelManifest.xml
|
||||
.fake/
|
||||
*.lnk
|
||||
/pack-tree.lua
|
||||
|
||||
# VSCode
|
||||
.vscode/
|
||||
.history/
|
||||
|
||||
# Temporary disabled
|
||||
Data/3_0/ModCache.lua
|
||||
|
||||
|
||||
@@ -429,7 +429,9 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
|
||||
node.dependsOnIntuitiveLeapLike = false
|
||||
|
||||
-- Reset Node to default
|
||||
ReplaceNode(node,self.tree.nodes[id])
|
||||
node.conqueredBy = nil
|
||||
|
||||
self:ReplaceNode(node,self.tree.nodes[id])
|
||||
|
||||
if node.type ~= "ClassStart" and node.type ~= "Socket" then
|
||||
for nodeId, itemId in pairs(self.jewels) do
|
||||
@@ -453,35 +455,51 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
|
||||
end
|
||||
end
|
||||
|
||||
-- If node is conquered, replace it or add mods
|
||||
if node.conqueredBy and node.type ~= "Socket" then
|
||||
local conqueredBy = node.conqueredBy
|
||||
local legionNodes = self.build.latestTree.legion.nodes
|
||||
--self.tree.nodes[id].isConquered = true
|
||||
if node.type == "Keystone" then
|
||||
local legionnode = legionNodes[conqueredBy.conquerer.type.."_keystone_"..conqueredBy.conquerer.id]
|
||||
ReplaceNode(node,legionnode)
|
||||
elseif conqueredBy.conquerer.type == "eternal" and node.type == "Normal" then
|
||||
local legionnode =legionNodes["eternal_small_blank"]
|
||||
ReplaceNode(node,legionnode)
|
||||
elseif conqueredBy.conquerer.type == "templar" and node.type == "Normal" and isValueInArray(attributes, node.dn) then
|
||||
local legionnode =legionNodes["templar_devotion_node"]
|
||||
ReplaceNode(node,legionnode)
|
||||
elseif conqueredBy.conquerer.type == "maraketh" and (node.type == "Normal" or node.type == "Notable") then
|
||||
local str = isValueInArray(attributes, node.dn) and "2" or "4"
|
||||
self:NodeAdditionFromString(node,"+"..str.." to Dexterity","Tree:"..node.id)
|
||||
|
||||
elseif conqueredBy.conquerer.type == "karui" and (node.type == "Normal" or node.type == "Notable") then
|
||||
local str = isValueInArray(attributes, node.dn) and "2" or "4"
|
||||
self:NodeAdditionFromString(node,"+"..str.." to Strength","Tree:"..node.id)
|
||||
end
|
||||
end
|
||||
|
||||
if node.alloc then
|
||||
node.depends[1] = node -- All nodes depend on themselves
|
||||
end
|
||||
end
|
||||
|
||||
for id, node in pairs(self.nodes) do
|
||||
-- If node is conquered, replace it or add mods
|
||||
if node.conqueredBy and node.type ~= "Socket" then
|
||||
local conqueredBy = node.conqueredBy
|
||||
local legionNodes = self.tree.legion.nodes
|
||||
--self.tree.nodes[id].isConquered = true
|
||||
if node.type == "Keystone" then
|
||||
local legionNode = legionNodes[conqueredBy.conqueror.type.."_keystone_"..conqueredBy.conqueror.id]
|
||||
self:ReplaceNode(node, legionNode)
|
||||
elseif conqueredBy.conqueror.type == "eternal" and node.type == "Normal" then
|
||||
local legionNode =legionNodes["eternal_small_blank"]
|
||||
self:ReplaceNode(node,legionNode)
|
||||
elseif conqueredBy.conqueror.type == "templar" and node.type == "Normal" and isValueInArray(attributes, node.dn) then
|
||||
local legionNode =legionNodes["templar_devotion_node"]
|
||||
self:ReplaceNode(node,legionNode)
|
||||
elseif conqueredBy.conqueror.type == "maraketh" and (node.type == "Normal" or node.type == "Notable") then
|
||||
local str = isValueInArray(attributes, node.dn) and "2" or "4"
|
||||
self:NodeAdditionFromString(node,"+"..str.." to Dexterity")
|
||||
elseif conqueredBy.conqueror.type == "karui" and (node.type == "Normal" or node.type == "Notable") then
|
||||
local str = isValueInArray(attributes, node.dn) and "2" or "4"
|
||||
self:NodeAdditionFromString(node,"+"..str.." to Strength")
|
||||
elseif conqueredBy.conqueror.type == "vaal" and node.type == "Normal" then
|
||||
local legionNode =legionNodes["vaal_small_fire_resistance"]
|
||||
node.dn = "Vaal small Node"
|
||||
node.sd = {"Right click to set mod"}
|
||||
node.sprites = legionNode.sprites
|
||||
node.mods = {""}
|
||||
node.modList = new("ModList")
|
||||
node.modKey = ""
|
||||
elseif conqueredBy.conqueror.type == "vaal" and node.type == "Notable" then
|
||||
local legionNode =legionNodes["vaal_notable_curse_1"]
|
||||
node.dn = "Vaal notable Node"
|
||||
node.sd = {"Right click to set mod"}
|
||||
node.sprites = legionNode.sprites
|
||||
node.mods = {""}
|
||||
node.modList = new("ModList")
|
||||
node.modKey = ""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for id, node in pairs(self.allocNodes) do
|
||||
@@ -558,15 +576,15 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
|
||||
end
|
||||
end
|
||||
|
||||
function ReplaceNode(old, new)
|
||||
function PassiveSpecClass:ReplaceNode(old, new)
|
||||
if old.dn == new.dn then return 1 end
|
||||
old.dn = new.dn
|
||||
old.sd = new.sd
|
||||
old.mods = new.mods
|
||||
old.modKey = new.modKey
|
||||
old.modList = new.modList
|
||||
old.overlay = new.overlay
|
||||
old.icon = new.icon
|
||||
old.sprites = new.sprites
|
||||
old.keystoneMod = new.keystoneMod
|
||||
end
|
||||
|
||||
function PassiveSpecClass:CreateUndoState()
|
||||
@@ -577,10 +595,11 @@ function PassiveSpecClass:RestoreUndoState(state)
|
||||
self:DecodeURL(state)
|
||||
end
|
||||
|
||||
function PassiveSpecClass:NodeAdditionFromString(node,sd,source)
|
||||
function PassiveSpecClass:NodeAdditionFromString(node,sd)
|
||||
local addition = {}
|
||||
addition.sd = {sd}
|
||||
addition.mods = { }
|
||||
addition.modList = new("ModList")
|
||||
addition.modKey = ""
|
||||
local i = 1
|
||||
while addition.sd[i] do
|
||||
@@ -633,12 +652,11 @@ function PassiveSpecClass:NodeAdditionFromString(node,sd,source)
|
||||
end
|
||||
end
|
||||
|
||||
-- Build unified list of modifiers from all recognised modifier lines
|
||||
addition.modList = new("ModList")
|
||||
-- Build unified list of modifiers from all recognised modifier lines
|
||||
for _, mod in pairs(addition.mods) do
|
||||
if mod.list and not mod.extra then
|
||||
for i, mod in ipairs(mod.list) do
|
||||
mod.source = source
|
||||
mod.source = "Tree:"..node.id
|
||||
if type(mod.value) == "table" and mod.value.mod then
|
||||
mod.value.mod.source = mod.source
|
||||
end
|
||||
@@ -646,10 +664,10 @@ function PassiveSpecClass:NodeAdditionFromString(node,sd,source)
|
||||
end
|
||||
end
|
||||
end
|
||||
node.sd = TableConcat(node.sd, addition.sd)
|
||||
node.mods = TableConcat(node.mods, addition.mods)
|
||||
node.sd = TableConcat(self.tree.nodes[node.id].sd, addition.sd)
|
||||
node.mods = TableConcat(self.tree.nodes[node.id].mods, addition.mods)
|
||||
local modList = new("ModList")
|
||||
modList:AddList(node.modList)
|
||||
modList:AddList(addition.modList)
|
||||
modList:AddList(self.tree.nodes[node.id].modList)
|
||||
node.modList = modList
|
||||
end
|
||||
@@ -118,6 +118,7 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion)
|
||||
end
|
||||
end
|
||||
|
||||
-- Load legion sprite sheets and build sprite map
|
||||
local legionSprites = LoadModule("TreeData/legion/tree-legion.lua")
|
||||
for type, data in pairs(legionSprites) do
|
||||
local maxZoom = data[#data]
|
||||
@@ -244,7 +245,11 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion)
|
||||
}
|
||||
local orbitDist = { [0] = 0, 82, 162, 335, 493 }
|
||||
for _, node in pairs(self.nodes) do
|
||||
node.meta = { __index = node }
|
||||
node.conquered = false
|
||||
node.alternative = {}
|
||||
|
||||
|
||||
node.meta = { __index = node}
|
||||
nodeMap[node.id] = node
|
||||
node.linkedId = { }
|
||||
|
||||
@@ -358,7 +363,7 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion)
|
||||
node.modKey = node.modKey.."["..modLib.formatMod(mod).."]"
|
||||
end
|
||||
end
|
||||
node.mods[i] = { list = list, extra = extra }
|
||||
node.mods[i] = { list = list, extra = extra }
|
||||
i = i + 1
|
||||
while node.mods[i] do
|
||||
-- Skip any lines with dummy lists added by the line combining code
|
||||
|
||||
@@ -278,6 +278,8 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
|
||||
build.itemsTab:SelectControl(slot)
|
||||
build.viewMode = "ITEMS"
|
||||
end
|
||||
elseif hoverNode and hoverNode.conqueredBy and hoverNode.conqueredBy.conqueror.name == "vaal" then
|
||||
build.treeTab:ModifyNodePopup(hoverNode)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -357,4 +357,80 @@ function TreeTabClass:OpenExportPopup()
|
||||
main:ClosePopup()
|
||||
end)
|
||||
popup = main:OpenPopup(380, 100, "Export Tree", controls, "done", "edit")
|
||||
end
|
||||
|
||||
function TreeTabClass:ModifyNodePopup(selectedNode)
|
||||
local controls = { }
|
||||
local sourceList = { }
|
||||
local modList = { }
|
||||
local function buildMods(sourceId)
|
||||
wipeTable(modList)
|
||||
for _, node in ipairs(self.build.tree.legion.nodes) do
|
||||
if node.dn == "vaal" then
|
||||
local label
|
||||
if craft.master then
|
||||
label = craft.master .. " " .. craft.masterLevel .. " "..craft.type:sub(1,3).."^8[" .. table.concat(craft, "/") .. "]"
|
||||
else
|
||||
label = table.concat(craft, "/")
|
||||
end
|
||||
t_insert(modList, {
|
||||
label = label,
|
||||
mod = craft,
|
||||
type = "crafted",
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
local function addModifier()
|
||||
local item = new("Item", self.build.targetVersion, self.displayItem:BuildRaw())
|
||||
item.id = self.displayItem.id
|
||||
local sourceId = sourceList[controls.source.selIndex].sourceId
|
||||
if sourceId == "CUSTOM" then
|
||||
if controls.custom.buf:match("%S") then
|
||||
t_insert(item.modLines, { line = controls.custom.buf, custom = true })
|
||||
end
|
||||
else
|
||||
local listMod = modList[controls.modSelect.selIndex]
|
||||
for _, line in ipairs(listMod.mod) do
|
||||
t_insert(item.modLines, { line = line, [listMod.type] = true })
|
||||
end
|
||||
end
|
||||
item:BuildAndParseRaw()
|
||||
return item
|
||||
end
|
||||
controls.sourceLabel = new("LabelControl", {"TOPRIGHT",nil,"TOPLEFT"}, 95, 20, 0, 16, "^7Source:")
|
||||
controls.source = new("DropDownControl", {"TOPLEFT",nil,"TOPLEFT"}, 100, 20, 150, 18, sourceList, function(index, value)
|
||||
buildMods(value.sourceId)
|
||||
controls.modSelect:SetSel(1)
|
||||
end)
|
||||
controls.source.enabled = #sourceList > 1
|
||||
controls.modSelectLabel = new("LabelControl", {"TOPRIGHT",nil,"TOPLEFT"}, 95, 45, 0, 16, "^7Modifier:")
|
||||
controls.modSelect = new("DropDownControl", {"TOPLEFT",nil,"TOPLEFT"}, 100, 45, 600, 18, modList)
|
||||
controls.modSelect.shown = function()
|
||||
return sourceList[controls.source.selIndex].sourceId ~= "CUSTOM"
|
||||
end
|
||||
controls.modSelect.tooltipFunc = function(tooltip, mode, index, value)
|
||||
tooltip:Clear()
|
||||
if mode ~= "OUT" and value then
|
||||
for _, line in ipairs(value.mod) do
|
||||
tooltip:AddLine(16, "^7"..line)
|
||||
end
|
||||
end
|
||||
end
|
||||
controls.custom = new("EditControl", {"TOPLEFT",nil,"TOPLEFT"}, 100, 45, 440, 18)
|
||||
controls.custom.shown = function()
|
||||
return sourceList[controls.source.selIndex].sourceId == "CUSTOM"
|
||||
end
|
||||
controls.save = new("ButtonControl", nil, -45, 75, 80, 20, "Add", function()
|
||||
self:SetDisplayItem(addModifier())
|
||||
main:ClosePopup()
|
||||
end)
|
||||
controls.save.tooltipFunc = function(tooltip)
|
||||
tooltip:Clear()
|
||||
self:AddItemTooltip(tooltip, addModifier())
|
||||
end
|
||||
controls.close = new("ButtonControl", nil, 45, 75, 80, 20, "Cancel", function()
|
||||
main:ClosePopup()
|
||||
end)
|
||||
main:OpenPopup(710, 105, "Replace Modifier of Node", controls, "save", sourceList[controls.source.selIndex].sourceId == "CUSTOM" and "custom")
|
||||
end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,9 +13,11 @@ launch = { }
|
||||
SetMainObject(launch)
|
||||
|
||||
function launch:OnInit()
|
||||
package.cpath = package.cpath .. ';C:/Users/Aron/.PyCharmCE2019.3/config/plugins/intellij-emmylua/classes/debugger/emmy/windows/x86/?.dll'
|
||||
-- Debug Attach
|
||||
package.cpath = package.cpath .. ';C:/Users/Aron/.vscode/extensions/tangzx.emmylua-0.3.28/debugger/emmy/windows/x86/?.dll'
|
||||
local dbg = require('emmy_core')
|
||||
dbg.tcpListen('localhost', 9967)
|
||||
-------------------------
|
||||
|
||||
self.devMode = false
|
||||
self.versionNumber = "?"
|
||||
|
||||
@@ -10,7 +10,7 @@ local band = bit.band
|
||||
local bor = bit.bor
|
||||
local bnot = bit.bnot
|
||||
|
||||
local conquererList = {
|
||||
local conquerorList = {
|
||||
["xibaqua"] = {id = 1, type = "vaal"},
|
||||
["doryani"] = {id = 2, type = "vaal"},
|
||||
["zerphi"] = {id = 3, type = "vaal"},
|
||||
@@ -1817,19 +1817,19 @@ local specialModList = {
|
||||
-- Legion modifiers
|
||||
["bathed in the blood of (%d+) sacrificed in the name of (.+)"] = function(num, _, name)
|
||||
return { mod("JewelData", "LIST",
|
||||
{key = "conqueredBy", value = {id = num, conquerer = conquererList[name:lower()] } }) } end,
|
||||
{key = "conqueredBy", value = {id = num, conqueror = conquerorList[name:lower()] } }) } end,
|
||||
["carved to glorify (%d+) new faithful converted by high templar (.+)"] = function(num, _, name)
|
||||
return { mod("JewelData", "LIST",
|
||||
{key = "conqueredBy", value = {id = num, conquerer = conquererList[name:lower()] } }) } end,
|
||||
{key = "conqueredBy", value = {id = num, conqueror = conquerorList[name:lower()] } }) } end,
|
||||
["commanded leadership over (%d+) warriors under (.+)"] = function(num, _, name)
|
||||
return { mod("JewelData", "LIST",
|
||||
{key = "conqueredBy", value = {id = num, conquerer = conquererList[name:lower()] } }) } end,
|
||||
{key = "conqueredBy", value = {id = num, conqueror = conquerorList[name:lower()] } }) } end,
|
||||
["commissioned (%d+) coins to commemorate (.+)"] = function(num, _, name)
|
||||
return { mod("JewelData", "LIST",
|
||||
{key = "conqueredBy", value = {id = num, conquerer = conquererList[name:lower()] } }) } end,
|
||||
{key = "conqueredBy", value = {id = num, conqueror = conquerorList[name:lower()] } }) } end,
|
||||
["denoted service of (%d+) dekhara in the akhara of (.+)"] = function(num, _, name)
|
||||
return { mod("JewelData", "LIST",
|
||||
{key = "conqueredBy", value = {id = num, conquerer = conquererList[name:lower()] } }) } end,
|
||||
{key = "conqueredBy", value = {id = num, conqueror = conquerorList[name:lower()] } }) } end,
|
||||
}
|
||||
local keystoneList = {
|
||||
-- List of keystones that can be found on uniques
|
||||
|
||||
@@ -52,22 +52,22 @@ return {
|
||||
["notableActive"]={{
|
||||
["filename"]="skills-additional-3.jpg",
|
||||
["coords"]={
|
||||
["Art/2DArt/SkillIcons/passives/VaalNotableOffensive.dds"]={["x"]=0,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/VaalNotableDefensive.dds"]={["x"]=38,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/DevotionNotable.dds"]={["x"]=76,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/EternalEmpireOffensiveNotable.dds"]={["x"]=114,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/EternalEmpireDefensiveNotable.dds"]={["x"]=152,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/VaalNotableOffensive.dds"]={["x"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/VaalNotableDefensive.dds"]={["x"]=38,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/DevotionNotable.dds"]={["x"]=76,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/EternalEmpireOffensiveNotable.dds"]={["x"]=114,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/EternalEmpireDefensiveNotable.dds"]={["x"]=152,["y"]=27,["w"]=38,["h"]=38},
|
||||
}
|
||||
}
|
||||
},
|
||||
["notableInctive"]={{
|
||||
["notableInactive"]={{
|
||||
["filename"]="skills-additional-disabled-3.jpg",
|
||||
["coords"]={
|
||||
["Art/2DArt/SkillIcons/passives/VaalNotableOffensive.dds"]={["x"]=0,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/VaalNotableDefensive.dds"]={["x"]=38,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/DevotionNotable.dds"]={["x"]=76,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/EternalEmpireOffensiveNotable.dds"]={["x"]=114,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/EternalEmpireDefensiveNotable.dds"]={["x"]=152,["y"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/VaalNotableOffensive.dds"]={["x"]=0,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/VaalNotableDefensive.dds"]={["x"]=38,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/DevotionNotable.dds"]={["x"]=76,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/EternalEmpireOffensiveNotable.dds"]={["x"]=114,["y"]=27,["w"]=38,["h"]=38},
|
||||
["Art/2DArt/SkillIcons/passives/EternalEmpireDefensiveNotable.dds"]={["x"]=152,["y"]=27,["w"]=38,["h"]=38},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user