Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LS-73 issue with pick character item opacity fixed #39

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,21 @@
endingLineNumber = "174"
offsetFromSymbolStart = "496">
</Location>
<Location
uuid = "3F37E280-4E59-4F7F-B4DA-2659C093B7AB - 75b3d5780075f675"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Greedy_Kings.GameSceneViewController.updateTimer() -&gt; ()"
moduleName = "Greedy Kings"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/surenpoghosyan/Documents/TheLongStory/Greedy%20Kings/Game/UI/Game%20Scene/Views/GameSceneViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "171"
endingLineNumber = "171"
offsetFromSymbolStart = "496">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
Expand Down Expand Up @@ -751,6 +766,21 @@
endingLineNumber = "355"
offsetFromSymbolStart = "504">
</Location>
<Location
uuid = "7060B3C8-41E4-4AF1-881C-7835F29ECAAD - 64a2413a5e8ae65"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Greedy_Kings.GameSceneViewController.updateHealthScale(player: Greedy_Kings.Player) -&gt; ()"
moduleName = "Greedy Kings"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/surenpoghosyan/Documents/TheLongStory/Greedy%20Kings/Game/UI/Game%20Scene/Views/GameSceneViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "352"
endingLineNumber = "352"
offsetFromSymbolStart = "504">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
Expand Down Expand Up @@ -829,6 +859,21 @@
endingLineNumber = "356"
offsetFromSymbolStart = "864">
</Location>
<Location
uuid = "0C7614E6-F669-430C-B95F-A9D7984CFE6C - 64a2413a5e8ae5a"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Greedy_Kings.GameSceneViewController.updateHealthScale(player: Greedy_Kings.Player) -&gt; ()"
moduleName = "Greedy Kings"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/surenpoghosyan/Documents/TheLongStory/Greedy%20Kings/Game/UI/Game%20Scene/Views/GameSceneViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "353"
endingLineNumber = "353"
offsetFromSymbolStart = "864">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
Expand Down Expand Up @@ -1093,116 +1138,20 @@
endingLineNumber = "284"
offsetFromSymbolStart = "516">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "8866B769-E910-435E-9F80-2B39D288967A"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Greedy Kings/Game/UI/Pick Character/Views/PickCharacterViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "60"
endingLineNumber = "60"
landmarkName = "setupCharacterData()"
landmarkType = "7">
<Locations>
<Location
uuid = "8866B769-E910-435E-9F80-2B39D288967A - 27a84f19aeb1f12b"
uuid = "7ECB8E96-8C3E-4BB0-8D5A-D5B8EA54A0D2 - 4c81b1e429bcde84"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Greedy_Kings.PickCharacterViewController.checkAndSetupCharactersData() -&gt; ()"
moduleName = "Greedy Kings"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/surenpoghosyan/Documents/Greedy%20Kings/Greedy%20Kings/Game/UI/Pick%20Character/Views/PickCharacterViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "60"
endingLineNumber = "60"
offsetFromSymbolStart = "1484">
</Location>
<Location
uuid = "8866B769-E910-435E-9F80-2B39D288967A - 94c62e4ffcfc4e76"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Greedy_Kings.PickCharacterViewController.setupCharacterData() -&gt; ()"
moduleName = "Greedy Kings"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/surenpoghosyan/Documents/Greedy%20Kings/Greedy%20Kings/Game/UI/Pick%20Character/Views/PickCharacterViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "60"
endingLineNumber = "60"
offsetFromSymbolStart = "748">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "2CC4BB48-4597-439B-B6A4-F9AC578CCCF5"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Greedy Kings/Game/UI/Pick Character/Views/PickCharacterViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "57"
endingLineNumber = "57"
landmarkName = "setupCharacterData()"
landmarkType = "7">
<Locations>
<Location
uuid = "2CC4BB48-4597-439B-B6A4-F9AC578CCCF5 - 27a84f19aeb1f1ce"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Greedy_Kings.PickCharacterViewController.checkAndSetupCharactersData() -&gt; ()"
moduleName = "Greedy Kings"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/surenpoghosyan/Documents/Greedy%20Kings/Greedy%20Kings/Game/UI/Pick%20Character/Views/PickCharacterViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "57"
endingLineNumber = "57"
offsetFromSymbolStart = "1076">
</Location>
<Location
uuid = "2CC4BB48-4597-439B-B6A4-F9AC578CCCF5 - 94c62e4ffcfc4e93"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Greedy_Kings.PickCharacterViewController.setupCharacterData() -&gt; ()"
moduleName = "Greedy Kings"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/surenpoghosyan/Documents/Greedy%20Kings/Greedy%20Kings/Game/UI/Pick%20Character/Views/PickCharacterViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "57"
endingLineNumber = "57"
offsetFromSymbolStart = "116">
</Location>
<Location
uuid = "2CC4BB48-4597-439B-B6A4-F9AC578CCCF5 - 94c62e4ffcfc4e93"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Greedy_Kings.PickCharacterViewController.setupCharacterData() -&gt; ()"
symbolName = "Greedy_Kings.GameSceneViewController.onContinue() -&gt; ()"
moduleName = "Greedy Kings"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/surenpoghosyan/Documents/Greedy%20Kings/Greedy%20Kings/Game/UI/Pick%20Character/Views/PickCharacterViewController.swift"
urlString = "file:///Users/surenpoghosyan/Documents/TheLongStory/Greedy%20Kings/Game/UI/Game%20Scene/Views/GameSceneViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "57"
endingLineNumber = "57"
offsetFromSymbolStart = "540">
startingLineNumber = "281"
endingLineNumber = "281"
offsetFromSymbolStart = "516">
</Location>
</Locations>
</BreakpointContent>
Expand Down Expand Up @@ -1297,6 +1246,21 @@
endingLineNumber = "388"
offsetFromSymbolStart = "1764">
</Location>
<Location
uuid = "870E6937-997C-4D9B-A982-A729370FADFE - 776c58b6730504e6"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Greedy_Kings.GameSceneViewController.updatePlayerState(side: Greedy_Kings.Side) -&gt; ()"
moduleName = "Greedy Kings"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/surenpoghosyan/Documents/TheLongStory/Greedy%20Kings/Game/UI/Game%20Scene/Views/GameSceneViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "385"
endingLineNumber = "385"
offsetFromSymbolStart = "1764">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ final class PickCharacterViewController: UIViewController {
// set character data
private func setupCharacterData() {
if let characters = storageManager.get(key: "characters", storageType: .userdefaults) as? Data {

let decoder = JSONDecoder()
if let characters = try? decoder.decode([Character].self, from: characters) {
print(characters)
characterData = characters
}
}

}

// setup custom back button for navigation
Expand Down Expand Up @@ -233,13 +232,9 @@ extension PickCharacterViewController: UICollectionViewDataSource {
cell.isUserInteractionEnabled = character.availableToPick

// check the availability of character for picking and change its ui state
if character.availableToPick {
cell.nameLabel.alpha = 1
cell.characterImageView.alpha = 0.7
if character.availableToPick == true {
cell.isUserInteractionEnabled = true
} else {
cell.nameLabel.alpha = 0.7
cell.characterImageView.alpha = 0.7
cell.isUserInteractionEnabled = false
}
return cell
Expand All @@ -254,6 +249,7 @@ extension PickCharacterViewController: UICollectionViewDelegate {
let sectionOffset = indexPath.section * (characterData.count / 2)
let selectedCharacter = characterData[sectionOffset + indexPath.row]


if selectedCharacter.availableToPick {
if selectedPlayer == 1 {
if pickedCharacterForPlayer1 == nil {
Expand All @@ -274,7 +270,7 @@ extension PickCharacterViewController: UICollectionViewDelegate {

pickedCharacterForPlayer1 = selectedCharacter

cell?.alpha = 0.5
cell?.alpha = 0.7

characterData[sectionOffset + indexPath.row].availableToPick = false
selectedPlayer = 2
Expand All @@ -297,13 +293,12 @@ extension PickCharacterViewController: UICollectionViewDelegate {
])

pickedCharacterForPlayer2 = selectedCharacter
cell?.alpha = 0.5
cell?.alpha = 0.7
characterData[sectionOffset + indexPath.row].availableToPick = false
nextButton.alpha = 1.0
selectedPlayer = 1
}
}
collectionView.reloadData()
}
}
}
Expand Down