diff --git a/assets/cn/ui/MAIN_GOTO_PLAYER.BUTTON.png b/assets/cn/ui/MAIN_GOTO_PLAYER.BUTTON.png new file mode 100644 index 000000000..9fea5fc65 Binary files /dev/null and b/assets/cn/ui/MAIN_GOTO_PLAYER.BUTTON.png differ diff --git a/assets/cn/ui/MAIN_GOTO_PLAYER.png b/assets/cn/ui/MAIN_GOTO_PLAYER.png new file mode 100644 index 000000000..150d9f3a2 Binary files /dev/null and b/assets/cn/ui/MAIN_GOTO_PLAYER.png differ diff --git a/assets/cn/ui/OCR_PLAYER_EXP.png b/assets/cn/ui/OCR_PLAYER_EXP.png new file mode 100644 index 000000000..dae135a7c Binary files /dev/null and b/assets/cn/ui/OCR_PLAYER_EXP.png differ diff --git a/assets/cn/ui/OCR_PLAYER_LEVEL.png b/assets/cn/ui/OCR_PLAYER_LEVEL.png new file mode 100644 index 000000000..8b2b253ef Binary files /dev/null and b/assets/cn/ui/OCR_PLAYER_LEVEL.png differ diff --git a/assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.BUTTON.png b/assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.BUTTON.png new file mode 100644 index 000000000..d56745935 Binary files /dev/null and b/assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.BUTTON.png differ diff --git a/assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.png b/assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.png new file mode 100644 index 000000000..3dbe3110c Binary files /dev/null and b/assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.png differ diff --git a/config/template.json b/config/template.json index 103f5575c..443075854 100644 --- a/config/template.json +++ b/config/template.json @@ -2638,6 +2638,17 @@ "Color": "^00AA00", "Record": "2020-01-01 00:00:00" }, + "PlayerLevel": { + "Value": 0, + "Color": "^FFAA33", + "Record": "2020-01-01 00:00:00" + }, + "PlayerExp": { + "Value": 0, + "Limit": 0, + "Color": "^FFAA33", + "Record": "2020-01-01 00:00:00" + }, "Storage": { "Storage": {} } diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 332ac6bc9..aaea17552 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -13127,6 +13127,42 @@ "validate": "datetime" } }, + "PlayerLevel": { + "Value": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^FFAA33", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, + "PlayerExp": { + "Value": { + "type": "input", + "value": 0 + }, + "Limit": { + "type": "input", + "value": 0 + }, + "Color": { + "type": "input", + "value": "^FFAA33", + "display": "hide" + }, + "Record": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, "Storage": { "Storage": { "type": "storage", diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 916910e82..3d6e5ce0a 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -1069,8 +1069,19 @@ ResearchPercent: value: ^000000 display: hide Record: 2020-01-01 00:00:00 - - +PlayerLevel: + Value: 0 + Color: + value: ^000000 + display: hide + Record: 2020-01-01 00:00:00 +PlayerExp: + Value: 0 + Limit: 0 + Color: + value: ^000000 + display: hide + Record: 2020-01-01 00:00:00 # ==================== AutoRestart ==================== AutoRestart: diff --git a/module/config/argument/dashboard.yaml b/module/config/argument/dashboard.yaml index 65b62eaf8..0ea6f54fb 100644 --- a/module/config/argument/dashboard.yaml +++ b/module/config/argument/dashboard.yaml @@ -16,4 +16,6 @@ Dashboard: - Medal - Merit - GuildCoin - - ResearchPercent \ No newline at end of file + - ResearchPercent + - PlayerLevel + - PlayerExp \ No newline at end of file diff --git a/module/config/argument/gui.yaml b/module/config/argument/gui.yaml index e4c8fb0e9..894a3d616 100644 --- a/module/config/argument/gui.yaml +++ b/module/config/argument/gui.yaml @@ -72,6 +72,8 @@ Overview: Core: GuildCoin: ResearchPercent: + PlayerLevel: + PlayerExp: Log: Running: Pending: diff --git a/module/config/argument/override.yaml b/module/config/argument/override.yaml index 02f17dda7..6be3cfa5a 100644 --- a/module/config/argument/override.yaml +++ b/module/config/argument/override.yaml @@ -501,3 +501,7 @@ Dashboard: Color: ^AAAAAA ResearchPercent: Color: ^00AA00 + PlayerLevel: + Color: ^FFAA33 + PlayerExp: + Color: ^FFAA33 diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 0f622f8a3..b4e559eb0 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -644,6 +644,17 @@ class GeneratedConfig: ResearchPercent_Color = '^000000' ResearchPercent_Record = datetime.datetime(2020, 1, 1, 0, 0) + # Group `PlayerLevel` + PlayerLevel_Value = 0 + PlayerLevel_Color = '^000000' + PlayerLevel_Record = datetime.datetime(2020, 1, 1, 0, 0) + + # Group `PlayerExp` + PlayerExp_Value = 0 + PlayerExp_Limit = 0 + PlayerExp_Color = '^000000' + PlayerExp_Record = datetime.datetime(2020, 1, 1, 0, 0) + # Group `AutoRestart` AutoRestart_Enabled = False AutoRestart_AttemptsToRestart = 114514 diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index d5ca5c6b0..121229bae 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -3567,6 +3567,46 @@ "help": "ResearchPercent.Record.help" } }, + "PlayerLevel": { + "_info": { + "name": "PlayerLevel._info.name", + "help": "PlayerLevel._info.help" + }, + "Value": { + "name": "PlayerLevel.Value.name", + "help": "PlayerLevel.Value.help" + }, + "Color": { + "name": "PlayerLevel.Color.name", + "help": "PlayerLevel.Color.help" + }, + "Record": { + "name": "PlayerLevel.Record.name", + "help": "PlayerLevel.Record.help" + } + }, + "PlayerExp": { + "_info": { + "name": "PlayerExp._info.name", + "help": "PlayerExp._info.help" + }, + "Value": { + "name": "PlayerExp.Value.name", + "help": "PlayerExp.Value.help" + }, + "Limit": { + "name": "PlayerExp.Limit.name", + "help": "PlayerExp.Limit.help" + }, + "Color": { + "name": "PlayerExp.Color.name", + "help": "PlayerExp.Color.help" + }, + "Record": { + "name": "PlayerExp.Record.name", + "help": "PlayerExp.Record.help" + } + }, "AutoRestart": { "_info": { "name": "AutoRestart._info.name", @@ -3689,6 +3729,8 @@ "Core": "Core Data", "GuildCoin": "Guild Coin", "ResearchPercent": "Gui.Overview.ResearchPercent", + "PlayerLevel": "Gui.Overview.PlayerLevel", + "PlayerExp": "Gui.Overview.PlayerExp", "Log": "Log", "Running": "Running", "Pending": "Pending", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index dde90e76e..e61fc22ee 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -3567,6 +3567,46 @@ "help": "ResearchPercent.Record.help" } }, + "PlayerLevel": { + "_info": { + "name": "PlayerLevel._info.name", + "help": "PlayerLevel._info.help" + }, + "Value": { + "name": "PlayerLevel.Value.name", + "help": "PlayerLevel.Value.help" + }, + "Color": { + "name": "PlayerLevel.Color.name", + "help": "PlayerLevel.Color.help" + }, + "Record": { + "name": "PlayerLevel.Record.name", + "help": "PlayerLevel.Record.help" + } + }, + "PlayerExp": { + "_info": { + "name": "PlayerExp._info.name", + "help": "PlayerExp._info.help" + }, + "Value": { + "name": "PlayerExp.Value.name", + "help": "PlayerExp.Value.help" + }, + "Limit": { + "name": "PlayerExp.Limit.name", + "help": "PlayerExp.Limit.help" + }, + "Color": { + "name": "PlayerExp.Color.name", + "help": "PlayerExp.Color.help" + }, + "Record": { + "name": "PlayerExp.Record.name", + "help": "PlayerExp.Record.help" + } + }, "AutoRestart": { "_info": { "name": "AutoRestart._info.name", @@ -3689,6 +3729,8 @@ "Core": "Core Data", "GuildCoin": "Guild Coin", "ResearchPercent": "Gui.Overview.ResearchPercent", + "PlayerLevel": "Gui.Overview.PlayerLevel", + "PlayerExp": "Gui.Overview.PlayerExp", "Log": "ログ", "Running": "実行中", "Pending": "隊列中", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 0ed33f256..c1834ef1c 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -3567,6 +3567,46 @@ "help": "ResearchPercent.Record.help" } }, + "PlayerLevel": { + "_info": { + "name": "PlayerLevel._info.name", + "help": "PlayerLevel._info.help" + }, + "Value": { + "name": "PlayerLevel.Value.name", + "help": "PlayerLevel.Value.help" + }, + "Color": { + "name": "PlayerLevel.Color.name", + "help": "PlayerLevel.Color.help" + }, + "Record": { + "name": "PlayerLevel.Record.name", + "help": "PlayerLevel.Record.help" + } + }, + "PlayerExp": { + "_info": { + "name": "PlayerExp._info.name", + "help": "PlayerExp._info.help" + }, + "Value": { + "name": "PlayerExp.Value.name", + "help": "PlayerExp.Value.help" + }, + "Limit": { + "name": "PlayerExp.Limit.name", + "help": "PlayerExp.Limit.help" + }, + "Color": { + "name": "PlayerExp.Color.name", + "help": "PlayerExp.Color.help" + }, + "Record": { + "name": "PlayerExp.Record.name", + "help": "PlayerExp.Record.help" + } + }, "AutoRestart": { "_info": { "name": "自动重启", @@ -3689,6 +3729,8 @@ "Core": "核心数据", "GuildCoin": "舰队币", "ResearchPercent": "科研船进度", + "PlayerLevel": "指挥官等级", + "PlayerExp": "指挥官经验", "Log": "日志", "Running": "运行中", "Pending": "队列中", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 8fac771b5..09f86a268 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -3567,6 +3567,46 @@ "help": "ResearchPercent.Record.help" } }, + "PlayerLevel": { + "_info": { + "name": "PlayerLevel._info.name", + "help": "PlayerLevel._info.help" + }, + "Value": { + "name": "PlayerLevel.Value.name", + "help": "PlayerLevel.Value.help" + }, + "Color": { + "name": "PlayerLevel.Color.name", + "help": "PlayerLevel.Color.help" + }, + "Record": { + "name": "PlayerLevel.Record.name", + "help": "PlayerLevel.Record.help" + } + }, + "PlayerExp": { + "_info": { + "name": "PlayerExp._info.name", + "help": "PlayerExp._info.help" + }, + "Value": { + "name": "PlayerExp.Value.name", + "help": "PlayerExp.Value.help" + }, + "Limit": { + "name": "PlayerExp.Limit.name", + "help": "PlayerExp.Limit.help" + }, + "Color": { + "name": "PlayerExp.Color.name", + "help": "PlayerExp.Color.help" + }, + "Record": { + "name": "PlayerExp.Record.name", + "help": "PlayerExp.Record.help" + } + }, "AutoRestart": { "_info": { "name": "AutoRestart._info.name", @@ -3689,6 +3729,8 @@ "Core": "覈心數據", "GuildCoin": "艦隊幣", "ResearchPercent": "Gui.Overview.ResearchPercent", + "PlayerLevel": "Gui.Overview.PlayerLevel", + "PlayerExp": "Gui.Overview.PlayerExp", "Log": "日誌", "Running": "執行中", "Pending": "佇列中", diff --git a/module/ui/assets.py b/module/ui/assets.py index 5b02726e0..6f244ee79 100644 --- a/module/ui/assets.py +++ b/module/ui/assets.py @@ -52,6 +52,7 @@ MAIN_GOTO_EVENT_LIST = Button(area={'cn': (607, 141, 657, 191), 'en': (607, 141, MAIN_GOTO_FLEET = Button(area={'cn': (859, 372, 936, 410), 'en': (832, 378, 975, 404), 'jp': (736, 360, 985, 435), 'tw': (855, 371, 936, 411)}, color={'cn': (187, 216, 248), 'en': (183, 215, 247), 'jp': (107, 164, 233), 'tw': (180, 212, 248)}, button={'cn': (749, 364, 992, 430), 'en': (777, 365, 987, 423), 'jp': (736, 360, 985, 435), 'tw': (741, 364, 990, 435)}, file={'cn': './assets/cn/ui/MAIN_GOTO_FLEET.png', 'en': './assets/en/ui/MAIN_GOTO_FLEET.png', 'jp': './assets/jp/ui/MAIN_GOTO_FLEET.png', 'tw': './assets/tw/ui/MAIN_GOTO_FLEET.png'}) MAIN_GOTO_GUILD = Button(area={'cn': (1116, 666, 1241, 713), 'en': (1119, 667, 1267, 711), 'jp': (1127, 671, 1253, 709), 'tw': (1119, 667, 1267, 711)}, color={'cn': (81, 99, 133), 'en': (72, 89, 123), 'jp': (104, 128, 167), 'tw': (72, 89, 123)}, button={'cn': (1116, 666, 1241, 713), 'en': (1119, 667, 1267, 711), 'jp': (1127, 671, 1253, 709), 'tw': (1119, 667, 1267, 711)}, file={'cn': './assets/cn/ui/MAIN_GOTO_GUILD.png', 'en': './assets/en/ui/MAIN_GOTO_GUILD.png', 'jp': './assets/jp/ui/MAIN_GOTO_GUILD.png', 'tw': './assets/tw/ui/MAIN_GOTO_GUILD.png'}) MAIN_GOTO_MISSION = Button(area={'cn': (816, 666, 932, 713), 'en': (818, 667, 953, 712), 'jp': (805, 665, 955, 710), 'tw': (816, 666, 932, 713)}, color={'cn': (93, 110, 140), 'en': (91, 112, 150), 'jp': (85, 99, 131), 'tw': (93, 110, 140)}, button={'cn': (816, 666, 932, 713), 'en': (818, 667, 953, 712), 'jp': (805, 665, 955, 710), 'tw': (816, 666, 932, 713)}, file={'cn': './assets/cn/ui/MAIN_GOTO_MISSION.png', 'en': './assets/en/ui/MAIN_GOTO_MISSION.png', 'jp': './assets/jp/ui/MAIN_GOTO_MISSION.png', 'tw': './assets/tw/ui/MAIN_GOTO_MISSION.png'}) +MAIN_GOTO_PLAYER = Button(area={'cn': (23, 31, 28, 37), 'en': (23, 31, 28, 37), 'jp': (23, 31, 28, 37), 'tw': (23, 31, 28, 37)}, color={'cn': (56, 85, 130), 'en': (56, 85, 130), 'jp': (56, 85, 130), 'tw': (56, 85, 130)}, button={'cn': (26, 33, 88, 76), 'en': (26, 33, 88, 76), 'jp': (26, 33, 88, 76), 'tw': (26, 33, 88, 76)}, file={'cn': './assets/cn/ui/MAIN_GOTO_PLAYER.png', 'en': './assets/cn/ui/MAIN_GOTO_PLAYER.png', 'jp': './assets/cn/ui/MAIN_GOTO_PLAYER.png', 'tw': './assets/cn/ui/MAIN_GOTO_PLAYER.png'}) MAIN_GOTO_RAID = Button(area={'cn': (1029, 304, 1102, 342), 'en': (1027, 307, 1118, 333), 'jp': (1006, 288, 1155, 436), 'tw': (1026, 303, 1104, 344)}, color={'cn': (240, 213, 157), 'en': (243, 219, 165), 'jp': (216, 171, 100), 'tw': (240, 213, 162)}, button={'cn': (610, 264, 654, 305), 'en': (610, 264, 654, 305), 'jp': (606, 264, 653, 305), 'tw': (610, 264, 654, 305)}, file={'cn': './assets/cn/ui/MAIN_GOTO_RAID.png', 'en': './assets/en/ui/MAIN_GOTO_RAID.png', 'jp': './assets/jp/ui/MAIN_GOTO_RAID.png', 'tw': './assets/tw/ui/MAIN_GOTO_RAID.png'}) MAIN_GOTO_RESHMENU = Button(area={'cn': (1029, 304, 1102, 342), 'en': (1027, 307, 1118, 333), 'jp': (1006, 288, 1155, 436), 'tw': (1026, 303, 1104, 344)}, color={'cn': (240, 213, 157), 'en': (243, 219, 165), 'jp': (216, 171, 100), 'tw': (240, 213, 162)}, button={'cn': (644, 666, 798, 713), 'en': (645, 665, 796, 713), 'jp': (647, 670, 774, 710), 'tw': (644, 666, 798, 713)}, file={'cn': './assets/cn/ui/MAIN_GOTO_RESHMENU.png', 'en': './assets/en/ui/MAIN_GOTO_RESHMENU.png', 'jp': './assets/jp/ui/MAIN_GOTO_RESHMENU.png', 'tw': './assets/tw/ui/MAIN_GOTO_RESHMENU.png'}) MAIN_GOTO_REWARD = Button(area={'cn': (11, 139, 30, 189), 'en': (11, 139, 30, 189), 'jp': (11, 139, 30, 189), 'tw': (11, 139, 30, 189)}, color={'cn': (69, 81, 115), 'en': (69, 81, 115), 'jp': (69, 81, 115), 'tw': (69, 81, 115)}, button={'cn': (11, 139, 30, 189), 'en': (11, 139, 30, 189), 'jp': (11, 139, 30, 189), 'tw': (11, 139, 30, 189)}, file={'cn': './assets/cn/ui/MAIN_GOTO_REWARD.png', 'en': './assets/en/ui/MAIN_GOTO_REWARD.png', 'jp': './assets/jp/ui/MAIN_GOTO_REWARD.png', 'tw': './assets/tw/ui/MAIN_GOTO_REWARD.png'}) @@ -63,6 +64,8 @@ MEOWFFICER_INFO = Button(area={'cn': (1090, 603, 1241, 650), 'en': (1106, 616, 1 META_CHECK = Button(area={'cn': (120, 14, 209, 35), 'en': (148, 13, 265, 36), 'jp': (125, 11, 235, 39), 'tw': (120, 14, 209, 35)}, color={'cn': (159, 143, 144), 'en': (170, 156, 156), 'jp': (124, 105, 106), 'tw': (159, 143, 144)}, button={'cn': (120, 14, 209, 35), 'en': (148, 13, 265, 36), 'jp': (125, 11, 235, 39), 'tw': (120, 14, 209, 35)}, file={'cn': './assets/cn/ui/META_CHECK.png', 'en': './assets/en/ui/META_CHECK.png', 'jp': './assets/jp/ui/META_CHECK.png', 'tw': './assets/tw/ui/META_CHECK.png'}) MISSION_CHECK = Button(area={'cn': (120, 15, 173, 40), 'en': (123, 18, 221, 37), 'jp': (120, 14, 173, 40), 'tw': (119, 12, 176, 42)}, color={'cn': (141, 156, 194), 'en': (104, 117, 158), 'jp': (150, 165, 202), 'tw': (125, 139, 178)}, button={'cn': (120, 15, 173, 40), 'en': (123, 18, 221, 37), 'jp': (120, 14, 173, 40), 'tw': (119, 12, 176, 42)}, file={'cn': './assets/cn/ui/MISSION_CHECK.png', 'en': './assets/en/ui/MISSION_CHECK.png', 'jp': './assets/jp/ui/MISSION_CHECK.png', 'tw': './assets/tw/ui/MISSION_CHECK.png'}) MUNITIONS_CHECK = Button(area={'cn': (32, 621, 86, 647), 'en': (25, 622, 85, 644), 'jp': (23, 625, 80, 645), 'tw': (31, 619, 88, 649)}, color={'cn': (151, 147, 147), 'en': (174, 171, 171), 'jp': (99, 91, 91), 'tw': (127, 121, 121)}, button={'cn': (32, 621, 86, 647), 'en': (25, 622, 85, 644), 'jp': (23, 625, 80, 645), 'tw': (31, 619, 88, 649)}, file={'cn': './assets/cn/ui/MUNITIONS_CHECK.png', 'en': './assets/en/ui/MUNITIONS_CHECK.png', 'jp': './assets/jp/ui/MUNITIONS_CHECK.png', 'tw': './assets/tw/ui/MUNITIONS_CHECK.png'}) +OCR_PLAYER_EXP = Button(area={'cn': (1075, 162, 1266, 184), 'en': (1075, 162, 1266, 184), 'jp': (1075, 162, 1266, 184), 'tw': (1075, 162, 1266, 184)}, color={'cn': (110, 106, 124), 'en': (110, 106, 124), 'jp': (110, 106, 124), 'tw': (110, 106, 124)}, button={'cn': (1075, 162, 1266, 184), 'en': (1075, 162, 1266, 184), 'jp': (1075, 162, 1266, 184), 'tw': (1075, 162, 1266, 184)}, file={'cn': './assets/cn/ui/OCR_PLAYER_EXP.png', 'en': './assets/cn/ui/OCR_PLAYER_EXP.png', 'jp': './assets/cn/ui/OCR_PLAYER_EXP.png', 'tw': './assets/cn/ui/OCR_PLAYER_EXP.png'}) +OCR_PLAYER_LEVEL = Button(area={'cn': (1158, 125, 1269, 156), 'en': (1158, 125, 1269, 156), 'jp': (1158, 125, 1269, 156), 'tw': (1158, 125, 1269, 156)}, color={'cn': (108, 105, 125), 'en': (108, 105, 125), 'jp': (108, 105, 125), 'tw': (108, 105, 125)}, button={'cn': (1158, 125, 1269, 156), 'en': (1158, 125, 1269, 156), 'jp': (1158, 125, 1269, 156), 'tw': (1158, 125, 1269, 156)}, file={'cn': './assets/cn/ui/OCR_PLAYER_LEVEL.png', 'en': './assets/cn/ui/OCR_PLAYER_LEVEL.png', 'jp': './assets/cn/ui/OCR_PLAYER_LEVEL.png', 'tw': './assets/cn/ui/OCR_PLAYER_LEVEL.png'}) OS_CHECK = Button(area={'cn': (613, 17, 627, 34), 'en': (613, 17, 627, 34), 'jp': (613, 17, 627, 34), 'tw': (613, 17, 627, 34)}, color={'cn': (58, 117, 146), 'en': (58, 117, 146), 'jp': (58, 117, 146), 'tw': (58, 117, 146)}, button={'cn': (613, 17, 627, 34), 'en': (613, 17, 627, 34), 'jp': (613, 17, 627, 34), 'tw': (613, 17, 627, 34)}, file={'cn': './assets/cn/ui/OS_CHECK.png', 'en': './assets/en/ui/OS_CHECK.png', 'jp': './assets/jp/ui/OS_CHECK.png', 'tw': './assets/tw/ui/OS_CHECK.png'}) PLAYER_CHECK = Button(area={'cn': (28, 668, 139, 688), 'en': (11, 649, 157, 705), 'jp': (26, 668, 139, 689), 'tw': (28, 668, 139, 688)}, color={'cn': (237, 204, 127), 'en': (197, 156, 97), 'jp': (237, 205, 128), 'tw': (237, 204, 127)}, button={'cn': (28, 668, 139, 688), 'en': (11, 649, 157, 705), 'jp': (26, 668, 139, 689), 'tw': (28, 668, 139, 688)}, file={'cn': './assets/cn/ui/PLAYER_CHECK.png', 'en': './assets/en/ui/PLAYER_CHECK.png', 'jp': './assets/jp/ui/PLAYER_CHECK.png', 'tw': './assets/tw/ui/PLAYER_CHECK.png'}) RAID_CHECK = Button(area={'cn': (107, 13, 216, 38), 'en': (107, 15, 188, 34), 'jp': (107, 13, 217, 40), 'tw': (111, 9, 228, 42)}, color={'cn': (129, 131, 129), 'en': (85, 87, 85), 'jp': (127, 129, 127), 'tw': (132, 154, 140)}, button={'cn': (107, 13, 216, 38), 'en': (107, 15, 188, 34), 'jp': (107, 13, 217, 40), 'tw': (111, 9, 228, 42)}, file={'cn': './assets/cn/ui/RAID_CHECK.png', 'en': './assets/en/ui/RAID_CHECK.png', 'jp': './assets/jp/ui/RAID_CHECK.png', 'tw': './assets/tw/ui/RAID_CHECK.png'}) diff --git a/module/ui/page.py b/module/ui/page.py index c6dee5023..10440a7d7 100644 --- a/module/ui/page.py +++ b/module/ui/page.py @@ -303,3 +303,8 @@ page_main_white.link(button=MAIL_ENTER_WHITE, destination=page_mail) # Keep page_rpg_stage, so Raid can import page_rpg_stage = page_raid + +# Player +page_player = Page(PLAYER_CHECK) +page_main.link(button=MAIN_GOTO_PLAYER, destination=page_player) +page_main_white.link(button=MAIN_GOTO_PLAYER_WHITE, destination=page_player) diff --git a/module/ui/ui.py b/module/ui/ui.py index 345453b87..ff713b100 100644 --- a/module/ui/ui.py +++ b/module/ui/ui.py @@ -1,7 +1,10 @@ +from datetime import datetime, timedelta + from module.base.button import Button from module.base.decorator import run_once from module.base.timer import Timer from module.combat.assets import GET_ITEMS_1, GET_ITEMS_2, GET_SHIP +from module.config.utils import deep_get from module.exception import (GameNotRunningError, GamePageUnknownError, GameTooManyClickError) from module.exercise.assets import EXERCISE_PREPARATION @@ -10,6 +13,7 @@ from module.handler.assets import (AUTO_SEARCH_MENU_EXIT, BATTLE_PASS_NOTICE, GA LOGIN_ANNOUNCE_2, LOGIN_CHECK, LOGIN_RETURN_SIGN, MAINTENANCE_ANNOUNCE, MONTHLY_PASS_NOTICE) from module.handler.info_handler import InfoHandler +from module.log_res.log_res import LogRes from module.logger import logger from module.map.assets import (FLEET_PREPARATION, MAP_PREPARATION, MAP_PREPARATION_CANCEL, WITHDRAW) @@ -18,7 +22,7 @@ from module.ocr.ocr import Ocr from module.os_handler.assets import (AUTO_SEARCH_REWARD, EXCHANGE_CHECK, RESET_FLEET_PREPARATION, RESET_TICKET_POPUP) from module.raid.assets import * from module.ui.assets import * -from module.ui.page import (Page, page_campaign, page_event, page_main, page_main_white, page_sp) +from module.ui.page import (Page, page_campaign, page_event, page_main, page_main_white, page_sp, page_player) from module.ui_white.assets import * @@ -218,7 +222,44 @@ class UI(InfoHandler): logger.critical("Please switch to a supported page before starting Alas") raise GamePageUnknownError - def ui_goto(self, destination, offset=(30, 30), skip_first_screenshot=True): + def update_player_info(self): + self.ui_goto_old(page_player) + + img = self.device.screenshot() + + level_ocr = Ocr(buttons=OCR_PLAYER_LEVEL) + level_res = level_ocr.ocr(img) + exp_ocr = Ocr(buttons=OCR_PLAYER_EXP) + exp_res = exp_ocr.ocr(img) + + if isinstance(level_res, str): + level_str = level_res.replace(".", "").lower().replace("lv", "") + if level_str.isdigit(): + LogRes(config=self.config).PlayerLevel = { + "Value": int(level_str) + } + + if isinstance(exp_res, str): + exp_info = exp_res.split("/") + if len(exp_info) == 2: + curr_exp, exp_limit = exp_info[0], exp_info[1] + if curr_exp.isdigit() and exp_limit.isdigit(): + LogRes(config=self.config).PlayerExp = { + "Value": int(curr_exp), + "Limit": int(exp_limit) + } + + self.config.save(self.config.config_name) + + def ui_goto(self, destination, *args, **kwargs): + player_info_last_updated_time = deep_get(self.config.data, "Dashboard.PlayerExp.Record") + now = datetime.now() + if now >= player_info_last_updated_time + timedelta(hours=24): + self.update_player_info() + + self.ui_goto_old(destination, *args, **kwargs) + + def ui_goto_old(self, destination, offset=(30, 30), skip_first_screenshot=True): """ Args: destination (Page): diff --git a/module/ui_white/assets.py b/module/ui_white/assets.py index 5af6b7a4e..7561234e5 100644 --- a/module/ui_white/assets.py +++ b/module/ui_white/assets.py @@ -16,6 +16,7 @@ MAIN_GOTO_FLEET_WHITE = Button(area={'cn': (1025, 437, 1097, 579), 'en': (1024, MAIN_GOTO_GUILD_WHITE = Button(area={'cn': (1116, 656, 1261, 703), 'en': (1115, 657, 1262, 703), 'jp': (1115, 658, 1261, 703), 'tw': (1116, 657, 1261, 703)}, color={'cn': (213, 206, 209), 'en': (217, 215, 216), 'jp': (212, 209, 207), 'tw': (211, 207, 213)}, button={'cn': (1116, 656, 1261, 703), 'en': (1115, 657, 1262, 703), 'jp': (1115, 658, 1261, 703), 'tw': (1116, 657, 1261, 703)}, file={'cn': './assets/cn/ui_white/MAIN_GOTO_GUILD_WHITE.png', 'en': './assets/en/ui_white/MAIN_GOTO_GUILD_WHITE.png', 'jp': './assets/jp/ui_white/MAIN_GOTO_GUILD_WHITE.png', 'tw': './assets/tw/ui_white/MAIN_GOTO_GUILD_WHITE.png'}) MAIN_GOTO_MEMORIES_WHITE = Button(area={'cn': (1125, 546, 1195, 579), 'en': (1125, 546, 1195, 579), 'jp': (1125, 546, 1195, 579), 'tw': (1125, 546, 1195, 579)}, color={'cn': (255, 152, 191), 'en': (255, 152, 191), 'jp': (255, 152, 191), 'tw': (255, 152, 191)}, button={'cn': (1125, 546, 1195, 579), 'en': (1125, 546, 1195, 579), 'jp': (1125, 546, 1195, 579), 'tw': (1125, 546, 1195, 579)}, file={'cn': './assets/cn/ui_white/MAIN_GOTO_MEMORIES_WHITE.png', 'en': './assets/en/ui_white/MAIN_GOTO_MEMORIES_WHITE.png', 'jp': './assets/jp/ui_white/MAIN_GOTO_MEMORIES_WHITE.png', 'tw': './assets/tw/ui_white/MAIN_GOTO_MEMORIES_WHITE.png'}) MAIN_GOTO_MISSION_WHITE = Button(area={'cn': (802, 656, 949, 704), 'en': (803, 656, 948, 703), 'jp': (802, 657, 948, 703), 'tw': (803, 657, 948, 703)}, color={'cn': (219, 213, 214), 'en': (210, 207, 207), 'jp': (224, 216, 221), 'tw': (212, 211, 215)}, button={'cn': (802, 656, 949, 704), 'en': (803, 656, 948, 703), 'jp': (802, 657, 948, 703), 'tw': (803, 657, 948, 703)}, file={'cn': './assets/cn/ui_white/MAIN_GOTO_MISSION_WHITE.png', 'en': './assets/en/ui_white/MAIN_GOTO_MISSION_WHITE.png', 'jp': './assets/jp/ui_white/MAIN_GOTO_MISSION_WHITE.png', 'tw': './assets/tw/ui_white/MAIN_GOTO_MISSION_WHITE.png'}) +MAIN_GOTO_PLAYER_WHITE = Button(area={'cn': (15, 11, 75, 14), 'en': (15, 11, 75, 14), 'jp': (15, 11, 75, 14), 'tw': (15, 11, 75, 14)}, color={'cn': (254, 255, 255), 'en': (254, 255, 255), 'jp': (254, 255, 255), 'tw': (254, 255, 255)}, button={'cn': (12, 13, 78, 79), 'en': (12, 13, 78, 79), 'jp': (12, 13, 78, 79), 'tw': (12, 13, 78, 79)}, file={'cn': './assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.png', 'en': './assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.png', 'jp': './assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.png', 'tw': './assets/cn/ui_white/MAIN_GOTO_PLAYER_WHITE.png'}) MAIN_GOTO_RESHMENU_WHITE = Button(area={'cn': (646, 656, 793, 703), 'en': (646, 656, 792, 703), 'jp': (646, 657, 792, 703), 'tw': (646, 656, 792, 703)}, color={'cn': (216, 213, 217), 'en': (224, 224, 225), 'jp': (225, 222, 227), 'tw': (220, 216, 225)}, button={'cn': (646, 656, 793, 703), 'en': (646, 656, 792, 703), 'jp': (646, 657, 792, 703), 'tw': (646, 656, 792, 703)}, file={'cn': './assets/cn/ui_white/MAIN_GOTO_RESHMENU_WHITE.png', 'en': './assets/en/ui_white/MAIN_GOTO_RESHMENU_WHITE.png', 'jp': './assets/jp/ui_white/MAIN_GOTO_RESHMENU_WHITE.png', 'tw': './assets/tw/ui_white/MAIN_GOTO_RESHMENU_WHITE.png'}) MAIN_GOTO_REWARD_WHITE = Button(area={'cn': (11, 209, 30, 259), 'en': (11, 216, 31, 253), 'jp': (10, 216, 30, 253), 'tw': (10, 216, 31, 253)}, color={'cn': (73, 84, 122), 'en': (105, 115, 162), 'jp': (79, 82, 108), 'tw': (90, 96, 128)}, button={'cn': (11, 209, 30, 259), 'en': (11, 216, 31, 253), 'jp': (10, 216, 30, 253), 'tw': (10, 216, 31, 253)}, file={'cn': './assets/cn/ui_white/MAIN_GOTO_REWARD_WHITE.png', 'en': './assets/en/ui_white/MAIN_GOTO_REWARD_WHITE.png', 'jp': './assets/jp/ui_white/MAIN_GOTO_REWARD_WHITE.png', 'tw': './assets/tw/ui_white/MAIN_GOTO_REWARD_WHITE.png'}) MAIN_GOTO_SHOP_WHITE = Button(area={'cn': (18, 656, 164, 703), 'en': (18, 656, 165, 703), 'jp': (19, 657, 165, 702), 'tw': (19, 657, 164, 702)}, color={'cn': (221, 214, 212), 'en': (232, 220, 204), 'jp': (231, 223, 218), 'tw': (232, 224, 222)}, button={'cn': (18, 656, 164, 703), 'en': (18, 656, 165, 703), 'jp': (19, 657, 165, 702), 'tw': (19, 657, 164, 702)}, file={'cn': './assets/cn/ui_white/MAIN_GOTO_SHOP_WHITE.png', 'en': './assets/en/ui_white/MAIN_GOTO_SHOP_WHITE.png', 'jp': './assets/jp/ui_white/MAIN_GOTO_SHOP_WHITE.png', 'tw': './assets/tw/ui_white/MAIN_GOTO_SHOP_WHITE.png'})