Skip to content
This repository has been archived by the owner on Nov 17, 2024. It is now read-only.

feat: Allow Paimon to evaluate the warps. #145

Merged
merged 3 commits into from
Oct 3, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "UI_EmotionIcon1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "UI_EmotionIcon2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "UI_EmotionIcon3.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "UI_EmotionIcon4.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "UI_EmotionIcon5.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
5 changes: 5 additions & 0 deletions Common/UserDefaultKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ extension DefaultsKeys {
.init("checkedUpdateVersions", defaultValue: [])
}

/// Whether using Paimon to evaluate the gacha records.
var useGuestGachaEvaluator: DefaultsKey<Bool> {
.init("useGuestGachaEvaluator", defaultValue: false)
}

// MARK: - For widgets

var widgetTimelineLatestStartAppRefreshTime: DefaultsKey<Date?> {
Expand Down
20 changes: 11 additions & 9 deletions Features/Gacha/View/AccountGachaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ private struct GachaStatisticSectionView: View {
if gachaType != .regularWarp {
VStack {
HStack {
Text("gacha.account_detail.statistic.pom_pom_review")
let keyPaimon = "gacha.account_detail.statistic.paimon_review"
let keyPomPom = "gacha.account_detail.statistic.pom_pom_review"
Text(Defaults[\.useGuestGachaEvaluator] ? keyPaimon : keyPomPom)
.font(.caption)
.foregroundColor(.secondary)
Spacer()
Expand All @@ -321,10 +323,10 @@ private struct GachaStatisticSectionView: View {
ForEach(Rank.allCases, id: \.rawValue) { rank in
Group {
if judgedRank == rank {
rank.image().resizable()
rank.image(neighborGame: Defaults[\.useGuestGachaEvaluator]).resizable()
.scaledToFit()
} else {
rank.image().resizable()
rank.image(neighborGame: Defaults[\.useGuestGachaEvaluator]).resizable()
.scaledToFit()
.opacity(0.25)
}
Expand All @@ -344,18 +346,18 @@ private struct GachaStatisticSectionView: View {
}

extension GachaStatisticSectionView.Rank {
func image() -> Image {
func image(neighborGame: Bool = false) -> Image {
switch self {
case .one:
return Image("Pom-Pom_Sticker_21")
return neighborGame ? Image("UI_EmotionIcon5") : Image("Pom-Pom_Sticker_21")
case .two:
return Image("Pom-Pom_Sticker_32")
return neighborGame ? Image("UI_EmotionIcon4") : Image("Pom-Pom_Sticker_32")
case .three:
return Image("Pom-Pom_Sticker_18")
return neighborGame ? Image("UI_EmotionIcon3") : Image("Pom-Pom_Sticker_18")
case .four:
return Image("Pom-Pom_Sticker_24")
return neighborGame ? Image("UI_EmotionIcon2") : Image("Pom-Pom_Sticker_24")
case .five:
return Image("Pom-Pom_Sticker_30")
return neighborGame ? Image("UI_EmotionIcon1") : Image("Pom-Pom_Sticker_30")
}
}

Expand Down
12 changes: 12 additions & 0 deletions HSRPizzaHelper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
5BB6BD702ACAC529001D6847 /* DisplayOptionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BB6BD6F2ACAC529001D6847 /* DisplayOptionsView.swift */; };
BF06C4A52A04D42900EE9120 /* WebViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF06C4A42A04D42900EE9120 /* WebViews.swift */; };
BF06C4A82A04FD1F00EE9120 /* ReviewHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF06C4A72A04FD1F00EE9120 /* ReviewHandler.swift */; };
BF14CFA82A049ADB00E437C6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = BF14CFAA2A049ADB00E437C6 /* Localizable.strings */; };
Expand Down Expand Up @@ -312,6 +313,7 @@
5B0BAC842A265E5700B0B8F8 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/HSRPizzaHelperWidget.strings"; sourceTree = "<group>"; };
5B0BAC852A265E5700B0B8F8 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
5B0BAC862A265E5700B0B8F8 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
5BB6BD6F2ACAC529001D6847 /* DisplayOptionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayOptionsView.swift; sourceTree = "<group>"; };
BF06C4A42A04D42900EE9120 /* WebViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViews.swift; sourceTree = "<group>"; };
BF06C4A72A04FD1F00EE9120 /* ReviewHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewHandler.swift; sourceTree = "<group>"; };
BF14CFA92A049ADB00E437C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -549,6 +551,14 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
5BB6BD6E2ACAC514001D6847 /* SubViews */ = {
isa = PBXGroup;
children = (
5BB6BD6F2ACAC529001D6847 /* DisplayOptionsView.swift */,
);
path = SubViews;
sourceTree = "<group>";
};
BF14CFA72A049AC100E437C6 /* Internationalization */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1105,6 +1115,7 @@
EAE519CA2A0178D100EF23B7 /* View */ = {
isa = PBXGroup;
children = (
5BB6BD6E2ACAC514001D6847 /* SubViews */,
EADA63762A0201B200BF070F /* HomeView.swift */,
EAE37EBE2A0206AC00154432 /* SettingView.swift */,
EA1D523D2A76521E00FA66A9 /* ToolView.swift */,
Expand Down Expand Up @@ -1545,6 +1556,7 @@
EA5F23322A0BE87000D6D024 /* OnFocused.swift in Sources */,
EA742BF92A020B8700ACB8E4 /* GetCookieWebView.swift in Sources */,
EA2C06522A04AC5A00A328E6 /* TestAccountSectionView.swift in Sources */,
5BB6BD702ACAC529001D6847 /* DisplayOptionsView.swift in Sources */,
EAE519822A01738600EF23B7 /* ContentView.swift in Sources */,
EA1D523E2A76521E00FA66A9 /* ToolView.swift in Sources */,
EADA63752A01FF8B00BF070F /* DailyNoteViewModel.swift in Sources */,
Expand Down
9 changes: 9 additions & 0 deletions HSRPizzaHelper/View/SettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ struct SettingView: View {
Image(systemSymbol: .bellBadgeFill)
}
}
NavigationLink {
DisplayOptionsView()
} label: {
Label {
Text("setting.uirelated.title")
} icon: {
Image(systemSymbol: .uiwindowSplit2x1)
}
}
}
Section {
Button {
Expand Down
38 changes: 38 additions & 0 deletions HSRPizzaHelper/View/SubViews/DisplayOptionsView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// DisplayOptionsView.swift
// HSRPizzaHelper
//
// Created by ShikiSuen on 2023/10/2.
//

import SwiftUI
import SwiftyUserDefaults

struct DisplayOptionsView: View {
@State var useGuestGachaEvaluator = Binding(
get: {
Defaults[\.useGuestGachaEvaluator]
},
set: {
Defaults[\.useGuestGachaEvaluator] = $0
}
)

var body: some View {
Group {
mainView()
}
.inlineNavigationTitle("setting.uirelated.title")
}

@ViewBuilder
func mainView() -> some View {
List {
Section {
Toggle(isOn: useGuestGachaEvaluator) {
Text("setting.uirelated.useguestgachaevaluator")
}
}
}
}
}
3 changes: 3 additions & 0 deletions Internationalization/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
"setting.notification.daily_training.header" = "Daily Training";
"setting.notification.daily_training.date_picker" = "Notify me at";
"setting.notification.daily_training.footer" = "China mainland server user only. ";
"setting.uirelated.title" = "UI Settings";
"setting.uirelated.useguestgachaevaluator" = "Let Paimon evaluate the warps instead";
"sys.weekday.sunday" = "Sunday";
"sys.weekday.monday" = "Monday";
"sys.weekday.tuesday" = "Tuesday";
Expand Down Expand Up @@ -314,6 +316,7 @@
"gacha.account_detail.statistic.5_star_avg_pull" = "5-star Average Pulls";
"gacha.account_detail.statistic.limited_5_star_avg_pull" = "Limited 5-star Average Pulls";
"gacha.account_detail.statistic.won_5050" = "Won 50/50";
"gacha.account_detail.statistic.paimon_review" = "Paimon's Review";
"gacha.account_detail.statistic.pom_pom_review" = "Pom-Pom's Review";
"gacha.account_detail.detail.title" = "Detail";
"gacha.account_detail.detail.filter.header" = "Filter";
Expand Down
3 changes: 3 additions & 0 deletions Internationalization/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
"setting.notification.daily_training.header" = "Entrenamiento Diario";
"setting.notification.daily_training.date_picker" = "Notificarme cuando";
"setting.notification.daily_training.footer" = "Solo para usuarios del servidor de China Continental. ";
"setting.uirelated.title" = "UI Settings";
"setting.uirelated.useguestgachaevaluator" = "Let Paimon evaluate the warps instead";
"sys.weekday.sunday" = "Domingo ";
"sys.weekday.monday" = "Lunes";
"sys.weekday.tuesday" = "Martes";
Expand Down Expand Up @@ -314,6 +316,7 @@
"gacha.account_detail.statistic.5_star_avg_pull" = "5-star Average Pulls";
"gacha.account_detail.statistic.limited_5_star_avg_pull" = "Limited 5-star Average Pulls";
"gacha.account_detail.statistic.won_5050" = "Won 50/50";
"gacha.account_detail.statistic.paimon_review" = "Paimon's Review";
"gacha.account_detail.statistic.pom_pom_review" = "Pom-Pom's Review";
"gacha.account_detail.detail.title" = "Detail";
"gacha.account_detail.detail.filter.header" = "Filter";
Expand Down
3 changes: 3 additions & 0 deletions Internationalization/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
"setting.notification.daily_training.header" = "デイリー訓練";
"setting.notification.daily_training.date_picker" = "通知の時間:";
"setting.notification.daily_training.footer" = "中国大陸サーバー限定機能である。";
"setting.uirelated.title" = "操作画面設定";
"setting.uirelated.useguestgachaevaluator" = "パイモンに跳躍の評価を";
"sys.weekday.sunday" = "日曜日";
"sys.weekday.monday" = "月曜日";
"sys.weekday.tuesday" = "火曜日";
Expand Down Expand Up @@ -314,6 +316,7 @@
"gacha.account_detail.statistic.5_star_avg_pull" = "星5平均ガチャ回數";
"gacha.account_detail.statistic.limited_5_star_avg_pull" = "限定星5平均ガチャ回數";
"gacha.account_detail.statistic.won_5050" = "すり抜け回避率";
"gacha.account_detail.statistic.paimon_review" = "パイモンの評価";
"gacha.account_detail.statistic.pom_pom_review" = "パムの評価";
"gacha.account_detail.detail.title" = "詳細記録";
"gacha.account_detail.detail.filter.header" = "フィルター";
Expand Down
3 changes: 3 additions & 0 deletions Internationalization/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
"setting.notification.daily_training.header" = "Daily Training";
"setting.notification.daily_training.date_picker" = "Notify me at";
"setting.notification.daily_training.footer" = "China mainland server user only. ";
"setting.uirelated.title" = "UI Settings";
"setting.uirelated.useguestgachaevaluator" = "Let Paimon evaluate the warps instead";
"sys.weekday.sunday" = "Sunday";
"sys.weekday.monday" = "Monday";
"sys.weekday.tuesday" = "Tuesday";
Expand Down Expand Up @@ -314,6 +316,7 @@
"gacha.account_detail.statistic.5_star_avg_pull" = "5-star Average Pulls";
"gacha.account_detail.statistic.limited_5_star_avg_pull" = "Limited 5-star Average Pulls";
"gacha.account_detail.statistic.won_5050" = "Won 50/50";
"gacha.account_detail.statistic.paimon_review" = "Paimon's Review";
"gacha.account_detail.statistic.pom_pom_review" = "Pom-Pom's Review";
"gacha.account_detail.detail.title" = "Detail";
"gacha.account_detail.detail.filter.header" = "Filter";
Expand Down
1 change: 1 addition & 0 deletions Internationalization/vi.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@
"gacha.account_detail.statistic.5_star_avg_pull" = "5-star Average Pulls";
"gacha.account_detail.statistic.limited_5_star_avg_pull" = "Limited 5-star Average Pulls";
"gacha.account_detail.statistic.won_5050" = "Won 50/50";
"gacha.account_detail.statistic.paimon_review" = "Paimon's Review";
"gacha.account_detail.statistic.pom_pom_review" = "Pom-Pom's Review";
"gacha.account_detail.detail.title" = "Detail";
"gacha.account_detail.detail.filter.header" = "Filter";
Expand Down
3 changes: 3 additions & 0 deletions Internationalization/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
"setting.notification.daily_training.header" = "每日实训";
"setting.notification.daily_training.date_picker" = "提醒于";
"setting.notification.daily_training.footer" = "仅中国大陆服务器用户。";
"setting.uirelated.title" = "界面设置";
"setting.uirelated.useguestgachaevaluator" = "改由派蒙评价跃迁";
"sys.weekday.sunday" = "星期日";
"sys.weekday.monday" = "星期一";
"sys.weekday.tuesday" = "星期二";
Expand Down Expand Up @@ -314,6 +316,7 @@
"gacha.account_detail.statistic.5_star_avg_pull" = "五星平均抽数";
"gacha.account_detail.statistic.limited_5_star_avg_pull" = "限定五星平均抽数";
"gacha.account_detail.statistic.won_5050" = "不歪率";
"gacha.account_detail.statistic.paimon_review" = "派蒙的评价";
"gacha.account_detail.statistic.pom_pom_review" = "帕姆的评价";
"gacha.account_detail.detail.title" = "详细记录";
"gacha.account_detail.detail.filter.header" = "筛选";
Expand Down
3 changes: 3 additions & 0 deletions Internationalization/zh-Hant.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
"setting.notification.daily_training.header" = "每日實訓";
"setting.notification.daily_training.date_picker" = "提醒於";
"setting.notification.daily_training.footer" = "僅限中國內地伺服器。";
"setting.uirelated.title" = "介面設定";
"setting.uirelated.useguestgachaevaluator" = "改由派蒙評價躍遷";
"sys.weekday.sunday" = "星期日";
"sys.weekday.monday" = "星期一";
"sys.weekday.tuesday" = "星期二";
Expand Down Expand Up @@ -314,6 +316,7 @@
"gacha.account_detail.statistic.5_star_avg_pull" = "五星平均抽數";
"gacha.account_detail.statistic.limited_5_star_avg_pull" = "限定五星平均抽數";
"gacha.account_detail.statistic.won_5050" = "不歪率";
"gacha.account_detail.statistic.paimon_review" = "派蒙的評價";
"gacha.account_detail.statistic.pom_pom_review" = "帕姆的評價";
"gacha.account_detail.detail.title" = "詳細記錄";
"gacha.account_detail.detail.filter.header" = "篩選";
Expand Down
Loading