diff --git a/lua/app/ui/collection/collection_ui.lua b/lua/app/ui/collection/collection_ui.lua index 7ef4c294..54c88da5 100644 --- a/lua/app/ui/collection/collection_ui.lua +++ b/lua/app/ui/collection/collection_ui.lua @@ -44,7 +44,6 @@ function CollectionUI:onLoadRootComplete() self.btnClose = uiMap["collect_ui.banner.btn_close"] self.scrollrectComp = uiMap["collect_ui.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) self.rewardsNode = uiMap["collection_ui.rewards"] - self.btnRewards = uiMap["collection_ui.rewards.point.btn_rewards"] self.txTotalValue = uiMap["collect_ui.rewards.btn_rewards.tx_total"] self.btnGet = uiMap["collection_ui.rewards.btn_get"] self.imgGet = uiMap["collection_ui.rewards.btn_get.img_icon"] @@ -52,7 +51,7 @@ function CollectionUI:onLoadRootComplete() self.txDesc = uiMap["collect_ui.rewards.tx_desc"] self.txStage = uiMap["collect_ui.rewards.tx_stage"] self.imgProg = uiMap["collect_ui.rewards.prog.img_prog"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) - self.flyEndTarget = uiMap["collection_ui.rewards.point"] + self.btnRewards = uiMap["collection_ui.rewards.point"] self.flyIcon = uiMap["collection_ui.fly_icon"] self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_1)) @@ -154,7 +153,7 @@ function CollectionUI:showFlyAnim() end self.animFly = self.root:createBindTweenSequence() self.animFly:Insert(0, self.flyIcon:getTransform():DOScale(0.8, 0.2)) - self.animFly:Insert(0.2, self.flyIcon:getTransform():DOMove(self.flyEndTarget:getPosition(), 1)) + self.animFly:Insert(0.2, self.flyIcon:getTransform():DOMove(self.btnRewards:getPosition(), 1)) self.animFly:Insert(0.4, self.flyIcon:getTransform():DOScale(0.4, 0.4)) self.animFly:OnComplete(function() self.flyIcon:setActive(false) diff --git a/lua/app/ui/dungeon/cell/dungeon_target_cell.lua b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua index c6223a3b..dd3eb03f 100644 --- a/lua/app/ui/dungeon/cell/dungeon_target_cell.lua +++ b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua @@ -16,6 +16,9 @@ function DungeonTargetCell:init() self:bind(DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON), "isDirty", function() self:refresh() end) + self:bind(DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR), "isDirty", function() + self:refresh() + end) end function DungeonTargetCell:refresh(target, getWay, id) diff --git a/lua/app/ui/dungeon/item_get_ui.lua b/lua/app/ui/dungeon/item_get_ui.lua index 128ca4a2..9d5b4a90 100644 --- a/lua/app/ui/dungeon/item_get_ui.lua +++ b/lua/app/ui/dungeon/item_get_ui.lua @@ -32,7 +32,7 @@ function ItemGetUI:onLoadRootComplete() self.txTitle:setText(I18N:getText("item", self.target.id, "name")) self.txDesc:setText(I18N:getText("item", self.target.id, "desc")) self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_23)) - -- self.rewardCell:refreshItemById(self.target.id) + self.rewardCell:refreshItemById(self.target.id) local itemCfg = ConfigManager:getConfig("item")[self.target.id] if itemCfg == nil or itemCfg.get_way_type == nil or itemCfg.get_way == nil or #itemCfg.get_way == 0 then diff --git a/lua/app/ui/hero/armor_info_comp.lua b/lua/app/ui/hero/armor_info_comp.lua index 6656e8ac..8b81810d 100644 --- a/lua/app/ui/hero/armor_info_comp.lua +++ b/lua/app/ui/hero/armor_info_comp.lua @@ -76,7 +76,7 @@ function ArmorInfoComp:refreshSelectArmor() -- current local armorEntity = DataManager.EquipData:getEquip(self.heroEntity:getCfgId(), self.selectPart) self.txCurName:setText(armorEntity:getName()) - self.imgCurBg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_" .. armorEntity:getStage()) + self.imgCurBg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_" .. armorEntity:getStage() + 1) self.imgCurIcon:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, tostring(armorEntity:getIconId()), function() self.imgCurIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize() end) @@ -85,7 +85,7 @@ function ArmorInfoComp:refreshSelectArmor() -- next local armorNextEntity = armorEntity:getNextLevelEntity() self.txNextName:setText(armorNextEntity:getName()) - self.imgNextBg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_" .. armorNextEntity:getStage()) + self.imgNextBg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_" .. armorNextEntity:getStage() + 1) self.imgNextIcon:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, tostring(armorNextEntity:getIconId()), function() self.imgNextIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize() end) @@ -185,7 +185,7 @@ function ArmorInfoComp:refreshPart(index) local imgType = map["img_type"] local txLevel = map["tx_num"] - local stage = armorEntity:getStage() + local stage = armorEntity:getStage() + 1 imgSelect:setActive(part == self.selectPart) imgSelect:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_select_" .. math.floor(stage / 2) + stage % 2) imgBg:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, "frame_" .. stage) diff --git a/lua/app/ui/hero/weapon_info_comp.lua b/lua/app/ui/hero/weapon_info_comp.lua index 75ec803b..94d5f665 100644 --- a/lua/app/ui/hero/weapon_info_comp.lua +++ b/lua/app/ui/hero/weapon_info_comp.lua @@ -10,6 +10,7 @@ function WeaponInfoComp:init() self.txLevel = uiMap["weapon_info.level.tx_level"] self.txDesc1 = uiMap["weapon_info.tx_desc_1"] self.txDesc2 = uiMap["weapon_info.tx_desc_2"] + self.attrContent = uiMap["weapon_info.ScrollView.Viewport.Content"] self.txAttr = uiMap["weapon_info.ScrollView.Viewport.Content.tx_attr"] self.btnUp = uiMap["weapon_info.upgrade.btn_up"] self.txUp = uiMap["weapon_info.upgrade.btn_up.tx_desc"] @@ -42,11 +43,12 @@ function WeaponInfoComp:refresh() local nextWeaponEntity = self.weaponEntity:getNextLevelEntity() self.txName:setText(self.weaponEntity:getName()) - self.imgWeapon:setSprite(GConst.ATLAS_PATH.ICON_EQUIP, tostring(self.weaponEntity:getIconId()), function() - self.imgWeapon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize() - end) + self.imgWeapon:setTexture("assets/arts/textures/background/weapon/".. self.weaponEntity:getIconId() .. ".png") self.txLevel:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_3) .. self.weaponEntity:getLevel().."/"..self.weaponEntity:getMaxLevel()) self.txAttr:setText(self.weaponEntity:getAttrDesc()) + local height = self.txAttr:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight + self.attrContent:setSizeDeltaY(height) + self.attrContent:setAnchoredPosition(0, 0) -- 基础属性 local diffAtk = (nextWeaponEntity:getAttack() - self.weaponEntity:getAttack()) // DEFAULT_FACTOR diff --git a/lua/app/userdata/collection/collection_data.lua b/lua/app/userdata/collection/collection_data.lua index f718d211..2e4e361f 100644 --- a/lua/app/userdata/collection/collection_data.lua +++ b/lua/app/userdata/collection/collection_data.lua @@ -39,7 +39,7 @@ function CollectionData:setDirty(collectionType) end end -function CollectionData:isOpen(collectionType) +function CollectionData:isOpen() if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.COLLECT, true) then return false end @@ -52,7 +52,7 @@ end -- 是否有红点 function CollectionData:hasRedPoint(collectionType) - return self.dataCollects[collectionType]:hasRedPoint() + return self:isOpen() and self.dataCollects[collectionType]:hasRedPoint() end -- 获取当前收集值 diff --git a/lua/app/userdata/equip/equip_entity.lua b/lua/app/userdata/equip/equip_entity.lua index 035c4c33..64aee9a4 100644 --- a/lua/app/userdata/equip/equip_entity.lua +++ b/lua/app/userdata/equip/equip_entity.lua @@ -173,11 +173,11 @@ function EquipEntity:getSkillHurtPercent() return 0 end --- 获取部位阶段等级 +-- 获取部位阶段等级,未达到最低阶段等级时,阶段为0 function EquipEntity:getStage() for idx, level in pairs(self.cfg.features_level) do if self.level < level then - return idx + return idx - 1 end end return nil-- 超过最大阶段等级 @@ -188,6 +188,10 @@ function EquipEntity:getAttrDesc() local strAttr = "" local stage = self:getStage() for i = 1, stage + 1 do + if i > #self.cfg.features_level or i > #self.cfg.features_attr then + break + end + local level = self.cfg.features_level[i] local attr = self.cfg.features_attr[i] local str = I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_3) .. level .. ":".. GFunc.getAttrDesc(attr.type, attr.num) @@ -204,7 +208,7 @@ end -- 获取部位已获得属性 function EquipEntity:getStageAttr() local stage = self:getStage() - if stage then + if stage and stage > 0 then return self.cfg.features_attr[stage] end return nil @@ -214,7 +218,7 @@ end function EquipEntity:getIconId() local stage = self:getStage() if stage then - return self.cfg.weapon_icon[stage] + return self.cfg.weapon_icon[stage + 1] end return nil end @@ -223,7 +227,7 @@ end function EquipEntity:getName() local names = I18N:getText("equip", self:getId(), "name") names = string.split(names, ",") - return names[self:getStage()] or "" + return names[self:getStage() + 1] or "" end -- 获取部位当前等级