mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Fix build
This commit is contained in:
parent
2fdec84b46
commit
1b52877d0b
7 changed files with 30 additions and 30 deletions
|
|
@ -912,7 +912,7 @@ public final class GiftCompositionComponent: Component {
|
|||
} else if !nowAnimating && wasAnimating {
|
||||
var tail = Array(models.shuffled().prefix(6))
|
||||
if let mainModelFile {
|
||||
tail.append(.model(name: "", file: mainModelFile, rarity: 0))
|
||||
tail.append(.model(name: "", file: mainModelFile, rarity: .rare, crafted: false))
|
||||
}
|
||||
self.beginDecelerationWithQueue(
|
||||
tail: tail,
|
||||
|
|
|
|||
|
|
@ -725,9 +725,9 @@ private final class GiftAuctionViewSheetContent: CombinedComponent {
|
|||
if let genericGift {
|
||||
var attributes: [StarGift.UniqueGift.Attribute] = []
|
||||
if state.previewModelIndex == -1 {
|
||||
attributes.append(.model(name: "", file: genericGift.file, rarity: 0))
|
||||
attributes.append(.model(name: "", file: genericGift.file, rarity: .rare, crafted: false))
|
||||
if let background = genericGift.background {
|
||||
attributes.append(.backdrop(name: "", id: 0, innerColor: background.centerColor, outerColor: background.edgeColor, patternColor: 0, textColor: 0, rarity: 0))
|
||||
attributes.append(.backdrop(name: "", id: 0, innerColor: background.centerColor, outerColor: background.edgeColor, patternColor: 0, textColor: 0, rarity: .rare))
|
||||
}
|
||||
} else if !state.previewModels.isEmpty {
|
||||
attributes.append(state.previewModels[state.previewModelIndex])
|
||||
|
|
|
|||
|
|
@ -83,23 +83,23 @@ public func giftOfferAlertController(
|
|||
let tag: AnyObject?
|
||||
|
||||
switch attribute {
|
||||
case let .model(name, _, rarity):
|
||||
case let .model(name, _, rarity, _):
|
||||
id = "model"
|
||||
title = strings.Gift_Unique_Model
|
||||
value = NSAttributedString(string: name, font: tableFont, textColor: tableTextColor)
|
||||
percentage = Float(rarity) * 0.1
|
||||
percentage = Float(rarity.permilleValue) * 0.1
|
||||
tag = modelButtonTag
|
||||
case let .backdrop(name, _, _, _, _, _, rarity):
|
||||
id = "backdrop"
|
||||
title = strings.Gift_Unique_Backdrop
|
||||
value = NSAttributedString(string: name, font: tableFont, textColor: tableTextColor)
|
||||
percentage = Float(rarity) * 0.1
|
||||
percentage = Float(rarity.permilleValue) * 0.1
|
||||
tag = backdropButtonTag
|
||||
case let .pattern(name, _, rarity):
|
||||
id = "pattern"
|
||||
title = strings.Gift_Unique_Symbol
|
||||
value = NSAttributedString(string: name, font: tableFont, textColor: tableTextColor)
|
||||
percentage = Float(rarity) * 0.1
|
||||
percentage = Float(rarity.permilleValue) * 0.1
|
||||
tag = symbolButtonTag
|
||||
case .originalInfo:
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -68,23 +68,23 @@ public func giftTransferAlertController(
|
|||
let tag: AnyObject?
|
||||
|
||||
switch attribute {
|
||||
case let .model(name, _, rarity):
|
||||
case let .model(name, _, rarity, _):
|
||||
id = "model"
|
||||
title = strings.Gift_Unique_Model
|
||||
value = NSAttributedString(string: name, font: tableFont, textColor: tableTextColor)
|
||||
percentage = Float(rarity) * 0.1
|
||||
percentage = Float(rarity.permilleValue) * 0.1
|
||||
tag = modelButtonTag
|
||||
case let .backdrop(name, _, _, _, _, _, rarity):
|
||||
id = "backdrop"
|
||||
title = strings.Gift_Unique_Backdrop
|
||||
value = NSAttributedString(string: name, font: tableFont, textColor: tableTextColor)
|
||||
percentage = Float(rarity) * 0.1
|
||||
percentage = Float(rarity.permilleValue) * 0.1
|
||||
tag = backdropButtonTag
|
||||
case let .pattern(name, _, rarity):
|
||||
id = "pattern"
|
||||
title = strings.Gift_Unique_Symbol
|
||||
value = NSAttributedString(string: name, font: tableFont, textColor: tableTextColor)
|
||||
percentage = Float(rarity) * 0.1
|
||||
percentage = Float(rarity.permilleValue) * 0.1
|
||||
tag = symbolButtonTag
|
||||
case .originalInfo:
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -425,11 +425,11 @@ private final class GiftUpgradeVariantsScreenComponent: Component {
|
|||
var isSelected = false
|
||||
for attribute in attributeList {
|
||||
switch attribute {
|
||||
case let .model(name, file, rarityValue):
|
||||
case let .model(name, file, rarityValue, _):
|
||||
itemId += "\(file.fileId.id)"
|
||||
if self.selectedSection == .models {
|
||||
title = name
|
||||
rarity = rarityValue
|
||||
rarity = rarityValue.permilleValue
|
||||
modelAttribute = attribute
|
||||
|
||||
if case let .model(_, selectedFile, _, _) = self.selectedModel {
|
||||
|
|
@ -442,7 +442,7 @@ private final class GiftUpgradeVariantsScreenComponent: Component {
|
|||
itemId += "\(id)"
|
||||
if self.selectedSection == .backdrops {
|
||||
title = name
|
||||
rarity = rarityValue
|
||||
rarity = rarityValue.permilleValue
|
||||
backdropAttribute = attribute
|
||||
|
||||
if case let .backdrop(_, selectedId, _, _, _, _, _) = self.selectedBackdrop {
|
||||
|
|
@ -455,7 +455,7 @@ private final class GiftUpgradeVariantsScreenComponent: Component {
|
|||
itemId += "\(file.fileId.id)"
|
||||
if self.selectedSection == .symbols {
|
||||
title = name
|
||||
rarity = rarityValue
|
||||
rarity = rarityValue.permilleValue
|
||||
symbolAttribute = attribute
|
||||
|
||||
if case let .pattern(_, selectedFile, _) = self.selectedSymbol {
|
||||
|
|
@ -1270,18 +1270,18 @@ private final class AttributeInfoComponent: Component {
|
|||
let subtitle: String
|
||||
let rarity: Int32
|
||||
switch component.attribute {
|
||||
case let .model(name, _, rarityValue):
|
||||
case let .model(name, _, rarityValue, _):
|
||||
title = name
|
||||
subtitle = component.strings.Gift_Variants_Model
|
||||
rarity = rarityValue
|
||||
rarity = rarityValue.permilleValue
|
||||
case let .backdrop(name, _, _, _, _, _, rarityValue):
|
||||
title = name
|
||||
subtitle = component.strings.Gift_Variants_Backdrop
|
||||
rarity = rarityValue
|
||||
rarity = rarityValue.permilleValue
|
||||
case let .pattern(name, _, rarityValue):
|
||||
title = name
|
||||
subtitle = component.strings.Gift_Variants_Symbol
|
||||
rarity = rarityValue
|
||||
rarity = rarityValue.permilleValue
|
||||
default:
|
||||
title = ""
|
||||
subtitle = ""
|
||||
|
|
|
|||
|
|
@ -4115,17 +4115,17 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||
var otherValuesAndPercentages: [(value: String, percentage: Float)] = []
|
||||
|
||||
switch attribute {
|
||||
case let .model(name, _, rarity):
|
||||
case let .model(name, _, rarity, _):
|
||||
id = "model"
|
||||
title = strings.Gift_Unique_Model
|
||||
value = NSAttributedString(string: name, font: tableFont, textColor: tableTextColor)
|
||||
percentage = Float(rarity) * 0.1
|
||||
percentage = Float(rarity.permilleValue) * 0.1
|
||||
tag = state.modelButtonTag
|
||||
|
||||
if state.justUpgraded, let sampleAttributes = state.upgradePreview?.attributes {
|
||||
for sampleAttribute in sampleAttributes {
|
||||
if case let .model(name, _, rarity) = sampleAttribute {
|
||||
otherValuesAndPercentages.append((name, Float(rarity) * 0.1))
|
||||
if case let .model(name, _, rarity, _) = sampleAttribute {
|
||||
otherValuesAndPercentages.append((name, Float(rarity.permilleValue) * 0.1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4133,13 +4133,13 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||
id = "backdrop"
|
||||
title = strings.Gift_Unique_Backdrop
|
||||
value = NSAttributedString(string: name, font: tableFont, textColor: tableTextColor)
|
||||
percentage = Float(rarity) * 0.1
|
||||
percentage = Float(rarity.permilleValue) * 0.1
|
||||
tag = state.backdropButtonTag
|
||||
|
||||
if state.justUpgraded, let sampleAttributes = state.upgradePreview?.attributes {
|
||||
for sampleAttribute in sampleAttributes {
|
||||
if case let .backdrop(name, _, _, _, _, _, rarity) = sampleAttribute {
|
||||
otherValuesAndPercentages.append((name, Float(rarity) * 0.1))
|
||||
otherValuesAndPercentages.append((name, Float(rarity.permilleValue) * 0.1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4147,13 +4147,13 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||
id = "pattern"
|
||||
title = strings.Gift_Unique_Symbol
|
||||
value = NSAttributedString(string: name, font: tableFont, textColor: tableTextColor)
|
||||
percentage = Float(rarity) * 0.1
|
||||
percentage = Float(rarity.permilleValue) * 0.1
|
||||
tag = state.symbolButtonTag
|
||||
|
||||
if state.justUpgraded, let sampleAttributes = state.upgradePreview?.attributes {
|
||||
for sampleAttribute in sampleAttributes {
|
||||
if case let .pattern(name, _, rarity) = sampleAttribute {
|
||||
otherValuesAndPercentages.append((name, Float(rarity) * 0.1))
|
||||
otherValuesAndPercentages.append((name, Float(rarity.permilleValue) * 0.1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -762,9 +762,9 @@ final class UserAppearanceScreenComponent: Component {
|
|||
slug: slug,
|
||||
owner: .peerId(component.context.account.peerId),
|
||||
attributes: [
|
||||
.model(name: "", file: file, rarity: 0),
|
||||
.pattern(name: "", file: patternFile, rarity: 0),
|
||||
.backdrop(name: "", id: 0, innerColor: innerColor, outerColor: outerColor, patternColor: patternColor, textColor: textColor, rarity: 0)
|
||||
.model(name: "", file: file, rarity: .rare, crafted: false),
|
||||
.pattern(name: "", file: patternFile, rarity: .rare),
|
||||
.backdrop(name: "", id: 0, innerColor: innerColor, outerColor: outerColor, patternColor: patternColor, textColor: textColor, rarity: .rare)
|
||||
],
|
||||
availability: StarGift.UniqueGift.Availability(issued: 0, total: 0),
|
||||
giftAddress: nil,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue