From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/Guild/XGuildApplyInfo.cs | 8 + .../XMainClient/Guild/XGuildApplyInfo.cs.meta | 12 + .../XMainClient/Guild/XGuildApproveDocument.cs | 183 +++ .../Guild/XGuildApproveDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildArenaBattleDocument.cs | 1157 +++++++++++++++++++ .../Guild/XGuildArenaBattleDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildArenaDocument.cs | 640 ++++++++++ .../XMainClient/Guild/XGuildArenaDocument.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildBasicData.cs | 172 +++ .../XMainClient/Guild/XGuildBasicData.cs.meta | 12 + .../XMainClient/Guild/XGuildBoonBehaviour.cs | 25 + .../XMainClient/Guild/XGuildBoonBehaviour.cs.meta | 12 + .../XMainClient/Guild/XGuildBossRankInfo.cs | 41 + .../XMainClient/Guild/XGuildBossRankInfo.cs.meta | 12 + .../XMainClient/Guild/XGuildBossRankList.cs | 17 + .../XMainClient/Guild/XGuildBossRankList.cs.meta | 12 + .../XMainClient/Guild/XGuildCheckInBonusBrief.cs | 40 + .../Guild/XGuildCheckInBonusBrief.cs.meta | 12 + .../XMainClient/Guild/XGuildCheckInBonusInfo.cs | 162 +++ .../Guild/XGuildCheckInBonusInfo.cs.meta | 12 + .../XMainClient/Guild/XGuildCollectDocument.cs | 798 +++++++++++++ .../Guild/XGuildCollectDocument.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildConfig.cs | 244 ++++ .../Scripts/XMainClient/Guild/XGuildConfig.cs.meta | 12 + .../Guild/XGuildDailyHandleRefreshBehavior.cs | 31 + .../Guild/XGuildDailyHandleRefreshBehavior.cs.meta | 12 + .../Guild/XGuildDailyHandleRefreshDlg.cs | 142 +++ .../Guild/XGuildDailyHandleRefreshDlg.cs.meta | 12 + .../Guild/XGuildDailyRefreshTaskBehavior.cs | 34 + .../Guild/XGuildDailyRefreshTaskBehavior.cs.meta | 12 + .../XMainClient/Guild/XGuildDailyRefreshTaskDlg.cs | 223 ++++ .../Guild/XGuildDailyRefreshTaskDlg.cs.meta | 12 + .../XMainClient/Guild/XGuildDailyTaskBehavior.cs | 71 ++ .../Guild/XGuildDailyTaskBehavior.cs.meta | 12 + .../XMainClient/Guild/XGuildDailyTaskDocument.cs | 1200 +++++++++++++++++++ .../Guild/XGuildDailyTaskDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildDailyTaskView.cs | 619 ++++++++++ .../XMainClient/Guild/XGuildDailyTaskView.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildDocument.cs | 686 +++++++++++ .../XMainClient/Guild/XGuildDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildDonateBehavior.cs | 89 ++ .../XMainClient/Guild/XGuildDonateBehavior.cs.meta | 12 + .../XMainClient/Guild/XGuildDonateDocument.cs | 405 +++++++ .../XMainClient/Guild/XGuildDonateDocument.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildDonateView.cs | 601 ++++++++++ .../XMainClient/Guild/XGuildDonateView.cs.meta | 12 + .../XMainClient/Guild/XGuildDragonBehaviour.cs | 84 ++ .../Guild/XGuildDragonBehaviour.cs.meta | 12 + .../XMainClient/Guild/XGuildDragonDocument.cs | 545 +++++++++ .../XMainClient/Guild/XGuildDragonDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildDragonGuildRankInfo.cs | 44 + .../Guild/XGuildDragonGuildRankInfo.cs.meta | 12 + .../XMainClient/Guild/XGuildDragonGuildRankList.cs | 17 + .../Guild/XGuildDragonGuildRankList.cs.meta | 12 + .../Guild/XGuildDragonGuildRoleRankInfo.cs | 44 + .../Guild/XGuildDragonGuildRoleRankInfo.cs.meta | 12 + .../Guild/XGuildDragonGuildRoleRankList.cs | 17 + .../Guild/XGuildDragonGuildRoleRankList.cs.meta | 12 + .../XMainClient/Guild/XGuildGrowthBuffBehavior.cs | 74 ++ .../Guild/XGuildGrowthBuffBehavior.cs.meta | 12 + .../XMainClient/Guild/XGuildGrowthBuffView.cs | 266 +++++ .../XMainClient/Guild/XGuildGrowthBuffView.cs.meta | 12 + .../XMainClient/Guild/XGuildGrowthBuildBehavior.cs | 92 ++ .../Guild/XGuildGrowthBuildBehavior.cs.meta | 12 + .../XMainClient/Guild/XGuildGrowthBuildView.cs | 259 +++++ .../Guild/XGuildGrowthBuildView.cs.meta | 12 + .../XMainClient/Guild/XGuildGrowthDocument.cs | 431 +++++++ .../XMainClient/Guild/XGuildGrowthDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildGrowthDonateView.cs | 109 ++ .../Guild/XGuildGrowthDonateView.cs.meta | 12 + .../XMainClient/Guild/XGuildGrowthEntranceView.cs | 110 ++ .../Guild/XGuildGrowthEntranceView.cs.meta | 12 + .../XMainClient/Guild/XGuildGrowthLabBehavior.cs | 64 + .../Guild/XGuildGrowthLabBehavior.cs.meta | 12 + .../XMainClient/Guild/XGuildGrowthLabView.cs | 268 +++++ .../XMainClient/Guild/XGuildGrowthLabView.cs.meta | 12 + .../XMainClient/Guild/XGuildHallDocument.cs | 224 ++++ .../XMainClient/Guild/XGuildHallDocument.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildInfoChange.cs | 18 + .../XMainClient/Guild/XGuildInfoChange.cs.meta | 12 + .../XMainClient/Guild/XGuildInheritDocument.cs | 566 +++++++++ .../Guild/XGuildInheritDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildJockerMatchDocument.cs | 548 +++++++++ .../Guild/XGuildJockerMatchDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildJockerMatchStep.cs | 11 + .../Guild/XGuildJockerMatchStep.cs.meta | 12 + .../XMainClient/Guild/XGuildJockerMatchView.cs | 505 ++++++++ .../Guild/XGuildJockerMatchView.cs.meta | 12 + .../XMainClient/Guild/XGuildJokerBehaviour.cs | 97 ++ .../XMainClient/Guild/XGuildJokerBehaviour.cs.meta | 12 + .../XMainClient/Guild/XGuildJokerCommonView.cs | 740 ++++++++++++ .../Guild/XGuildJokerCommonView.cs.meta | 12 + .../XMainClient/Guild/XGuildJokerDocument.cs | 288 +++++ .../XMainClient/Guild/XGuildJokerDocument.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildJokerView.cs | 375 ++++++ .../XMainClient/Guild/XGuildJokerView.cs.meta | 12 + .../Guild/XGuildLevelChangedEventArgs.cs | 21 + .../Guild/XGuildLevelChangedEventArgs.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildListData.cs | 33 + .../XMainClient/Guild/XGuildListData.cs.meta | 12 + .../XMainClient/Guild/XGuildListDocument.cs | 307 +++++ .../XMainClient/Guild/XGuildListDocument.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildLogAppoint.cs | 32 + .../XMainClient/Guild/XGuildLogAppoint.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildLogBase.cs | 79 ++ .../XMainClient/Guild/XGuildLogBase.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildLogBossMVP.cs | 23 + .../XMainClient/Guild/XGuildLogBossMVP.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildLogJoin.cs | 23 + .../XMainClient/Guild/XGuildLogJoin.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildLogLeave.cs | 23 + .../XMainClient/Guild/XGuildLogLeave.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildMember.cs | 114 ++ .../Scripts/XMainClient/Guild/XGuildMember.cs.meta | 12 + .../XMainClient/Guild/XGuildMemberBasicInfo.cs | 119 ++ .../Guild/XGuildMemberBasicInfo.cs.meta | 12 + .../XMainClient/Guild/XGuildMemberDocument.cs | 483 ++++++++ .../XMainClient/Guild/XGuildMemberDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildMemberListEventArgs.cs | 18 + .../Guild/XGuildMemberListEventArgs.cs.meta | 12 + .../XMainClient/Guild/XGuildMemberRankInfo.cs | 16 + .../XMainClient/Guild/XGuildMemberRankInfo.cs.meta | 12 + .../XMainClient/Guild/XGuildMemberRankList.cs | 12 + .../XMainClient/Guild/XGuildMemberRankList.cs.meta | 12 + .../XMainClient/Guild/XGuildMineBattleDocument.cs | 248 ++++ .../Guild/XGuildMineBattleDocument.cs.meta | 12 + .../Guild/XGuildMineEntranceDocument.cs | 92 ++ .../Guild/XGuildMineEntranceDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildMineMainDocument.cs | 432 +++++++ .../Guild/XGuildMineMainDocument.cs.meta | 12 + .../Assets/Scripts/XMainClient/Guild/XGuildPP.cs | 195 ++++ .../Scripts/XMainClient/Guild/XGuildPP.cs.meta | 12 + .../Guild/XGuildPositionChangedEventArgs.cs | 21 + .../Guild/XGuildPositionChangedEventArgs.cs.meta | 12 + .../XMainClient/Guild/XGuildQualifierDocument.cs | 319 +++++ .../Guild/XGuildQualifierDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildRankDocument.cs | 102 ++ .../XMainClient/Guild/XGuildRankDocument.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildRankInfo.cs | 28 + .../XMainClient/Guild/XGuildRankInfo.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildRankList.cs | 17 + .../XMainClient/Guild/XGuildRankList.cs.meta | 12 + .../XMainClient/Guild/XGuildRedPackageSendBrief.cs | 56 + .../Guild/XGuildRedPackageSendBrief.cs.meta | 12 + .../XMainClient/Guild/XGuildRedPacketBehaviour.cs | 32 + .../Guild/XGuildRedPacketBehaviour.cs.meta | 12 + .../XMainClient/Guild/XGuildRedPacketBrief.cs | 84 ++ .../XMainClient/Guild/XGuildRedPacketBrief.cs.meta | 12 + .../XMainClient/Guild/XGuildRedPacketDetail.cs | 26 + .../Guild/XGuildRedPacketDetail.cs.meta | 12 + .../XMainClient/Guild/XGuildRedPacketDocument.cs | 644 +++++++++++ .../Guild/XGuildRedPacketDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildRedPacketLog.cs | 58 + .../XMainClient/Guild/XGuildRedPacketLog.cs.meta | 12 + .../XMainClient/Guild/XGuildRelaxGameBehaviour.cs | 24 + .../Guild/XGuildRelaxGameBehaviour.cs.meta | 12 + .../XMainClient/Guild/XGuildRelaxGameDocument.cs | 129 +++ .../Guild/XGuildRelaxGameDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildRelaxGameView.cs | 221 ++++ .../XMainClient/Guild/XGuildRelaxGameView.cs.meta | 12 + .../Guild/XGuildResContentionBuffDocument.cs | 676 +++++++++++ .../Guild/XGuildResContentionBuffDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildSalaryDocument.cs | 594 ++++++++++ .../XMainClient/Guild/XGuildSalaryDocument.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildSalaryInfo.cs | 118 ++ .../XMainClient/Guild/XGuildSalaryInfo.cs.meta | 12 + .../XMainClient/Guild/XGuildSignInDocument.cs | 333 ++++++ .../XMainClient/Guild/XGuildSignInDocument.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildSignInLog.cs | 47 + .../XMainClient/Guild/XGuildSignInLog.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildSignNode.cs | 105 ++ .../XMainClient/Guild/XGuildSignNode.cs.meta | 12 + .../Guild/XGuildSignRedPackageBehaviour.cs | 81 ++ .../Guild/XGuildSignRedPackageBehaviour.cs.meta | 12 + .../XMainClient/Guild/XGuildSkillBehaviour.cs | 73 ++ .../XMainClient/Guild/XGuildSkillBehaviour.cs.meta | 12 + .../XMainClient/Guild/XGuildSkillDocument.cs | 512 ++++++++ .../XMainClient/Guild/XGuildSkillDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildSkillStudyHandle.cs | 179 +++ .../Guild/XGuildSkillStudyHandle.cs.meta | 12 + .../Scripts/XMainClient/Guild/XGuildSkillView.cs | 487 ++++++++ .../XMainClient/Guild/XGuildSkillView.cs.meta | 12 + .../Guild/XGuildSmallMonsterBehaviour.cs | 62 + .../Guild/XGuildSmallMonsterBehaviour.cs.meta | 12 + .../Guild/XGuildSmallMonsterDocument.cs | 250 ++++ .../Guild/XGuildSmallMonsterDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildSmallMonsterView.cs | 215 ++++ .../Guild/XGuildSmallMonsterView.cs.meta | 12 + .../Guild/XGuildTaskRefreshResultDlg.cs | 151 +++ .../Guild/XGuildTaskRefreshResultDlg.cs.meta | 12 + .../Guild/XGuildTaskRefreshResultDlgBehavior.cs | 35 + .../XGuildTaskRefreshResultDlgBehavior.cs.meta | 12 + .../XMainClient/Guild/XGuildTerritoryDocument.cs | 1220 ++++++++++++++++++++ .../Guild/XGuildTerritoryDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildViewDocument.cs | 162 +++ .../XMainClient/Guild/XGuildViewDocument.cs.meta | 12 + .../Guild/XGuildWeeklyBountyBehavior.cs | 108 ++ .../Guild/XGuildWeeklyBountyBehavior.cs.meta | 12 + .../Guild/XGuildWeeklyBountyDocument.cs | 577 +++++++++ .../Guild/XGuildWeeklyBountyDocument.cs.meta | 12 + .../XMainClient/Guild/XGuildWeeklyBountyView.cs | 917 +++++++++++++++ .../Guild/XGuildWeeklyBountyView.cs.meta | 12 + 202 files changed, 25529 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildApplyInfo.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildApplyInfo.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildApproveDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildApproveDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildArenaBattleDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildArenaBattleDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildArenaDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildArenaDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildBasicData.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildBasicData.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildBoonBehaviour.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildBoonBehaviour.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankInfo.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankInfo.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankList.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankList.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusBrief.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusBrief.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusInfo.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusInfo.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildCollectDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildCollectDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildConfig.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildConfig.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshBehavior.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshBehavior.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshDlg.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshDlg.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskBehavior.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskBehavior.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskDlg.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskDlg.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskBehavior.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskBehavior.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDonateBehavior.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDonateBehavior.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDonateDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDonateDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDonateView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDonateView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonBehaviour.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonBehaviour.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankInfo.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankInfo.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankList.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankList.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankInfo.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankInfo.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankList.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankList.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffBehavior.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffBehavior.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildBehavior.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildBehavior.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDonateView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDonateView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthEntranceView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthEntranceView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabBehavior.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabBehavior.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildHallDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildHallDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildInfoChange.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildInfoChange.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildInheritDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildInheritDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchStep.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchStep.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJokerBehaviour.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJokerBehaviour.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJokerCommonView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJokerCommonView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJokerDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJokerDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJokerView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildJokerView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLevelChangedEventArgs.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLevelChangedEventArgs.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildListData.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildListData.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildListDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildListDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogAppoint.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogAppoint.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogBase.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogBase.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogBossMVP.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogBossMVP.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogJoin.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogJoin.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogLeave.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildLogLeave.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberBasicInfo.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberBasicInfo.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberListEventArgs.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberListEventArgs.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankInfo.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankInfo.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankList.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankList.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMineBattleDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMineBattleDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMineEntranceDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMineEntranceDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMineMainDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildMineMainDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildPP.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildPP.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildPositionChangedEventArgs.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildPositionChangedEventArgs.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildQualifierDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildQualifierDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRankInfo.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRankInfo.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRankList.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRankList.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPackageSendBrief.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPackageSendBrief.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBehaviour.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBehaviour.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDetail.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDetail.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketLog.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketLog.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameBehaviour.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameBehaviour.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildResContentionBuffDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildResContentionBuffDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSignInDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSignInDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSignInLog.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSignInLog.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSignNode.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSignNode.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSignRedPackageBehaviour.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSignRedPackageBehaviour.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSkillBehaviour.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSkillBehaviour.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSkillDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSkillDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSkillStudyHandle.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSkillStudyHandle.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSkillView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSkillView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterBehaviour.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterBehaviour.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterView.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlgBehavior.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlgBehavior.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildTerritoryDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildTerritoryDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildViewDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildViewDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyBehavior.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyBehavior.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyDocument.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyDocument.cs.meta create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyView.cs create mode 100644 Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyView.cs.meta (limited to 'Client/Assets/Scripts/XMainClient/Guild') diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildApplyInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildApplyInfo.cs new file mode 100644 index 00000000..3154f595 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildApplyInfo.cs @@ -0,0 +1,8 @@ +using System; + +namespace XMainClient +{ + internal class XGuildApplyInfo : XGuildMemberBasicInfo + { + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildApplyInfo.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildApplyInfo.cs.meta new file mode 100644 index 00000000..27776075 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildApplyInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bc7956177ba98d64c8321bc918849442 +timeCreated: 1611404446 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildApproveDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildApproveDocument.cs new file mode 100644 index 00000000..f162fb87 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildApproveDocument.cs @@ -0,0 +1,183 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildApproveDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildApproveDocument.uuID; + } + } + + public XGuildApproveView GuildApproveView { get; set; } + + public List ApproveList + { + get + { + return this.m_ApproveList; + } + } + + public GuildApproveSetting ApproveSetting + { + get + { + return this._ApproveSetting; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildApproveDocument"); + + private List m_ApproveList = new List(); + + private GuildApproveSetting _ApproveSetting = new GuildApproveSetting(); + + public void ReqApproveList() + { + RpcC2M_FetchGuildApp rpc = new RpcC2M_FetchGuildApp(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetApproveList(FetchGAPPRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + int num = oRes.roleid.Count - this.m_ApproveList.Count; + bool flag2 = num > 0; + if (flag2) + { + for (int i = 0; i < num; i++) + { + XGuildApplyInfo item = new XGuildApplyInfo(); + this.m_ApproveList.Add(item); + } + } + else + { + this.m_ApproveList.RemoveRange(this.m_ApproveList.Count + num, -num); + } + for (int j = 0; j < oRes.roleid.Count; j++) + { + XGuildApplyInfo xguildApplyInfo = this.m_ApproveList[j]; + xguildApplyInfo.uid = oRes.roleid[j]; + xguildApplyInfo.name = oRes.rolename[j]; + xguildApplyInfo.level = oRes.level[j]; + xguildApplyInfo.time = (int)oRes.time[j]; + xguildApplyInfo.ppt = oRes.ppt[j]; + xguildApplyInfo.profession = XFastEnumIntEqualityComparer.ToInt(oRes.profession[j]); + } + bool flag3 = this.GuildApproveView != null && this.GuildApproveView.IsVisible(); + if (flag3) + { + this.GuildApproveView.RefreshList(true); + } + } + } + + public void ReqApprove(bool bApprove, int index) + { + bool flag = index < 0 || index >= this.m_ApproveList.Count; + if (!flag) + { + RpcC2M_GuildApprovalNew rpcC2M_GuildApprovalNew = new RpcC2M_GuildApprovalNew(); + rpcC2M_GuildApprovalNew.oArg.roleid = this.m_ApproveList[index].uid; + rpcC2M_GuildApprovalNew.oArg.type = (bApprove ? 0 : 1); + XSingleton.singleton.Send(rpcC2M_GuildApprovalNew); + } + } + + public void ReqRejectAll() + { + RpcC2M_GuildApprovalNew rpcC2M_GuildApprovalNew = new RpcC2M_GuildApprovalNew(); + rpcC2M_GuildApprovalNew.oArg.type = 2; + XSingleton.singleton.Send(rpcC2M_GuildApprovalNew); + } + + public void OnApprove(GuildApprovalArg oArg, GuildApprovalRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(oRes.result); + } + else + { + bool flag2 = oArg.type == 2; + if (flag2) + { + this.m_ApproveList.Clear(); + } + else + { + for (int i = 0; i < this.m_ApproveList.Count; i++) + { + bool flag3 = this.m_ApproveList[i].uid == oArg.roleid; + if (flag3) + { + this.m_ApproveList.RemoveAt(i); + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag4 = oArg.type == 0; + if (flag4) + { + specificDocument.BasicData.memberCount += 1u; + } + break; + } + } + } + bool flag5 = this.GuildApproveView == null || !this.GuildApproveView.IsVisible(); + if (!flag5) + { + this.GuildApproveView.RefreshMember(); + this.GuildApproveView.RefreshList(oArg.type == 2); + } + } + } + + public void ReqSetApprove(GuildApproveSetting setting) + { + RpcC2M_ChangeGuildSettingNew rpcC2M_ChangeGuildSettingNew = new RpcC2M_ChangeGuildSettingNew(); + rpcC2M_ChangeGuildSettingNew.oArg.needapproval = (setting.autoApprove ? 0 : 1); + rpcC2M_ChangeGuildSettingNew.oArg.powerpoint = setting.PPT; + XSingleton.singleton.Send(rpcC2M_ChangeGuildSettingNew); + } + + public void OnSetApprove(GuildApproveSetting setting) + { + this._ApproveSetting = setting; + bool flag = this.GuildApproveView != null && this.GuildApproveView.IsVisible(); + if (flag) + { + this.GuildApproveView.RefreshSetting(); + } + } + + public void OnGuildBrief(GuildBriefRes oRes) + { + this._ApproveSetting.autoApprove = (oRes.needApproval == 0); + this._ApproveSetting.PPT = (int)oRes.recuritppt; + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = this.GuildApproveView != null && this.GuildApproveView.IsVisible(); + if (flag) + { + this.ReqApproveList(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildApproveDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildApproveDocument.cs.meta new file mode 100644 index 00000000..fb244acc --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildApproveDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 13f78b3a83b15d94dac1f27bcc1b74d8 +timeCreated: 1611403251 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaBattleDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaBattleDocument.cs new file mode 100644 index 00000000..3bb2f2b6 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaBattleDocument.cs @@ -0,0 +1,1157 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildArenaBattleDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildArenaBattleDocument.uuID; + } + } + + public GVGBattleInfo BlueInfo + { + get + { + return this._blueInfo; + } + } + + public GVGBattleInfo RedInfo + { + get + { + return this._redInfo; + } + } + + public double InspireCDTime + { + get + { + return this.m_InspireCDTime; + } + } + + private IGVGBattlePrepare CurView + { + get + { + bool flag = this.Pattern == GuildArenaBattlePattern.GMF || this.Pattern == GuildArenaBattlePattern.GPR; + IGVGBattlePrepare singleton; + if (flag) + { + singleton = DlgBase.singleton; + } + else + { + singleton = DlgBase.singleton; + } + return singleton; + } + } + + private bool IsGVG + { + get + { + SceneType sceneType = XSingleton.singleton.SceneType; + return sceneType == SceneType.SCENE_GPR || sceneType == SceneType.SCENE_GMF || sceneType == SceneType.SCENE_GCF; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildArenaBattleDocument"); + + private GVGBattleInfo _blueInfo = new GVGBattleInfo(); + + private GVGBattleInfo _redInfo = new GVGBattleInfo(); + + public double m_InspireCDTime = 0.0; + + public uint ReviveItemID = 0u; + + public uint ReviveItemNumber = 0u; + + public GuildArenaBattlePattern Pattern = GuildArenaBattlePattern.GPR; + + public XGuildArenaBattleDocument.ReadyType MyReadyType = XGuildArenaBattleDocument.ReadyType.Observer; + + public GuildMatchFightState MyFightState = GuildMatchFightState.GUILD_MF_NONE; + + public GmfRoleDatas mGmfRoleDatas = null; + + public int GMFGroupBlueMatchPoint = 0; + + public int GMFGroupRedMatchPoint = 0; + + public XGuildArenaBattleDocument.BattleEndData blueBattleEndData = new XGuildArenaBattleDocument.BattleEndData(); + + public XGuildArenaBattleDocument.BattleEndData redBattleEndData = new XGuildArenaBattleDocument.BattleEndData(); + + public XGuildArenaBattleDocument.GuildArenaSection mArenaSection; + + public GVGCombatInfo blueCombatInfo = new GVGCombatInfo(); + + public GVGCombatInfo redCombatInfo = new GVGCombatInfo(); + + public XGuildArenaBattleDocument.BattleEndData blueAllFightEnd = new XGuildArenaBattleDocument.BattleEndData(); + + public XGuildArenaBattleDocument.BattleEndData redAllFightEnd = new XGuildArenaBattleDocument.BattleEndData(); + + public uint _kicked_token = 0u; + + public bool bCantUpForKicked = false; + + protected internal XFx fxEncourageButton; + + protected internal XFx fxEncourageProgressNum; + + protected internal XFx fxEncourageProgressAdd; + + public GVGDuelResult BlueDuelResult = new GVGDuelResult(); + + public GVGDuelResult RedDuelResult = new GVGDuelResult(); + + public uint Round = 0u; + + public bool InBattleGroup = false; + + public enum GuildArenaSection + { + Prepare, + Battle, + Result + } + + public enum ReadyType + { + Ready, + NoReady, + Observer + } + + public class BattleEndData + { + public bool isWin = true; + + public GmfRoleBrief Role = null; + + public GmfGuildBrief Guild = null; + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + private ulong GetMyGuildID() + { + return XDocuments.GetSpecificDocument(XGuildDocument.uuID).BasicData.uid; + } + + public int GetBattleSignNumber() + { + SceneType sceneType = XSingleton.singleton.SceneType; + int result = 0; + bool flag = sceneType == SceneType.SCENE_GPR || sceneType == SceneType.SCENE_GCF; + if (flag) + { + result = XSingleton.singleton.GetInt("GuildArenaBattleGpr"); + } + else + { + bool flag2 = sceneType == SceneType.SCENE_GMF; + if (flag2) + { + result = XSingleton.singleton.GetInt("GuildArenaBattleNumber"); + } + } + return result; + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + bool isGVG = this.IsGVG; + if (isGVG) + { + this.EnterGVG(); + } + } + + public override void OnLeaveScene() + { + bool isGVG = this.IsGVG; + if (isGVG) + { + this.LeaveGVG(); + } + } + + public override void Update(float fDeltaT) + { + base.Update(fDeltaT); + this.InspireUpdate(fDeltaT); + } + + public void OnUpdateGuildArenaBattle(GmfRoleDatas data) + { + XSingleton.singleton.AddGreenLog("OnUpdateGuildArenaBattle", data.halfrole11.inspire.ToString(), " ", data.halfrole22.inspire.ToString(), null, null); + this.mGmfRoleDatas = data; + this.MyFightState = GuildMatchFightState.GUILD_MF_NONE; + this.MyReadyType = XGuildArenaBattleDocument.ReadyType.Observer; + ulong myGuildID = this.GetMyGuildID(); + bool flag = data.halfrole11.guildb.guildid == myGuildID; + if (flag) + { + this.InBattleGroup = true; + this._blueInfo.Convert(data.halfrole11); + this._redInfo.Convert(data.halfrole22); + this.CheckRoleState(this._blueInfo.Group, XSingleton.singleton.XPlayerData.RoleID, ref this.MyFightState, ref this.MyReadyType); + } + else + { + bool flag2 = data.halfrole22.guildb.guildid == myGuildID; + if (flag2) + { + this.InBattleGroup = true; + this._blueInfo.Convert(data.halfrole22); + this._redInfo.Convert(data.halfrole11); + this.CheckRoleState(this._blueInfo.Group, XSingleton.singleton.XPlayerData.RoleID, ref this.MyFightState, ref this.MyReadyType); + } + else + { + this.InBattleGroup = false; + this._blueInfo.Convert(data.halfrole11); + this._redInfo.Convert(data.halfrole22); + } + } + bool flag3 = this.IsGMF(); + if (flag3) + { + this.MatchPoint(); + } + bool flag4 = this.CurView.IsVisible(); + if (flag4) + { + this.CurView.ReFreshGroup(); + } + } + + private void CheckRoleState(List roles, ulong roleID, ref GuildMatchFightState state, ref XGuildArenaBattleDocument.ReadyType type) + { + bool flag = roles == null; + if (!flag) + { + type = XGuildArenaBattleDocument.ReadyType.NoReady; + int i = 0; + int count = roles.Count; + while (i < count) + { + bool flag2 = roles[i].roleID == roleID; + if (flag2) + { + state = roles[i].state; + type = XGuildArenaBattleDocument.ReadyType.Ready; + break; + } + i++; + } + } + } + + private void SpectateSpecial(GmfRoleDatas data) + { + bool bSpectator = XSingleton.singleton.bSpectator; + if (bSpectator) + { + XSpectateSceneDocument specificDocument = XDocuments.GetSpecificDocument(XSpectateSceneDocument.uuID); + bool flag = specificDocument.BlueSaveID == 0UL || specificDocument.RedSaveID == 0UL; + if (flag) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.SpectateSpecial ", specificDocument.BlueSaveID.ToString(), " <-> ", specificDocument.RedSaveID.ToString(), null, null, XDebugColor.XDebug_None); + } + else + { + bool flag2 = specificDocument.BlueSaveID == data.halfrole11.guildb.guildid; + if (flag2) + { + this._blueInfo.Convert(data.halfrole11); + this._redInfo.Convert(data.halfrole22); + this.MyReadyType = XGuildArenaBattleDocument.ReadyType.NoReady; + foreach (GmfRole gmfRole in this._blueInfo.Group) + { + bool flag3 = gmfRole.roleID == XSingleton.singleton.XPlayerData.RoleID; + if (flag3) + { + this.MyReadyType = XGuildArenaBattleDocument.ReadyType.Ready; + this.MyFightState = gmfRole.state; + break; + } + } + } + else + { + bool flag4 = specificDocument.BlueSaveID == data.halfrole22.guildb.guildid; + if (flag4) + { + this._blueInfo.Convert(data.halfrole22); + this._redInfo.Convert(data.halfrole11); + this.MyReadyType = XGuildArenaBattleDocument.ReadyType.NoReady; + foreach (GmfRole gmfRole2 in this._blueInfo.Group) + { + bool flag5 = gmfRole2.roleID == XSingleton.singleton.XPlayerData.RoleID; + if (flag5) + { + this.MyReadyType = XGuildArenaBattleDocument.ReadyType.Ready; + this.MyFightState = gmfRole2.state; + break; + } + } + } + else + { + this._blueInfo.Convert(data.halfrole11); + this._redInfo.Convert(data.halfrole22); + this.MyReadyType = XGuildArenaBattleDocument.ReadyType.Observer; + } + } + } + } + } + + private void MatchPoint() + { + int num = 0; + int num2 = 0; + foreach (GmfRole gmfRole in this._blueInfo.Group) + { + bool flag = gmfRole.roleID == 0UL; + if (!flag) + { + GuildMatchFightState state = gmfRole.state; + if (state == GuildMatchFightState.GUILD_MF_WAITING || state == GuildMatchFightState.GUILD_MF_FIGHTING) + { + num++; + } + } + } + foreach (GmfRole gmfRole2 in this._redInfo.Group) + { + bool flag2 = gmfRole2.roleID == 0UL; + if (!flag2) + { + GuildMatchFightState state2 = gmfRole2.state; + if (state2 == GuildMatchFightState.GUILD_MF_WAITING || state2 == GuildMatchFightState.GUILD_MF_FIGHTING) + { + num2++; + } + } + } + this.GMFGroupBlueMatchPoint = num; + this.GMFGroupRedMatchPoint = num2; + } + + public void OnUpdateBattleEnd(GmfOneBattleEnd data) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnUpdateBattleEnd ", data.ToString(), null, null, null, null, XDebugColor.XDebug_None); + bool flag = !this.IsGMF(); + if (!flag) + { + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetVisible(false, true); + } + bool flag3 = data.winguild.guildid == XDocuments.GetSpecificDocument(XGuildDocument.uuID).BasicData.uid; + if (flag3) + { + this.blueBattleEndData.isWin = true; + this.redBattleEndData.isWin = false; + this.blueBattleEndData.Role = data.winrole; + this.redBattleEndData.Role = data.loselrole; + this.blueBattleEndData.Guild = data.winguild; + this.redBattleEndData.Guild = data.loseguild; + } + else + { + bool flag4 = data.loseguild.guildid == XDocuments.GetSpecificDocument(XGuildDocument.uuID).BasicData.uid; + if (flag4) + { + this.blueBattleEndData.isWin = false; + this.redBattleEndData.isWin = true; + this.blueBattleEndData.Role = data.loselrole; + this.redBattleEndData.Role = data.winrole; + this.blueBattleEndData.Guild = data.loseguild; + this.redBattleEndData.Guild = data.winguild; + } + else + { + this.blueBattleEndData.isWin = true; + this.redBattleEndData.isWin = false; + this.blueBattleEndData.Role = data.winrole; + this.redBattleEndData.Role = data.loselrole; + this.blueBattleEndData.Guild = data.winguild; + this.redBattleEndData.Guild = data.loseguild; + } + } + ulong roleID = XSingleton.singleton.XPlayerData.RoleID; + bool flag5 = roleID == this.blueBattleEndData.Role.roleid; + bool flag6 = roleID == this.redBattleEndData.Role.roleid; + bool flag7 = flag5; + if (flag7) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.GmfOneBattleEnd Killer", null, null, null, null, null, XDebugColor.XDebug_None); + } + bool flag8 = flag6; + if (flag8) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.GmfOneBattleEnd Deader", null, null, null, null, null, XDebugColor.XDebug_None); + } + string smallResult = string.Empty; + switch (data.reason) + { + case GMFFailReason.GMF_FAIL_NONE: + case GMFFailReason.GMF_FAIL_DIE: + DlgBase.singleton.SetSmallResult(""); + break; + case GMFFailReason.GMF_FAIL_TIMEOVER: + smallResult = string.Format(XStringDefineProxy.GetString("GUILD_ARENA_OVERTIME_WINER_PERSONAL"), data.winrole.rolename); + DlgBase.singleton.SetSmallResult(smallResult); + break; + case GMFFailReason.GMF_FAIL_QUIT: + smallResult = string.Format(XStringDefineProxy.GetString("GUILD_ARENA_THEY_QUITE_PERSONAL"), data.loselrole.rolename); + DlgBase.singleton.SetSmallResult(smallResult); + break; + case GMFFailReason.GMF_FAIL_REFRESE: + DlgBase.singleton.SetSmallResult(""); + break; + default: + DlgBase.singleton.SetSmallResult(""); + break; + } + } + } + + public void ReceiveGuildCombatNotify(GmfGuildCombatPara param) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.ReceiveGuildCombatNotify ", null, null, null, null, null, XDebugColor.XDebug_None); + bool flag = param.guildcombat11 == null || param.guildcombat22 == null; + if (!flag) + { + ulong myGuildID = this.GetMyGuildID(); + bool flag2 = param.guildcombat11.gmfguild.guildid == myGuildID; + if (flag2) + { + this.blueCombatInfo.Set(param.guildcombat11); + this.redCombatInfo.Set(param.guildcombat22); + this.BlueInfo.Convert(param.guildcombat11.rolecombat); + this.RedInfo.Convert(param.guildcombat22.rolecombat); + } + else + { + bool flag3 = param.guildcombat22.gmfguild.guildid == myGuildID; + if (flag3) + { + this.blueCombatInfo.Set(param.guildcombat22); + this.redCombatInfo.Set(param.guildcombat11); + this.BlueInfo.Convert(param.guildcombat22.rolecombat); + this.RedInfo.Convert(param.guildcombat11.rolecombat); + } + else + { + this.blueCombatInfo.Set(param.guildcombat11); + this.redCombatInfo.Set(param.guildcombat22); + this.BlueInfo.Convert(param.guildcombat11.rolecombat); + this.RedInfo.Convert(param.guildcombat22.rolecombat); + } + } + this.Round = param.guildcombat11.score + param.guildcombat22.score; + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.ReceiveGuildCombatNotify ", this.Round.ToString(), null, null, null, null, XDebugColor.XDebug_None); + bool flag4 = this.CurView.IsVisible(); + if (flag4) + { + this.CurView.ReFreshGroup(); + } + } + } + + public void OnAllFightEnd(GmfAllFightEnd data) + { + bool flag = !this.IsGMF(); + if (!flag) + { + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetVisible(false, true); + } + string log = "winguild:" + data.winguild.ToString() + "loseguildid:" + data.loseguild.ToString(); + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnAllFightEnd ", log, null, null, null, null, XDebugColor.XDebug_None); + DlgBase.singleton.RefreahCountTime(10f, true); + bool flag3 = data.winguild.guildid == XDocuments.GetSpecificDocument(XGuildDocument.uuID).BasicData.uid; + if (flag3) + { + this.blueAllFightEnd.isWin = true; + this.redAllFightEnd.isWin = false; + this.blueAllFightEnd.Guild = data.winguild; + this.redAllFightEnd.Guild = data.loseguild; + } + else + { + bool flag4 = data.loseguild.guildid == XDocuments.GetSpecificDocument(XGuildDocument.uuID).BasicData.uid; + if (flag4) + { + this.blueAllFightEnd.isWin = false; + this.redAllFightEnd.isWin = true; + this.blueAllFightEnd.Guild = data.loseguild; + this.redAllFightEnd.Guild = data.winguild; + } + else + { + this.blueAllFightEnd.isWin = true; + this.redAllFightEnd.isWin = false; + this.blueAllFightEnd.Guild = data.winguild; + this.redAllFightEnd.Guild = data.loseguild; + } + } + GmfGuildBrief winguild = data.winguild; + GmfGuildBrief loseguild = data.loseguild; + this.CurView.SetVisible(false, true); + DlgBase.singleton.SetVisible(true, true); + string guildResult = string.Empty; + bool flag5 = winguild.guildid == loseguild.guildid; + if (flag5) + { + XSingleton.singleton.AddErrorLog("data.winguildid = data.loseguildid", null, null, null, null, null); + } + else + { + bool flag6 = winguild.guildid == XDocuments.GetSpecificDocument(XGuildDocument.uuID).BasicData.uid; + if (flag6) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnAllFightEnd Guild Win", null, null, null, null, null, XDebugColor.XDebug_None); + switch (data.wintype) + { + case GMF_FINAL_WIN_TYPE.GMF_FWY_NORMAL: + DlgBase.singleton.SetGuildResult(""); + break; + case GMF_FINAL_WIN_TYPE.GMF_FWY_OPNONE: + guildResult = string.Format(XStringDefineProxy.GetString("GUILD_ARENA_QUITE"), loseguild.guildname); + DlgBase.singleton.SetGuildResult(guildResult); + break; + case GMF_FINAL_WIN_TYPE.GMF_FWY_RANK: + DlgBase.singleton.SetGuildResult(XStringDefineProxy.GetString("GUILD_ARENA_WIN_GUILDALL_RANK")); + break; + } + } + else + { + bool flag7 = loseguild.guildid == XDocuments.GetSpecificDocument(XGuildDocument.uuID).BasicData.uid; + if (flag7) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnAllFightEnd Guild Failed", null, null, null, null, null, XDebugColor.XDebug_None); + switch (data.wintype) + { + case GMF_FINAL_WIN_TYPE.GMF_FWY_NORMAL: + DlgBase.singleton.SetGuildResult(""); + break; + case GMF_FINAL_WIN_TYPE.GMF_FWY_OPNONE: + guildResult = string.Format(XStringDefineProxy.GetString("GUILD_ARENA_QUITE"), loseguild.guildname); + DlgBase.singleton.SetGuildResult(guildResult); + break; + case GMF_FINAL_WIN_TYPE.GMF_FWY_RANK: + DlgBase.singleton.SetGuildResult(XStringDefineProxy.GetString("GUILD_ARENA_WIN_GUILDALL_RANK")); + break; + } + } + else + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnAllFightEnd winguildid Observer", null, null, null, null, null, XDebugColor.XDebug_None); + } + } + } + } + } + + public void OnGmfJoinBattle(GmfJoinBattleArg oRes) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.GmfJoinBattleArg ", oRes.leftTime.ToString(), null, null, null, null, XDebugColor.XDebug_None); + } + + public void GetJoinBattleRes() + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.GetJoinBattleRes ", null, null, null, null, null, XDebugColor.XDebug_None); + } + + public void OnWaitOtherLoad(GmfWaitOtherArg oRes) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnWaitOtherLoad ", oRes.lefttime.ToString(), null, null, null, null, XDebugColor.XDebug_None); + } + + public void OnWaitFightBegin(GmfWaitFightArg oRes) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnWaitFightBegin ", oRes.lefttime.ToString(), null, null, null, null, XDebugColor.XDebug_None); + } + + public void ReadyReq(ulong roleid, GMFReadyType type) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.ReadyReq ", type.ToString(), null, null, null, null, XDebugColor.XDebug_None); + RpcC2G_GmfReadyReq rpcC2G_GmfReadyReq = new RpcC2G_GmfReadyReq(); + rpcC2G_GmfReadyReq.oArg.roleid = roleid; + rpcC2G_GmfReadyReq.oArg.type = type; + XSingleton.singleton.Send(rpcC2G_GmfReadyReq); + } + + public void OnReadyReq(GmfReadyRes oRes) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnReadyReq ", oRes.ToString(), null, null, null, null, XDebugColor.XDebug_None); + bool flag = oRes.errcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.errcode, "fece00"); + } + else + { + bool flag2 = this.CurView.IsVisible(); + if (flag2) + { + this.CurView.ReFreshGroup(); + } + } + } + + public void InspireReq() + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.InspireReq ", null, null, null, null, null, XDebugColor.XDebug_None); + RpcC2G_InspireReq rpc = new RpcC2G_InspireReq(); + XSingleton.singleton.Send(rpc); + } + + private void InspireUpdate(float detailTime) + { + bool flag = this.m_InspireCDTime > 0.0; + if (flag) + { + this.m_InspireCDTime -= (double)detailTime; + } + else + { + this.m_InspireCDTime = 0.0; + } + } + + public void OnInspireReq(InspireRes oRes) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnInspireReq ", oRes.ToString(), null, null, null, null, XDebugColor.XDebug_None); + bool flag = oRes.ErrorCode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.ErrorCode, "fece00"); + } + else + { + XSingleton.singleton.AddGreenLog("XMainClient.XGuildArenaBattleDocument.Inspire.Cooldowntime:", oRes.cooldowntime.ToString(), null, null, null, null); + this.m_InspireCDTime = double.Parse(XSingleton.singleton.GetValue("GMFInspireCoolDown")); + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILDARENA_INSPIRE_NOTICE"), "fece00"); + bool flag2 = this.CurView.IsLoaded() && this.CurView.IsVisible(); + if (flag2) + { + this.CurView.RefreshInspire(); + } + } + } + + public void OnBattleState(GmfBatlleStatePara Data) + { + XSingleton.singleton.AddLog("XMainClient.XGuildArenaBattleDocument.OnBattleState ", Data.state.ToString(), " ", Data.lefttime.ToString(), null, null, XDebugColor.XDebug_None); + switch (Data.state) + { + case GmfBattleState.GMF_BS_WAIT: + { + this.mArenaSection = XGuildArenaBattleDocument.GuildArenaSection.Prepare; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.ReturnHall(); + } + DlgBase.singleton.SetVisible(false, true); + bool flag2 = !this.CurView.IsVisible(); + if (flag2) + { + this.CurView.SetVisible(true, true); + } + else + { + this.CurView.RefreshSection(); + } + this.CurView.RefreahCountTime(Data.lefttime); + break; + } + case GmfBattleState.GMF_BS_FIGHT: + { + this.mArenaSection = XGuildArenaBattleDocument.GuildArenaSection.Battle; + DlgBase.singleton.SetVisible(false, true); + bool flag3 = !this.CurView.IsVisible(); + if (flag3) + { + this.CurView.SetVisible(true, true); + } + else + { + this.CurView.RefreshSection(); + } + this.CurView.RefreahCountTime(Data.lefttime); + break; + } + case GmfBattleState.GMF_BS_RESULT: + { + this.CurView.SetVisible(false, true); + bool flag4 = XSingleton.singleton.SceneType == SceneType.SCENE_GMF; + if (flag4) + { + this.mArenaSection = XGuildArenaBattleDocument.GuildArenaSection.Result; + DlgBase.singleton.SetVisible(true, true); + DlgBase.singleton.RefreahCountTime(Data.lefttime, false); + } + else + { + bool flag5 = XSingleton.singleton.SceneType == SceneType.SCENE_GPR; + if (flag5) + { + this.mArenaSection = XGuildArenaBattleDocument.GuildArenaSection.Prepare; + } + } + break; + } + case GmfBattleState.GMF_BS_NONE: + XSingleton.singleton.AddErrorLog("XMainClient.XGuildArenaBattleDocument.OnInspireReq ", Data.state.ToString(), " ", Data.lefttime.ToString(), null, null); + break; + } + } + + public void OnBekicked(GmfKickRes res) + { + string text = string.Format(XSingleton.singleton.GetString("GUILD_ARENA_BEKICKED"), res.kickname); + XSingleton.singleton.ShowSystemTip(text, "fece00"); + bool flag = res.cooldowntime > 0.01f; + if (flag) + { + this.bCantUpForKicked = true; + bool flag2 = this._kicked_token > 0u; + if (flag2) + { + XSingleton.singleton.KillTimer(this._kicked_token); + } + this._kicked_token = XSingleton.singleton.SetTimer(res.cooldowntime, new XTimerMgr.ElapsedEventHandler(this.OnBekickedCallback), null); + } + bool flag3 = this.CurView.IsLoaded(); + if (flag3) + { + this.CurView.UpdateDownUp(); + } + } + + private void OnBekickedCallback(object o) + { + this.bCantUpForKicked = false; + bool flag = this.CurView.IsLoaded(); + if (flag) + { + this.CurView.UpdateDownUp(); + } + } + + public void ChangeSpectator(XRole role) + { + } + + private void ConvertSceneTypeToPattern(SceneType type, ref GuildArenaBattlePattern pattern) + { + if (type != SceneType.SCENE_GMF) + { + if (type != SceneType.SCENE_GPR) + { + if (type == SceneType.SCENE_GCF) + { + pattern = GuildArenaBattlePattern.GCF; + } + } + else + { + pattern = GuildArenaBattlePattern.GPR; + } + } + else + { + pattern = GuildArenaBattlePattern.GMF; + } + } + + private void EnterGVG() + { + this.ConvertSceneTypeToPattern(XSingleton.singleton.SceneType, ref this.Pattern); + this.CurView.OnEnterSceneFinally(); + this.bCantUpForKicked = false; + bool flag = this.fxEncourageButton == null; + if (flag) + { + this.fxEncourageButton = XSingleton.singleton.CreateFx("Effects/FX_Particle/UIfx/UI_Encourage", null, true); + } + bool flag2 = this.fxEncourageProgressNum == null; + if (flag2) + { + this.fxEncourageProgressNum = XSingleton.singleton.CreateFx("Effects/FX_Particle/UIfx/UI_Encourage_Num", null, true); + } + bool flag3 = this.fxEncourageProgressAdd == null; + if (flag3) + { + this.fxEncourageProgressAdd = XSingleton.singleton.CreateFx("Effects/FX_Particle/UIfx/UI_Encourage_Add", null, true); + } + bool flag4 = this.mGmfRoleDatas != null; + if (flag4) + { + this.SpectateSpecial(this.mGmfRoleDatas); + } + } + + private void LeaveGVG() + { + bool flag = this.fxEncourageButton != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this.fxEncourageButton, true); + this.fxEncourageButton = null; + } + bool flag2 = this.fxEncourageProgressNum != null; + if (flag2) + { + XSingleton.singleton.DestroyFx(this.fxEncourageProgressNum, true); + this.fxEncourageProgressNum = null; + } + bool flag3 = this.fxEncourageProgressAdd != null; + if (flag3) + { + XSingleton.singleton.DestroyFx(this.fxEncourageProgressAdd, true); + this.fxEncourageProgressAdd = null; + } + } + + public void ReceiveDuelRoundResult(GprOneBattleEnd res) + { + XSingleton.singleton.AddGreenLog("XMainClient.XGuildArenaBattleDocument.ReceiveDuelRoundResult", null, null, null, null, null); + bool flag = !this.IsGPR() && !this.IsGCF(); + if (!flag) + { + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetVisible(false, true); + } + ulong myGuildID = this.GetMyGuildID(); + bool cross = this.IsGCF(); + bool flag3 = res.winguild.guildid == myGuildID; + if (flag3) + { + this.InBattleGroup = true; + this.BlueDuelResult.Setup(res.winguild, res.winrolecombat, true, cross); + this.RedDuelResult.Setup(res.loseguild, res.loserolecombat, false, cross); + } + else + { + bool flag4 = res.loseguild.guildid == myGuildID; + if (flag4) + { + this.InBattleGroup = true; + this.BlueDuelResult.Setup(res.loseguild, res.loserolecombat, false, cross); + this.RedDuelResult.Setup(res.winguild, res.winrolecombat, true, cross); + } + else + { + this.InBattleGroup = false; + this.BlueDuelResult.Setup(res.winguild, res.winrolecombat, true, cross); + this.RedDuelResult.Setup(res.loseguild, res.loserolecombat, false, cross); + } + } + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + + public void ReceiveDuelFinalResult(GprAllFightEnd res) + { + XSingleton.singleton.AddGreenLog("XMainClient.XGuildArenaBattleDocument.ReceiveDuelFinalResult", null, null, null, null, null); + bool flag = !this.IsGPR() && !this.IsGCF(); + if (!flag) + { + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetVisible(false, true); + } + ulong myGuildID = this.GetMyGuildID(); + bool cross = this.IsGCF(); + bool flag3 = res.winguild.guildid == myGuildID; + if (flag3) + { + this.BlueDuelResult.Setup(res.winguild, res.winscore, true, cross); + this.RedDuelResult.Setup(res.loseguild, res.losescore, false, cross); + } + else + { + bool flag4 = res.loseguild.guildid == myGuildID; + if (flag4) + { + this.BlueDuelResult.Setup(res.loseguild, res.losescore, false, cross); + this.RedDuelResult.Setup(res.winguild, res.winscore, true, cross); + } + else + { + this.BlueDuelResult.Setup(res.winguild, res.winscore, true, cross); + this.RedDuelResult.Setup(res.loseguild, res.losescore, false, cross); + } + } + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_RealDead, new XComponent.XEventHandler(this.OnActionEvent)); + base.RegisterEvent(XEventDefine.XEvent_FightGroupChanged, new XComponent.XEventHandler(this.OnFightGroupChanged)); + } + + private bool OnFightGroupChanged(XEventArgs e) + { + bool flag = !this.IsGPR() && !this.IsGCF(); + bool result; + if (flag) + { + result = true; + } + else + { + XFightGroupChangedArgs xfightGroupChangedArgs = e as XFightGroupChangedArgs; + bool flag2 = xfightGroupChangedArgs == null || xfightGroupChangedArgs.targetEntity == null; + if (flag2) + { + result = true; + } + else + { + BattleIndicateHandler battleIndicateHandler = null; + XSingleton.singleton.AddGreenLog("OnFightGroupChanged", null, null, null, null, null); + bool bSpectator = XSingleton.singleton.bSpectator; + if (bSpectator) + { + bool flag3 = DlgBase.singleton.IsLoaded(); + if (flag3) + { + battleIndicateHandler = DlgBase.singleton.IndicateHandler; + } + } + else + { + bool flag4 = DlgBase.singleton.IsLoaded(); + if (flag4) + { + battleIndicateHandler = DlgBase.singleton.IndicateHandler; + } + } + bool flag5 = battleIndicateHandler == null; + if (flag5) + { + result = true; + } + else + { + bool isPlayer = xfightGroupChangedArgs.targetEntity.IsPlayer; + if (isPlayer) + { + List all = XSingleton.singleton.GetAll(); + int i = 0; + int count = all.Count; + while (i < count) + { + bool isPlayer2 = all[i].IsPlayer; + if (!isPlayer2) + { + this.UpdateIndicateHandle(battleIndicateHandler, all[i]); + } + i++; + } + } + else + { + this.UpdateIndicateHandle(battleIndicateHandler, xfightGroupChangedArgs.targetEntity); + } + result = true; + } + } + } + return result; + } + + private void UpdateIndicateHandle(BattleIndicateHandler handler, XEntity entity) + { + handler.MiniMapDel(entity); + handler.MiniMapAdd(entity); + } + + private bool OnActionEvent(XEventArgs arg) + { + XRealDeadEventArgs xrealDeadEventArgs = arg as XRealDeadEventArgs; + bool flag = !xrealDeadEventArgs.TheDead.IsPlayer; + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = this.IsGPR(); + int @int; + if (flag2) + { + @int = XSingleton.singleton.GetInt("GPRReviveTime"); + } + else + { + bool flag3 = this.IsGCF(); + if (!flag3) + { + return false; + } + @int = XSingleton.singleton.GetInt("GPCFReviveTime"); + } + bool flag4 = this.CurView.IsVisible(); + if (flag4) + { + this.CurView.SetResurgence(@int); + } + result = true; + } + return result; + } + + public void ReceiveBattleSkill(PvpBattleKill battleSkillInfo) + { + bool flag = !this.CurView.IsVisible(); + if (!flag) + { + GVGBattleSkill gvgbattleSkill = new GVGBattleSkill(); + gvgbattleSkill.killerID = battleSkillInfo.killID; + gvgbattleSkill.deadID = battleSkillInfo.deadID; + gvgbattleSkill.contiKillCount = battleSkillInfo.contiKillCount; + bool killerPosition = false; + bool flag2 = this.TryGetBattleName(battleSkillInfo.killID, out gvgbattleSkill.killerName, out killerPosition); + if (flag2) + { + gvgbattleSkill.killerPosition = killerPosition; + } + this.TryGetBattleName(battleSkillInfo.deadID, out gvgbattleSkill.deadName, out killerPosition); + DlgBase.singleton.AddBattleSkill(gvgbattleSkill); + XSingleton.singleton.AddGreenLog(string.Format("ReceiveBattleSkill:{0} --- ,{1} ,.... {2}", gvgbattleSkill.killerName, gvgbattleSkill.deadName, gvgbattleSkill.contiKillCount), null, null, null, null, null); + } + } + + private bool TryGetBattleName(ulong roleID, out string targetName, out bool position) + { + targetName = string.Empty; + position = false; + GmfRole gmfRole = null; + bool flag = this._redInfo.TryGetMember(roleID, out gmfRole); + bool result; + if (flag) + { + targetName = gmfRole.rolename; + position = true; + result = true; + } + else + { + bool flag2 = this._blueInfo.TryGetMember(roleID, out gmfRole); + if (flag2) + { + targetName = gmfRole.rolename; + position = false; + result = true; + } + else + { + result = false; + } + } + return result; + } + + public bool IsGPR() + { + return XSingleton.singleton.SceneType == SceneType.SCENE_GPR; + } + + public bool IsGMF() + { + return XSingleton.singleton.SceneType == SceneType.SCENE_GMF; + } + + public bool IsGCF() + { + return XSingleton.singleton.SceneType == SceneType.SCENE_GCF; + } + + public void NotifyVSPayRevive(VsPayRevivePara para) + { + this.ReviveItemID = para.itemid; + this.ReviveItemNumber = para.itemcount; + } + + public void SendVSPayRevive() + { + bool flag = this.ReviveItemID > 0u; + if (flag) + { + ulong itemCount = XBagDocument.BagDoc.GetItemCount((int)this.ReviveItemID); + bool flag2 = itemCount >= (ulong)this.ReviveItemNumber; + if (flag2) + { + RpcC2G_VsPayReviveReq rpc = new RpcC2G_VsPayReviveReq(); + XSingleton.singleton.Send(rpc); + } + else + { + ItemList.RowData itemConf = XBagDocument.GetItemConf((int)this.ReviveItemID); + bool flag3 = itemConf != null; + if (flag3) + { + UiUtility singleton = XSingleton.singleton; + string key = "FASHION_HAIR_COLORING"; + object[] itemName = itemConf.ItemName; + singleton.ShowSystemTip(XStringDefineProxy.GetString(key, itemName), "fece00"); + } + } + } + } + + public void ReceiveVSPayRevive(VsPayRevivePara oArg, VsPayReviveRes oRes) + { + bool flag = oRes.ret > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.ret, "fece00"); + } + bool flag2 = this.CurView.IsVisible(); + if (flag2) + { + this.CurView.SetResurgence(0); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaBattleDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaBattleDocument.cs.meta new file mode 100644 index 00000000..5fe4a3f0 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaBattleDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3000b2bfb5d3e5145b6ebb064020c7fe +timeCreated: 1611403520 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaDocument.cs new file mode 100644 index 00000000..b1f939e1 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaDocument.cs @@ -0,0 +1,640 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildArenaDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildArenaDocument.uuID; + } + } + + public bool bHasAvailableArenaIcon + { + get + { + return this.m_hasAvailableArenaIcon; + } + set + { + this.m_hasAvailableArenaIcon = value; + this.m_iconVisibleTime = (double)(this.m_hasAvailableArenaIcon ? 600 : 0); + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildPvp, true); + SceneType sceneType = XSingleton.singleton.GetSceneType(XSingleton.singleton.SceneID); + bool flag = sceneType == SceneType.SCENE_HALL || sceneType == SceneType.SCENE_GUILD_HALL; + if (flag) + { + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildPvpMainInterface, true); + } + } + } + + public uint CanEnterBattle + { + get + { + return this.m_canEnterBattle; + } + } + + public bool VisibleEnterBattle + { + get + { + return this.m_visibleEnterBattle; + } + } + + public bool RegistrationStatu + { + get + { + return this.m_registrationStatu; + } + } + + public double RegistrationTime + { + get + { + return this.m_registrationTime; + } + } + + public uint RegistrationCount + { + get + { + return this.m_registrationCount; + } + } + + public GuildArenaType BattleStep + { + get + { + return this.m_battleStep; + } + } + + public GuildArenaState TimeState + { + get + { + return this.m_timeState; + } + } + + public bool bInArenaTime + { + get + { + return this.m_inArenaTime; + } + } + + public bool bHasAvailableJion + { + get + { + return this.m_hasAvailableJoin; + } + } + + public List CombatTabs + { + get + { + return this.m_CombatTabs; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildArenaDocument"); + + private Dictionary m_GuildListDic = new Dictionary(); + + private Dictionary> m_combatGroupDic = new Dictionary>(); + + private List m_CombatTabs = new List(); + + private bool m_hasAvailableArenaIcon = false; + + private bool m_inArenaTime = false; + + private bool m_hasAvailableJoin = false; + + private uint m_canEnterBattle = 0u; + + private bool m_visibleEnterBattle = false; + + private uint m_selectBattleID = 0u; + + private double m_iconVisibleTime = 0.0; + + public int SelectWarIndex = 1; + + public GuildArenaTab SelectTabIndex = GuildArenaTab.Hall; + + private GuildArenaState m_timeState = GuildArenaState.GUILD_ARENA_NOT_BEGIN; + + public List IntegralUnits = new List(); + + public List DuelCombatInfos = new List(); + + private GuildArenaType m_battleStep = GuildArenaType.notopen; + + private bool m_registrationStatu = false; + + private double m_registrationTime = 0.0; + + private uint m_registrationCount = 0u; + + private bool m_sendJoinRpc = false; + + protected override void OnReconnected(XReconnectedEventArgs args) + { + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + switch (this.SelectTabIndex) + { + case GuildArenaTab.Hall: + this.SendGuildIntegralInfo(); + this.SendGetApplyGuildList(); + break; + case GuildArenaTab.Duel: + this.SendIntegralBattleInfo(); + break; + case GuildArenaTab.Combat: + this.SendGuildArenaInfo(); + break; + } + } + } + + public override void Update(float fDeltaT) + { + base.Update(fDeltaT); + bool flag = this.m_iconVisibleTime > 0.0; + if (flag) + { + this.m_iconVisibleTime -= (double)fDeltaT; + bool flag2 = this.m_iconVisibleTime <= 0.0; + if (flag2) + { + this.bHasAvailableArenaIcon = false; + } + } + bool flag3 = this.m_registrationTime > (double)fDeltaT; + if (flag3) + { + this.m_registrationTime -= (double)fDeltaT; + } + else + { + this.m_registrationTime = 0.0; + } + } + + public void UpdateView(GuildArenaTab tab) + { + bool flag = DlgBase.singleton.IsVisible() && this.SelectTabIndex == tab; + if (flag) + { + DlgBase.singleton.RefreshData(); + } + } + + public bool TryGetGuildInfo(ulong guildID, out XGuildBasicData guildInfo) + { + guildInfo = null; + return guildID > 0UL && this.m_GuildListDic.TryGetValue(guildID, out guildInfo); + } + + public GuildArenaGroupData GetGuildGroup(uint combatID, uint battleID) + { + Dictionary dictionary; + bool flag = this.m_combatGroupDic.TryGetValue(combatID, out dictionary); + GuildArenaGroupData result; + if (flag) + { + result = (dictionary.ContainsKey(battleID) ? dictionary[battleID] : null); + } + else + { + result = null; + } + return result; + } + + public ulong GetArenaWinnerGuildID(uint combatTeamID, uint battleID = 7u) + { + Dictionary dictionary; + bool flag = this.m_combatGroupDic.TryGetValue(combatTeamID, out dictionary); + ulong result; + if (flag) + { + result = ((dictionary.ContainsKey(battleID) && dictionary[battleID] != null) ? dictionary[battleID].winerId : 0UL); + } + else + { + result = 0UL; + } + return result; + } + + private int GetCurRoundIndex() + { + int result = 0; + switch (this.BattleStep) + { + case GuildArenaType.battleone: + result = 0; + break; + case GuildArenaType.battletwo: + result = 1; + break; + case GuildArenaType.battlethree: + result = 2; + break; + case GuildArenaType.battlefour: + result = 3; + break; + } + return result; + } + + public void SendGuildArenaJoinBattle() + { + bool flag = this.m_canEnterBattle != 1u && this.m_canEnterBattle != 2u; + if (!flag) + { + bool sendJoinRpc = this.m_sendJoinRpc; + if (!sendJoinRpc) + { + RpcC2M_gmfjoinreq rpc = new RpcC2M_gmfjoinreq(); + XSingleton.singleton.Send(rpc); + this.m_sendJoinRpc = true; + } + } + } + + public void ReceiveGuildArenaJoinBattle(gmfjoinres res) + { + this.m_sendJoinRpc = false; + bool flag = res.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(res.errorcode, "fece00"); + } + } + + public void SendGuildArenaInfo() + { + RpcC2M_AskGuildArenaInfoNew rpc = new RpcC2M_AskGuildArenaInfoNew(); + XSingleton.singleton.Send(rpc); + } + + public void OnGuildArenaInfo(AskGuildArenaInfoReq oRes) + { + this.m_GuildListDic.Clear(); + this.m_CombatTabs.Clear(); + this.m_combatGroupDic.Clear(); + this.m_timeState = oRes.timeState; + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool bInGuild = specificDocument.bInGuild; + List allguildInfo = oRes.allguildInfo; + int i = 0; + int count = allguildInfo.Count; + while (i < count) + { + XGuildBasicData xguildBasicData = new XGuildBasicData(); + xguildBasicData.Init(allguildInfo[i]); + this.m_GuildListDic[xguildBasicData.uid] = xguildBasicData; + i++; + } + this.m_inArenaTime = (allguildInfo.Count > 0); + List warData = oRes.warData; + this.m_hasAvailableJoin = false; + this.m_canEnterBattle = 0u; + this.m_selectBattleID = 0u; + i = 0; + count = warData.Count; + while (i < count) + { + this.m_CombatTabs.Add((int)warData[i].warType); + this.m_combatGroupDic[warData[i].warType] = new Dictionary(); + int count2 = warData[i].guildArenaGroupData.Count; + for (int j = count2 - 1; j >= 0; j--) + { + GuildArenaGroupData guildArenaGroupData = warData[i].guildArenaGroupData[j]; + this.m_combatGroupDic[warData[i].warType].Add(guildArenaGroupData.battleId, guildArenaGroupData); + bool flag = guildArenaGroupData.guildOneId == specificDocument.BasicData.uid || guildArenaGroupData.guildTwoId == specificDocument.BasicData.uid; + if (flag) + { + this.SelectWarIndex = (int)warData[i].warType; + this.m_hasAvailableJoin = true; + bool flag2 = this.m_selectBattleID == 0u || this.m_selectBattleID < guildArenaGroupData.battleId; + if (flag2) + { + this.m_canEnterBattle = guildArenaGroupData.state; + this.m_selectBattleID = guildArenaGroupData.battleId; + this.m_visibleEnterBattle = (guildArenaGroupData.winerId == 0UL || (guildArenaGroupData.winerId == specificDocument.BasicData.uid && guildArenaGroupData.battleId != 7u)); + } + } + } + i++; + } + this.UpdateView(GuildArenaTab.Combat); + } + + public void OnSynGuildArenaBattleInfos(SynGuildArenaBattleInfo info) + { + uint warType = info.warType; + List arenaBattleInfo = info.arenaBattleInfo; + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + Dictionary dictionary; + bool flag = this.m_combatGroupDic.TryGetValue(info.warType, out dictionary); + if (flag) + { + int i = 0; + int count = arenaBattleInfo.Count; + while (i < count) + { + bool flag2 = dictionary.ContainsKey(arenaBattleInfo[i].battleId); + if (flag2) + { + dictionary[arenaBattleInfo[i].battleId] = arenaBattleInfo[i]; + } + else + { + dictionary.Add(arenaBattleInfo[i].battleId, arenaBattleInfo[i]); + } + bool flag3 = arenaBattleInfo[i].guildOneId == specificDocument.BasicData.uid || arenaBattleInfo[i].guildTwoId == specificDocument.BasicData.uid; + if (flag3) + { + this.m_canEnterBattle = arenaBattleInfo[i].state; + this.m_selectBattleID = arenaBattleInfo[i].battleId; + this.m_visibleEnterBattle = (arenaBattleInfo[i].winerId == 0UL || (arenaBattleInfo[i].winerId == specificDocument.BasicData.uid && arenaBattleInfo[i].battleId != 7u)); + } + i++; + } + } + this.UpdateView(GuildArenaTab.Combat); + } + + public void SendGuildIntegralInfo() + { + RpcC2M_GetGuildIntegralInfo rpc = new RpcC2M_GetGuildIntegralInfo(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveIntegralBattleInfo(GetGuildIntegralInfoRes res) + { + this.m_battleStep = res.battletype; + this.m_registrationTime = res.applytime; + this.m_registrationStatu = res.isapply; + this.m_registrationCount = res.curturn; + GuildArenaType battleStep = this.m_battleStep; + GuildArenaTab guildArenaTab; + if (battleStep - GuildArenaType.battleone > 3) + { + if (battleStep != GuildArenaType.battlefinal) + { + guildArenaTab = GuildArenaTab.Hall; + } + else + { + guildArenaTab = GuildArenaTab.Combat; + } + } + else + { + guildArenaTab = GuildArenaTab.Duel; + } + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + bool flag2 = this.SelectTabIndex == guildArenaTab; + if (flag2) + { + DlgBase.singleton.RefreshData(); + } + else + { + DlgBase.singleton.SelectTabIndex(guildArenaTab); + } + } + } + + public void OnUpdateGuildArenaState(UpdateGuildArenaState state) + { + GuildArenaGroupData guildGroup = this.GetGuildGroup(state.warType, state.battleId); + bool flag = guildGroup == null; + if (!flag) + { + guildGroup.warstate = state.state; + this.UpdateView(GuildArenaTab.Combat); + } + } + + public void ReceiveGuildArenaNextTime(NoticeGuildArenaNextTime time) + { + this.m_timeState = time.state; + this.UpdateView(GuildArenaTab.Combat); + } + + public void SendIntegralBattleInfo() + { + RpcC2M_getintegralbattleInfo rpc = new RpcC2M_getintegralbattleInfo(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveIntegralBattleInfo(getintegralbattleInfores res) + { + this.DuelCombatInfos.Clear(); + ulong uid = XDocuments.GetSpecificDocument(XGuildDocument.uuID).UID; + int curRoundIndex = this.GetCurRoundIndex(); + int i = 0; + int count = res.battleTime.Count; + while (i < count) + { + GuildArenaDuelCombatInfo guildArenaDuelCombatInfo = new GuildArenaDuelCombatInfo(); + guildArenaDuelCombatInfo.CombatTime = res.battleTime[i]; + bool flag = i < res.battleinfo.Count; + if (flag) + { + IntegralBattle integralBattle = res.battleinfo[i]; + guildArenaDuelCombatInfo.IsDo = integralBattle.isdo; + guildArenaDuelCombatInfo.Step = integralBattle.state; + guildArenaDuelCombatInfo.Statu = ((integralBattle.state == IntegralState.integralend) ? GuildArenaDuelCombatStatu.Used : GuildArenaDuelCombatStatu.Current); + guildArenaDuelCombatInfo.isShow = true; + bool flag2 = integralBattle.guildone == uid; + if (flag2) + { + guildArenaDuelCombatInfo.GuildID = integralBattle.guildtwo; + guildArenaDuelCombatInfo.GuildName = integralBattle.nametwo; + guildArenaDuelCombatInfo.Winner = (integralBattle.guildonescore > integralBattle.guildtwoscore); + guildArenaDuelCombatInfo.GuildIcon = integralBattle.icontwo; + guildArenaDuelCombatInfo.GuildScore = integralBattle.guildonescore; + } + else + { + bool flag3 = integralBattle.guildtwo == uid; + if (flag3) + { + guildArenaDuelCombatInfo.GuildID = integralBattle.guildone; + guildArenaDuelCombatInfo.GuildName = integralBattle.nameone; + guildArenaDuelCombatInfo.GuildScore = integralBattle.guildtwoscore; + guildArenaDuelCombatInfo.Winner = (integralBattle.guildtwoscore > integralBattle.guildonescore); + guildArenaDuelCombatInfo.GuildIcon = integralBattle.iconone; + } + } + } + else + { + guildArenaDuelCombatInfo.Statu = GuildArenaDuelCombatStatu.Next; + guildArenaDuelCombatInfo.isShow = false; + } + this.DuelCombatInfos.Add(guildArenaDuelCombatInfo); + i++; + } + this.UpdateView(GuildArenaTab.Duel); + } + + public void SendApplyGuildArena() + { + RpcC2M_applyguildarena rpc = new RpcC2M_applyguildarena(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveApplyGuildArena(applyguildarenares res) + { + bool flag = res.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(res.errorcode); + } + else + { + this.m_registrationStatu = true; + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_ARENA_SIGN_SUCCESS"), "fece00"); + this.SendGetApplyGuildList(); + this.UpdateView(GuildArenaTab.Hall); + } + } + + public void SendGetApplyGuildList() + { + RpcC2M_getapplyguildlist rpc = new RpcC2M_getapplyguildlist(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveApplyGuildList(getapplyguildlistres res) + { + this.IntegralUnits.Clear(); + this.IntegralUnits.AddRange(res.guildlist); + this.UpdateView(GuildArenaTab.Hall); + } + + private int IntegralUnitsCompare(Integralunit u1, Integralunit u2) + { + return (int)(u2.guildscore - u1.guildscore); + } + + public int GetMyIntegralUnitIndex() + { + int result = -1; + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + ulong uid = specificDocument.BasicData.uid; + int i = 0; + int count = this.IntegralUnits.Count; + while (i < count) + { + bool flag = this.IntegralUnits[i].guildid != uid; + if (!flag) + { + result = i; + break; + } + i++; + } + return result; + } + + public void SendEnterDuelBattle(int index) + { + bool flag = index >= this.DuelCombatInfos.Count; + if (!flag) + { + GuildArenaDuelCombatInfo guildArenaDuelCombatInfo = this.DuelCombatInfos[index]; + bool flag2 = guildArenaDuelCombatInfo.Step == IntegralState.integralwatch || guildArenaDuelCombatInfo.Step == IntegralState.integralenterscene; + if (flag2) + { + XSingleton.singleton.AddGreenLog("XMainClient.GuildArenaDocument.SendEnterDuelBattle", null, null, null, null, null); + RpcC2M_gmfjoinreq rpc = new RpcC2M_gmfjoinreq(); + XSingleton.singleton.Send(rpc); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_ARENA_OUTTIME"), "fece00"); + } + } + } + + public void ReceiveUpdateBattleStatu(IntegralState state) + { + int curRoundIndex = this.GetCurRoundIndex(); + bool flag = curRoundIndex == -1 || curRoundIndex >= this.DuelCombatInfos.Count; + if (!flag) + { + GuildArenaDuelCombatInfo guildArenaDuelCombatInfo = this.DuelCombatInfos[curRoundIndex]; + guildArenaDuelCombatInfo.Step = state; + bool flag2 = this.SelectTabIndex == GuildArenaTab.Duel; + if (flag2) + { + bool flag3 = !guildArenaDuelCombatInfo.isShow; + if (flag3) + { + this.SendIntegralBattleInfo(); + } + else + { + this.UpdateView(GuildArenaTab.Duel); + } + } + else + { + bool flag4 = DlgBase.singleton.IsVisible() && (guildArenaDuelCombatInfo.Step == IntegralState.integralenterscene || guildArenaDuelCombatInfo.Step == IntegralState.integralwatch); + if (flag4) + { + DlgBase.singleton.SelectTabIndex(GuildArenaTab.Duel); + } + } + } + } + + public void SendReqGuildArenaHistory() + { + RpcC2M_ReqGuildArenaHistory rpc = new RpcC2M_ReqGuildArenaHistory(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveGuildArenaHistory(ReqGuildArenaHistoryRse res) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetHistoryList(res.history); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaDocument.cs.meta new file mode 100644 index 00000000..3ab13436 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildArenaDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 83d57a97b9bcbdf47af8f1876d14232c +timeCreated: 1611404046 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildBasicData.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildBasicData.cs new file mode 100644 index 00000000..66c2f4e3 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildBasicData.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildBasicData : XDataBase + { + public string announcement + { + get + { + bool flag = this._announcement == null || this._announcement == ""; + string result; + if (flag) + { + result = XStringDefineProxy.GetString("GUILD_DEFAULT_ANNOUNCEMENT"); + } + else + { + result = this._announcement; + } + return result; + } + set + { + this._announcement = value; + } + } + + public string actualAnnoucement + { + get + { + return this._announcement; + } + } + + public ulong uid; + + public string guildName; + + public string leaderName; + + public ulong leaderuid; + + public uint level; + + public uint memberCount; + + public uint maxMemberCount; + + private string _announcement; + + public int portraitIndex; + + public uint exp; + + public int rank; + + public uint liveness; + + public List liveList = new List(); + + public uint popularity; + + public uint technology; + + public uint resource; + + public string GetLiveness() + { + string text = string.Empty; + bool flag = this.liveList.Count > 0; + if (flag) + { + int i = 0; + int count = this.liveList.Count; + while (i < count) + { + bool flag2 = this.liveness < this.liveList[i]; + if (flag2) + { + text = string.Format("GUILD_LIVENESS_{0}", i + 1); + break; + } + i++; + } + } + bool flag3 = string.IsNullOrEmpty(text); + string result; + if (flag3) + { + result = this.liveness.ToString(); + } + else + { + result = XStringDefineProxy.GetString(text, new object[] + { + this.liveness + }); + } + return result; + } + + public string GetLivenessTips() + { + bool flag = this.liveList.Count != 3; + string result; + if (flag) + { + result = string.Empty; + } + else + { + result = string.Format(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("GUILD_LIVENESS_TIPS")), new object[] + { + this.liveList[0], + this.liveList[0], + this.liveList[1], + this.liveList[1], + this.liveList[2], + this.liveList[2] + }); + } + return result; + } + + public virtual void Init(GuildInfo info) + { + this.uid = info.id; + this.guildName = info.name; + this.leaderuid = info.leaderID; + this.leaderName = info.leaderName; + this.level = (uint)info.level; + this.memberCount = (uint)info.memberCount; + this.maxMemberCount = (uint)info.capacity; + this.portraitIndex = info.icon; + this.announcement = info.annoucement; + this.popularity = info.prestige; + } + + public void Init(GuildBriefRes info) + { + this.guildName = info.name; + this.leaderName = info.leaderName; + this.leaderuid = info.leaderID; + this.level = (uint)info.level; + this.memberCount = (uint)info.membercount; + this.maxMemberCount = (uint)info.capacity; + this.announcement = info.annoucement; + this.portraitIndex = info.icon; + this.exp = info.exp; + this.rank = info.rank; + this.liveness = info.activity; + this.liveList.Clear(); + this.liveList.Add(info.activityOne); + this.liveList.Add(info.activityTwo); + this.liveList.Add(info.activityThree); + this.popularity = info.prestige; + this.technology = info.schoolpoint; + this.resource = info.hallpoint; + } + + public virtual string ToGuildNameString() + { + return this.guildName; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildBasicData.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildBasicData.cs.meta new file mode 100644 index 00000000..254b0e4b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildBasicData.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e52b35127ded674499c28da4cb0ff39f +timeCreated: 1611404742 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildBoonBehaviour.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildBoonBehaviour.cs new file mode 100644 index 00000000..d365e40c --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildBoonBehaviour.cs @@ -0,0 +1,25 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildBoonBehaviour : DlgBehaviourBase + { + public IXUIButton m_Close; + + public XUIPool m_BoonPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public IXUIScrollView m_ScrollView; + + private void Awake() + { + Transform transform = base.transform.Find("Bg/Panel/BoonTpl"); + this.m_BoonPool.SetupPool(transform.parent.gameObject, transform.gameObject, 3u, false); + this.m_Close = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_ScrollView = (base.transform.Find("Bg/Panel").GetComponent("XUIScrollView") as IXUIScrollView); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildBoonBehaviour.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildBoonBehaviour.cs.meta new file mode 100644 index 00000000..d8020db0 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildBoonBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9cc103da7a9b90c4f921c6779c0df506 +timeCreated: 1611404233 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankInfo.cs new file mode 100644 index 00000000..3528d0fa --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankInfo.cs @@ -0,0 +1,41 @@ +using System; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + public class XGuildBossRankInfo : XBaseRankInfo + { + public string guildBossName; + + public uint guildBossIndex; + + public float damage; + + public string m_Time; + + public string guildName; + + public string strongDPSName; + + public float MaxHP; + + public override void ProcessData(RankData data) + { + this.rank = data.Rank; + this.guildBossName = data.guildBossName; + this.guildBossIndex = data.guildBossIndex; + this.damage = data.damage; + this.value = (ulong)data.time; + this.guildName = data.guildname; + this.strongDPSName = data.guildBossDpsMax; + this.m_Time = XSingleton.singleton.TimeFormatString((int)this.value, 2, 3, 4, false, true); + } + + public override string GetValue() + { + return this.m_Time; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankInfo.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankInfo.cs.meta new file mode 100644 index 00000000..e89d7274 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4ab364a70403f4a48a448d0eb375e99f +timeCreated: 1611403665 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankList.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankList.cs new file mode 100644 index 00000000..2ce615ed --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankList.cs @@ -0,0 +1,17 @@ +using System; + +namespace XMainClient +{ + public class XGuildBossRankList : XBaseRankList + { + public XGuildBossRankList() + { + this.type = XRankType.GuildBossRank; + } + + public override XBaseRankInfo CreateNewInfo() + { + return new XGuildBossRankInfo(); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankList.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankList.cs.meta new file mode 100644 index 00000000..63191ce4 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildBossRankList.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2efbcd19afff331408929ca7845dd2e0 +timeCreated: 1611403513 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusBrief.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusBrief.cs new file mode 100644 index 00000000..37b52a9a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusBrief.cs @@ -0,0 +1,40 @@ +using System; +using KKSG; + +namespace XMainClient +{ + internal class XGuildCheckInBonusBrief + { + public uint needMemberCount + { + get + { + return this.bonueMemberCount - this.frontBonusMemberCount; + } + } + + public uint bonusID = 0u; + + public uint bonueMemberCount = 0u; + + public BonusState bonusState = BonusState.Bonus_UnActive; + + public XGuildRedPacketBrief brief = new XGuildRedPacketBrief(); + + public uint frontBonusMemberCount = 0u; + + public uint bonusType = 0u; + + public void SetBrief(GuildBonusAppear appear) + { + bool flag = appear == null; + if (!flag) + { + this.brief.SetData(appear); + this.bonusID = appear.bonusID; + this.bonusType = appear.bonusContentType; + this.bonueMemberCount = appear.needCheckInNum; + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusBrief.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusBrief.cs.meta new file mode 100644 index 00000000..dff45129 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusBrief.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 354a9360d3ea05e469107da757f8124d +timeCreated: 1611403558 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusInfo.cs new file mode 100644 index 00000000..746d01b3 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusInfo.cs @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildCheckInBonusInfo + { + public int ActiveCount + { + get + { + int num = 0; + int i = 0; + int num2 = this.BonusBriefs.Length; + while (i < num2) + { + bool flag = this.BonusBriefs[i] != null && this.BonusBriefs[i].bonusState == BonusState.Bonus_Active; + if (flag) + { + num++; + } + i++; + } + return num; + } + } + + public bool isCheckIn; + + public int checkInNumber; + + public int onLineNum; + + public int guildMemberNum; + + public double timeofday; + + public double leftAskBonusTime; + + public XGuildCheckInBonusBrief[] BonusBriefs = new XGuildCheckInBonusBrief[4]; + + public XGuildCheckInBonusInfo() + { + DateTime now = DateTime.Now; + this.timeofday = (double)(3600 * now.Hour + 60 * now.Minute + now.Second); + } + + public void SetBonusBrief(List appears) + { + int i = 0; + int num = 4; + while (i < num) + { + XGuildCheckInBonusBrief xguildCheckInBonusBrief = new XGuildCheckInBonusBrief(); + bool flag = i < appears.Count; + if (flag) + { + GuildBonusAppear guildBonusAppear = appears[i]; + xguildCheckInBonusBrief.SetBrief(guildBonusAppear); + bool flag2 = i > 0; + if (flag2) + { + xguildCheckInBonusBrief.frontBonusMemberCount = appears[i - 1].needCheckInNum; + } + else + { + xguildCheckInBonusBrief.frontBonusMemberCount = 0u; + } + bool flag3 = (long)this.checkInNumber >= (long)((ulong)xguildCheckInBonusBrief.bonueMemberCount); + if (flag3) + { + bool flag4 = guildBonusAppear.bonusID > 0u; + if (flag4) + { + bool flag5 = guildBonusAppear.bonusStatus > 0u; + if (flag5) + { + xguildCheckInBonusBrief.bonusState = BonusState.Bouns_Over; + } + else + { + xguildCheckInBonusBrief.bonusState = BonusState.Bonus_Actived; + } + } + else + { + xguildCheckInBonusBrief.bonusState = BonusState.Bonus_Active; + } + } + else + { + xguildCheckInBonusBrief.bonusState = BonusState.Bonus_UnActive; + } + } + this.BonusBriefs[i] = xguildCheckInBonusBrief; + i++; + } + } + + public int GetAddPercent(int onlineNum) + { + string value = XSingleton.singleton.GetValue("GuildBonusOnLineNumAddPercent"); + string[] array = value.Split(XGlobalConfig.ListSeparator); + int result = 0; + int i = 0; + int num = array.Length; + while (i < num) + { + string[] array2 = array[i].Split(XGlobalConfig.SequenceSeparator); + bool flag = int.Parse(array2[0]) > onlineNum; + if (flag) + { + break; + } + result = int.Parse(array2[1]); + i++; + } + return result; + } + + public bool TryGetFreeBrief(out XGuildCheckInBonusBrief brief) + { + brief = null; + int i = 0; + int num = this.BonusBriefs.Length; + while (i < num) + { + bool flag = this.BonusBriefs[i] != null && this.BonusBriefs[i].bonusState == BonusState.Bonus_Active; + if (flag) + { + brief = this.BonusBriefs[i]; + return true; + } + i++; + } + return false; + } + + public bool HasActive() + { + return this.ActiveCount > 0; + } + + public bool AllActived() + { + int i = 0; + int num = this.BonusBriefs.Length; + while (i < num) + { + bool flag = this.BonusBriefs[i] == null || this.BonusBriefs[i].bonusState == BonusState.Bonus_Actived; + if (flag) + { + return false; + } + i++; + } + return true; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusInfo.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusInfo.cs.meta new file mode 100644 index 00000000..cc979523 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildCheckInBonusInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3b9b3c52935cf5945bb736cb7b7ac40f +timeCreated: 1611403599 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildCollectDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildCollectDocument.cs new file mode 100644 index 00000000..3033845e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildCollectDocument.cs @@ -0,0 +1,798 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildCollectDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildCollectDocument.uuID; + } + } + + public GuildCampPartyReward RewardReader + { + get + { + return XGuildCollectDocument._rewardReader; + } + } + + public bool ActivityState + { + get + { + return this._activityState; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildCollectDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private static GuildCampPartyReward _rewardReader = new GuildCampPartyReward(); + + private bool _activityState = false; + + private bool _lotteryMachineState = false; + + public List NpcPool = new List(); + + public List LotteryMachineList = new List(); + + public Dictionary NpcIndex = new Dictionary(); + + public List NpcList = new List(); + + private int _npcMaxShowNum; + + private CollectNpcRefreshMode _npcRefreshMode; + + private uint _lastMeetLotteryUid; + + private float _lotteryWaitTime; + + private string _lotteryProcessText; + + private string _lotteryProcessTips; + + private uint _lastSendNpcID = 0u; + + private float _lastSendNpcTime; + + public Dictionary CollectUseDict = new Dictionary(); + + public bool MainInterfaceBtnState = false; + + public List _fxList = new List(); + + private static readonly string m_fxPath = "Effects/FX_Particle/Scene/Lzg_scene/rwts_05"; + + public double SignTime; + + public uint LeftTime; + + private int SUMMONLEFTTIME = 300; + + private string NORMALNAME = ""; + + private string SPECIALNAME = ""; + + private uint _hallTimeToken; + + private LinkedList _lotteryFxLink = new LinkedList(); + + private XFx _lotteryBoxFx; + + private static readonly string LotteryFlyFXPATH = "Effects/FX_Particle/UIfx/UI_ghpd_rabbit_Clip02"; + + private static readonly string LotteryBoxFXPATH = "Effects/FX_Particle/UIfx/UI_ghpd_rabbit_Clip01"; + + public Dictionary LotteryCDInfo = new Dictionary(); + + public int LotteryTimes = 3; + + public float GuildCollecLotteryCD = 120f; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildCollectDocument.AsyncLoader.AddTask("Table/GuildCampPartyReward", XGuildCollectDocument._rewardReader, false); + XGuildCollectDocument.AsyncLoader.Execute(callback); + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + this._activityState = false; + this._lotteryMachineState = false; + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_GUILD_HALL; + if (flag) + { + this._lotteryWaitTime = float.Parse(XSingleton.singleton.GetValue("GuildCollecLotteryWaitTime")); + this._lotteryProcessText = XStringDefineProxy.GetString("GuildCollectProcessText"); + this._lotteryProcessTips = XStringDefineProxy.GetString("GuildCollectProcessTips"); + this.LotteryTimes = int.Parse(XSingleton.singleton.GetValue("GuildCollecLotteryTimes")); + this.GuildCollecLotteryCD = float.Parse(XSingleton.singleton.GetValue("GuildCollecLotteryCD")); + List intList = XSingleton.singleton.GetIntList("GuildCollectNpcShowNum"); + XQualitySetting.ESetting quality = (XQualitySetting.ESetting)XQualitySetting.GetQuality(); + int num = XFastEnumIntEqualityComparer.ToInt(quality); + bool flag2 = num > intList.Count - 1; + if (flag2) + { + num = intList.Count - 1; + } + this._npcMaxShowNum = intList[num]; + this._npcRefreshMode = ((XSingleton.singleton.GetValue("GuildCollectNpcRefreshMode") == "0") ? CollectNpcRefreshMode.Random : CollectNpcRefreshMode.Distance); + this.NpcIndex.Clear(); + this.NpcList.Clear(); + this.NpcPool.Clear(); + this.LotteryMachineList.Clear(); + bool activityState = this._activityState; + if (activityState) + { + this.RefreshTime(null); + this.InitNpcList(); + bool lotteryMachineState = this._lotteryMachineState; + if (lotteryMachineState) + { + this.SetLotteryMachineState(true, true); + } + } + this.SetMainInterfaceBtnState(false); + } + } + + public int CheckLotteryCD(uint uid) + { + LotteryCD lotteryCD; + bool flag = this.LotteryCDInfo.TryGetValue(uid, out lotteryCD); + int result; + if (flag) + { + bool flag2 = lotteryCD.Times < this.LotteryTimes; + if (flag2) + { + lotteryCD.Times++; + result = -1; + } + else + { + int num = (int)(Time.time - lotteryCD.LastLotteryTime - this.GuildCollecLotteryCD); + bool flag3 = num >= 0; + if (flag3) + { + lotteryCD.Times = 1; + lotteryCD.LastLotteryTime = Time.time; + result = -1; + } + else + { + result = -num; + } + } + } + else + { + lotteryCD = new LotteryCD(); + lotteryCD.Times = 1; + lotteryCD.LastLotteryTime = Time.time; + this.LotteryCDInfo[uid] = lotteryCD; + result = -1; + } + return result; + } + + public void SetActivityState(bool state) + { + bool flag = this._activityState != state; + if (flag) + { + this._activityState = state; + XSingleton.singleton.AddGreenLog("set guildcollect state = ", state.ToString(), null, null, null, null); + bool flag2 = XSingleton.singleton.SceneType == SceneType.SCENE_GUILD_HALL; + if (flag2) + { + bool activityState = this._activityState; + if (activityState) + { + this.RefreshTime(null); + this.InitNpcList(); + } + else + { + foreach (KeyValuePair keyValuePair in this.NpcIndex) + { + XSingleton.singleton.DestroyNpc(keyValuePair.Value); + } + for (int i = 0; i < this.NpcPool.Count; i++) + { + XSingleton.singleton.DestroyNpc(this.NpcPool[i]); + } + this.NpcIndex.Clear(); + this.NpcList.Clear(); + this.NpcPool.Clear(); + } + } + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.OnGuildSysChange(); + } + } + } + + public void InitNpcList() + { + int num = this._npcMaxShowNum; + this.NORMALNAME = XStringDefineProxy.GetString("GuildCollectSummonNormal"); + this.SPECIALNAME = XStringDefineProxy.GetString("GuildCollectSummonSpecial"); + uint num2 = 101u; + for (;;) + { + XNpcInfo.RowData byNPCID = XSingleton.singleton.NpcInfo.GetByNPCID(num2); + bool flag = byNPCID == null || byNPCID.NPCType != 4u; + if (flag) + { + break; + } + XNpc xnpc = XSingleton.singleton.CreateNpc(num2, true); + xnpc.EngineObject.Position = XGameUI.Far_Far_Away; + this.NpcPool.Add(num2); + num--; + bool flag2 = num <= 0; + if (flag2) + { + break; + } + num2 += 1u; + } + } + + public void SyncNpcList(List list) + { + HashSet hashSet = new HashSet(); + for (int i = 0; i < list.Count; i++) + { + hashSet.Add(list[i].sprite_id); + } + for (int j = this.NpcList.Count - 1; j >= 0; j--) + { + bool flag = hashSet.Contains(this.NpcList[j].id); + if (flag) + { + hashSet.Remove(this.NpcList[j].id); + } + else + { + this.SetNpcInValid(j); + this.NpcList.RemoveAt(j); + } + } + bool flag2 = false; + for (int k = 0; k < list.Count; k++) + { + bool flag3 = hashSet.Contains(list[k].sprite_id); + if (flag3) + { + flag2 = true; + Vector3 pos; + pos= new Vector3((float)(list[k].position >> 16) / 100f, 0f, (float)(list[k].position & 65535) / 100f); + string name = string.IsNullOrEmpty(list[k].summoner) ? this.NORMALNAME : string.Format("{0}{1}", list[k].summoner, this.SPECIALNAME); + this.NpcList.Add(new CollectNpcInfo(list[k].sprite_id, pos, name)); + } + } + bool flag4 = flag2; + if (flag4) + { + this.SortNpcByMode(this._npcRefreshMode); + } + this.DealWithNpcList(); + } + + public void OnMeetNpc(uint uid) + { + bool flag = this.NpcIndex.ContainsValue(uid); + if (flag) + { + foreach (KeyValuePair keyValuePair in this.NpcIndex) + { + bool flag2 = keyValuePair.Value == uid; + if (flag2) + { + bool flag3 = this._lastSendNpcID == keyValuePair.Key && Time.time < this._lastSendNpcTime; + if (flag3) + { + return; + } + RpcC2G_GetGuildCamPartyRandItem rpcC2G_GetGuildCamPartyRandItem = new RpcC2G_GetGuildCamPartyRandItem(); + rpcC2G_GetGuildCamPartyRandItem.oArg.query_type = 2u; + rpcC2G_GetGuildCamPartyRandItem.oArg.npc_id = keyValuePair.Key; + XSingleton.singleton.Send(rpcC2G_GetGuildCamPartyRandItem); + this._lastSendNpcTime = Time.time + 0.5f; + return; + } + } + } + XSingleton.singleton.ShowSystemTip(ErrorCode.ERR_GUILDACMPPATY_SPRITE_ONTEXIST, "fece00"); + } + + public void OnMeetLottery(uint uid) + { + bool flag = DlgBase.singleton.IsVisible(); + if (!flag) + { + int num = this.CheckLotteryCD(uid); + bool flag2 = num != -1; + if (flag2) + { + XSingleton.singleton.ShowSystemTip(string.Format(XStringDefineProxy.GetString("GuildCollectLotteryCDTips"), num), "fece00"); + } + else + { + this._lastMeetLotteryUid = uid; + DlgBase.singleton.ShowProcess(this._lotteryWaitTime, this._lotteryProcessText, this._lotteryProcessTips, new GuildInheritProcessDlg.OnSliderProcessEnd(this.QueryLottery)); + this.SetMoveState(false); + XNpc npc = XSingleton.singleton.GetNpc(uid); + bool flag3 = npc == null; + if (!flag3) + { + npc.ShowUp(null); + bool flag4 = npc != null; + if (flag4) + { + XSingleton.singleton.PlaySound(npc, AudioChannel.Motion, "Audio/UI/UI_rabbit"); + } + XSingleton.singleton.SetTimer(float.Parse(XSingleton.singleton.GetValue("GuildCollecBoxFxTime")), new XTimerMgr.ElapsedEventHandler(this.DelayCreateLotteryBoxFx), uid); + string[] array = XSingleton.singleton.GetValue("GuildCollecLotteryFxNum").Split(new char[] + { + '=' + }); + bool flag5 = array.Length < 2; + if (!flag5) + { + int num2 = XSingleton.singleton.RandomInt(int.Parse(array[0]), int.Parse(array[1]) + 1); + array = XSingleton.singleton.GetValue("GuildCollecLotteryFxProduce").Split(new char[] + { + '=' + }); + float min = float.Parse(array[0]); + float max = float.Parse(array[1]); + for (int i = 0; i < num2; i++) + { + XSingleton.singleton.SetTimer(XSingleton.singleton.RandomFloat(min, max), new XTimerMgr.ElapsedEventHandler(this.DelayCreateLotteryFlyFx), uid); + } + } + } + } + } + } + + public void DelayCreateLotteryBoxFx(object o) + { + uint id = (uint)o; + XNpc npc = XSingleton.singleton.GetNpc(id); + bool flag = npc == null; + if (!flag) + { + bool flag2 = this._lotteryBoxFx != null; + if (flag2) + { + XSingleton.singleton.DestroyFx(this._lotteryBoxFx, true); + } + this._lotteryBoxFx = XSingleton.singleton.CreateFx(XGuildCollectDocument.LotteryBoxFXPATH, null, true); + this._lotteryBoxFx.Play(npc.EngineObject.Position, Quaternion.identity, Vector3.one, 1f); + } + } + + public void DelayCreateLotteryFlyFx(object o) + { + uint id = (uint)o; + XNpc npc = XSingleton.singleton.GetNpc(id); + bool flag = npc == null || XSingleton.singleton.Player == null; + if (!flag) + { + this.CreatLotteryFx(npc.EngineObject.Position, XSingleton.singleton.Player.EngineObject.Position + new Vector3(0f, 0.3f)); + } + } + + public void QueryLottery() + { + this.SetMoveState(true); + RpcC2G_GetGuildCamPartyRandItem rpcC2G_GetGuildCamPartyRandItem = new RpcC2G_GetGuildCamPartyRandItem(); + rpcC2G_GetGuildCamPartyRandItem.oArg.query_type = 1u; + rpcC2G_GetGuildCamPartyRandItem.oArg.npc_id = this._lastMeetLotteryUid; + XSingleton.singleton.Send(rpcC2G_GetGuildCamPartyRandItem); + } + + public void SetMoveState(bool state) + { + bool flag = XSingleton.singleton.Player != null && XSingleton.singleton.Player.Nav != null; + if (flag) + { + XSingleton.singleton.Player.Nav.Interrupt(); + XSingleton.singleton.Player.Nav.Enabled = state; + } + XSingleton.singleton.Freezed = !state; + } + + public void DealWithNpcList() + { + bool flag = this._npcRefreshMode == CollectNpcRefreshMode.Distance; + if (flag) + { + this.NpcList.Sort(new Comparison(this.Compare)); + } + int num = this._npcMaxShowNum; + for (int i = 0; i < this.NpcList.Count; i++) + { + bool flag2 = this.NpcIndex.ContainsKey(this.NpcList[i].id); + if (flag2) + { + num--; + } + } + bool flag3 = num > 0; + if (flag3) + { + for (int j = 0; j < this.NpcList.Count; j++) + { + bool use = this.NpcList[j].use; + if (!use) + { + bool flag4 = !this.NpcIndex.ContainsKey(this.NpcList[j].id); + if (flag4) + { + this.CreateNpc(this.NpcList[j].pos, this.NpcList[j].id, this.NpcList[j].name); + num--; + bool flag5 = num <= 0; + if (flag5) + { + break; + } + } + } + } + } + } + + private int Compare(CollectNpcInfo x, CollectNpcInfo y) + { + bool flag = x.id == y.id; + int result; + if (flag) + { + result = 0; + } + else + { + float num = Vector3.Distance(x.pos, XSingleton.singleton.Player.EngineObject.Position); + float num2 = Vector3.Distance(y.pos, XSingleton.singleton.Player.EngineObject.Position); + result = ((num > num2) ? 1 : -1); + } + return result; + } + + public void SortNpcByMode(CollectNpcRefreshMode mode) + { + bool flag = mode == CollectNpcRefreshMode.Distance; + if (flag) + { + this.NpcList.Sort(new Comparison(this.Compare)); + } + else + { + XSingleton.singleton.Shuffle(ref this.NpcList); + } + } + + public void SetNpcInValid(int index) + { + uint num = 0u; + bool flag = this.NpcIndex.TryGetValue(this.NpcList[index].id, out num); + if (flag) + { + this.ReturnPool(num); + this.NpcIndex.Remove(this.NpcList[index].id); + bool flag2 = XSingleton.singleton.LastNpc != null && XSingleton.singleton.LastNpc.TypeID == num; + if (flag2) + { + bool flag3 = XSingleton.singleton.Player != null && XSingleton.singleton.Player.Nav != null; + if (flag3) + { + XSingleton.singleton.Player.Nav.Interrupt(); + } + XSingleton.singleton.LastNpc = null; + } + } + } + + public void ReturnPool(uint uid) + { + XNpc npc = XSingleton.singleton.GetNpc(uid); + bool flag = npc != null; + if (flag) + { + npc.EngineObject.Position = XGameUI.Far_Far_Away; + this.NpcPool.Add(uid); + } + } + + public void CreateNpc(Vector3 pos, uint npcID, string name) + { + bool flag = this.NpcPool.Count == 0; + if (flag) + { + XSingleton.singleton.AddErrorLog("Get guildcollect Npc by pool error! It's a empty pool.", null, null, null, null, null); + } + else + { + int index = this.NpcPool.Count - 1; + uint num = this.NpcPool[index]; + this.NpcPool.RemoveAt(index); + XNpc npc = XSingleton.singleton.GetNpc(num); + bool flag2 = npc == null; + if (flag2) + { + XSingleton.singleton.AddErrorLog("create npc by pool error. id = ", num.ToString(), null, null, null, null); + } + else + { + bool flag3 = npc.BillBoard != null; + if (flag3) + { + npc.BillBoard.OnGuildCollectNpcNameChange(name); + } + npc.EngineObject.Position = pos; + npc.EngineObject.LocalEulerAngles = new Vector3(0f, XSingleton.singleton.RandomFloat(-180f, 180f), 0f); + this.NpcIndex[npcID] = num; + } + } + } + + public void SetLotteryMachineState(bool state, bool force = false) + { + bool flag = XSingleton.singleton.SceneType != SceneType.SCENE_GUILD_HALL; + if (!flag) + { + bool flag2 = !force && state == this._lotteryMachineState; + if (!flag2) + { + this._lotteryMachineState = state; + bool lotteryMachineState = this._lotteryMachineState; + if (lotteryMachineState) + { + uint num = 100u; + for (;;) + { + XNpcInfo.RowData byNPCID = XSingleton.singleton.NpcInfo.GetByNPCID(num); + bool flag3 = byNPCID == null || byNPCID.NPCType != 5u; + if (flag3) + { + break; + } + XNpc xnpc = XSingleton.singleton.CreateNpc(num, true); + this.LotteryMachineList.Add(num); + XFx xfx = XSingleton.singleton.CreateFx(XGuildCollectDocument.m_fxPath, null, true); + bool flag4 = xfx != null && xnpc != null; + if (flag4) + { + this._fxList.Add(xfx); + xfx.Play(xnpc.EngineObject, new Vector3(-0.05f, xnpc.Height + 0.6f, 0f), Vector3.one, 1f, false, false, "", 0f); + } + num -= 1u; + } + } + else + { + for (int i = 0; i < this.LotteryMachineList.Count; i++) + { + XSingleton.singleton.DestroyNpc(this.LotteryMachineList[i]); + } + for (int j = 0; j < this._fxList.Count; j++) + { + bool flag5 = this._fxList[j] != null; + if (flag5) + { + XSingleton.singleton.DestroyFx(this._fxList[j], true); + } + } + this._fxList.Clear(); + this.LotteryMachineList.Clear(); + } + } + } + } + + public override void OnLeaveScene() + { + base.OnLeaveScene(); + this.NpcIndex.Clear(); + this.NpcList.Clear(); + this.NpcPool.Clear(); + this.LotteryMachineList.Clear(); + for (int i = 0; i < this._fxList.Count; i++) + { + bool flag = this._fxList[i] != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this._fxList[i], true); + } + } + this._fxList.Clear(); + bool flag2 = this._lotteryFxLink.Count != 0; + if (flag2) + { + LinkedListNode next; + for (LinkedListNode linkedListNode = this._lotteryFxLink.First; linkedListNode != null; linkedListNode = next) + { + next = linkedListNode.Next; + linkedListNode.Value.Destroy(); + this._lotteryFxLink.Remove(linkedListNode); + } + XSingleton.singleton.AddGreenLog("Clear guildcollect fx link, cout = ", this._lotteryFxLink.Count.ToString(), null, null, null, null); + } + bool flag3 = this._lotteryBoxFx != null; + if (flag3) + { + XSingleton.singleton.DestroyFx(this._lotteryBoxFx, true); + this._lotteryBoxFx = null; + } + } + + public void SetMainInterfaceBtnState(bool state) + { + this.MainInterfaceBtnState = state; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildCollectMainInterface, true); + } + + public void QuerySummon() + { + SeqList sequenceList = XSingleton.singleton.GetSequenceList("GuildCampSummonSpiritCost", false); + string text = string.Format(XStringDefineProxy.GetString("GuildCollectSummonTips"), XLabelSymbolHelper.FormatSmallIcon(sequenceList[0, 0]), sequenceList[0, 1]); + text = XSingleton.singleton.ReplaceReturn(text); + string @string = XStringDefineProxy.GetString("COMMON_OK"); + string string2 = XStringDefineProxy.GetString("COMMON_CANCEL"); + XSingleton.singleton.ShowModalDialog(text, @string, string2, new ButtonClickEventHandler(this.OnSummonSure)); + } + + public bool OnSummonSure(IXUIButton btn) + { + DlgBase.singleton.SetVisible(false, true); + RpcC2G_GuildPartySummonSpirit rpc = new RpcC2G_GuildPartySummonSpirit(); + XSingleton.singleton.Send(rpc); + return true; + } + + public void QueryGetRewardCount() + { + RpcC2G_GetGuildPartyReceiveInfo rpc = new RpcC2G_GetGuildPartyReceiveInfo(); + XSingleton.singleton.Send(rpc); + } + + public void OnUseCountGet(List list) + { + this.CollectUseDict.Clear(); + for (int i = 0; i < list.Count; i++) + { + this.CollectUseDict[(uint)list[i].key] = (int)list[i].value; + } + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.Refresh(); + } + } + + public void QueryGetReward(uint id) + { + RpcC2G_GetGuildCampPartyReward rpcC2G_GetGuildCampPartyReward = new RpcC2G_GetGuildCampPartyReward(); + rpcC2G_GetGuildCampPartyReward.oArg.reward_id = id; + XSingleton.singleton.Send(rpcC2G_GetGuildCampPartyReward); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public void CreatLotteryFx(Vector3 startPos, Vector3 endPos) + { + string[] array = XSingleton.singleton.GetValue("GuildCollecLotteryFxDuration").Split(new char[] + { + '=' + }); + bool flag = array.Length < 2; + if (!flag) + { + float duration = XSingleton.singleton.RandomFloat(float.Parse(array[0]), float.Parse(array[1])); + array = XSingleton.singleton.GetValue("GuildCollecLotteryFxSpeed").Split(new char[] + { + '=' + }); + bool flag2 = array.Length < 2; + if (!flag2) + { + float speedY = XSingleton.singleton.RandomFloat(float.Parse(array[0]), float.Parse(array[1])); + ParabolaFx value = new ParabolaFx(XGuildCollectDocument.LotteryFlyFXPATH, duration, speedY, startPos, endPos); + this._lotteryFxLink.AddLast(value); + } + } + } + + public override void Update(float fDeltaT) + { + base.Update(fDeltaT); + bool flag = !this._activityState; + if (!flag) + { + bool flag2 = this._lotteryFxLink.Count == 0; + if (!flag2) + { + LinkedListNode next; + for (LinkedListNode linkedListNode = this._lotteryFxLink.First; linkedListNode != null; linkedListNode = next) + { + next = linkedListNode.Next; + bool flag3 = !linkedListNode.Value.Update(); + if (flag3) + { + this._lotteryFxLink.Remove(linkedListNode); + } + } + } + } + } + + public void SetTime(uint leftTime) + { + this.SignTime = XSingleton.singleton.GetMachineTime(); + this.LeftTime = leftTime; + this.SUMMONLEFTTIME = XSingleton.singleton.GetInt("GuildCampSummonSpiritTime"); + } + + public void RefreshTime(object o = null) + { + int num = (int)(XSingleton.singleton.GetMachineTime() - this.SignTime); + num = (int)(this.LeftTime - (uint)num); + int num2 = num - this.SUMMONLEFTTIME; + bool flag = num < 0; + if (flag) + { + num = 0; + } + bool flag2 = num2 < 0; + if (flag2) + { + num2 = 0; + } + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshGuildCollectTime(num, num2); + } + bool flag4 = DlgBase.singleton.IsVisible(); + if (flag4) + { + DlgBase.singleton.RefreshTime(num); + } + this._hallTimeToken = XSingleton.singleton.SetTimer(1f, new XTimerMgr.ElapsedEventHandler(this.RefreshTime), null); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildCollectDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildCollectDocument.cs.meta new file mode 100644 index 00000000..6766c713 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildCollectDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3314ba52464564b439d38a39722ca7d3 +timeCreated: 1611403551 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildConfig.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildConfig.cs new file mode 100644 index 00000000..62a72e55 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildConfig.cs @@ -0,0 +1,244 @@ +using System; +using System.Collections.Generic; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildConfig + { + public uint MaxLevel + { + get + { + return this._MaxLevel; + } + } + + private GuildConfigTable m_ConfigTable; + + private Dictionary m_UnlockLevel = new Dictionary(default(XFastEnumIntEqualityComparer)); + + private XSysDefine[] _LockedSys = new XSysDefine[] + { + XSysDefine.XSys_GuildHall_SignIn, + XSysDefine.XSys_GuildHall_Skill, + XSysDefine.XSys_GuildBoon_RedPacket, + XSysDefine.XSys_GuildRelax_Joker, + XSysDefine.XSys_GuildBoon_Shop, + XSysDefine.XSys_GuildDragon, + XSysDefine.XSys_GuildMine, + XSysDefine.XSys_GuildPvp, + XSysDefine.XSys_GuildBoon_DailyActivity, + XSysDefine.XSys_GuildChallenge, + XSysDefine.XSys_GuildRelax_JokerMatch, + XSysDefine.XSys_GuildBoon_Salay, + XSysDefine.XSys_GuildTerritory, + XSysDefine.XSys_CrossGVG + }; + + private uint _MaxLevel; + + private List m_TotalExp = new List(); + + private List m_BaseExp = new List(); + + private List m_SkillCount = new List(); + + public void Init(GuildConfigTable configTable) + { + this.m_BaseExp.Clear(); + this.m_TotalExp.Clear(); + this.m_SkillCount.Clear(); + this.m_ConfigTable = configTable; + uint num = 0u; + this._MaxLevel = (uint)this.m_ConfigTable.Table.Length; + int num2 = 0; + while ((long)num2 < (long)((ulong)this.MaxLevel)) + { + GuildConfigTable.RowData rowData = this.m_ConfigTable.Table[num2]; + for (int i = 0; i < this._LockedSys.Length; i++) + { + bool flag = !this.m_UnlockLevel.ContainsKey(this._LockedSys[i]); + if (flag) + { + int value = XGuildConfig.GetValue(rowData, this._LockedSys[i]); + bool flag2 = value > 0; + if (flag2) + { + this.m_UnlockLevel.Add(this._LockedSys[i], (uint)(num2 + 1)); + } + } + } + this.m_BaseExp.Add(num); + num += rowData.GuildExpNeed; + this.m_TotalExp.Add(num); + this.m_SkillCount.Add(rowData.StudySkillTimes); + num2++; + } + } + + public GuildConfigTable.RowData GetDataByLevel(uint level) + { + bool flag = level > this._MaxLevel || level == 0u; + GuildConfigTable.RowData result; + if (flag) + { + result = null; + } + else + { + result = this.m_ConfigTable.Table[(int)(level - 1u)]; + } + return result; + } + + public static int GetValue(GuildConfigTable.RowData data, XSysDefine sys) + { + if (sys <= XSysDefine.XSys_GuildRelax_Joker) + { + if (sys <= XSysDefine.XSys_GuildHall_SignIn) + { + switch (sys) + { + case XSysDefine.XSys_GuildDragon: + return (int)data.GuildDragon; + case XSysDefine.XSys_GuildPvp: + return data.GuildArena; + case XSysDefine.XSys_GuildRedPacket: + break; + case XSysDefine.XSys_GuildMine: + return data.GuildMine; + case XSysDefine.XSys_CrossGVG: + return data.CrossGVG; + default: + if (sys == XSysDefine.XSys_GuildHall_SignIn) + { + return data.GuildSign; + } + break; + } + } + else + { + if (sys == XSysDefine.XSys_GuildHall_Skill) + { + return data.GuildSkill; + } + if (sys == XSysDefine.XSys_GuildRelax_Joker) + { + return data.PokerTimes; + } + } + } + else if (sys <= XSysDefine.XSys_GuildBoon_Salay) + { + if (sys == XSysDefine.XSys_GuildRelax_JokerMatch) + { + return data.GuildJokerMatch; + } + switch (sys) + { + case XSysDefine.XSys_GuildBoon_RedPacket: + return data.GuildWelfare; + case XSysDefine.XSys_GuildBoon_Shop: + return data.GuildStore; + case XSysDefine.XSys_GuildBoon_DailyActivity: + return data.GuildActivity; + case XSysDefine.XSys_GuildBoon_Salay: + return data.GuildSalay; + } + } + else + { + if (sys == XSysDefine.XSys_GuildChallenge) + { + return data.GuildChallenge; + } + if (sys == XSysDefine.XSys_GuildTerritory) + { + return data.GuildTerritory; + } + } + return 0; + } + + public bool IsSysUnlock(XSysDefine sys, uint level) + { + uint num = 0u; + bool flag = this.m_UnlockLevel.TryGetValue(sys, out num); + bool result; + if (flag) + { + bool flag2 = level >= num; + result = flag2; + } + else + { + result = true; + } + return result; + } + + public uint GetUnlockLevel(XSysDefine sys) + { + uint num = 1u; + bool flag = this.m_UnlockLevel.TryGetValue(sys, out num); + uint result; + if (flag) + { + result = num; + } + else + { + result = 1u; + } + return result; + } + + public uint GetBaseExp(uint level) + { + bool flag = (ulong)level > (ulong)((long)this.m_BaseExp.Count) || level == 0u; + uint result; + if (flag) + { + result = 0u; + } + else + { + result = this.m_BaseExp[(int)(level - 1u)]; + } + return result; + } + + public uint GetTotalStudyCount(int startLevel, int endLevel) + { + uint num = 0u; + endLevel = Math.Min(endLevel, this.m_SkillCount.Count); + startLevel = 1; + bool flag = startLevel - 1 < endLevel; + if (flag) + { + for (int i = startLevel - 1; i < endLevel; i++) + { + num += this.m_SkillCount[i]; + } + } + return num; + } + + public uint GetTotalExp(uint level) + { + bool flag = (ulong)level > (ulong)((long)this.m_BaseExp.Count) || level == 0u; + uint result; + if (flag) + { + result = 0u; + } + else + { + result = this.m_TotalExp[(int)(level - 1u)]; + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildConfig.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildConfig.cs.meta new file mode 100644 index 00000000..b506cf9e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildConfig.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 87834b0c9daba0b4183e2c2c502c3560 +timeCreated: 1611404079 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshBehavior.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshBehavior.cs new file mode 100644 index 00000000..f22ff7a3 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshBehavior.cs @@ -0,0 +1,31 @@ +using System; +using UILib; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildDailyHandleRefreshBehavior : DlgBehaviourBase + { + public IXUIScrollView ScrollView; + + public IXUIWrapContent WrapContent; + + public IXUILabel HelpTimesLabel; + + public IXUIButton CloseBtn; + + public IXUILabel FreeTimeLabel; + + public IXUILabel TaskLucky; + + private void Awake() + { + this.ScrollView = (base.transform.Find("Bg/List").GetComponent("XUIScrollView") as IXUIScrollView); + this.WrapContent = (base.transform.Find("Bg/List/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.HelpTimesLabel = (base.transform.Find("Bg/TimesDec/Times").GetComponent("XUILabel") as IXUILabel); + this.CloseBtn = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.FreeTimeLabel = (base.transform.Find("Bg/T").GetComponent("XUILabel") as IXUILabel); + this.TaskLucky = (base.transform.Find("Bg/TaskLevel/Lucky").GetComponent("XUILabel") as IXUILabel); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshBehavior.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshBehavior.cs.meta new file mode 100644 index 00000000..0ef1cf83 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshBehavior.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 657e2d0f290f5cd4ab6c827d8df6f57b +timeCreated: 1611403850 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshDlg.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshDlg.cs new file mode 100644 index 00000000..43e8d813 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshDlg.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDailyHandleRefreshDlg : DlgBase + { + public override string fileName + { + get + { + return "Guild/DailyTaskInvitation"; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + protected override void OnLoad() + { + base.OnLoad(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + protected override void Init() + { + base.Init(); + this.InitProperties(); + } + + protected override void OnShow() + { + base.OnShow(); + XGuildDailyTaskDocument.Doc.SendToGetAskRefreshTaskInfo(); + } + + public override void StackRefresh() + { + base.StackRefresh(); + } + + private void InitProperties() + { + base.uiBehaviour.WrapContent.RegisterItemInitEventHandler(new WrapItemInitEventHandler(this.InitWrapContent)); + base.uiBehaviour.WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.UpdateWrapContent)); + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickToClose)); + base.uiBehaviour.FreeTimeLabel.SetText(string.Format(XStringDefineProxy.GetString("DailyFreeHelpOthersTime"), XSingleton.singleton.GetInt("DailyTaskMaxHelpCount"))); + } + + private bool OnClickToClose(IXUIButton button) + { + this.SetVisible(false, true); + return true; + } + + private void InitWrapContent(Transform itemTransform, int index) + { + IXUIButton ixuibutton = itemTransform.Find("OK").GetComponent("XUIButton") as IXUIButton; + ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickToHelp)); + IXUIButton ixuibutton2 = itemTransform.Find("Cancel").GetComponent("XUIButton") as IXUIButton; + ixuibutton2.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickToRefuse)); + } + + private void UpdateWrapContent(Transform itemTransform, int index) + { + DailyTaskRefreshRoleInfo taskAskInfoByIndex = XGuildDailyTaskDocument.Doc.GetTaskAskInfoByIndex(index); + bool flag = taskAskInfoByIndex != null; + if (flag) + { + IXUIButton ixuibutton = itemTransform.Find("OK").GetComponent("XUIButton") as IXUIButton; + ixuibutton.ID = taskAskInfoByIndex.roleid; + IXUIButton ixuibutton2 = itemTransform.Find("Cancel").GetComponent("XUIButton") as IXUIButton; + ixuibutton2.ID = taskAskInfoByIndex.roleid; + IXUILabel ixuilabel = itemTransform.Find("Times").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(string.Format(XStringDefineProxy.GetString("MyselfLeftRefreshTimes"), taskAskInfoByIndex.refresh_num)); + IXUILabel ixuilabel2 = itemTransform.Find("Name").GetComponent("XUILabel") as IXUILabel; + ixuilabel2.SetText(taskAskInfoByIndex.name); + IXUISprite ixuisprite = itemTransform.Find("Quality").GetComponent("XUISprite") as IXUISprite; + ixuisprite.SetSprite(ixuisprite.spriteName.Substring(0, ixuisprite.spriteName.Length - 1) + taskAskInfoByIndex.score); + IXUISprite ixuisprite2 = itemTransform.Find("head").GetComponent("XUISprite") as IXUISprite; + ixuisprite2.SetSprite(XSingleton.singleton.GetProfHeadIcon2((int)taskAskInfoByIndex.profession)); + } + } + + private bool OnClickToRefuse(IXUIButton button) + { + ulong id = button.ID; + XGuildDailyTaskDocument.Doc.SendToRefreshTaskOp(DailyRefreshOperType.DROT_Refuse, id); + return true; + } + + private bool OnClickToHelp(IXUIButton button) + { + bool flag = XGuildDailyTaskDocument.Doc.HelpNum <= 0u; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("DailyHelpTimesNotEnough"), "fece00"); + } + else + { + ulong id = button.ID; + XGuildDailyTaskDocument.Doc.SendToRefreshTaskOp(DailyRefreshOperType.DROT_Refresh, id); + } + return true; + } + + public void RefreshContent() + { + List stringList = XSingleton.singleton.GetStringList("LuckyLevel"); + int index = Mathf.Min((int)(XGuildDailyTaskDocument.Doc.MyLuck - 1u), stringList.Count - 1); + base.uiBehaviour.TaskLucky.SetText(stringList[index]); + List stringList2 = XSingleton.singleton.GetStringList("LuckyLevelColor"); + Color color = XSingleton.singleton.ConvertRGBStringToColor(stringList2[index]); + base.uiBehaviour.TaskLucky.SetColor(color); + int @int = XSingleton.singleton.GetInt("DailyTaskMaxHelpCount"); + base.uiBehaviour.HelpTimesLabel.SetText(XGuildDailyTaskDocument.Doc.HelpNum + "/" + @int); + List askInfoList = XGuildDailyTaskDocument.Doc.AskInfoList; + base.uiBehaviour.WrapContent.SetContentCount(askInfoList.Count, false); + base.uiBehaviour.ScrollView.ResetPosition(); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshDlg.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshDlg.cs.meta new file mode 100644 index 00000000..fadba084 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyHandleRefreshDlg.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c7856a183c9f06543a0a72149c72884c +timeCreated: 1611404531 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskBehavior.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskBehavior.cs new file mode 100644 index 00000000..486e3743 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskBehavior.cs @@ -0,0 +1,34 @@ +using System; +using UILib; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildDailyRefreshTaskBehavior : DlgBehaviourBase + { + public IXUIScrollView ScrollView; + + public IXUIWrapContent WrapContent; + + public IXUISprite AddSprite; + + public IXUISprite TaskLevelSprite; + + public IXUILabel RefreshTimesLabel; + + public IXUIButton CloseBtn; + + public IXUISprite HelpOtherRefresh; + + private void Awake() + { + this.ScrollView = (base.transform.Find("Bg/Panel").GetComponent("XUIScrollView") as IXUIScrollView); + this.WrapContent = (base.transform.Find("Bg/Panel/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.AddSprite = (base.transform.Find("Bg/RefreshTimes/BtnAdd").GetComponent("XUISprite") as IXUISprite); + this.RefreshTimesLabel = (base.transform.Find("Bg/RefreshTimes").GetComponent("XUILabel") as IXUILabel); + this.TaskLevelSprite = (base.transform.Find("Bg/TaskLevel").GetComponent("XUISprite") as IXUISprite); + this.CloseBtn = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.HelpOtherRefresh = (base.transform.Find("Bg/BtnHelpGuild").GetComponent("XUISprite") as IXUISprite); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskBehavior.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskBehavior.cs.meta new file mode 100644 index 00000000..0ea83318 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskBehavior.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ca84fb1880cb4514a8edd638dcb6714d +timeCreated: 1611404542 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskDlg.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskDlg.cs new file mode 100644 index 00000000..5b4b3346 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskDlg.cs @@ -0,0 +1,223 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDailyRefreshTaskDlg : DlgBase + { + public override string fileName + { + get + { + return "Guild/DailyTaskInviteDlg"; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + protected override void OnLoad() + { + base.OnLoad(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + protected override void Init() + { + base.Init(); + this.InitProperties(); + } + + protected override void OnShow() + { + base.OnShow(); + XGuildDailyTaskDocument.Doc.SendToRefreshTasks(); + } + + public override void StackRefresh() + { + base.StackRefresh(); + } + + public void RefreshContent() + { + base.uiBehaviour.RefreshTimesLabel.SetText(XGuildDailyTaskDocument.Doc.Refresh_num.ToString()); + List dailyTaskRefreshRoleInfoList = XGuildDailyTaskDocument.Doc.DailyTaskRefreshRoleInfoList; + base.uiBehaviour.WrapContent.SetContentCount(dailyTaskRefreshRoleInfoList.Count, false); + base.uiBehaviour.ScrollView.ResetPosition(); + base.uiBehaviour.TaskLevelSprite.SetSprite(base.uiBehaviour.TaskLevelSprite.spriteName.Substring(0, base.uiBehaviour.TaskLevelSprite.spriteName.Length - 1) + XGuildDailyTaskDocument.Doc.CurScore); + } + + private void InitProperties() + { + base.uiBehaviour.WrapContent.RegisterItemInitEventHandler(new WrapItemInitEventHandler(this.InitWrapContent)); + base.uiBehaviour.WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.UpdateWrapContent)); + base.uiBehaviour.AddSprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAddRefreshTimes)); + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClose)); + base.uiBehaviour.HelpOtherRefresh.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnHelpOthers)); + } + + private void OnHelpOthers(IXUISprite button) + { + this.SetVisible(false, true); + bool inGuild = XGuildDocument.InGuild; + if (inGuild) + { + DlgBase.singleton.SetVisible(true, true); + } + else + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + + private bool OnClose(IXUIButton button) + { + this.SetVisible(false, true); + XGuildDailyTaskDocument.Doc.SendGetDailyTaskInfo(); + return true; + } + + private void OnAddRefreshTimes(IXUISprite uiSprite) + { + List intList = XSingleton.singleton.GetIntList("BuyRefreshCost"); + int @int = XSingleton.singleton.GetInt("MaxBuyRefreshCount"); + uint todayBuyNumber = XGuildDailyTaskDocument.Doc.TodayBuyNumber; + bool flag = (ulong)todayBuyNumber < (ulong)((long)@int); + if (flag) + { + int num = intList[Mathf.Min(intList.Count - 1, (int)todayBuyNumber)]; + ulong virtualItemCount = XBagDocument.BagDoc.GetVirtualItemCount(ItemEnum.DRAGON_COIN); + bool flag2 = (ulong)num <= virtualItemCount; + if (flag2) + { + string format = XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("BuyRefreshTaskCountStr")); + XSingleton.singleton.ShowModalDialog(string.Format(format, num, (long)@int - (long)((ulong)todayBuyNumber)), new ButtonClickEventHandler(this.ConfirmToBuy)); + } + else + { + DlgBase.singleton.ShowBorad(7); + } + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("ReachedToMaxBuyNumbers"), "fece00"); + } + } + + private bool ConfirmToBuy(IXUIButton button) + { + XSingleton.singleton.CloseModalDlg(); + XGuildDailyTaskDocument.Doc.SendToRefreshTaskOp(DailyRefreshOperType.DROT_BuyCount, 0UL); + return true; + } + + private void UpdateWrapContent(Transform itemTransform, int index) + { + DailyTaskRefreshRoleInfo refreshTaskItemInfo = XGuildDailyTaskDocument.Doc.GetRefreshTaskItemInfo(index); + bool flag = refreshTaskItemInfo != null; + if (flag) + { + Transform transform = itemTransform.Find("Bg"); + transform.gameObject.SetActive(refreshTaskItemInfo.roleid != XSingleton.singleton.XPlayerData.RoleID); + Transform transform2 = itemTransform.Find("MySelfBg"); + transform2.gameObject.SetActive(refreshTaskItemInfo.roleid == XSingleton.singleton.XPlayerData.RoleID); + IXUIButton ixuibutton = itemTransform.Find("BtnInvite").GetComponent("XUIButton") as IXUIButton; + ixuibutton.ID = refreshTaskItemInfo.roleid; + ixuibutton.SetEnable(!refreshTaskItemInfo.already_ask, false); + string text = (refreshTaskItemInfo.roleid == XSingleton.singleton.XPlayerData.RoleID) ? XStringDefineProxy.GetString("GuildDailyRefreshTask") : XStringDefineProxy.GetString("GuildDailyAskRefresh"); + bool flag2 = refreshTaskItemInfo.already_ask && refreshTaskItemInfo.roleid != XSingleton.singleton.XPlayerData.RoleID; + if (flag2) + { + text = XStringDefineProxy.GetString("AlreadyAsked"); + } + IXUILabel ixuilabel = itemTransform.Find("BtnInvite/Label").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(text); + string text2 = (refreshTaskItemInfo.roleid == XSingleton.singleton.XPlayerData.RoleID) ? (refreshTaskItemInfo.name + XStringDefineProxy.GetString("GuildScoreLogMe")) : refreshTaskItemInfo.name; + IXUILabel ixuilabel2 = itemTransform.Find("Info/Name").GetComponent("XUILabel") as IXUILabel; + ixuilabel2.SetText(text2); + IXUILabel ixuilabel3 = itemTransform.Find("Info/Times").GetComponent("XUILabel") as IXUILabel; + string format = (refreshTaskItemInfo.roleid == XSingleton.singleton.XPlayerData.RoleID) ? XStringDefineProxy.GetString("MyselfLeftRefreshTimes") : XStringDefineProxy.GetString("GuildLeftRefreshTimes"); + ixuilabel3.SetText(string.Format(format, refreshTaskItemInfo.refresh_num)); + IXUILabel ixuilabel4 = itemTransform.Find("Luck").GetComponent("XUILabel") as IXUILabel; + List stringList = XSingleton.singleton.GetStringList("LuckyLevel"); + int index2 = Mathf.Min((int)(refreshTaskItemInfo.luck - 1u), stringList.Count - 1); + ixuilabel4.SetText(stringList[index2]); + List stringList2 = XSingleton.singleton.GetStringList("LuckyLevelColor"); + Color color = XSingleton.singleton.ConvertRGBStringToColor(stringList2[index2]); + ixuilabel4.SetColor(color); + IXUISprite ixuisprite = itemTransform.Find("Info/AvatarBG/Avatar").GetComponent("XUISprite") as IXUISprite; + ixuisprite.SetSprite(XSingleton.singleton.GetProfHeadIcon2((int)refreshTaskItemInfo.profession)); + Transform transform3 = itemTransform.Find("Info/AvatarBG/Relation/Guild"); + transform3.gameObject.SetActive(refreshTaskItemInfo.roleid != XSingleton.singleton.XPlayerData.RoleID); + Transform transform4 = itemTransform.Find("Info/AvatarBG/Online"); + transform4.gameObject.SetActive(refreshTaskItemInfo.is_online); + } + } + + private void InitWrapContent(Transform itemTransform, int index) + { + IXUIButton ixuibutton = itemTransform.Find("BtnInvite").GetComponent("XUIButton") as IXUIButton; + ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickToRefreshTask)); + } + + private bool OnClickToRefreshTask(IXUIButton button) + { + ulong id = button.ID; + bool flag = XGuildDailyTaskDocument.Doc.Refresh_num > 0u; + if (flag) + { + bool flag2 = id == XSingleton.singleton.XPlayerData.RoleID; + if (flag2) + { + bool flag3 = XGuildDailyTaskDocument.Doc.CurScore == 4u; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("DailyTaskGetToBestQuality"), "fece00"); + } + else + { + XGuildDailyTaskDocument.Doc.SendToRefreshTaskOp(DailyRefreshOperType.DROT_Refresh, id); + } + } + else + { + bool flag4 = XGuildDailyTaskDocument.Doc.CurScore == 4u; + if (flag4) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("DailyTaskGetToBestQuality"), "fece00"); + } + else + { + XGuildDailyTaskDocument.Doc.SendToRefreshTaskOp(DailyRefreshOperType.DROT_AskHelp, id); + } + } + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("NoRefreshTaskTimes"), "fece00"); + } + return true; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskDlg.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskDlg.cs.meta new file mode 100644 index 00000000..8f6500a9 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyRefreshTaskDlg.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c2ae8673cb36c0544baf059384134824 +timeCreated: 1611404494 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskBehavior.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskBehavior.cs new file mode 100644 index 00000000..f2f4a4e7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskBehavior.cs @@ -0,0 +1,71 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDailyTaskBehavior : DlgBehaviourBase + { + public IXUIButton CompleteTaskBtn = null; + + public Transform CurrentRewardsGrid = null; + + public Transform AdditionalRewardsGrid = null; + + public IXUIButton SubmmitBtn = null; + + public IXUIButton CloseBtn = null; + + public XUIPool RewardPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public IXUILabel timeLabel; + + public IXUILabel taskTimeLabel; + + public IXUILabel taskNumLabel; + + public IXUIWrapContent TaskContent; + + public IXUIButton RefreshTaskBtn; + + public Transform RefreshRecordRoot; + + public IXUISprite TaskLevelSprite; + + public IXUIButton RefreshLogBtn; + + public IXUIWrapContent RefreshLogWrapContent; + + public IXUIScrollView RefreshLogScrollView; + + public IXUIButton RefreshCloseBtn; + + public IXUILabel TalkLabel; + + public IXUIButton TipButton; + + private void Awake() + { + this.SubmmitBtn = (base.transform.Find("Submmit").GetComponent("XUIButton") as IXUIButton); + this.CloseBtn = (base.transform.Find("Close").GetComponent("XUIButton") as IXUIButton); + this.CurrentRewardsGrid = base.transform.Find("Rewards/BaseRewards"); + this.AdditionalRewardsGrid = base.transform.Find("Rewards/AllRewards"); + this.RewardPool.SetupPool(null, base.transform.Find("Rewards/Tpl").gameObject, 2u, false); + this.timeLabel = (base.transform.Find("TimesDec2/Times").GetComponent("XUILabel") as IXUILabel); + this.taskTimeLabel = (base.transform.Find("TimesDec/Times").GetComponent("XUILabel") as IXUILabel); + this.taskNumLabel = (base.transform.Find("BaseInfo/Num").GetComponent("XUILabel") as IXUILabel); + this.TalkLabel = (base.transform.Find("Talk").GetComponent("XUILabel") as IXUILabel); + this.TaskContent = (base.transform.Find("ScrollView/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.RefreshTaskBtn = (base.transform.Find("Refresh").GetComponent("XUIButton") as IXUIButton); + this.RefreshRecordRoot = base.transform.Find("LogPanel"); + this.TaskLevelSprite = (base.transform.Find("TaskLevel").GetComponent("XUISprite") as IXUISprite); + this.RefreshLogBtn = (base.transform.Find("RefreshLogBtn").GetComponent("XUIButton") as IXUIButton); + this.RefreshLogWrapContent = (this.RefreshRecordRoot.Find("LogMenu/Panel/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.RefreshLogScrollView = (this.RefreshRecordRoot.Find("LogMenu/Panel").GetComponent("XUIScrollView") as IXUIScrollView); + this.RefreshCloseBtn = (this.RefreshRecordRoot.Find("Close").GetComponent("XUIButton") as IXUIButton); + this.TipButton = (base.transform.Find("Help").GetComponent("XUIButton") as IXUIButton); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskBehavior.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskBehavior.cs.meta new file mode 100644 index 00000000..c3687571 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskBehavior.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 46d95b11efa8cdc4b93d95b71bfc64eb +timeCreated: 1611403651 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskDocument.cs new file mode 100644 index 00000000..ded1df9d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskDocument.cs @@ -0,0 +1,1200 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDailyTaskDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildDailyTaskDocument.uuID; + } + } + + public static XGuildDailyTaskDocument Doc + { + get + { + return XSingleton.singleton.Doc.GetXComponent(XGuildDailyTaskDocument.uuID) as XGuildDailyTaskDocument; + } + } + + public uint TaskRoleLevel + { + get + { + return this._taskRoleLevel; + } + set + { + this._taskRoleLevel = value; + this.ResetRewardsMap(); + } + } + + public uint AskedNum + { + get + { + return this._askedNum; + } + set + { + this._askedNum = value; + } + } + + public uint Count + { + get + { + return this._count; + } + set + { + this._count = value; + } + } + + public bool IsRewarded + { + get + { + return this._isRewarded; + } + set + { + this._isRewarded = value; + } + } + + public List DailyTaskRefreshRoleInfoList + { + get + { + return this._dailyTaskRefreshRoleInfoList; + } + } + + public List AskInfoList + { + get + { + return this._askInfoList; + } + } + + public List DailyTaskRefreshRecordList + { + get + { + return this._dailyTaskRefreshRecordList; + } + } + + public uint Refresh_num + { + get + { + return this._refresh_num; + } + } + + public uint CurScore + { + get + { + return this._curScore; + } + } + + public uint TodayBuyNumber + { + get + { + return this._todayBuyNum; + } + } + + public uint HelpNum + { + get + { + return this._helpNum; + } + } + + public uint MyLuck + { + get + { + return this._myLuck; + } + } + + public bool DailyTaskHelpRefreshIcon { get; set; } + + public bool DailyTaskBeenRefreshIcon { get; set; } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildDailyTaskDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private static DailyTask _dailyTaskInfoTable = new DailyTask(); + + public static DailyTaskReward DailyTaskRewardTable = new DailyTaskReward(); + + private Dictionary _guildTaskRewardWithMap = new Dictionary(); + + private List _curGuildDailyTaskList = new List(); + + private uint _taskRoleLevel = 1u; + + private uint _askedNum = 0u; + + private uint _count = 0u; + + private bool _isRewarded = false; + + private List _dailyTaskRefreshRoleInfoList = new List(); + + private uint _myLuck = 1u; + + private uint _refresh_num; + + private uint _todayBuyNum; + + private List _askInfoList = new List(); + + private uint _helpNum; + + private List _dailyTaskRefreshRecordList = new List(); + + private uint _curScore; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildDailyTaskDocument.AsyncLoader.AddTask("Table/DailyTask", XGuildDailyTaskDocument._dailyTaskInfoTable, false); + XGuildDailyTaskDocument.AsyncLoader.AddTask("Table/DailyTaskReward", XGuildDailyTaskDocument.DailyTaskRewardTable, false); + XGuildDailyTaskDocument.AsyncLoader.Execute(callback); + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + this.DailyTaskHelpRefreshIcon = false; + this.DailyTaskBeenRefreshIcon = false; + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_TaskStateChange, new XComponent.XEventHandler(this.OnTaskStateChanged)); + } + + public override void OnDetachFromHost() + { + base.OnDetachFromHost(); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + this.InitFromServerData(arg.PlayerInfo.task_record); + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + } + + public void SendGetDailyTaskInfo() + { + RpcC2G_GetDailyTaskInfo rpc = new RpcC2G_GetDailyTaskInfo(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetDailyTasks(GetDailyTaskInfoRes res) + { + this.UpdateTaskContent(res.task); + this.TaskRoleLevel = res.accept_level; + this.AskedNum = res.askhelp_num; + this.Count = res.count; + this.IsRewarded = res.is_rewarded; + this._curScore = res.score; + this._refresh_num = res.remain_refresh_count; + this._myLuck = Math.Max(1u, res.luck); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshTaskContent(); + } + } + + public void GiveUpTask() + { + RpcC2G_DailyTaskGiveUp rpc = new RpcC2G_DailyTaskGiveUp(); + XSingleton.singleton.Send(rpc); + } + + public void OnGiveUpTask(DailyTaskGiveUpRes oRes) + { + bool flag = oRes.result == ErrorCode.ERR_SUCCESS; + if (flag) + { + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetVisibleWithAnimation(false, null); + } + } + else + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + } + + private bool OnTaskStateChanged(XEventArgs e) + { + XTaskStatusChangeArgs xtaskStatusChangeArgs = e as XTaskStatusChangeArgs; + bool flag = xtaskStatusChangeArgs.status == TaskStatus.TaskStatus_Taked; + if (flag) + { + uint id = xtaskStatusChangeArgs.id; + TaskTableNew.RowData taskData = XTaskDocument.GetTaskData(id); + bool flag2 = taskData != null; + if (flag2) + { + bool flag3 = taskData.TaskType == 4u; + if (flag3) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + bool flag4 = taskData.TaskType == 7u; + if (flag4) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + } + return true; + } + + private void UpdateTaskContent(List task) + { + this._curGuildDailyTaskList.Clear(); + for (int i = 0; i < task.Count; i++) + { + DailyTaskInfo dailyTaskInfo = task[i]; + this._curGuildDailyTaskList.Add(new GuildDailyTaskInfo + { + taskID = dailyTaskInfo.id, + step = dailyTaskInfo.step, + isRewarded = dailyTaskInfo.is_rewarded, + hasAsked = dailyTaskInfo.ask_help + }); + } + this._curGuildDailyTaskList.Sort(new Comparison(this.SortDailyTask)); + } + + public DailyTaskReward.RowData GetSingleTaskRewardInfoByID(GuildTaskType type, uint taskID) + { + DailyTask.RowData dailyTaskTableInfoByID = this.GetDailyTaskTableInfoByID(taskID); + bool flag = dailyTaskTableInfoByID != null; + if (flag) + { + uint mappingValueWithQualityAndType = XGuildDailyTaskDocument.GetMappingValueWithQualityAndType(type, 1u, dailyTaskTableInfoByID.taskquality); + DailyTaskReward.RowData result; + bool flag2 = this._guildTaskRewardWithMap.TryGetValue(mappingValueWithQualityAndType, out result); + if (flag2) + { + return result; + } + } + return null; + } + + public DailyTaskReward.RowData GetTotalTaskRewardInfo(GuildTaskType type, uint count) + { + uint mappingValueWithQualityAndType = XGuildDailyTaskDocument.GetMappingValueWithQualityAndType(type, 2u, count); + DailyTaskReward.RowData rowData; + bool flag = this._guildTaskRewardWithMap.TryGetValue(mappingValueWithQualityAndType, out rowData); + DailyTaskReward.RowData result; + if (flag) + { + result = rowData; + } + else + { + result = null; + } + return result; + } + + public bool GoToTakeTask() + { + XTaskDocument specificDocument = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + XTaskRecord taskRecord = specificDocument.TaskRecord; + for (int i = 0; i < taskRecord.Tasks.Count; i++) + { + bool flag = taskRecord.Tasks[i].Status == TaskStatus.TaskStatus_CanTake && taskRecord.Tasks[i].TableData.TaskType == 4u; + if (flag) + { + return true; + } + } + return false; + } + + public int GetRewardedTaskCount() + { + int num = 0; + for (int i = 0; i < this._curGuildDailyTaskList.Count; i++) + { + bool isRewarded = this._curGuildDailyTaskList[i].isRewarded; + if (isRewarded) + { + num++; + } + } + return num; + } + + internal GuildDailyTaskInfo GetTaskInfoByIndex(int index) + { + bool flag = index < this._curGuildDailyTaskList.Count; + GuildDailyTaskInfo result; + if (flag) + { + result = this._curGuildDailyTaskList[index]; + } + else + { + result = null; + } + return result; + } + + public int GetTaskItemCount() + { + return this._curGuildDailyTaskList.Count; + } + + public void SendToGetMyTaskReward(uint type, uint id) + { + RpcC2G_GetDailyTaskReward rpcC2G_GetDailyTaskReward = new RpcC2G_GetDailyTaskReward(); + rpcC2G_GetDailyTaskReward.oArg.type = type; + rpcC2G_GetDailyTaskReward.oArg.id = id; + XSingleton.singleton.Send(rpcC2G_GetDailyTaskReward); + } + + public void OnGetDailyTaskReward(GetDailyTaskRewardArg oArg, GetDailyTaskRewardRes oRes) + { + bool flag = oRes.code == ErrorCode.ERR_SUCCESS; + if (flag) + { + XLevelSealDocument specificDocument = XDocuments.GetSpecificDocument(XLevelSealDocument.uuID); + int rewardedTaskCount = XGuildDailyTaskDocument.Doc.GetRewardedTaskCount(); + bool flag2 = rewardedTaskCount >= XSingleton.singleton.GetInt("DailyTaskMinTotalTaskCount") && oArg.type == 2u; + if (flag2) + { + DailyTaskReward.RowData totalTaskRewardInfo = this.GetTotalTaskRewardInfo(GuildTaskType.DailyTask, (uint)rewardedTaskCount); + bool flag3 = totalTaskRewardInfo == null; + if (flag3) + { + return; + } + List list = new List(); + SeqListRef? rewadsByScore = this.GetRewadsByScore(totalTaskRewardInfo, this._curScore); + bool flag4 = rewadsByScore != null; + if (flag4) + { + for (int i = 0; i < (int)rewadsByScore.Value.count; i++) + { + ItemBrief itemBrief = new ItemBrief(); + itemBrief.itemID = rewadsByScore.Value[i, 0]; + int num = (int)rewadsByScore.Value[i, 1]; + bool flag5 = itemBrief.itemID == 4u && specificDocument.IsInLevelSeal(); + if (flag5) + { + num = (int)((double)num * 0.5); + } + itemBrief.itemCount = (uint)num; + list.Add(itemBrief); + } + } + bool flag6 = rewardedTaskCount >= this.GetTaskItemCount(); + if (flag6) + { + List additionalRewards = this.GetAdditionalRewards(); + foreach (GuildTaskReward guildTaskReward in additionalRewards) + { + ItemBrief itemBrief2 = new ItemBrief(); + itemBrief2.itemID = guildTaskReward.itemID; + uint num2 = guildTaskReward.count; + bool flag7 = guildTaskReward.itemID == 4u && specificDocument.IsInLevelSeal(); + if (flag7) + { + num2 = (uint)(num2 * 0.5); + } + itemBrief2.itemCount = num2; + list.Add(itemBrief2); + } + } + DlgBase.singleton.ShowByTitle(list, XSingleton.singleton.GetString("DailyTaskRewards"), null); + } + this.UpdateTaskContent(oRes.task); + bool flag8 = oArg.type == 1u; + if (flag8) + { + bool flag9 = DlgBase.singleton.IsVisible(); + if (flag9) + { + DlgBase.singleton.RefreshTaskItemByID(oArg.id); + } + } + else + { + bool flag10 = oArg.type == 2u; + if (flag10) + { + bool flag11 = DlgBase.singleton.IsVisible(); + if (flag11) + { + DlgBase.singleton.SetVisibleWithAnimation(false, null); + } + } + } + } + else + { + XSingleton.singleton.ShowSystemTip(oRes.code, "fece00"); + } + } + + public GuildDailyTaskInfo GetTaskInfoByID(uint id) + { + for (int i = 0; i < this._curGuildDailyTaskList.Count; i++) + { + bool flag = this._curGuildDailyTaskList[i].taskID == id; + if (flag) + { + return this._curGuildDailyTaskList[i]; + } + } + return null; + } + + public DailyTask.RowData GetDailyTaskTableInfoByID(uint taskID) + { + for (int i = 0; i < XGuildDailyTaskDocument._dailyTaskInfoTable.Table.Length; i++) + { + DailyTask.RowData rowData = XGuildDailyTaskDocument._dailyTaskInfoTable.Table[i]; + bool flag = rowData.taskID == taskID; + if (flag) + { + return rowData; + } + } + return null; + } + + public List GetAdditionalRewards() + { + for (int i = 0; i < XGuildDailyTaskDocument.DailyTaskRewardTable.Table.Length; i++) + { + DailyTaskReward.RowData rowData = XGuildDailyTaskDocument.DailyTaskRewardTable.Table[i]; + uint num = rowData.level[0]; + uint num2 = rowData.level[1]; + SeqListRef? extraRewadsByScore = this.GetExtraRewadsByScore(rowData, this._curScore); + bool flag = this._taskRoleLevel >= num && this._taskRoleLevel <= num2 && extraRewadsByScore != null && extraRewadsByScore.Value.count > 0; + if (flag) + { + List list = new List(); + for (int j = 0; j < extraRewadsByScore.Value.Count; j++) + { + list.Add(new GuildTaskReward + { + itemID = extraRewadsByScore.Value[j, 0], + count = extraRewadsByScore.Value[j, 1] + }); + } + return list; + } + } + return null; + } + + public static uint GetMappingValueWithQualityAndType(GuildTaskType category, uint type, uint quality) + { + return (uint)(10000 * (int)category + (int)(1000u * type) + (int)quality); + } + + public SeqListRef? GetRewadsByScore(DailyTaskReward.RowData data, uint score) + { + SeqListRef? result; + switch (score) + { + case 0u: + result = new SeqListRef?(data.reward_d); + break; + case 1u: + result = new SeqListRef?(data.reward_c); + break; + case 2u: + result = new SeqListRef?(data.reward_b); + break; + case 3u: + result = new SeqListRef?(data.reward_a); + break; + case 4u: + result = new SeqListRef?(data.reward_s); + break; + default: + result = null; + break; + } + return result; + } + + public SeqListRef? GetExtraRewadsByScore(DailyTaskReward.RowData data, uint score) + { + SeqListRef? result; + switch (score) + { + case 0u: + result = new SeqListRef?(data.extrareward_d); + break; + case 1u: + result = new SeqListRef?(data.extrareward_c); + break; + case 2u: + result = new SeqListRef?(data.extrareward_b); + break; + case 3u: + result = new SeqListRef?(data.extrareward_a); + break; + case 4u: + result = new SeqListRef?(data.extrareward_s); + break; + default: + result = null; + break; + } + return result; + } + + private int SortDailyTask(GuildDailyTaskInfo x, GuildDailyTaskInfo y) + { + bool flag = x.isRewarded ^ y.isRewarded; + int result; + if (flag) + { + result = (x.isRewarded ? 1 : -1); + } + else + { + DailyTask.RowData dailyTaskTableInfoByID = this.GetDailyTaskTableInfoByID(x.taskID); + DailyTask.RowData dailyTaskTableInfoByID2 = this.GetDailyTaskTableInfoByID(y.taskID); + bool flag2 = dailyTaskTableInfoByID == null || dailyTaskTableInfoByID2 == null; + if (flag2) + { + result = 0; + } + else + { + bool flag3 = dailyTaskTableInfoByID.taskquality != dailyTaskTableInfoByID2.taskquality; + if (flag3) + { + result = (int)(dailyTaskTableInfoByID2.taskquality - dailyTaskTableInfoByID.taskquality); + } + else + { + result = (int)(dailyTaskTableInfoByID.taskID - dailyTaskTableInfoByID2.taskID); + } + } + } + return result; + } + + private void ResetRewardsMap() + { + this._guildTaskRewardWithMap.Clear(); + for (int i = 0; i < XGuildDailyTaskDocument.DailyTaskRewardTable.Table.Length; i++) + { + DailyTaskReward.RowData rowData = XGuildDailyTaskDocument.DailyTaskRewardTable.Table[i]; + uint num = rowData.level[0]; + uint num2 = rowData.level[1]; + bool flag = this._taskRoleLevel >= num && this._taskRoleLevel <= num2; + if (flag) + { + uint mappingValueWithQualityAndType = XGuildDailyTaskDocument.GetMappingValueWithQualityAndType((GuildTaskType)rowData.category, rowData.tasktype, rowData.taskquality); + bool flag2 = !this._guildTaskRewardWithMap.ContainsKey(mappingValueWithQualityAndType); + if (flag2) + { + this._guildTaskRewardWithMap.Add(mappingValueWithQualityAndType, rowData); + } + else + { + XSingleton.singleton.AddGreenLog(string.Concat(new object[] + { + "Same taskType and quality", + this._taskRoleLevel, + " type", + rowData.tasktype, + " quality", + rowData.taskquality, + " index", + i + }), null, null, null, null, null); + } + } + } + } + + public void SendDailyTaskAskHelp(PeriodTaskType type, uint taskID) + { + RpcC2G_DailyTaskAskHelp rpcC2G_DailyTaskAskHelp = new RpcC2G_DailyTaskAskHelp(); + rpcC2G_DailyTaskAskHelp.oArg.task_id = taskID; + rpcC2G_DailyTaskAskHelp.oArg.task_type = type; + XSingleton.singleton.Send(rpcC2G_DailyTaskAskHelp); + } + + public void OnGetDailyHelpReply(DailyTaskAskHelpArg oArg, DailyTaskAskHelpRes oRes) + { + bool flag = oRes.code == ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("ReqHelpSuccess"), "fece00"); + DailyTask.RowData dailyTaskTableInfoByID = this.GetDailyTaskTableInfoByID(oArg.task_id); + this.SendGuildDonateReq(dailyTaskTableInfoByID.conditionNum, dailyTaskTableInfoByID.conditionId[0], oRes.ask_uid, NoticeType.NT_GUILD_Daily_DONATE_REQ); + GuildDailyTaskInfo taskInfoByID = this.GetTaskInfoByID(oArg.task_id); + bool flag2 = taskInfoByID != null; + if (flag2) + { + taskInfoByID.hasAsked = true; + uint askedNum = this.AskedNum; + this.AskedNum = askedNum + 1u; + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshTaskItemByID(oArg.task_id); + } + } + } + } + + public void SendToRefreshTasks() + { + RpcC2M_GetDailyTaskRefreshInfo rpc = new RpcC2M_GetDailyTaskRefreshInfo(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetTaskRefreshInfo(GetDailyTaskRefreshInfoRes oRes) + { + this._dailyTaskRefreshRoleInfoList = oRes.friendinfo; + this._myLuck = Math.Max(1u, oRes.luck); + this._refresh_num = oRes.refresh_num; + this._todayBuyNum = oRes.today_buy_num; + this._dailyTaskRefreshRoleInfoList.Sort(new Comparison(this.SortTaskRefreshInfo)); + this._dailyTaskRefreshRoleInfoList.Insert(0, new DailyTaskRefreshRoleInfo + { + luck = this._myLuck, + refresh_num = this._refresh_num, + roleid = XSingleton.singleton.XPlayerData.RoleID, + profession = XSingleton.singleton.XPlayerData.Profession, + already_ask = (this._refresh_num <= 0u), + name = XSingleton.singleton.XPlayerData.Name + }); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshContent(); + } + } + + private int SortTaskRefreshInfo(DailyTaskRefreshRoleInfo x, DailyTaskRefreshRoleInfo y) + { + bool flag = x.luck != y.luck; + int result; + if (flag) + { + result = (int)(y.luck - x.luck); + } + else + { + bool flag2 = x.time != y.time; + if (flag2) + { + result = (int)(y.time - x.time); + } + else + { + int friendDegreeAll = (int)DlgBase.singleton.GetFriendDegreeAll(x.roleid); + int friendDegreeAll2 = (int)DlgBase.singleton.GetFriendDegreeAll(y.roleid); + result = friendDegreeAll2 - friendDegreeAll; + } + } + return result; + } + + public void SendToGetAskRefreshTaskInfo() + { + RpcC2M_GetDailyTaskAskHelp rpc = new RpcC2M_GetDailyTaskAskHelp(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetTaskHelpInfo(GetDailyTaskAskHelpRes oRes) + { + this._askInfoList = oRes.askinfos; + bool flag = this._askInfoList.Count == 0; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("DailyTaskRefreshOutdate"), "fece00"); + } + this._helpNum = oRes.help_num; + this._myLuck = Math.Max(1u, oRes.luck); + this.RefreshRequestSysIcon(); + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshContent(); + } + } + + public void SendToGetRefreshLogInfo() + { + RpcC2M_GetDailyTaskRefreshRecord rpc = new RpcC2M_GetDailyTaskRefreshRecord(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetRefreshRecordInfo(GetDailyTaskRefreshRecordRes oRes) + { + this._dailyTaskRefreshRecordList = oRes.records; + this._dailyTaskRefreshRecordList.Reverse(); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + bool flag2 = false; + for (int i = 0; i < this._dailyTaskRefreshRecordList.Count; i++) + { + bool isnew = this._dailyTaskRefreshRecordList[i].isnew; + if (isnew) + { + flag2 = true; + break; + } + } + bool flag3 = flag2; + if (flag3) + { + DlgBase.singleton.RefreshLogContent(); + } + } + } + + public void SendToRefreshTaskOp(DailyRefreshOperType type, ulong roleID) + { + RpcC2M_DailyTaskRefreshOper rpcC2M_DailyTaskRefreshOper = new RpcC2M_DailyTaskRefreshOper(); + rpcC2M_DailyTaskRefreshOper.oArg.type = type; + rpcC2M_DailyTaskRefreshOper.oArg.roleid = roleID; + XSingleton.singleton.Send(rpcC2M_DailyTaskRefreshOper); + } + + public void OnGetTaskRefreshOperResult(DailyTaskRefreshOperArg oArg, DailyTaskRefreshOperRes oRes) + { + bool flag = oRes.result == ErrorCode.ERR_SUCCESS; + if (flag) + { + switch (oArg.type) + { + case DailyRefreshOperType.DROT_Refresh: + { + bool flag2 = this._refresh_num > 0u; + if (flag2) + { + this._refresh_num -= 1u; + } + for (int i = 0; i < this._askInfoList.Count; i++) + { + bool flag3 = this._askInfoList[i].roleid == oArg.roleid; + if (flag3) + { + this._askInfoList[i].refresh_num -= 1u; + this._askInfoList[i].score = oRes.score; + List intList = XSingleton.singleton.GetIntList("DailyGuildRefreshNotifyLevel"); + bool flag4 = intList.Contains((int)oRes.score); + if (flag4) + { + this.SendNotifyToGuildChannel(this._askInfoList[i], (int)oRes.score); + } + bool flag5 = this._askInfoList[i].refresh_num <= 0u || oRes.score == 4u; + if (flag5) + { + this._askInfoList.RemoveAt(i); + } + break; + } + } + bool flag6 = oArg.roleid == XSingleton.singleton.XPlayerData.RoleID; + if (flag6) + { + this._curScore = oRes.score; + bool flag7 = DlgBase.singleton.IsVisible(); + if (flag7) + { + bool flag8 = this._dailyTaskRefreshRoleInfoList.Count > 0 && this._dailyTaskRefreshRoleInfoList[0].roleid == XSingleton.singleton.XPlayerData.RoleID; + if (flag8) + { + this._dailyTaskRefreshRoleInfoList[0].refresh_num = this._refresh_num; + this._dailyTaskRefreshRoleInfoList[0].already_ask = (this._dailyTaskRefreshRoleInfoList[0].refresh_num <= 0u); + } + DlgBase.singleton.RefreshContent(); + } + } + else + { + this._helpNum -= 1u; + } + bool flag9 = DlgBase.singleton.IsVisible(); + if (flag9) + { + DlgBase.singleton.RefreshContent(); + } + DlgBase.singleton.AfterScore = oRes.score; + DlgBase.singleton.BeforeScore = oRes.oldscore; + DlgBase.singleton.SetVisibleWithAnimation(true, null); + XGuildMemberDocument specificDocument = XDocuments.GetSpecificDocument(XGuildMemberDocument.uuID); + specificDocument.RefreshMemberTaskScore(oArg.roleid, oRes.score); + bool flag10 = DlgBase.singleton.IsVisible(); + if (flag10) + { + DlgBase.singleton.OnRefreshDailyTaskReply(); + } + break; + } + case DailyRefreshOperType.DROT_Refuse: + { + for (int j = 0; j < this._askInfoList.Count; j++) + { + bool flag11 = this._askInfoList[j].roleid == oArg.roleid; + if (flag11) + { + this._askInfoList.RemoveAt(j); + break; + } + } + bool flag12 = this._askInfoList.Count == 0; + if (flag12) + { + this.DailyTaskHelpRefreshIcon = false; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildDailyRequest, true); + } + bool flag13 = DlgBase.singleton.IsVisible(); + if (flag13) + { + DlgBase.singleton.RefreshContent(); + } + break; + } + case DailyRefreshOperType.DROT_BuyCount: + { + this._refresh_num += 1u; + this._todayBuyNum += 1u; + bool flag14 = this._dailyTaskRefreshRoleInfoList.Count > 0 && this._dailyTaskRefreshRoleInfoList[0].roleid == XSingleton.singleton.XPlayerData.RoleID; + if (flag14) + { + this._dailyTaskRefreshRoleInfoList[0].refresh_num = this._refresh_num; + this._dailyTaskRefreshRoleInfoList[0].already_ask = (this._dailyTaskRefreshRoleInfoList[0].refresh_num <= 0u); + } + bool flag15 = DlgBase.singleton.IsVisible(); + if (flag15) + { + DlgBase.singleton.RefreshContent(); + } + break; + } + case DailyRefreshOperType.DROT_AskHelp: + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("DailyAskForHelpSuccess"), "fece00"); + for (int k = 0; k < this._dailyTaskRefreshRoleInfoList.Count; k++) + { + bool flag16 = this._dailyTaskRefreshRoleInfoList[k].roleid == oArg.roleid; + if (flag16) + { + this._dailyTaskRefreshRoleInfoList[k].already_ask = true; + break; + } + } + bool flag17 = DlgBase.singleton.IsVisible(); + if (flag17) + { + DlgBase.singleton.RefreshContent(); + } + break; + } + } + } + else + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + bool flag18 = oArg.roleid == XSingleton.singleton.XPlayerData.RoleID && oArg.type == DailyRefreshOperType.DROT_Refresh && oRes.result == ErrorCode.ERR_DAILY_TASK_NO_REFRESH_COUNT; + if (flag18) + { + this._refresh_num = 0u; + bool flag19 = DlgBase.singleton.IsVisible(); + if (flag19) + { + bool flag20 = this._dailyTaskRefreshRoleInfoList.Count > 0 && this._dailyTaskRefreshRoleInfoList[0].roleid == XSingleton.singleton.XPlayerData.RoleID; + if (flag20) + { + this._dailyTaskRefreshRoleInfoList[0].refresh_num = this._refresh_num; + this._dailyTaskRefreshRoleInfoList[0].already_ask = (this._dailyTaskRefreshRoleInfoList[0].refresh_num <= 0u); + } + DlgBase.singleton.RefreshContent(); + } + } + bool flag21 = oArg.type == DailyRefreshOperType.DROT_Refuse || oArg.type == DailyRefreshOperType.DROT_Refresh; + if (flag21) + { + for (int l = 0; l < this._askInfoList.Count; l++) + { + bool flag22 = this._askInfoList[l].roleid == oArg.roleid; + if (flag22) + { + this._askInfoList.RemoveAt(l); + break; + } + } + } + this.RefreshRequestSysIcon(); + bool flag23 = DlgBase.singleton.IsVisible(); + if (flag23) + { + DlgBase.singleton.RefreshContent(); + } + } + } + + private void SendNotifyToGuildChannel(DailyTaskRefreshRoleInfo dailyTaskRefreshRoleInfo, int level) + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag = !specificDocument.CheckInGuild(); + if (!flag) + { + XInvitationDocument specificDocument2 = XDocuments.GetSpecificDocument(XInvitationDocument.uuID); + NoticeTable.RowData noticeData = specificDocument2.GetNoticeData(NoticeType.NT_GUILD_Daily_Refresh_Thanks_REQ); + bool flag2 = noticeData == null; + if (!flag2) + { + string itemQualityName = XSingleton.singleton.GetItemQualityName(level); + List stringList = XSingleton.singleton.GetStringList("LuckyLevel"); + int index = Math.Min((int)(this._myLuck - 1u), stringList.Count - 1); + List list = new List(); + ChatParam chatParam = new ChatParam(); + chatParam.link = new ChatParamLink(); + chatParam.link.id = noticeData.linkparam; + chatParam.link.content = noticeData.linkcontent; + ChatParam chatParam2 = new ChatParam(); + chatParam2.role = new ChatParamRole(); + chatParam2.role.uniqueid = XSingleton.singleton.XPlayerData.RoleID; + chatParam2.role.name = XSingleton.singleton.XPlayerData.Name; + chatParam2.role.profession = XSingleton.singleton.XPlayerData.TypeID; + ChatParam chatParam3 = new ChatParam(); + chatParam3.role = new ChatParamRole(); + chatParam3.role.uniqueid = dailyTaskRefreshRoleInfo.roleid; + chatParam3.role.name = dailyTaskRefreshRoleInfo.name; + chatParam3.role.profession = (uint)dailyTaskRefreshRoleInfo.profession; + list.Add(chatParam2); + list.Add(chatParam3); + list.Add(chatParam); + DlgBase.singleton.SendChatContent(string.Format(noticeData.info, stringList[index], itemQualityName), (ChatChannelType)noticeData.channel, true, list, true, 0UL, 0f, false, false); + } + } + } + + public void OnGetDailyTaskEvent(PtcM2C_DailyTaskEventNtf roPtc) + { + bool flag = roPtc.Data.type == DailyTaskIconType.DailyTaskIcon_AskHelp; + if (flag) + { + this.DailyTaskHelpRefreshIcon = true; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildDailyRequest, true); + } + else + { + bool flag2 = roPtc.Data.type == DailyTaskIconType.DailyTaskIcon_BeHelp; + if (flag2) + { + this.DailyTaskBeenRefreshIcon = true; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildDailyTask, true); + } + else + { + bool flag3 = roPtc.Data.type == DailyTaskIconType.DailyTaskIcon_AskHelpDispear; + if (flag3) + { + this.DailyTaskHelpRefreshIcon = false; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildDailyRequest, true); + } + } + } + } + + public DailyTaskRefreshRoleInfo GetTaskAskInfoByIndex(int index) + { + bool flag = index < this._askInfoList.Count; + DailyTaskRefreshRoleInfo result; + if (flag) + { + result = this._askInfoList[index]; + } + else + { + result = null; + } + return result; + } + + public DailyTaskRefreshRoleInfo GetRefreshTaskItemInfo(int index) + { + bool flag = index < this._dailyTaskRefreshRoleInfoList.Count; + DailyTaskRefreshRoleInfo result; + if (flag) + { + result = this._dailyTaskRefreshRoleInfoList[index]; + } + else + { + result = null; + } + return result; + } + + public DailyTaskRefreshInfo GetRefreshTaskLogInfo(int index) + { + bool flag = index < this._dailyTaskRefreshRecordList.Count; + DailyTaskRefreshInfo result; + if (flag) + { + result = this._dailyTaskRefreshRecordList[index]; + } + else + { + result = null; + } + return result; + } + + public DailyTaskRefreshInfo GetRefreshTaskLogInfoByRoleID(ulong roleID) + { + for (int i = 0; i < this._dailyTaskRefreshRecordList.Count; i++) + { + bool flag = this._dailyTaskRefreshRecordList[i].roleid == roleID; + if (flag) + { + return this._dailyTaskRefreshRecordList[i]; + } + } + return null; + } + + public void SendGuildDonateReq(uint number, uint itemID, uint reqID, NoticeType type = NoticeType.NT_GUILD_Daily_DONATE_REQ) + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag = !specificDocument.CheckInGuild(); + if (!flag) + { + XInvitationDocument specificDocument2 = XDocuments.GetSpecificDocument(XInvitationDocument.uuID); + NoticeTable.RowData noticeData = specificDocument2.GetNoticeData(type); + bool flag2 = noticeData == null; + if (!flag2) + { + List list = new List(); + ChatParam chatParam = new ChatParam(); + chatParam.link = new ChatParamLink(); + chatParam.link.id = noticeData.linkparam; + chatParam.link.param.Add((ulong)reqID); + chatParam.link.content = noticeData.linkcontent; + ChatParam chatParam2 = new ChatParam(); + chatParam2.role = new ChatParamRole(); + chatParam2.role.uniqueid = XSingleton.singleton.XPlayerData.RoleID; + chatParam2.role.name = XSingleton.singleton.XPlayerData.Name; + chatParam2.role.profession = XSingleton.singleton.XPlayerData.TypeID; + ChatParam chatParam3 = new ChatParam(); + chatParam3.item = new ChatParamItem(); + chatParam3.item.item = new ItemBrief(); + chatParam3.item.item.itemCount = number; + chatParam3.item.item.itemID = itemID; + list.Add(chatParam2); + list.Add(chatParam3); + list.Add(chatParam); + DlgBase.singleton.SendChatContent(noticeData.info, (ChatChannelType)noticeData.channel, true, list, true, 0UL, 0f, false, false); + } + } + } + + public void InitFromServerData(RoleTask roleTask) + { + bool flag = roleTask.dailytask.Count == 0; + if (flag) + { + XSingleton.singleton.SetSysRedPointState(XSysDefine.XSys_GuildDailyTask, false); + } + else + { + XSingleton.singleton.SetSysRedPointState(XSysDefine.XSys_GuildDailyTask, roleTask.daily_red_point); + } + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildDailyTask, true); + XGuildDonateDocument.Doc.DailyDonatedNum = roleTask.today_donate_count; + } + + public void ClearRequesetItems() + { + this._askInfoList.Clear(); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshContent(); + } + this.RefreshRequestSysIcon(); + } + + public void OnTaskRefreshNtf(PtcM2C_TaskRefreshNtf roPtc) + { + this._curScore = roPtc.Data.score; + this._refresh_num = roPtc.Data.remain_refresh_count; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + this.SendGetDailyTaskInfo(); + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + bool flag3 = this._dailyTaskRefreshRoleInfoList.Count > 0 && this._dailyTaskRefreshRoleInfoList[0].roleid == XSingleton.singleton.XPlayerData.RoleID; + if (flag3) + { + this._dailyTaskRefreshRoleInfoList[0].refresh_num = this._refresh_num; + this._dailyTaskRefreshRoleInfoList[0].already_ask = (this._dailyTaskRefreshRoleInfoList[0].refresh_num <= 0u); + } + DlgBase.singleton.RefreshContent(); + } + } + + private void RefreshRequestSysIcon() + { + bool flag = this._askInfoList.Count == 0; + if (flag) + { + this.DailyTaskHelpRefreshIcon = false; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildDailyRequest, true); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskDocument.cs.meta new file mode 100644 index 00000000..acdef535 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ae982954253daa04792df1732ef4a842 +timeCreated: 1611404340 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskView.cs new file mode 100644 index 00000000..f1421e87 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskView.cs @@ -0,0 +1,619 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDailyTaskView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildDailyTask"; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override int sysid + { + get + { + return 886; + } + } + + private IXUIWrapContent _taskContent = null; + + private uint _curTabedTaskID = 0u; + + private bool selectedDefault = false; + + protected override void OnLoad() + { + base.OnLoad(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + protected override void Init() + { + base.Init(); + this.InitProperties(); + } + + protected override void OnHide() + { + base.OnHide(); + } + + protected override void OnShow() + { + base.OnShow(); + base.uiBehaviour.RefreshRecordRoot.gameObject.SetActive(false); + this._curTabedTaskID = 0u; + this.selectedDefault = false; + XGuildDailyTaskDocument.Doc.SendGetDailyTaskInfo(); + XGuildDailyTaskDocument.Doc.SendToGetRefreshLogInfo(); + } + + public override void StackRefresh() + { + base.StackRefresh(); + XGuildDailyTaskDocument.Doc.SendGetDailyTaskInfo(); + } + + public void Refresh() + { + } + + public void RefreshGuildDailyContent() + { + } + + private void InitProperties() + { + base.uiBehaviour.RefreshRecordRoot.gameObject.SetActive(true); + base.uiBehaviour.SubmmitBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnclickSubmmitBtn)); + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.Onclose)); + this._taskContent = base.uiBehaviour.TaskContent; + this._taskContent.RegisterItemInitEventHandler(new WrapItemInitEventHandler(this.InitTaskItem)); + this._taskContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.UpdateTaskItem)); + base.uiBehaviour.RefreshTaskBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickRefreshBtn)); + base.uiBehaviour.RefreshLogBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickRefreshLogBtn)); + base.uiBehaviour.RefreshCloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseRefreshLogView)); + base.uiBehaviour.RefreshLogWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnUpdateRefreshLogItem)); + base.uiBehaviour.TipButton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnShowInstruction)); + } + + private bool OnShowInstruction(IXUIButton button) + { + DlgBase.singleton.ShowHelp(XSysDefine.XSys_GuildDailyTask); + return true; + } + + private void OnUpdateRefreshLogItem(Transform itemTransform, int index) + { + DailyTaskRefreshInfo refreshTaskLogInfo = XGuildDailyTaskDocument.Doc.GetRefreshTaskLogInfo(index); + bool flag = refreshTaskLogInfo != null; + if (flag) + { + IXUILabel ixuilabel = itemTransform.Find("Content").GetComponent("XUILabel") as IXUILabel; + string text = (refreshTaskLogInfo.roleid == XSingleton.singleton.XPlayerData.RoleID) ? XStringDefineProxy.GetString("GuildDailySelfFreshTask") : string.Format(XStringDefineProxy.GetString("GuildDailyFriendFreshTask", new object[] + { + refreshTaskLogInfo.name + }), new object[0]); + ixuilabel.SetText(text); + IXUISprite ixuisprite = itemTransform.Find("TaskLevel").GetComponent("XUISprite") as IXUISprite; + ixuisprite.SetSprite(ixuisprite.spriteName.Substring(0, ixuisprite.spriteName.Length - 1) + refreshTaskLogInfo.score); + IXUISprite ixuisprite2 = itemTransform.Find("BeforeTaskLevel").GetComponent("XUISprite") as IXUISprite; + ixuisprite2.SetSprite(ixuisprite2.spriteName.Substring(0, ixuisprite2.spriteName.Length - 1) + refreshTaskLogInfo.old_score); + IXUISprite ixuisprite3 = itemTransform.Find("New").GetComponent("XUISprite") as IXUISprite; + ixuisprite3.gameObject.SetActive(refreshTaskLogInfo.isnew); + string text2 = new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(refreshTaskLogInfo.time).ToLocalTime().ToString("yyyy-MM-dd H:mm"); + IXUILabel ixuilabel2 = itemTransform.Find("Time").GetComponent("XUILabel") as IXUILabel; + ixuilabel2.SetText(text2); + IXUISprite ixuisprite4 = itemTransform.Find("Bg").GetComponent("XUISprite") as IXUISprite; + ixuisprite4.ID = refreshTaskLogInfo.roleid; + ixuisprite4.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickToShowRoleDetail)); + } + } + + private void OnClickToShowRoleDetail(IXUISprite uiSprite) + { + bool flag = uiSprite.ID != XSingleton.singleton.XPlayerData.RoleID; + if (flag) + { + XCharacterCommonMenuDocument.ReqCharacterMenuInfo(uiSprite.ID, false); + } + } + + private bool OnCloseRefreshLogView(IXUIButton button) + { + XGuildDailyTaskDocument.Doc.DailyTaskBeenRefreshIcon = false; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildDailyTask, true); + base.uiBehaviour.RefreshRecordRoot.gameObject.SetActive(false); + return true; + } + + private bool OnClickRefreshLogBtn(IXUIButton button) + { + this.RefreshLogContent(); + return true; + } + + private bool OnClickRefreshBtn(IXUIButton button) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + return true; + } + + private bool Onclose(IXUIButton button) + { + this.SetVisibleWithAnimation(false, null); + return true; + } + + private bool OnclickSubmmitBtn(IXUIButton button) + { + int rewardedTaskCount = XGuildDailyTaskDocument.Doc.GetRewardedTaskCount(); + bool flag = rewardedTaskCount >= XSingleton.singleton.GetInt("DailyTaskMinTotalTaskCount"); + if (flag) + { + bool flag2 = rewardedTaskCount < XGuildDailyTaskDocument.Doc.GetTaskItemCount(); + if (flag2) + { + XSingleton.singleton.ShowModalDialog(XSingleton.singleton.GetString("ConfirmToSumbmit"), XStringDefineProxy.GetString(XStringDefine.COMMON_OK), XStringDefineProxy.GetString(XStringDefine.COMMON_CANCEL), new ButtonClickEventHandler(this.OnConfirmToSubmit)); + } + else + { + XGuildDailyTaskDocument.Doc.SendToGetMyTaskReward(2u, 0u); + } + } + return true; + } + + private bool OnConfirmToSubmit(IXUIButton button) + { + XGuildDailyTaskDocument.Doc.SendToGetMyTaskReward(2u, 0u); + DlgBase.singleton.SetVisible(false, true); + return true; + } + + private bool OnCacelTask(IXUIButton button) + { + XGuildDailyTaskDocument.Doc.GiveUpTask(); + DlgBase.singleton.SetVisible(false, true); + return true; + } + + private bool OnclickReqHelpBtn(IXUIButton button) + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool bInGuild = specificDocument.bInGuild; + if (bInGuild) + { + XGuildDailyTaskDocument.Doc.SendDailyTaskAskHelp(PeriodTaskType.PeriodTaskType_Daily, (uint)button.ID); + } + else + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("NotInGuild"), "fece00"); + } + return true; + } + + private bool OnclickCompleteBtn(IXUIButton button) + { + GuildDailyTaskInfo taskInfoByID = XGuildDailyTaskDocument.Doc.GetTaskInfoByID((uint)button.ID); + bool flag = taskInfoByID != null; + if (flag) + { + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(taskInfoByID.taskID); + bool flag2 = dailyTaskTableInfoByID != null; + if (flag2) + { + bool flag3 = taskInfoByID.step >= dailyTaskTableInfoByID.conditionNum; + if (flag3) + { + XGuildDailyTaskDocument.Doc.SendToGetMyTaskReward(1u, (uint)button.ID); + } + else + { + bool flag4 = dailyTaskTableInfoByID.tasktype == 1u; + if (flag4) + { + XSingleton.singleton.ShowItemAccess((int)dailyTaskTableInfoByID.conditionId[0], null); + } + else + { + this.ItemAccessByID(taskInfoByID.taskID); + } + } + } + } + return true; + } + + private void InitTaskItem(Transform itemTransform, int index) + { + IXUICheckBox ixuicheckBox = itemTransform.Find("Normal").GetComponent("XUICheckBox") as IXUICheckBox; + ixuicheckBox.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSwitchTaskItem)); + IXUISprite ixuisprite = itemTransform.Find("Item/Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnclickIcon)); + IXUIButton ixuibutton = itemTransform.Find("GetBtn").GetComponent("XUIButton") as IXUIButton; + ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnclickCompleteBtn)); + IXUIButton ixuibutton2 = itemTransform.Find("ReqHelp").GetComponent("XUIButton") as IXUIButton; + ixuibutton2.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnclickReqHelpBtn)); + IXUISprite ixuisprite2 = itemTransform.Find("boss").GetComponent("XUISprite") as IXUISprite; + ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnclickBossIcon)); + } + + private void OnclickBossIcon(IXUISprite uiSprite) + { + this.ItemAccessByID((uint)uiSprite.ID); + } + + private void ItemAccessByID(uint taskID) + { + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(taskID); + bool flag = dailyTaskTableInfoByID == null; + if (!flag) + { + List list = new List(); + List list2 = new List(); + for (int i = 0; i < dailyTaskTableInfoByID.BQ.Count; i++) + { + list.Add((int)dailyTaskTableInfoByID.BQ[i, 0]); + list2.Add((int)dailyTaskTableInfoByID.BQ[i, 1]); + } + DlgBase.singleton.ShowMonsterAccess(dailyTaskTableInfoByID.NPCID, list, list2, null); + } + } + + private void OnclickIcon(IXUISprite uiSprite) + { + XSingleton.singleton.ShowItemAccess((int)uiSprite.ID, null); + } + + private bool OnSwitchTaskItem(IXUICheckBox iXUICheckBox) + { + bool bChecked = iXUICheckBox.bChecked; + if (bChecked) + { + this._curTabedTaskID = (uint)iXUICheckBox.ID; + } + return true; + } + + private void UpdateRightPanel(ulong taskID) + { + } + + private void UpdateTotalTaskRewards() + { + XLevelSealDocument specificDocument = XDocuments.GetSpecificDocument(XLevelSealDocument.uuID); + base.uiBehaviour.RewardPool.ReturnAll(false); + int rewardedTaskCount = XGuildDailyTaskDocument.Doc.GetRewardedTaskCount(); + int count = Math.Min(Math.Max(XSingleton.singleton.GetInt("DailyTaskMinTotalTaskCount"), rewardedTaskCount + 1), XGuildDailyTaskDocument.Doc.GetTaskItemCount()); + DailyTaskReward.RowData totalTaskRewardInfo = XGuildDailyTaskDocument.Doc.GetTotalTaskRewardInfo(GuildTaskType.DailyTask, (uint)count); + bool flag = totalTaskRewardInfo != null; + if (flag) + { + SeqListRef? rewadsByScore = XGuildDailyTaskDocument.Doc.GetRewadsByScore(totalTaskRewardInfo, XGuildDailyTaskDocument.Doc.CurScore); + bool flag2 = rewadsByScore != null; + if (flag2) + { + for (int i = 0; i < (int)rewadsByScore.Value.count; i++) + { + GameObject gameObject = base.uiBehaviour.RewardPool.FetchGameObject(false); + int num = (int)rewadsByScore.Value[i, 1]; + bool flag3 = rewadsByScore.Value[i, 0] == 4u && specificDocument.IsInLevelSeal(); + if (flag3) + { + num = (int)((double)num * 0.5); + } + XSingleton.singleton.normalItemDrawer.DrawItem(gameObject, (int)rewadsByScore.Value[i, 0], num, false); + IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.ID = (ulong)rewadsByScore.Value[i, 0]; + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton.singleton.OnItemClick)); + gameObject.transform.parent = base.uiBehaviour.CurrentRewardsGrid; + } + IXUIList ixuilist = base.uiBehaviour.CurrentRewardsGrid.GetComponent("XUIList") as IXUIList; + ixuilist.Refresh(); + } + } + List additionalRewards = XGuildDailyTaskDocument.Doc.GetAdditionalRewards(); + bool flag4 = additionalRewards != null; + if (flag4) + { + for (int j = 0; j < additionalRewards.Count; j++) + { + GameObject gameObject2 = base.uiBehaviour.RewardPool.FetchGameObject(false); + int num2 = (int)additionalRewards[j].count; + bool flag5 = additionalRewards[j].itemID == 4u && specificDocument.IsInLevelSeal(); + if (flag5) + { + num2 = (int)((double)num2 * 0.5); + } + XSingleton.singleton.normalItemDrawer.DrawItem(gameObject2, (int)additionalRewards[j].itemID, num2, false); + IXUISprite ixuisprite2 = gameObject2.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite2.ID = (ulong)additionalRewards[j].itemID; + ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton.singleton.OnItemClick)); + gameObject2.transform.parent = base.uiBehaviour.AdditionalRewardsGrid; + } + IXUIList ixuilist2 = base.uiBehaviour.AdditionalRewardsGrid.GetComponent("XUIList") as IXUIList; + ixuilist2.Refresh(); + } + Transform transform = base.uiBehaviour.SubmmitBtn.gameObject.transform.Find("RedPoint"); + bool flag6 = rewardedTaskCount >= XGuildDailyTaskDocument.Doc.GetTaskItemCount(); + if (flag6) + { + transform.gameObject.SetActive(true); + } + else + { + transform.gameObject.SetActive(false); + } + Transform transform2 = base.uiBehaviour.SubmmitBtn.gameObject.transform.Find("task"); + IXUILabel ixuilabel = transform2.GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(XSingleton.singleton.GetString("SubmmitTask")); + base.uiBehaviour.SubmmitBtn.gameObject.SetActive(true); + base.uiBehaviour.SubmmitBtn.SetEnable(true, false); + bool isRewarded = XGuildDailyTaskDocument.Doc.IsRewarded; + if (isRewarded) + { + transform.gameObject.SetActive(false); + base.uiBehaviour.SubmmitBtn.SetEnable(false, false); + ixuilabel.SetText(XSingleton.singleton.GetString("dailyTaskFinish")); + } + else + { + bool flag7 = rewardedTaskCount < XSingleton.singleton.GetInt("DailyTaskMinTotalTaskCount"); + if (flag7) + { + base.uiBehaviour.SubmmitBtn.gameObject.SetActive(false); + } + } + base.uiBehaviour.taskTimeLabel.SetText(rewardedTaskCount + "/" + XGuildDailyTaskDocument.Doc.GetTaskItemCount()); + base.uiBehaviour.timeLabel.SetText(XGuildDailyTaskDocument.Doc.AskedNum + "/" + XSingleton.singleton.GetInt("DailyTaskAskHelpNum")); + base.uiBehaviour.taskNumLabel.SetText(count.ToString()); + } + + private void UpdateTaskItem(Transform itemTransform, int index) + { + GuildDailyTaskInfo taskInfoByIndex = XGuildDailyTaskDocument.Doc.GetTaskInfoByIndex(index); + bool flag = taskInfoByIndex != null; + if (flag) + { + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(taskInfoByIndex.taskID); + bool flag2 = dailyTaskTableInfoByID == null; + if (!flag2) + { + IXUILabel ixuilabel = itemTransform.Find("ResName").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(dailyTaskTableInfoByID.taskdescription); + IXUILabel ixuilabel2 = itemTransform.Find("Progress").GetComponent("XUILabel") as IXUILabel; + IXUICheckBox ixuicheckBox = itemTransform.Find("Normal").GetComponent("XUICheckBox") as IXUICheckBox; + ixuicheckBox.ID = (ulong)taskInfoByIndex.taskID; + uint step = taskInfoByIndex.step; + uint conditionNum = dailyTaskTableInfoByID.conditionNum; + IXUILabel ixuilabel3 = itemTransform.Find("GetBtn/T").GetComponent("XUILabel") as IXUILabel; + ixuilabel3.SetText(XSingleton.singleton.GetString("GoToSubmit")); + Transform transform = itemTransform.Find("boss"); + transform.gameObject.SetActive(true); + Transform transform2 = itemTransform.Find("Item"); + transform2.gameObject.SetActive(true); + IXUISprite ixuisprite = itemTransform.Find("Item/Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.ID = (ulong)dailyTaskTableInfoByID.conditionId[0]; + bool flag3 = dailyTaskTableInfoByID.tasktype == 1u; + if (flag3) + { + transform.gameObject.SetActive(false); + XSingleton.singleton.normalItemDrawer.DrawItem(transform2.gameObject, (int)dailyTaskTableInfoByID.conditionId[0], 0, false); + IXUISprite ixuisprite2 = transform2.Find("Quality").GetComponent("XUISprite") as IXUISprite; + ixuisprite2.SetSprite(ixuisprite2.spriteName.Substring(0, ixuisprite2.spriteName.Length - 1) + dailyTaskTableInfoByID.taskquality); + bool flag4 = step < conditionNum; + if (flag4) + { + ixuilabel3.SetText(XSingleton.singleton.GetString("GotoObtain")); + } + } + else + { + bool flag5 = step < conditionNum; + if (flag5) + { + ixuilabel3.SetText(XSingleton.singleton.GetString("GoToFight")); + } + transform2.gameObject.SetActive(false); + XEntityStatistics.RowData byID = XSingleton.singleton.EntityStatistics.GetByID(dailyTaskTableInfoByID.NPCID); + IXUISprite ixuisprite3 = transform.GetComponent("XUISprite") as IXUISprite; + ixuisprite3.ID = (ulong)dailyTaskTableInfoByID.taskID; + bool flag6 = byID != null; + if (flag6) + { + XEntityPresentation.RowData byPresentID = XSingleton.singleton.EntityInfo.GetByPresentID(byID.PresentID); + ixuisprite3.SetSprite(byPresentID.Avatar, byPresentID.Atlas, false); + } + IXUISprite ixuisprite4 = transform.Find("p").GetComponent("XUISprite") as IXUISprite; + ixuisprite4.SetSprite(ixuisprite4.spriteName.Substring(0, ixuisprite4.spriteName.Length - 1) + dailyTaskTableInfoByID.taskquality); + } + IXUIButton ixuibutton = itemTransform.Find("ReqHelp").GetComponent("XUIButton") as IXUIButton; + ixuibutton.ID = (ulong)taskInfoByIndex.taskID; + DailyTaskReward.RowData singleTaskRewardInfoByID = XGuildDailyTaskDocument.Doc.GetSingleTaskRewardInfoByID(GuildTaskType.DailyTask, taskInfoByIndex.taskID); + IXUISprite ixuisprite5 = itemTransform.Find("god").GetComponent("XUISprite") as IXUISprite; + IXUISprite ixuisprite6 = itemTransform.Find("exp").GetComponent("XUISprite") as IXUISprite; + IXUILabel ixuilabel4 = itemTransform.Find("godLabel").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel5 = itemTransform.Find("expLabel").GetComponent("XUILabel") as IXUILabel; + bool flag7 = singleTaskRewardInfoByID != null; + if (flag7) + { + SeqListRef taskreward = singleTaskRewardInfoByID.taskreward; + XLevelSealDocument specificDocument = XDocuments.GetSpecificDocument(XLevelSealDocument.uuID); + uint num = taskreward[0, 1]; + uint num2 = taskreward[1, 1]; + bool flag8 = taskreward[0, 0] == 4u && specificDocument.IsInLevelSeal(); + if (flag8) + { + num = (uint)(num * 0.5); + } + bool flag9 = taskreward[1, 0] == 4u && specificDocument.IsInLevelSeal(); + if (flag9) + { + num2 = (uint)(num2 * 0.5); + } + ixuilabel4.SetText(num.ToString()); + ixuilabel5.SetText(num2.ToString()); + ItemList.RowData itemConf = XBagDocument.GetItemConf((int)taskreward[0, 0]); + ixuisprite5.SetSprite(itemConf.ItemIcon1[0]); + itemConf = XBagDocument.GetItemConf((int)taskreward[1, 0]); + ixuisprite6.SetSprite(itemConf.ItemIcon1[0]); + } + IXUIButton ixuibutton2 = itemTransform.Find("GetBtn").GetComponent("XUIButton") as IXUIButton; + ixuibutton2.ID = (ulong)taskInfoByIndex.taskID; + Transform transform3 = itemTransform.Find("RedPoint"); + Transform transform4 = itemTransform.Find("CompleteFlag"); + ixuilabel2.SetText(step + "/" + conditionNum); + bool flag10 = step >= conditionNum && !taskInfoByIndex.isRewarded; + if (flag10) + { + transform3.gameObject.SetActive(true); + } + else + { + transform3.gameObject.SetActive(false); + } + ixuibutton2.SetEnable(true, false); + bool isRewarded = taskInfoByIndex.isRewarded; + if (isRewarded) + { + ixuibutton2.gameObject.SetActive(false); + transform4.gameObject.SetActive(true); + } + else + { + bool isRewarded2 = XGuildDailyTaskDocument.Doc.IsRewarded; + if (isRewarded2) + { + ixuibutton2.gameObject.SetActive(true); + ixuibutton2.SetEnable(false, false); + transform4.gameObject.SetActive(false); + transform3.gameObject.SetActive(false); + } + else + { + ixuibutton2.gameObject.SetActive(true); + transform4.gameObject.SetActive(false); + } + } + ixuibutton.gameObject.SetActive(true); + bool flag11 = taskInfoByIndex.hasAsked || (ulong)XGuildDailyTaskDocument.Doc.AskedNum >= (ulong)((long)XSingleton.singleton.GetInt("DailyTaskAskHelpNum")); + if (flag11) + { + ixuibutton.SetEnable(false, false); + } + else + { + ixuibutton.SetEnable(true, false); + } + IXUILabel ixuilabel6 = ixuibutton.gameObject.transform.Find("GetLabel").GetComponent("XUILabel") as IXUILabel; + bool hasAsked = taskInfoByIndex.hasAsked; + if (hasAsked) + { + ixuilabel6.SetText(XSingleton.singleton.GetString("DailyTaskGetted")); + } + else + { + ixuilabel6.SetText(XSingleton.singleton.GetString("DailyTaskGet")); + } + bool flag12 = (step >= conditionNum && !taskInfoByIndex.hasAsked) || dailyTaskTableInfoByID.tasktype != 1u || taskInfoByIndex.isRewarded || XGuildDailyTaskDocument.Doc.IsRewarded; + if (flag12) + { + ixuibutton.gameObject.SetActive(false); + } + } + } + } + + public void RefreshLogContent() + { + base.uiBehaviour.RefreshRecordRoot.gameObject.SetActive(true); + List dailyTaskRefreshRecordList = XGuildDailyTaskDocument.Doc.DailyTaskRefreshRecordList; + base.uiBehaviour.RefreshLogWrapContent.SetContentCount(dailyTaskRefreshRecordList.Count, false); + base.uiBehaviour.RefreshLogScrollView.ResetPosition(); + } + + public void RefreshTaskItemByID(uint id) + { + this._taskContent.RefreshAllVisibleContents(); + int rewardedTaskCount = XGuildDailyTaskDocument.Doc.GetRewardedTaskCount(); + base.uiBehaviour.RefreshTaskBtn.gameObject.SetActive(rewardedTaskCount == 0); + base.uiBehaviour.TalkLabel.SetText(string.Format(XSingleton.singleton.GetString("GuildDailyTaskLeftRefreshTimes"), XGuildDailyTaskDocument.Doc.Refresh_num)); + base.uiBehaviour.TalkLabel.gameObject.SetActive(rewardedTaskCount == 0 && XGuildDailyTaskDocument.Doc.Refresh_num > 0u); + this.UpdateTotalTaskRewards(); + } + + public void RefreshTaskContent() + { + base.uiBehaviour.TaskLevelSprite.SetSprite(base.uiBehaviour.TaskLevelSprite.spriteName.Substring(0, base.uiBehaviour.TaskLevelSprite.spriteName.Length - 1) + XGuildDailyTaskDocument.Doc.CurScore); + int rewardedTaskCount = XGuildDailyTaskDocument.Doc.GetRewardedTaskCount(); + base.uiBehaviour.RefreshTaskBtn.gameObject.SetActive(rewardedTaskCount == 0); + base.uiBehaviour.TalkLabel.SetText(string.Format(XSingleton.singleton.GetString("GuildDailyTaskLeftRefreshTimes"), XGuildDailyTaskDocument.Doc.Refresh_num)); + base.uiBehaviour.TalkLabel.gameObject.SetActive(rewardedTaskCount == 0 && XGuildDailyTaskDocument.Doc.Refresh_num > 0u); + int taskItemCount = XGuildDailyTaskDocument.Doc.GetTaskItemCount(); + bool flag = taskItemCount > 0; + if (flag) + { + this._taskContent.SetContentCount(taskItemCount, false); + this.UpdateTotalTaskRewards(); + } + } + + private void InitDefaultSelectedTaskItem() + { + bool flag = !this.selectedDefault; + if (flag) + { + Transform transform = this._taskContent.gameObject.transform; + bool flag2 = transform.childCount > 0; + if (flag2) + { + Transform child = transform.GetChild(0); + IXUICheckBox ixuicheckBox = child.Find("Normal").GetComponent("XUICheckBox") as IXUICheckBox; + bool flag3 = ixuicheckBox != null; + if (flag3) + { + ixuicheckBox.ForceSetFlag(true); + } + } + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskView.cs.meta new file mode 100644 index 00000000..e5fceaa3 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDailyTaskView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 817402d39b24fc34994b6b11d4b90789 +timeCreated: 1611404037 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDocument.cs new file mode 100644 index 00000000..ccd688c4 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDocument.cs @@ -0,0 +1,686 @@ +using System; +using System.Collections.Generic; +using KKSG; +using MiniJSON; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUpdater; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildDocument.uuID; + } + } + + public static XGuildConfig GuildConfig + { + get + { + return XGuildDocument._GuildConfig; + } + } + + public static XGuildPP GuildPP + { + get + { + return XGuildDocument._GuildPP; + } + } + + public static bool InGuild + { + get + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + return specificDocument.bInGuild; + } + } + + public XGuildBasicData BasicData + { + get + { + return this.m_BasicData; + } + } + + public ulong UID + { + get + { + return this.m_BasicData.uid; + } + } + + public GuildPosition Position + { + get + { + return this.m_Position; + } + } + + public uint Level + { + get + { + return this.m_BasicData.level; + } + } + + public uint CurSkillUpCount + { + get + { + return 0u; + } + } + + public uint MaxSkillUpCount + { + get + { + bool flag = !this.bInGuild; + uint result; + if (flag) + { + result = 0u; + } + else + { + result = XGuildDocument.GuildConfig.GetDataByLevel(this.Level).StudySkillTimes; + } + return result; + } + } + + public string PortraitSprite + { + get + { + return XGuildDocument.GetPortraitName(this.m_BasicData.portraitIndex); + } + } + + public uint CurrentCanUseExp + { + get + { + return 0u; + } + } + + public uint CurrentTotalExp + { + get + { + bool flag = !this.bInGuild; + uint result; + if (flag) + { + result = 0u; + } + else + { + result = XGuildDocument.GuildConfig.GetBaseExp(this.Level) + this.m_BasicData.exp; + } + return result; + } + } + + public uint CurrentLevelTotalExp + { + get + { + bool flag = !this.bInGuild; + uint result; + if (flag) + { + result = 0u; + } + else + { + result = XGuildDocument.GuildConfig.GetBaseExp(this.Level) + this.m_BasicData.exp; + } + return result; + } + } + + public bool bInGuild + { + get + { + return this.UID > 0UL; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private static GuildPermissionTable m_PermissionTable = new GuildPermissionTable(); + + private static GuildConfigTable m_ConfigTable = new GuildConfigTable(); + + private static Guildintroduce m_IntroduceTable = new Guildintroduce(); + + private static XGuildConfig _GuildConfig = new XGuildConfig(); + + private static XGuildPP _GuildPP = new XGuildPP(); + + private XGuildBasicData m_BasicData = new XGuildBasicData(); + + private bool _bInited = false; + + private GuildPosition m_Position; + + private float m_fEnterTime = 0f; + + public GuildBindStatus qqGroupBindStatus; + + public string qqGroupName; + + public static string GetPortraitName(int index) + { + return "ghicon_" + index.ToString(); + } + + public bool SetID(ulong id) + { + bool flag = !this._bInited || this.m_BasicData.uid != id; + this.m_BasicData.uid = id; + bool flag2 = flag; + if (flag2) + { + bool bInGuild = this.bInGuild; + if (bInGuild) + { + try + { + } + catch + { + } + } + } + return flag; + } + + public bool SetLevel(uint newLevel) + { + bool result = this.m_BasicData.level != 0u && this.m_BasicData.level != newLevel && this.m_BasicData.uid > 0UL; + this.m_BasicData.level = newLevel; + return result; + } + + public bool SetPosition(GuildPosition newPos) + { + bool result = this.m_Position != GuildPosition.GPOS_COUNT && this.m_Position != newPos && this.m_BasicData.uid > 0UL; + this.m_Position = newPos; + return result; + } + + public Guildintroduce.RowData GetIntroduce(string helpName) + { + return XGuildDocument.m_IntroduceTable.GetByHelpName(helpName); + } + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildDocument.AsyncLoader.AddTask("Table/GuildPermission", XGuildDocument.m_PermissionTable, false); + XGuildDocument.AsyncLoader.AddTask("Table/GuildConfig", XGuildDocument.m_ConfigTable, false); + XGuildDocument.AsyncLoader.AddTask("Table/GuildIntroduce", XGuildDocument.m_IntroduceTable, false); + XGuildDocument.AsyncLoader.Execute(callback); + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + this._bInited = false; + this.m_Position = GuildPosition.GPOS_COUNT; + this.m_BasicData.uid = 0UL; + this.m_BasicData.level = 0u; + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.OnInGuildStateChanged)); + base.RegisterEvent(XEventDefine.XEvent_GuildPositionChanged, new XComponent.XEventHandler(this.OnGuildPositionChanged)); + } + + protected bool OnInGuildStateChanged(XEventArgs args) + { + XInGuildStateChangedEventArgs xinGuildStateChangedEventArgs = args as XInGuildStateChangedEventArgs; + bool bRoleInit = xinGuildStateChangedEventArgs.bRoleInit; + bool result; + if (bRoleInit) + { + result = true; + } + else + { + bool flag = !xinGuildStateChangedEventArgs.bIsEnter; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_EXIT_GUILD"), "fece00"); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_JOIN_GUILD"), "fece00"); + } + result = true; + } + return result; + } + + protected bool OnGuildPositionChanged(XEventArgs args) + { + XSingleton.singleton.ShowModalDialog(XStringDefineProxy.GetString("GUILD_POSITION_CHANGED", new object[] + { + XGuildDocument.GuildPP.GetPositionName(this.m_Position, false) + }), XStringDefineProxy.GetString(XStringDefine.COMMON_OK)); + return true; + } + + public void InitData(PtcM2C_LoginGuildInfo data) + { + bool flag = this.SetID(data.Data.gid); + bool flag2 = this.SetPosition((GuildPosition)data.Data.position); + this.m_BasicData.portraitIndex = (int)data.Data.icon; + bool flag3 = this.SetLevel((uint)data.Data.level); + this.m_BasicData.guildName = data.Data.name; + this.QueryWXGroup(); + this.QueryQQGroup(); + bool flag4 = flag; + if (flag4) + { + XInGuildStateChangedEventArgs @event = XEventPool.GetEvent(); + @event.bIsEnter = this.bInGuild; + @event.bRoleInit = !this._bInited; + @event.Firer = XSingleton.singleton.Doc; + XSingleton.singleton.FireEvent(@event); + } + bool flag5 = flag2; + if (flag5) + { + XGuildPositionChangedEventArgs event2 = XEventPool.GetEvent(); + event2.position = this.m_Position; + event2.Firer = XSingleton.singleton.Doc; + XSingleton.singleton.FireEvent(event2); + } + bool flag6 = flag3; + if (flag6) + { + XGuildLevelChangedEventArgs event3 = XEventPool.GetEvent(); + event3.level = this.m_BasicData.level; + event3.Firer = XSingleton.singleton.Doc; + XSingleton.singleton.FireEvent(event3); + } + XGuildInfoChange event4 = XEventPool.GetEvent(); + event4.Firer = XSingleton.singleton.Player; + XSingleton.singleton.FireEvent(event4); + XGuildInfoChange event5 = XEventPool.GetEvent(); + event5.Firer = XSingleton.singleton.Doc; + XSingleton.singleton.FireEvent(event5); + this._bInited = true; + } + + public static void OnTableLoaded() + { + XGuildDocument.GuildPP.InitTable(XGuildDocument.m_PermissionTable); + XGuildDocument.GuildConfig.Init(XGuildDocument.m_ConfigTable); + } + + private bool _CanEnter() + { + float time = Time.time; + bool flag = time - this.m_fEnterTime > 3f; + bool result; + if (flag) + { + this.m_fEnterTime = time; + result = true; + } + else + { + result = false; + } + return result; + } + + public GuildSceneState TryEnterGuildScene() + { + bool bInGuild = this.bInGuild; + GuildSceneState result; + if (bInGuild) + { + SceneType sceneType = XSingleton.singleton.SceneType; + bool flag = sceneType == SceneType.SCENE_GUILD_HALL; + if (flag) + { + result = GuildSceneState.GSS_InGuildScene; + } + else + { + bool flag2 = !this._CanEnter(); + if (flag2) + { + result = GuildSceneState.GSS_NotGuildScene; + } + else + { + HomePlantDocument.Doc.GardenId = this.UID; + PtcC2G_EnterSceneReq ptcC2G_EnterSceneReq = new PtcC2G_EnterSceneReq(); + ptcC2G_EnterSceneReq.Data.sceneID = (uint)XSingleton.singleton.GetInt("GuildHallSceneID"); + ptcC2G_EnterSceneReq.Data.roleID = this.UID; + XSingleton.singleton.Send(ptcC2G_EnterSceneReq); + result = GuildSceneState.GSS_NotGuildScene; + } + } + } + else + { + bool flag3 = !DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + result = GuildSceneState.GSS_NoPermission; + } + return result; + } + + public void TryShowGuildHallUI() + { + bool bInGuild = this.bInGuild; + if (bInGuild) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + else + { + bool flag = !DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public override void OnEnterSceneFinally() + { + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_GUILD_HALL; + if (flag) + { + HomePlantDocument doc = HomePlantDocument.Doc; + doc.ClearFarmInfo(); + doc.HomeSprite.ClearInfo(); + HomePlantDocument.Doc.GardenId = this.UID; + doc.FetchPlantInfo(0u); + } + base.OnEnterSceneFinally(); + } + + public bool IHavePermission(GuildPermission pem) + { + return XGuildDocument.GuildPP.HasPermission(this.m_Position, pem); + } + + public bool CheckPermission(GuildPermission pem) + { + bool flag = !this.CheckInGuild(); + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = this.IHavePermission(pem); + if (flag2) + { + result = true; + } + else + { + XSingleton.singleton.ShowSystemTip(ErrorCode.ERR_GUILD_NO_PERMISSION, "fece00"); + result = false; + } + } + return result; + } + + public bool CheckUnlockLevel(XSysDefine sys) + { + bool flag = !this.CheckInGuild(); + bool result; + if (flag) + { + result = false; + } + else + { + uint unlockLevel = XGuildDocument.GuildConfig.GetUnlockLevel(sys); + bool flag2 = this.Level >= unlockLevel; + if (flag2) + { + result = true; + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("OPEN_AT_GUILD_LEVEL", new object[] + { + unlockLevel + }), "fece00"); + result = false; + } + } + return result; + } + + public bool IsSysUnlocked(XSysDefine sys) + { + bool flag = !this.bInGuild; + bool result; + if (flag) + { + result = false; + } + else + { + uint unlockLevel = XGuildDocument.GuildConfig.GetUnlockLevel(sys); + bool flag2 = this.Level >= unlockLevel; + result = flag2; + } + return result; + } + + public bool CheckInGuild() + { + bool bInGuild = this.bInGuild; + bool result; + if (bInGuild) + { + result = true; + } + else + { + XSingleton.singleton.ShowSystemTip(ErrorCode.ERR_GUILD_NOT_IN_GUILD, "fece00"); + result = false; + } + return result; + } + + public static void OnGuildHyperLinkClick(string param) + { + bool flag = XSingleton.singleton.CurrentStage.Stage != EXStage.Hall; + if (!flag) + { + ulong id = 0UL; + bool flag2 = XLabelSymbolHelper.ParseGuildParam(param, ref id); + if (flag2) + { + bool flag3 = XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Guild); + if (flag3) + { + XGuildViewDocument specificDocument = XDocuments.GetSpecificDocument(XGuildViewDocument.uuID); + specificDocument.View(id); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_LOG_CANNOT_JOIN"), "fece00"); + } + } + } + } + + public void QueryWXGroup() + { + bool flag = XSingleton.singleton.Channel != XAuthorizationChannel.XAuthorization_WeChat || !XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Guild_Bind_Group); + if (!flag) + { + XSingleton.singleton.wxGroupCallbackType = WXGroupCallBackType.Guild; + Dictionary dictionary = new Dictionary(); + dictionary["unionID"] = this.UID.ToString(); + dictionary["openIdList"] = XSingleton.singleton.OpenID; + string param = Json.Serialize(dictionary); + XSingleton.singleton.XPlatform.QueryWXGroup(param); + } + } + + public void QueryQQGroup() + { + bool flag = XSingleton.singleton.Channel != XAuthorizationChannel.XAuthorization_QQ || !XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Guild_Bind_Group); + if (!flag) + { + RpcC2M_GetGuildBindInfo rpcC2M_GetGuildBindInfo = new RpcC2M_GetGuildBindInfo(); + rpcC2M_GetGuildBindInfo.oArg.token = XSingleton.singleton.TokenCache; + XSingleton.singleton.Send(rpcC2M_GetGuildBindInfo); + XSingleton.singleton.AddLog("[QQGroup QueryQQGroup]token:" + XSingleton.singleton.TokenCache, null, null, null, null, null, XDebugColor.XDebug_None); + } + } + + public void OnGetQQGroupBindInfo(GetGuildBindInfoReq oArg, GetGuildBindInfoRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (!flag) + { + this.qqGroupBindStatus = oRes.bind_status; + this.qqGroupName = oRes.group_name; + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshQQGroupBtn(); + } + } + } + + public void BindQQGroup() + { + bool flag = XSingleton.singleton.Channel != XAuthorizationChannel.XAuthorization_QQ || !XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Guild_Bind_Group); + if (!flag) + { + RpcC2M_GuildBindGroup rpcC2M_GuildBindGroup = new RpcC2M_GuildBindGroup(); + rpcC2M_GuildBindGroup.oArg.token = XSingleton.singleton.TokenCache; + XSingleton.singleton.Send(rpcC2M_GuildBindGroup); + XSingleton.singleton.AddLog("[QQGroup BindQQGroup]token:" + XSingleton.singleton.TokenCache, null, null, null, null, null, XDebugColor.XDebug_None); + } + } + + public void OnBindQQGroup(GuildBindGroupReq oArg, GuildBindGroupRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(oRes.result); + } + else + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("GUILD_BIN_QQ_GROUP_SUC"), "fece00"); + this.qqGroupName = oRes.group_name; + this.qqGroupBindStatus = GuildBindStatus.GBS_Owner; + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshQQGroupBtn(); + } + } + } + + public void JoinQQGroup() + { + bool flag = XSingleton.singleton.Channel != XAuthorizationChannel.XAuthorization_QQ || !XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Guild_Bind_Group); + if (!flag) + { + RpcC2M_GuildJoinBindGroup rpcC2M_GuildJoinBindGroup = new RpcC2M_GuildJoinBindGroup(); + rpcC2M_GuildJoinBindGroup.oArg.token = XSingleton.singleton.TokenCache; + XSingleton.singleton.Send(rpcC2M_GuildJoinBindGroup); + XSingleton.singleton.AddLog("[QQGroup JoinQQGroup]token:" + XSingleton.singleton.TokenCache, null, null, null, null, null, XDebugColor.XDebug_None); + } + } + + public void OnJoinBindQQGroup(GuildJoinBindGroupReq oArg, GuildJoinBindGroupRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(oRes.result); + } + else + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("GUILD_JOIN_QQ_GROUP_SUC"), "fece00"); + this.qqGroupBindStatus = GuildBindStatus.GBS_Member; + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshQQGroupBtn(); + } + } + } + + public void UnbindQQGroup() + { + bool flag = XSingleton.singleton.Channel != XAuthorizationChannel.XAuthorization_QQ || !XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Guild_Bind_Group); + if (!flag) + { + RpcC2M_GuildUnBindGroup rpcC2M_GuildUnBindGroup = new RpcC2M_GuildUnBindGroup(); + rpcC2M_GuildUnBindGroup.oArg.token = XSingleton.singleton.TokenCache; + XSingleton.singleton.Send(rpcC2M_GuildUnBindGroup); + XSingleton.singleton.AddLog("[QQGroup UnbindQQGroup]token:" + XSingleton.singleton.TokenCache, null, null, null, null, null, XDebugColor.XDebug_None); + } + } + + public void OnUnbindQQGroup(GuildUnBindGroupReq oArg, GuildUnBindGroupRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(oRes.result); + } + else + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("GUILD_UNBIND_QQ_GROUP_SUC"), "fece00"); + this.qqGroupBindStatus = GuildBindStatus.GBS_NotBind; + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshQQGroupBtn(); + } + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDocument.cs.meta new file mode 100644 index 00000000..604f3da0 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 43e5cb605e6694141929bf86918505b6 +timeCreated: 1611403643 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateBehavior.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateBehavior.cs new file mode 100644 index 00000000..dded5b0b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateBehavior.cs @@ -0,0 +1,89 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDonateBehavior : DlgBehaviourBase + { + public IXUIWrapContent RankContent; + + public IXUIWrapContent DonationContent; + + public IXUICheckBox HistoryTab; + + public IXUICheckBox TodayTab; + + public IXUIButton CloseBtn; + + public Transform MyRankItem; + + public Transform EmptyRank; + + public IXUIScrollView LeftScrollView; + + public IXUIScrollView RightScrollView; + + public Transform RankRoot; + + public IXUIButton RankBtn; + + public IXUIButton RankCloseBtn; + + public IXUICheckBox dailyTab; + + public IXUICheckBox WeeklyTab; + + public IXUICheckBox GrowthTab; + + public Transform m_DonateFrame; + + public Transform m_GrowthFrame; + + public IXUIButton m_GrowthRecordBtn; + + public IXUIButton m_GrowthRecordCloseBtn; + + public Transform m_GrowthRecordList; + + public GameObject m_GrowthRecordEmpty; + + public XUIPool m_GrowthDonatePool = new XUIPool(XSingleton.singleton.m_uiTool); + + public XUIPool m_GrowthRecordPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public IXUILabel m_GrowthWeekTimes; + + private void Awake() + { + this.DonationContent = (base.transform.Find("DonateFrame/Panel/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.RightScrollView = (this.DonationContent.gameObject.transform.parent.GetComponent("XUIScrollView") as IXUIScrollView); + this.RankContent = (base.transform.Find("Rank/RankDlg/ScrollView/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.LeftScrollView = (this.RankContent.gameObject.transform.parent.GetComponent("XUIScrollView") as IXUIScrollView); + this.TodayTab = (base.transform.Find("Rank/RankDlg/Select/All").GetComponent("XUICheckBox") as IXUICheckBox); + this.HistoryTab = (base.transform.Find("Rank/RankDlg/Select/Self").GetComponent("XUICheckBox") as IXUICheckBox); + this.CloseBtn = (base.transform.Find("Close").GetComponent("XUIButton") as IXUIButton); + this.MyRankItem = base.transform.Find("Rank/RankDlg/MyRank"); + this.EmptyRank = base.transform.Find("Rank/RankDlg/EmptyRank"); + this.RankRoot = base.transform.Find("Rank"); + this.dailyTab = (base.transform.Find("Tabs/DailyDonation").GetComponent("XUICheckBox") as IXUICheckBox); + this.WeeklyTab = (base.transform.Find("Tabs/WeeklyDonation").GetComponent("XUICheckBox") as IXUICheckBox); + this.GrowthTab = (base.transform.Find("Tabs/GrowthDonation").GetComponent("XUICheckBox") as IXUICheckBox); + this.RankBtn = (base.transform.Find("DonateFrame/RankBtn").GetComponent("XUIButton") as IXUIButton); + this.RankCloseBtn = (this.RankRoot.Find("RankDlg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_DonateFrame = base.transform.Find("DonateFrame"); + this.m_GrowthFrame = base.transform.Find("GrowthFrame"); + this.m_GrowthRecordBtn = (this.m_GrowthFrame.Find("RecordBtn").GetComponent("XUIButton") as IXUIButton); + this.m_GrowthRecordList = this.m_GrowthFrame.Find("RecordDlg"); + this.m_GrowthRecordCloseBtn = (this.m_GrowthRecordList.Find("Close").GetComponent("XUIButton") as IXUIButton); + this.m_GrowthRecordEmpty = this.m_GrowthRecordList.Find("EmptyRank").gameObject; + Transform transform = this.m_GrowthFrame.Find("List/MemberTpl"); + this.m_GrowthDonatePool.SetupPool(transform.parent.gameObject, transform.gameObject, 5u, false); + transform = this.m_GrowthRecordList.Find("ScrollView/RankTpl"); + this.m_GrowthRecordPool.SetupPool(transform.parent.gameObject, transform.gameObject, 5u, false); + this.m_GrowthWeekTimes = (this.m_GrowthFrame.Find("time").GetComponent("XUILabel") as IXUILabel); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateBehavior.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateBehavior.cs.meta new file mode 100644 index 00000000..60f53c52 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateBehavior.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ca97779d7180e444397c9311310f098c +timeCreated: 1611404542 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateDocument.cs new file mode 100644 index 00000000..e7e65c2d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateDocument.cs @@ -0,0 +1,405 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDonateDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildDonateDocument.uuID; + } + } + + public static XGuildDonateDocument Doc + { + get + { + return XSingleton.singleton.Doc.GetXComponent(XGuildDonateDocument.uuID) as XGuildDonateDocument; + } + } + + public List DailyDonateOverviewList + { + get + { + return this._dailyDonateItemList; + } + set + { + this._dailyDonateItemList = value; + } + } + + public uint DailyDonatedNum + { + get + { + return this._dailyDonatedNum; + } + set + { + this._dailyDonatedNum = value; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildDonateDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private List _todayRankList = new List(); + + private List _dailyDonateItemList = new List(); + + private List _rankList = new List(); + + private List _weeklyDonateItemList = new List(); + + private uint _dailyDonatedNum = 0u; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildDonateDocument.AsyncLoader.Execute(callback); + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + } + + public override void OnDetachFromHost() + { + base.OnDetachFromHost(); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + } + + public GuildDonateRankInfo GetRankInfoByIndex(int index, DonateRankType type) + { + bool flag = type == DonateRankType.TodayRank && index < this._todayRankList.Count; + GuildDonateRankInfo result; + if (flag) + { + result = this._todayRankList[index]; + } + else + { + bool flag2 = type == DonateRankType.HistoryRank && index < this._rankList.Count; + if (flag2) + { + result = this._rankList[index]; + } + else + { + result = null; + } + } + return result; + } + + public void SortRankListWithRankType(DonateRankType type) + { + bool flag = type == DonateRankType.HistoryRank; + if (flag) + { + this._rankList.Sort(new Comparison(this.SortHistory)); + } + else + { + this._todayRankList.Sort(new Comparison(this.SortToday)); + } + } + + public void SendGetDonateBaseInfo() + { + RpcC2M_GetGuildDonateInfo rpc = new RpcC2M_GetGuildDonateInfo(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetDonateInfo(GetGuildDonateInfoRes res) + { + List info = res.info; + List rankitem = res.rankitem; + this.UpdateRankList(rankitem); + this._dailyDonatedNum = res.donatenum; + this._dailyDonateItemList.Clear(); + this._weeklyDonateItemList.Clear(); + for (int i = 0; i < info.Count; i++) + { + GuildMemberAskInfo guildMemberAskInfo = info[i]; + bool flag = guildMemberAskInfo.item.tasktype == PeriodTaskType.PeriodTaskType_Daily; + if (flag) + { + this._dailyDonateItemList.Add(new GuildDonateItemInfo + { + name = guildMemberAskInfo.name, + profession = guildMemberAskInfo.profession, + id = guildMemberAskInfo.item.id, + roleID = guildMemberAskInfo.item.roleid, + publishTime = guildMemberAskInfo.item.publishtime, + itemID = guildMemberAskInfo.item.itemid, + needCount = guildMemberAskInfo.item.needCount, + getCount = guildMemberAskInfo.item.getCount, + taskID = guildMemberAskInfo.item.taskid + }); + } + else + { + this._weeklyDonateItemList.Add(new GuildDonateItemInfo + { + name = guildMemberAskInfo.name, + profession = guildMemberAskInfo.profession, + id = guildMemberAskInfo.item.id, + roleID = guildMemberAskInfo.item.roleid, + publishTime = guildMemberAskInfo.item.publishtime, + itemID = guildMemberAskInfo.item.itemid, + needCount = guildMemberAskInfo.item.needCount, + getCount = guildMemberAskInfo.item.getCount, + itemType = guildMemberAskInfo.item.itemtype, + itemQuality = guildMemberAskInfo.item.itemquality, + index = guildMemberAskInfo.item.index, + taskID = guildMemberAskInfo.item.taskid + }); + } + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshCurDonateTypeUI(); + } + } + + private void UpdateRankList(List rankitem) + { + this._rankList.Clear(); + this._todayRankList.Clear(); + for (int i = 0; i < rankitem.Count; i++) + { + GuildMemberDonateRankItem guildMemberDonateRankItem = rankitem[i]; + this._rankList.Add(new GuildDonateRankInfo + { + roleID = guildMemberDonateRankItem.roleid, + todayCount = guildMemberDonateRankItem.todaycount, + totalCount = guildMemberDonateRankItem.totalcount, + lastTime = guildMemberDonateRankItem.lasttime, + roleName = guildMemberDonateRankItem.name, + level = guildMemberDonateRankItem.level, + profession = guildMemberDonateRankItem.profession + }); + bool flag = this._rankList[i].todayCount > 0u; + if (flag) + { + this._todayRankList.Add(this._rankList[i]); + } + } + } + + public GuildDonateItemInfo GetDonateItemInfoByIndex(GuildDonateType type, int index) + { + List list = (type == GuildDonateType.DailyDonate) ? this._dailyDonateItemList : this._weeklyDonateItemList; + bool flag = index < list.Count; + GuildDonateItemInfo result; + if (flag) + { + result = list[index]; + } + else + { + result = null; + } + return result; + } + + public void SendDonateMemberItem(uint id, uint count, List itemList = null) + { + RpcC2M_DonateMemberItem rpcC2M_DonateMemberItem = new RpcC2M_DonateMemberItem(); + rpcC2M_DonateMemberItem.oArg.id = id; + rpcC2M_DonateMemberItem.oArg.count = count; + bool flag = itemList != null; + if (flag) + { + rpcC2M_DonateMemberItem.oArg.itemuid.AddRange(itemList); + } + XSingleton.singleton.Send(rpcC2M_DonateMemberItem); + } + + public int GetMyRankIndex(DonateRankType type) + { + List list = (type == DonateRankType.TodayRank) ? this._todayRankList : this._rankList; + for (int i = 0; i < list.Count; i++) + { + bool flag = list[i].roleID == XSingleton.singleton.XPlayerData.RoleID; + if (flag) + { + return i; + } + } + return -1; + } + + public int GetRankContentCount(DonateRankType type) + { + return (type == DonateRankType.TodayRank) ? this._todayRankList.Count : this._rankList.Count; + } + + public void OnGetDonateMemberReply(DonateMemberItemArg oArg, DonateMemberItemRes oRes) + { + bool flag = oRes.result == ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("DonateSuccess"), "fece00"); + this.UpdateRankList(oRes.rankitem); + for (int i = 0; i < this._dailyDonateItemList.Count; i++) + { + bool flag2 = this._dailyDonateItemList[i].id == oArg.id; + if (flag2) + { + this._dailyDonateItemList[i].getCount += oArg.count; + this._dailyDonatedNum += oArg.count; + } + } + for (int j = 0; j < this._weeklyDonateItemList.Count; j++) + { + bool flag3 = this._weeklyDonateItemList[j].id == oArg.id; + if (flag3) + { + this._weeklyDonateItemList[j].getCount += oArg.count; + this._dailyDonatedNum += oArg.count; + } + } + bool flag4 = DlgBase.singleton.IsVisible(); + if (flag4) + { + DlgBase.singleton.RefreshCurDonateTypeUI(); + } + } + else + { + bool flag5 = oRes.result == ErrorCode.ERR_TASK_ASKITEM_REFRESH || oRes.result == ErrorCode.ERR_TASK_NO_ASKINFO; + if (flag5) + { + this.SendGetDonateBaseInfo(); + } + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + } + + public void ShowViewWithID(uint id, GuildDonateType type = GuildDonateType.DailyDonate) + { + bool inGuild = XGuildDocument.InGuild; + if (inGuild) + { + DlgBase.singleton.toSelectID = id; + DlgBase.singleton.DonateType = type; + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + else + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + + public void ShowViewWithType(GuildDonateType type) + { + bool inGuild = XGuildDocument.InGuild; + if (inGuild) + { + DlgBase.singleton.DonateType = type; + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + else + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + + public uint GetCanDonateMaxNum() + { + int @int = XSingleton.singleton.GetInt("DailyTaskDonateNum"); + return (uint)(((long)@int <= (long)((ulong)this._dailyDonatedNum)) ? 0 : (@int - (int)this._dailyDonatedNum)); + } + + private int SortHistory(GuildDonateRankInfo x, GuildDonateRankInfo y) + { + bool flag = x.totalCount != y.totalCount; + int result; + if (flag) + { + result = (int)(y.totalCount - x.totalCount); + } + else + { + result = (int)(y.lastTime - x.lastTime); + } + return result; + } + + private int SortToday(GuildDonateRankInfo x, GuildDonateRankInfo y) + { + bool flag = x.todayCount != y.todayCount; + int result; + if (flag) + { + result = (int)(y.todayCount - x.todayCount); + } + else + { + result = (int)(y.lastTime - x.lastTime); + } + return result; + } + + public int GetDonationListCount(GuildDonateType donateType) + { + int result; + if (donateType != GuildDonateType.DailyDonate) + { + if (donateType != GuildDonateType.WeeklyDonate) + { + result = 0; + } + else + { + result = this._weeklyDonateItemList.Count; + } + } + else + { + result = this._dailyDonateItemList.Count; + } + return result; + } + + public GuildDonateItemInfo GetDonationItemInfoWithTypeID(GuildDonateType donateType, uint id) + { + List list = (donateType == GuildDonateType.DailyDonate) ? this._dailyDonateItemList : this._weeklyDonateItemList; + for (int i = 0; i < list.Count; i++) + { + bool flag = list[i].id == id; + if (flag) + { + return list[i]; + } + } + return null; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateDocument.cs.meta new file mode 100644 index 00000000..a0fd34ce --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b9bdfdc4e8a4ade4cbdd9c6acda2babc +timeCreated: 1611404411 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateView.cs new file mode 100644 index 00000000..62c4769a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateView.cs @@ -0,0 +1,601 @@ +using System; +using System.Collections.Generic; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDonateView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildDonation"; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override bool fullscreenui + { + get + { + return true; + } + } + + private XGuildGrowthDocument _growthDoc; + + private DonateRankType _rankType = DonateRankType.TodayRank; + + public GuildDonateType DonateType = GuildDonateType.DailyDonate; + + public uint _curDonateID = 0u; + + public uint toSelectID = 0u; + + protected override void OnLoad() + { + base.OnLoad(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + protected override void Init() + { + base.Init(); + this._growthDoc = XDocuments.GetSpecificDocument(XGuildGrowthDocument.uuID); + this.InitProperties(); + } + + protected override void OnHide() + { + this.toSelectID = 0u; + this.DonateType = GuildDonateType.DailyDonate; + base.OnHide(); + } + + protected override void OnShow() + { + base.OnShow(); + base.uiBehaviour.RankRoot.gameObject.SetActive(false); + base.uiBehaviour.RankBtn.gameObject.SetActive(true); + XGuildDonateDocument.Doc.SendGetDonateBaseInfo(); + base.uiBehaviour.TodayTab.ForceSetFlag(true); + base.uiBehaviour.dailyTab.ForceSetFlag(this.DonateType == GuildDonateType.DailyDonate); + base.uiBehaviour.WeeklyTab.ForceSetFlag(this.DonateType == GuildDonateType.WeeklyDonate); + base.uiBehaviour.GrowthTab.ForceSetFlag(this.DonateType == GuildDonateType.GrowthDonate); + bool flag = this.DonateType == GuildDonateType.GrowthDonate; + if (flag) + { + this.OnSelectGrowthDonation(base.uiBehaviour.GrowthTab); + } + this.UpdateDonationWrapContent(); + } + + public override void StackRefresh() + { + base.StackRefresh(); + } + + private void InitProperties() + { + base.uiBehaviour.RankRoot.gameObject.SetActive(true); + base.uiBehaviour.DonationContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.DonateItemUpdate)); + base.uiBehaviour.RankContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.DonateRankItemUpdate)); + base.uiBehaviour.HistoryTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.SelectedHistoryTab)); + base.uiBehaviour.TodayTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.SelectedTodayTab)); + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnclickCloseBtn)); + base.uiBehaviour.dailyTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSelectDailyDonation)); + base.uiBehaviour.WeeklyTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSelectWeeklyDonation)); + base.uiBehaviour.GrowthTab.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSelectGrowthDonation)); + base.uiBehaviour.RankCloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseRankView)); + base.uiBehaviour.RankBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnShowRankView)); + base.uiBehaviour.m_GrowthRecordBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGrowthListBtnClick)); + base.uiBehaviour.m_GrowthRecordCloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGrowthListCloseBtnClick)); + } + + private bool OnGrowthListBtnClick(IXUIButton btn) + { + this.ShowGrowthList(); + return true; + } + + private bool OnGrowthListCloseBtnClick(IXUIButton btn) + { + base.uiBehaviour.m_GrowthRecordList.gameObject.SetActive(false); + return true; + } + + private bool OnShowRankView(IXUIButton button) + { + base.uiBehaviour.RankRoot.gameObject.SetActive(true); + this.UpdateRankContent(); + return true; + } + + private bool OnCloseRankView(IXUIButton button) + { + base.uiBehaviour.RankRoot.gameObject.SetActive(false); + return true; + } + + private bool OnSelectWeeklyDonation(IXUICheckBox iXUICheckBox) + { + bool bChecked = iXUICheckBox.bChecked; + if (bChecked) + { + this.DonateType = GuildDonateType.WeeklyDonate; + base.uiBehaviour.RankBtn.gameObject.SetActive(false); + base.uiBehaviour.m_DonateFrame.gameObject.SetActive(true); + base.uiBehaviour.m_GrowthFrame.gameObject.SetActive(false); + this.UpdateDonationWrapContent(); + } + return true; + } + + private bool OnSelectDailyDonation(IXUICheckBox iXUICheckBox) + { + bool bChecked = iXUICheckBox.bChecked; + if (bChecked) + { + this.DonateType = GuildDonateType.DailyDonate; + base.uiBehaviour.RankBtn.gameObject.SetActive(true); + base.uiBehaviour.m_DonateFrame.gameObject.SetActive(true); + base.uiBehaviour.m_GrowthFrame.gameObject.SetActive(false); + this.UpdateDonationWrapContent(); + } + return true; + } + + private bool OnSelectGrowthDonation(IXUICheckBox iXUICheckBox) + { + bool bChecked = iXUICheckBox.bChecked; + if (bChecked) + { + this.DonateType = GuildDonateType.GrowthDonate; + base.uiBehaviour.RankBtn.gameObject.SetActive(false); + base.uiBehaviour.m_DonateFrame.gameObject.SetActive(false); + base.uiBehaviour.m_GrowthFrame.gameObject.SetActive(true); + this.SetupGrowthDonate(); + this._growthDoc.QueryGrowthRecordList(); + } + return true; + } + + private bool OnclickCloseBtn(IXUIButton button) + { + this.SetVisibleWithAnimation(false, null); + return true; + } + + private bool SelectedTodayTab(IXUICheckBox iXUICheckBox) + { + bool bChecked = iXUICheckBox.bChecked; + if (bChecked) + { + this._rankType = DonateRankType.TodayRank; + this.UpdateRankContent(); + } + return true; + } + + private void UpdateRankContent() + { + this.UpdateRankWrapContent(); + this.UpdateMyRank(); + } + + private bool SelectedHistoryTab(IXUICheckBox iXUICheckBox) + { + bool bChecked = iXUICheckBox.bChecked; + if (bChecked) + { + this._rankType = DonateRankType.HistoryRank; + this.UpdateRankContent(); + } + return true; + } + + private void DonateRankItemUpdate(Transform itemTransform, int index) + { + GuildDonateRankInfo rankInfoByIndex = XGuildDonateDocument.Doc.GetRankInfoByIndex(index, this._rankType); + bool flag = rankInfoByIndex != null; + if (flag) + { + IXUILabel ixuilabel = itemTransform.Find("Win").GetComponent("XUILabel") as IXUILabel; + bool flag2 = this._rankType == DonateRankType.HistoryRank; + if (flag2) + { + ixuilabel.SetText(rankInfoByIndex.totalCount.ToString()); + } + else + { + ixuilabel.SetText(rankInfoByIndex.todayCount.ToString()); + } + IXUILabel ixuilabel2 = itemTransform.Find("Name").GetComponent("XUILabel") as IXUILabel; + ixuilabel2.SetText(rankInfoByIndex.roleName); + IXUISprite ixuisprite = itemTransform.Find("Rank").GetComponent("XUISprite") as IXUISprite; + IXUILabel ixuilabel3 = itemTransform.Find("Rank3").GetComponent("XUILabel") as IXUILabel; + bool flag3 = index < 3; + if (flag3) + { + ixuilabel3.gameObject.SetActive(false); + ixuisprite.gameObject.SetActive(true); + ixuisprite.SetSprite(ixuisprite.spriteName.Substring(0, ixuisprite.spriteName.Length - 1) + (index + 1)); + } + else + { + ixuisprite.gameObject.SetActive(false); + ixuilabel3.gameObject.SetActive(true); + ixuilabel3.SetText((index + 1).ToString()); + } + } + } + + private void DonateItemUpdate(Transform itemTransform, int index) + { + GuildDonateItemInfo donateItemInfoByIndex = XGuildDonateDocument.Doc.GetDonateItemInfoByIndex(this.DonateType, index); + Transform transform = itemTransform.Find("MemberTpl"); + bool flag = donateItemInfoByIndex != null; + if (flag) + { + IXUICheckBox ixuicheckBox = transform.GetComponent("XUICheckBox") as IXUICheckBox; + bool flag2 = donateItemInfoByIndex.id == this.toSelectID; + if (flag2) + { + ixuicheckBox.ForceSetFlag(true); + } + else + { + ixuicheckBox.ForceSetFlag(false); + } + transform.gameObject.SetActive(true); + itemTransform.gameObject.SetActive(true); + Transform transform2 = itemTransform.Find("MemberTpl/Item"); + bool flag3 = donateItemInfoByIndex.itemType > 0u; + ulong num; + if (flag3) + { + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(donateItemInfoByIndex.taskID); + num = (ulong)((dailyTaskTableInfoByID == null) ? 0u : dailyTaskTableInfoByID.BQ[0, 0]); + } + else + { + num = (ulong)donateItemInfoByIndex.itemID; + } + XSingleton.singleton.normalItemDrawer.DrawItem(transform2.gameObject, (int)num, 1, false); + IXUISprite ixuisprite = transform2.Find("Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.ID = num; + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickItemIcon)); + IXUILabel ixuilabel = itemTransform.Find("MemberTpl/Contribution").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(donateItemInfoByIndex.getCount + "/" + donateItemInfoByIndex.needCount); + IXUILabel ixuilabel2 = itemTransform.Find("MemberTpl/Name").GetComponent("XUILabel") as IXUILabel; + ixuilabel2.SetText(donateItemInfoByIndex.name); + IXUILabel ixuilabel3 = itemTransform.Find("MemberTpl/Owned/Num").GetComponent("XUILabel") as IXUILabel; + bool flag4 = donateItemInfoByIndex.itemType > 0u; + ulong num2; + if (flag4) + { + num2 = (ulong)((long)XBagDocument.BagDoc.GetItemsByTypeAndQuality(1UL << (int)donateItemInfoByIndex.itemType, (ItemQuality)donateItemInfoByIndex.itemQuality).Count); + } + else + { + num2 = XBagDocument.BagDoc.GetItemCount((int)donateItemInfoByIndex.itemID); + } + ixuilabel3.SetText(num2.ToString()); + Transform transform3 = itemTransform.Find("MemberTpl/Complete"); + IXUIButton ixuibutton = itemTransform.Find("MemberTpl/Do").GetComponent("XUIButton") as IXUIButton; + ixuibutton.ID = (ulong)donateItemInfoByIndex.id; + ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnclickDonateBtn)); + ixuibutton.gameObject.SetActive(true); + transform3.gameObject.SetActive(false); + ixuibutton.gameObject.SetActive(true); + bool flag5 = donateItemInfoByIndex.roleID == XSingleton.singleton.XPlayerData.RoleID; + if (flag5) + { + ixuibutton.gameObject.SetActive(false); + } + else + { + bool flag6 = donateItemInfoByIndex.getCount >= donateItemInfoByIndex.needCount; + if (flag6) + { + ixuibutton.gameObject.SetActive(false); + transform3.gameObject.SetActive(true); + } + else + { + ixuibutton.SetEnable(true, false); + } + } + } + else + { + transform.gameObject.SetActive(false); + } + } + + private void OnClickItemIcon(IXUISprite uiSprite) + { + XSingleton.singleton.ShowItemAccess((int)uiSprite.ID, null); + } + + private bool OnclickDonateBtn(IXUIButton button) + { + GuildDonateItemInfo donationItemInfoWithTypeID = XGuildDonateDocument.Doc.GetDonationItemInfoWithTypeID(this.DonateType, (uint)button.ID); + uint canDonateMaxNum = XGuildDonateDocument.Doc.GetCanDonateMaxNum(); + bool flag = donationItemInfoWithTypeID != null; + if (flag) + { + bool flag2 = donationItemInfoWithTypeID.itemType > 0u; + ulong num; + if (flag2) + { + num = (ulong)((long)XBagDocument.BagDoc.GetItemsByTypeAndQuality(1UL << (int)donationItemInfoWithTypeID.itemType, (ItemQuality)donationItemInfoWithTypeID.itemQuality).Count); + } + else + { + num = XBagDocument.BagDoc.GetItemCount((int)donationItemInfoWithTypeID.itemID); + } + bool flag3 = num == 0UL; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("DonateItemLess"), "fece00"); + } + else + { + bool flag4 = canDonateMaxNum == 0u; + if (flag4) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("DonateReachedMax"), "fece00"); + } + else + { + this._curDonateID = donationItemInfoWithTypeID.id; + uint max = (uint)Mathf.Min(new float[] + { + (uint)num, + donationItemInfoWithTypeID.needCount - donationItemInfoWithTypeID.getCount, + canDonateMaxNum + }); + bool flag5 = donationItemInfoWithTypeID.itemType > 0u; + if (flag5) + { + DlgBase.singleton.ShowView(new XShowSameQualityItemsView.SelectItemsHandler(this.OnSelectQualityItem), (ItemType)donationItemInfoWithTypeID.itemType, (ItemQuality)donationItemInfoWithTypeID.itemQuality, XStringDefineProxy.GetString("WeelyCommitTip"), (int)donationItemInfoWithTypeID.needCount, (int)donationItemInfoWithTypeID.getCount); + } + else + { + XSingleton.singleton.ShowSettingNumberDialog(donationItemInfoWithTypeID.itemID, XSingleton.singleton.GetString("ItemDonate"), 1u, max, 1u, new ModalSettingNumberDlg.GetInputNumber(this.GetItemNumer), 50); + } + } + } + } + return true; + } + + private void OnSelectQualityItem(List itemList) + { + bool flag = itemList.Count > 0; + if (flag) + { + XGuildDonateDocument.Doc.SendDonateMemberItem(this._curDonateID, (uint)itemList.Count, itemList); + } + } + + private void GetItemNumer(uint number) + { + bool flag = number > 0u; + if (flag) + { + XGuildDonateDocument.Doc.SendDonateMemberItem(this._curDonateID, number, null); + } + } + + private void UpdateMyRank() + { + int myRankIndex = XGuildDonateDocument.Doc.GetMyRankIndex(this._rankType); + bool flag = myRankIndex >= 0; + if (flag) + { + base.uiBehaviour.MyRankItem.gameObject.SetActive(true); + this.DonateRankItemUpdate(base.uiBehaviour.MyRankItem, myRankIndex); + } + else + { + base.uiBehaviour.MyRankItem.gameObject.SetActive(false); + } + } + + public void RefreshUI(GuildDonateType type) + { + bool flag = this.DonateType == type; + if (flag) + { + this.UpdateRankWrapContent(); + } + } + + public void RefreshCurDonateTypeUI() + { + this.UpdateDonationWrapContent(); + } + + private void UpdateRankWrapContent() + { + int rankContentCount = XGuildDonateDocument.Doc.GetRankContentCount(this._rankType); + XGuildDonateDocument.Doc.SortRankListWithRankType(this._rankType); + base.uiBehaviour.LeftScrollView.ResetPosition(); + base.uiBehaviour.RankContent.SetContentCount(rankContentCount, false); + bool flag = rankContentCount > 0; + if (flag) + { + base.uiBehaviour.EmptyRank.gameObject.SetActive(false); + } + else + { + base.uiBehaviour.EmptyRank.gameObject.SetActive(true); + } + this.UpdateDonationWrapContent(); + } + + private void UpdateDonationWrapContent() + { + int donationListCount = XGuildDonateDocument.Doc.GetDonationListCount(this.DonateType); + base.uiBehaviour.DonationContent.SetContentCount(donationListCount, false); + base.uiBehaviour.RightScrollView.ResetPosition(); + } + + public void SetupGrowthDonate() + { + this._growthDoc.QueryGrowthRecordList(); + base.uiBehaviour.m_GrowthRecordList.gameObject.SetActive(false); + this.RefreshGrowthDonateTimes(); + this._growthDoc.QueryBuildRank(); + this.Refresh(); + } + + public void Refresh() + { + bool flag = !base.uiBehaviour.m_GrowthFrame.gameObject.activeInHierarchy; + if (!flag) + { + base.uiBehaviour.m_GrowthDonatePool.ReturnAll(false); + Vector3 tplPos = base.uiBehaviour.m_GrowthDonatePool.TplPos; + for (int i = 0; i < this._growthDoc.GuildZiCaiTableReader.Table.Length; i++) + { + GuildZiCai.RowData rowData = this._growthDoc.GuildZiCaiTableReader.Table[i]; + GameObject gameObject = base.uiBehaviour.m_GrowthDonatePool.FetchGameObject(false); + gameObject.transform.localPosition = new Vector3(tplPos.x + (float)(base.uiBehaviour.m_GrowthDonatePool.TplWidth * i), tplPos.y); + GameObject gameObject2 = gameObject.transform.Find("Item").gameObject; + ItemList.RowData itemConf = XBagDocument.GetItemConf((int)rowData.itemid); + XSingleton.singleton.normalItemDrawer.DrawItem(gameObject2, itemConf, 0, false); + XSingleton.singleton.normalItemDrawer.OpenClickShowTooltipEvent(gameObject2, (int)rowData.itemid); + IXUILabel ixuilabel = gameObject2.transform.Find("Num").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetVisible(true); + ulong itemCount = XBagDocument.BagDoc.GetItemCount((int)rowData.itemid); + ixuilabel.SetText(string.Format("{0}{1}[ffffff]/1", (itemCount != 0UL) ? "" : "[e60012]", itemCount)); + IXUIButton ixuibutton = gameObject.transform.Find("Do").GetComponent("XUIButton") as IXUIButton; + ixuibutton.ID = (ulong)rowData.itemid; + ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnDoBtnClick)); + Transform transform = gameObject.transform.Find("box"); + transform.gameObject.SetActive(i == this._growthDoc.GuildZiCaiTableReader.Table.Length - 1); + this.SetReward(gameObject.transform.Find("Private"), rowData.rolerewards); + this.SetReward(gameObject.transform.Find("Guild"), rowData.guildrewards); + IXUILabel ixuilabel2 = gameObject.transform.Find("label").GetComponent("XUILabel") as IXUILabel; + ixuilabel2.SetText(XSingleton.singleton.ReplaceReturn(rowData.ShowTips)); + } + } + } + + public bool OnDoBtnClick(IXUIButton btn) + { + this._growthDoc.QueryGuildGrowthDonate((uint)btn.ID); + return true; + } + + public void SetReward(Transform t, SeqListRef list) + { + bool flag = list.Count == 0; + if (!flag) + { + IXUILabel ixuilabel = t.Find("t0").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = t.Find("t0/icon").GetComponent("XUISprite") as IXUISprite; + IXUILabel ixuilabel2 = t.Find("t1").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite2 = t.Find("t1/icon").GetComponent("XUISprite") as IXUISprite; + ixuilabel.SetText(list[0, 1].ToString()); + ixuisprite.spriteName = XBagDocument.GetItemSmallIcon((int)list[0, 0], 0u); + bool flag2 = list.Count <= 1; + if (flag2) + { + ixuilabel2.SetVisible(false); + ixuisprite2.SetVisible(false); + } + else + { + ixuilabel2.SetVisible(true); + ixuisprite2.SetVisible(true); + ixuilabel2.SetText(list[1, 1].ToString()); + ixuisprite2.spriteName = XBagDocument.GetItemSmallIcon((int)list[1, 0], 0u); + } + } + } + + public void ShowGrowthList() + { + base.uiBehaviour.m_GrowthRecordList.gameObject.SetActive(true); + this.RefreshDonateList(); + } + + public void RefreshDonateList() + { + base.uiBehaviour.m_GrowthRecordEmpty.gameObject.SetActive(this._growthDoc.RecordList.Count == 0); + base.uiBehaviour.m_GrowthRecordPool.ReturnAll(false); + int machineTimeFrom = XSingleton.singleton.GetMachineTimeFrom1970(); + for (int i = 0; i < this._growthDoc.RecordList.Count; i++) + { + GameObject gameObject = base.uiBehaviour.m_GrowthRecordPool.FetchGameObject(false); + gameObject.transform.localPosition = new Vector3(base.uiBehaviour.m_GrowthRecordPool.TplPos.x, base.uiBehaviour.m_GrowthRecordPool.TplPos.y - (float)(base.uiBehaviour.m_GrowthRecordPool.TplHeight * i)); + IXUILabel ixuilabel = gameObject.transform.Find("Name").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel2 = gameObject.transform.Find("Time").GetComponent("XUILabel") as IXUILabel; + ItemList.RowData itemConf = XBagDocument.GetItemConf((int)this._growthDoc.RecordList[i].ItemID); + ixuilabel.SetText(string.Format(XStringDefineProxy.GetString("GuildGrowthRecord"), this._growthDoc.RecordList[i].Name, itemConf.ItemName[0])); + int num = machineTimeFrom - (int)this._growthDoc.RecordList[i].Time; + ixuilabel2.SetText(XSingleton.singleton.TimeAgoFormatString((num > 0) ? num : 60)); + } + } + + public void CheckRecordRefresh() + { + bool activeInHierarchy = base.uiBehaviour.m_GrowthRecordList.gameObject.activeInHierarchy; + if (activeInHierarchy) + { + this.RefreshDonateList(); + } + } + + public void RefreshGrowthDonateTimes() + { + bool flag = !base.uiBehaviour.m_GrowthFrame.gameObject.activeInHierarchy; + if (!flag) + { + int @int = XSingleton.singleton.GetInt("GuildJZDonateMaxCount"); + base.uiBehaviour.m_GrowthWeekTimes.SetText(string.Format("{0}/{1}", this._growthDoc.WeekDonateTimes, @int)); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateView.cs.meta new file mode 100644 index 00000000..f138d1dc --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDonateView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b0e41f6fcb578fa48a4ea01daf1ca806 +timeCreated: 1611404354 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonBehaviour.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonBehaviour.cs new file mode 100644 index 00000000..f82ff583 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonBehaviour.cs @@ -0,0 +1,84 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildDragonBehaviour : DlgBehaviourBase + { + public IXUIButton m_BtnClose; + + public IXUIButton m_BtnRank; + + public IXUIButton m_BtnGoBattle; + + public IXUIButton m_BtnSubscribe; + + public IXUIButton m_BtnCancelSubscribe; + + public IXUILabel m_LeftTime; + + public IXUILabel m_OpenTime; + + public IXUILabel m_LeftTimeHint; + + public IXUILabel m_BossName; + + public IXUILabel m_Condition; + + public IXUILabel m_ConditionTitle; + + public IXUIWrapContent m_WrapContent; + + public IXUIScrollView m_ScrollView; + + public GameObject m_RankPanel; + + public IXUILabel m_RankPanel_EmptyRank; + + public IXUIButton m_BtnReward; + + public GameObject m_RewardPanel; + + public GameObject rankInfo; + + public GameObject outofRange; + + public IXUISprite m_PrivilegeIcon; + + public IXUILabel m_PrivilegeName; + + public IXUISprite m_Privilege; + + private void Awake() + { + this.m_BtnClose = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_BtnRank = (base.transform.Find("Bg/Frame/DamageRank").GetComponent("XUIButton") as IXUIButton); + this.m_BtnGoBattle = (base.transform.Find("Bg/Frame/GoBattle").GetComponent("XUIButton") as IXUIButton); + Transform transform = base.transform.Find("Bg/GuildRankPanel/ScrollView"); + this.m_ScrollView = (transform.GetComponent("XUIScrollView") as IXUIScrollView); + transform = transform.Find("WrapContent"); + this.m_WrapContent = (transform.GetComponent("XUIWrapContent") as IXUIWrapContent); + this.m_RankPanel = base.transform.Find("Bg/GuildRankPanel").gameObject; + this.m_RankPanel_EmptyRank = (base.transform.Find("Bg/GuildRankPanel/EmptyRank").GetComponent("XUILabel") as IXUILabel); + this.m_LeftTime = (base.transform.Find("Bg/Frame/LeftTime/Value").GetComponent("XUILabel") as IXUILabel); + this.m_OpenTime = (base.transform.Find("Bg/Frame/LeftTime/sk").GetComponent("XUILabel") as IXUILabel); + this.m_LeftTimeHint = (base.transform.Find("Bg/Frame/LeftTime/Over").GetComponent("XUILabel") as IXUILabel); + this.m_BossName = (base.transform.Find("Bg/Frame/LeftTime/12").GetComponent("XUILabel") as IXUILabel); + this.m_Condition = (base.transform.Find("Bg/Frame/LeftTime/shanghai/shanghai").GetComponent("XUILabel") as IXUILabel); + this.m_ConditionTitle = (base.transform.Find("Bg/Frame/LeftTime/shanghai").GetComponent("XUILabel") as IXUILabel); + this.m_RewardPanel = base.transform.Find("Bg/Frame/RewardDlg").gameObject; + this.m_BtnReward = (base.transform.Find("Bg/Frame/Youxiguize").GetComponent("XUIButton") as IXUIButton); + this.m_BtnSubscribe = (base.transform.Find("Bg/Frame/Subscribe").GetComponent("XUIButton") as IXUIButton); + this.m_BtnCancelSubscribe = (base.transform.Find("Bg/Frame/UnSubscribe").GetComponent("XUIButton") as IXUIButton); + this.rankInfo = base.transform.Find("Bg/GuildRankPanel/RankTpl").gameObject; + this.rankInfo.SetActive(false); + this.outofRange = base.transform.Find("Bg/GuildRankPanel/OutOfRange").gameObject; + this.outofRange.SetActive(false); + this.m_PrivilegeIcon = (base.transform.Find("Bg/tq").GetComponent("XUISprite") as IXUISprite); + this.m_PrivilegeName = (base.transform.Find("Bg/tq/t").GetComponent("XUILabel") as IXUILabel); + this.m_Privilege = (base.transform.Find("Bg/tq/p").GetComponent("XUISprite") as IXUISprite); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonBehaviour.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonBehaviour.cs.meta new file mode 100644 index 00000000..a9f1554b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1d74e729ff7feba4d9416017da656022 +timeCreated: 1611403354 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonDocument.cs new file mode 100644 index 00000000..71b8d0f7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonDocument.cs @@ -0,0 +1,545 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildDragonDocument : XDocComponent, IRankSource, IWorldBossBattleSource + { + public override uint ID + { + get + { + return XGuildDragonDocument.uuID; + } + } + + public XGuildDragonView GuildDragonView { get; set; } + + public GuildDragonChallengeResultView _GuildDragonChallengeResultView { get; set; } + + public BattleWorldBossHandler BattleHandler { get; set; } + + public bool bCanFight { get; set; } + + public uint EncourageCount + { + get + { + return this._EncourageCount; + } + } + + public XGuildDragonGuildRoleRankList GuildRankList + { + get + { + return this.m_GuildRankList; + } + } + + public XWorldBossDamageRankList PersonRankList + { + get + { + return this.m_BossDamageRankList; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildDragonDocument"); + + private uint _EncourageCount = 0u; + + public XWorldBossDamageRankHandler RankHandler; + + private XGuildDragonGuildRoleRankList m_GuildRankList = new XGuildDragonGuildRoleRankList(); + + private XWorldBossDamageRankList m_BossDamageRankList = new XWorldBossDamageRankList(); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + public static GuildBossConfigTable _GuildBossConfigReader = new GuildBossConfigTable(); + + private static GuildBossRewardTable _GuildBossRewardTableReader = new GuildBossRewardTable(); + + private static GuildBossRoleRewardTable _GuildBossRoleRewardReader = new GuildBossRoleRewardTable(); + + public List> currentRewardList = new List>(); + + public List dicRewardName = new List(); + + public List dicRewardDes = new List(); + + private GuildBossConfigTable.RowData rdCfg = null; + + private NoticeGuildBossEnd mData; + + private float fCdTime = 0f; + + private bool bStartCutScene = false; + + private bool bCountDown = false; + + private XElapseTimer CountDownTime = new XElapseTimer(); + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildDragonDocument.AsyncLoader.AddTask("Table/GuildBossConfig", XGuildDragonDocument._GuildBossConfigReader, false); + XGuildDragonDocument.AsyncLoader.AddTask("Table/GuildBossReward", XGuildDragonDocument._GuildBossRewardTableReader, false); + XGuildDragonDocument.AsyncLoader.AddTask("Table/GuildBossRoleReward", XGuildDragonDocument._GuildBossRoleRewardReader, false); + XGuildDragonDocument.AsyncLoader.Execute(callback); + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + this.bCanFight = false; + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.OnInGuildStateChanged)); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public uint GetEncourageCount(int index) + { + bool flag = index == 0; + uint result; + if (flag) + { + result = this._EncourageCount; + } + else + { + result = 0u; + } + return result; + } + + public void ReqEncourageTwo() + { + } + + protected bool OnInGuildStateChanged(XEventArgs args) + { + XInGuildStateChangedEventArgs xinGuildStateChangedEventArgs = args as XInGuildStateChangedEventArgs; + bool flag = !xinGuildStateChangedEventArgs.bIsEnter; + if (flag) + { + bool flag2 = this.GuildDragonView != null && this.GuildDragonView.IsVisible(); + if (flag2) + { + this.GuildDragonView.SetVisible(false, true); + } + this.bCanFight = false; + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildDragon, true); + } + return true; + } + + public uint GetSceneID() + { + return (uint)XSingleton.singleton.GetInt("GuildBossSceneID"); + } + + public void ReqRankData(RankeType type, bool inFight) + { + this.ReqBossRoleRank(inFight); + } + + public void ReqBossRoleRank(bool inFight) + { + RpcC2M_ClientQueryRankListNtf rpcC2M_ClientQueryRankListNtf = new RpcC2M_ClientQueryRankListNtf(); + rpcC2M_ClientQueryRankListNtf.oArg.RankType = (uint)XFastEnumIntEqualityComparer.ToInt(RankeType.GuildBossRoleRank); + rpcC2M_ClientQueryRankListNtf.oArg.TimeStamp = this.m_GuildRankList.timeStamp; + rpcC2M_ClientQueryRankListNtf.oArg.sendPunishData = (inFight ? 1u : 0u); + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + rpcC2M_ClientQueryRankListNtf.oArg.guildid = specificDocument.UID; + XSingleton.singleton.Send(rpcC2M_ClientQueryRankListNtf); + } + + public void OnGuildBossRoleRank(ClientQueryRankListRes oRes) + { + bool flag = oRes.ErrorCode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.ErrorCode, "fece00"); + } + else + { + XBaseRankList rankList = this.GetRankList((RankeType)oRes.RankType); + XRankDocument.ProcessRankListData(oRes.RankList, rankList); + XRankDocument.ProcessSelfRankData(oRes, rankList); + bool flag2 = this.GuildDragonView != null; + if (flag2) + { + this.GuildDragonView._SetMyRankFrame(rankList); + } + bool flag3 = this.GuildDragonView != null && this.GuildDragonView.IsVisible(); + if (flag3) + { + this.GuildDragonView.RefreshGuildRoleRank(); + } + bool flag4 = this.RankHandler != null && this.RankHandler.PanelObject != null && this.RankHandler.IsVisible(); + if (flag4) + { + this.RankHandler.RefreshPage(); + } + } + } + + public XBaseRankList GetRankList(RankeType type) + { + bool flag = type == RankeType.GuildBossRank; + XBaseRankList result; + if (flag) + { + result = this.m_GuildRankList; + } + else + { + bool flag2 = type == RankeType.GuildBossRoleRank; + if (flag2) + { + result = this.m_BossDamageRankList; + } + else + { + result = null; + } + } + return result; + } + + public void ReqWorldBossState() + { + RpcC2M_GetWorldBossStateNew rpcC2M_GetWorldBossStateNew = new RpcC2M_GetWorldBossStateNew(); + rpcC2M_GetWorldBossStateNew.oArg.type = 1u; + XSingleton.singleton.Send(rpcC2M_GetWorldBossStateNew); + } + + public void OnGetWorldBossLeftState(GetWorldBossStateRes oRes) + { + bool flag = this.GuildDragonView != null && this.GuildDragonView.IsVisible(); + if (flag) + { + this.GuildDragonView.SetLeftTime(oRes.TimeLeft, oRes.BossHp); + } + bool flag2 = oRes.BossHp <= 0u; + if (flag2) + { + this.bCanFight = false; + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildDragon, true); + } + } + + public void ReqBattleInfo() + { + RpcC2G_ReqGuildBossTimeLeft rpc = new RpcC2G_ReqGuildBossTimeLeft(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetBattleInfo(getguildbosstimeleftRes oRes) + { + this._EncourageCount = oRes.addAttrCount; + bool flag = this.BattleHandler != null && this.BattleHandler.active; + if (flag) + { + this.BattleHandler.SetLeftTime(oRes.timeleft); + } + } + + public void ReqEncourage() + { + RpcC2G_AddTempAttr rpcC2G_AddTempAttr = new RpcC2G_AddTempAttr(); + rpcC2G_AddTempAttr.oArg.type = 1u; + XSingleton.singleton.Send(rpcC2G_AddTempAttr); + } + + public void OnGetEncourage(AddTempAttrRes oRes) + { + bool flag = oRes.ErrorCode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.ErrorCode, "fece00"); + } + else + { + this.BattleHandler.RefreshEncourage(0); + } + } + + public void OnNotifyEncourage(uint oRes) + { + this._EncourageCount = oRes; + this.BattleHandler.RefreshEncourage(0); + } + + public void ReqGuildBossInfo() + { + RpcC2M_ReqGuildBossInfo rpc = new RpcC2M_ReqGuildBossInfo(); + XSingleton.singleton.Send(rpc); + } + + private GuildBossRoleRewardTable.RowData GetRoleRewardTableByBossID(uint bossid) + { + for (int i = 0; i < XGuildDragonDocument._GuildBossRoleRewardReader.Table.Length; i++) + { + bool flag = XGuildDragonDocument._GuildBossRoleRewardReader.Table[i].BossID == bossid; + if (flag) + { + return XGuildDragonDocument._GuildBossRoleRewardReader.Table[i]; + } + } + return null; + } + + public void OnGetGuildBossInfo(AskGuildBossInfoRes oRes) + { + bool flag = this.GuildDragonView == null || !this.GuildDragonView.IsVisible(); + if (!flag) + { + this.rdCfg = XGuildDragonDocument._GuildBossConfigReader.GetByBossID(oRes.bossId); + bool flag2 = this.rdCfg == null; + if (!flag2) + { + GuildBossRoleRewardTable.RowData roleRewardTableByBossID = this.GetRoleRewardTableByBossID(oRes.bossId); + GuildBossRewardTable.RowData byrank = XGuildDragonDocument._GuildBossRewardTableReader.GetByrank(1u); + this.currentRewardList.Clear(); + this.dicRewardName.Clear(); + this.dicRewardDes.Clear(); + int num = 0; + bool flag3 = roleRewardTableByBossID != null && roleRewardTableByBossID.prestige.Count != 0; + if (flag3) + { + this.GuildDragonView.ShowDropList(num++, XStringDefineProxy.GetString("GUILD_BOSS_HURT"), roleRewardTableByBossID.prestige[0, 0], roleRewardTableByBossID.prestige[0, 1]); + this.currentRewardList.Add(new Seq2(roleRewardTableByBossID.prestige[0, 0], roleRewardTableByBossID.prestige[0, 1])); + this.dicRewardName.Add("GUILD_BOSS_HURT"); + this.dicRewardDes.Add("GUILD_BOSS_REWARD_TYPE_HURT"); + } + bool flag4 = byrank != null && byrank.guildexp.Count != 0; + if (flag4) + { + this.GuildDragonView.ShowDropList(num++, XStringDefineProxy.GetString("GUILD_BOSS_PRE"), byrank.guildexp[0, 0], byrank.guildexp[0, 1]); + this.currentRewardList.Add(new Seq2(byrank.guildexp[0, 0], byrank.guildexp[0, 1])); + this.dicRewardName.Add("GUILD_BOSS_PRE"); + this.dicRewardDes.Add("GUILD_BOSS_REWARD_TYPE_PRE"); + } + bool isFirstKill = oRes.isFirstKill; + if (isFirstKill) + { + bool flag5 = this.rdCfg != null && this.rdCfg.FirsttKillReward.Count != 0; + if (flag5) + { + this.GuildDragonView.ShowDropList(num++, XStringDefineProxy.GetString("GUILD_BOSS_FIRSTKILL"), this.rdCfg.FirsttKillReward[0, 0], this.rdCfg.FirsttKillReward[0, 1]); + this.currentRewardList.Add(new Seq2(this.rdCfg.FirsttKillReward[0, 0], this.rdCfg.FirsttKillReward[0, 1])); + this.dicRewardName.Add("GUILD_BOSS_FIRSTKILL"); + this.dicRewardDes.Add("GUILD_BOSS_REWARD_TYPE_FIRSTKILL"); + } + } + bool flag6 = this.rdCfg != null && this.rdCfg.JoinReward.Count != 0; + if (flag6) + { + this.GuildDragonView.ShowDropList(num++, XStringDefineProxy.GetString("GUILD_BOSS_JOIN"), this.rdCfg.JoinReward[0, 0], this.rdCfg.JoinReward[0, 1]); + this.currentRewardList.Add(new Seq2(this.rdCfg.JoinReward[0, 0], this.rdCfg.JoinReward[0, 1])); + this.dicRewardName.Add("GUILD_BOSS_JOIN"); + this.dicRewardDes.Add("GUILD_BOSS_REWARD_TYPE_JOIN"); + } + bool flag7 = this.rdCfg != null && this.rdCfg.KillReward.Count != 0; + if (flag7) + { + this.GuildDragonView.ShowDropList(num++, XStringDefineProxy.GetString("GUILD_BOSS_KILL"), this.rdCfg.KillReward[0, 0], this.rdCfg.KillReward[0, 1]); + this.currentRewardList.Add(new Seq2(this.rdCfg.KillReward[0, 0], this.rdCfg.KillReward[0, 1])); + this.dicRewardName.Add("GUILD_BOSS_KILL"); + this.dicRewardDes.Add("GUILD_BOSS_REWARD_TYPE_KILL"); + } + for (int i = num; i < 5; i++) + { + this.GuildDragonView.ShowDropList(i, null, uint.MaxValue, uint.MaxValue); + } + AuctionHouseDocument specificDocument = XDocuments.GetSpecificDocument(AuctionHouseDocument.uuID); + List guildAuctReward = specificDocument.GetGuildAuctReward(AuctionActType.GuildBoss); + bool flag8 = guildAuctReward.Count > 0; + if (flag8) + { + uint[] rewardShow = guildAuctReward[0].RewardShow; + bool flag9 = rewardShow != null; + if (flag9) + { + for (int j = 0; j < rewardShow.Length; j++) + { + this.currentRewardList.Add(new Seq2(rewardShow[j], 0u)); + string item = string.Format("GUILD_BOSS_AUCTREWARD_{0}", rewardShow[j]); + this.dicRewardName.Add(item); + string item2 = string.Format("GUILD_BOSS_AUCTREWARD_{0}_DESC", rewardShow[j]); + this.dicRewardDes.Add(item2); + } + } + } + this.GuildDragonView.ShowCurrentBoss(oRes, this.rdCfg.BossName, this.rdCfg.EnemyID, oRes.needguildlvl); + bool flag10 = oRes.needguildlvl == 0u || oRes.needKillBossId == 0u; + if (flag10) + { + this.GuildDragonView.ShowCurrentBoss(oRes, this.rdCfg.BossName, this.rdCfg.EnemyID, oRes.needguildlvl); + } + } + } + } + + public void GetWorldBossTime(ref int startTime, ref int endTime) + { + XActivityDocument doc = XActivityDocument.Doc; + for (int i = 0; i < doc.MulActivityTable.Table.Length; i++) + { + bool flag = doc.MulActivityTable.Table[i].SystemID == XFastEnumIntEqualityComparer.ToInt(XSysDefine.XSys_GuildDragon); + if (flag) + { + SeqListRef openDayTime = doc.MulActivityTable.Table[i].OpenDayTime; + bool flag2 = openDayTime.Count > 0; + if (flag2) + { + startTime = (int)openDayTime[0, 0]; + endTime = (int)openDayTime[0, 1]; + } + } + } + } + + public void DragonChallengeResult(NoticeGuildBossEnd data) + { + this.mData = data; + this.ShowChallengeResult(); + } + + public void GuildBossTimeOut() + { + this.mData = new NoticeGuildBossEnd(); + this.mData.isWin = false; + this.StartCutScene(this.rdCfg.WinCutScene); + } + + public void ShowChallengeResult() + { + bool flag = this.mData != null && this.mData.isWin; + if (flag) + { + DlgBase.singleton.SetVisible(true, true); + this.StartCountDown(); + } + else + { + bool flag2 = this.rdCfg != null; + if (flag2) + { + this.StartCutScene(this.rdCfg.WinCutScene); + } + } + } + + public void ReqEnterScene() + { + bool flag = Time.realtimeSinceStartup - this.fCdTime < 1f; + if (!flag) + { + PtcC2G_EnterSceneReq ptcC2G_EnterSceneReq = new PtcC2G_EnterSceneReq(); + ptcC2G_EnterSceneReq.Data.sceneID = this.GetSceneID(); + XSingleton.singleton.Send(ptcC2G_EnterSceneReq); + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildDragon, true); + this.fCdTime = Time.realtimeSinceStartup; + } + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_GUILD_BOSS; + if (flag) + { + this.BattleHandler.RefreshEncourage(); + } + } + + public void ReqQutiScene() + { + XSingleton.singleton.ReqLeaveScene(); + } + + public override void Update(float fDeltaT) + { + this.UpdateCutScene(); + } + + public void StartCutScene(string bossWinCutScene) + { + this.bStartCutScene = true; + XSingleton.singleton.Start("CutScene/" + bossWinCutScene, true, true); + } + + private void UpdateCutScene() + { + bool flag = !this.bStartCutScene; + if (!flag) + { + bool flag2 = !XSingleton.singleton.IsPlaying; + if (flag2) + { + this.bStartCutScene = false; + DlgBase.singleton.SetVisible(true, true); + this.StartCountDown(); + } + } + } + + public void StartCountDown() + { + this.bCountDown = true; + bool isWin = this.mData.isWin; + if (isWin) + { + this._GuildDragonChallengeResultView.uiBehaviour.m_Desription.SetText(XStringDefineProxy.GetString("GUILD_BOSS_CHANGGLE_DES_WIN")); + } + else + { + this._GuildDragonChallengeResultView.uiBehaviour.m_Desription.SetText(XStringDefineProxy.GetString("GUILD_BOSS_CHANGGLE_DES_FAILED")); + } + this.CountDownTime.LeftTime = 5f; + } + + private void UpdateCountDown() + { + bool flag = !this.bCountDown; + if (!flag) + { + this.CountDownTime.Update(); + int num = (int)this.CountDownTime.LeftTime; + bool flag2 = num <= 0; + if (flag2) + { + this.bCountDown = false; + this.CountDownTime.LeftTime = 5f; + this.ReqQutiScene(); + } + else + { + bool flag3 = this._GuildDragonChallengeResultView != null && this._GuildDragonChallengeResultView.IsLoaded(); + if (flag3) + { + this._GuildDragonChallengeResultView.uiBehaviour.m_Time.SetText(XStringDefineProxy.GetString("GUILD_BOSS_CHANGGLE_COUNTDOWN", new object[] + { + num + })); + } + } + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonDocument.cs.meta new file mode 100644 index 00000000..ed3ed530 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b985d1f6e5d7fd042ae30a26be5b0aa6 +timeCreated: 1611404410 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankInfo.cs new file mode 100644 index 00000000..2d09c92d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankInfo.cs @@ -0,0 +1,44 @@ +using System; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + public class XGuildDragonGuildRankInfo : XBaseRankInfo + { + public uint time; + + private string _value; + + public override void ProcessData(RankData data) + { + this.name = data.RoleName; + this.formatname = XTitleDocument.GetTitleWithFormat(data.titleID, data.RoleName); + this.id = data.RoleId; + this.rank = data.Rank; + this.value = (ulong)data.damage; + this.time = data.time; + bool flag = this.time == uint.MaxValue; + if (flag) + { + this._value = XStringDefineProxy.GetString("RANK_DAMAGE", new object[] + { + XSingleton.singleton.NumberFormat(this.value) + }); + } + else + { + this._value = XStringDefineProxy.GetString("RANK_KILL", new object[] + { + XSingleton.singleton.TimeDuarationFormatString((int)this.time, 5) + }); + } + } + + public override string GetValue() + { + return this._value; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankInfo.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankInfo.cs.meta new file mode 100644 index 00000000..ff97ee62 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: faf84a5b3b3060b4bad715152b4663a7 +timeCreated: 1611404929 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankList.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankList.cs new file mode 100644 index 00000000..39f7b43a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankList.cs @@ -0,0 +1,17 @@ +using System; + +namespace XMainClient +{ + public class XGuildDragonGuildRankList : XBaseRankList + { + public XGuildDragonGuildRankList() + { + this.type = XRankType.GuildBossRank; + } + + public override XBaseRankInfo CreateNewInfo() + { + return new XGuildDragonGuildRankInfo(); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankList.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankList.cs.meta new file mode 100644 index 00000000..2bc5762b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRankList.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b4cd3796f98de1b45aabf07216db4916 +timeCreated: 1611404393 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankInfo.cs new file mode 100644 index 00000000..31036cd5 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankInfo.cs @@ -0,0 +1,44 @@ +using System; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + public class XGuildDragonGuildRoleRankInfo : XBaseRankInfo + { + public uint time; + + private string _value; + + public override void ProcessData(RankData data) + { + this.name = data.RoleName; + this.formatname = XTitleDocument.GetTitleWithFormat(data.titleID, data.RoleName); + this.id = data.RoleId; + this.rank = data.Rank; + this.value = (ulong)data.damage; + this.time = data.time; + bool flag = this.time == uint.MaxValue; + if (flag) + { + this._value = XStringDefineProxy.GetString("RANK_DAMAGE", new object[] + { + XSingleton.singleton.NumberFormat(this.value) + }); + } + else + { + this._value = XStringDefineProxy.GetString("RANK_KILL", new object[] + { + XSingleton.singleton.TimeDuarationFormatString((int)this.time, 5) + }); + } + } + + public override string GetValue() + { + return this._value; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankInfo.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankInfo.cs.meta new file mode 100644 index 00000000..40d51b50 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fed8f1d2db54a024b986080ac2266fa4 +timeCreated: 1611404943 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankList.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankList.cs new file mode 100644 index 00000000..02571935 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankList.cs @@ -0,0 +1,17 @@ +using System; + +namespace XMainClient +{ + public class XGuildDragonGuildRoleRankList : XBaseRankList + { + public XGuildDragonGuildRoleRankList() + { + this.type = XRankType.GuildBossRoleRank; + } + + public override XBaseRankInfo CreateNewInfo() + { + return new XGuildDragonGuildRoleRankInfo(); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankList.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankList.cs.meta new file mode 100644 index 00000000..ee20e11f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildDragonGuildRoleRankList.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 024ffb8dad69e7042a42cac85fdacd1b +timeCreated: 1611402956 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffBehavior.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffBehavior.cs new file mode 100644 index 00000000..3a915f60 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffBehavior.cs @@ -0,0 +1,74 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildGrowthBuffBehavior : DlgBehaviourBase + { + public IXUIButton CloseBtn; + + public IXUIButton HelpBtn; + + public IXUISprite m_DetailBuffIcon; + + public IXUILabel m_DetailBuffName; + + public IXUILabel m_DetailMaxLevel; + + public IXUILabel m_DetailCurrLevel; + + public IXUILabel m_DetailNextLevel; + + public IXUILabel m_DetailCurrKeepCost; + + public IXUISprite m_DetailCostArrow; + + public IXUILabel m_DetailNextKeepCost; + + public IXUILabel m_NextAttrText; + + public IXUILabelSymbol m_DetailCost; + + public IXUIButton LevelUpBtn; + + public IXUILabel LevelUpText; + + public Transform m_levelUpFx; + + public IXUIScrollView ScrollView; + + public XUIPool BuffItemPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public IXUILabel m_PointLeft; + + public IXUISprite m_PointClick; + + private void Awake() + { + this.CloseBtn = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.HelpBtn = (base.transform.Find("Bg/Help").GetComponent("XUIButton") as IXUIButton); + this.m_DetailBuffIcon = (base.transform.Find("Bg/Detail/Icon").GetComponent("XUISprite") as IXUISprite); + this.m_DetailBuffName = (base.transform.Find("Bg/Detail/Name").GetComponent("XUILabel") as IXUILabel); + this.m_DetailMaxLevel = (base.transform.Find("Bg/Detail/MaxLevel/Num").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCurrLevel = (base.transform.Find("Bg/Detail/CurrentLevel").GetComponent("XUILabel") as IXUILabel); + this.m_DetailNextLevel = (base.transform.Find("Bg/Detail/CurrentLevel/NextLevel").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCurrKeepCost = (base.transform.Find("Bg/Detail/CurrentAttr").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCostArrow = (base.transform.Find("Bg/Detail/CurrentAttr/P").GetComponent("XUISprite") as IXUISprite); + this.m_DetailNextKeepCost = (base.transform.Find("Bg/Detail/CurrentAttr/NextAttr").GetComponent("XUILabel") as IXUILabel); + this.m_NextAttrText = (base.transform.Find("Bg/Detail/NextText").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCost = (base.transform.Find("Bg/Detail/Cost").GetComponent("XUILabelSymbol") as IXUILabelSymbol); + this.LevelUpBtn = (base.transform.Find("Bg/Detail/Levelup").GetComponent("XUIButton") as IXUIButton); + this.LevelUpText = (base.transform.Find("Bg/Detail/Levelup/Text").GetComponent("XUILabel") as IXUILabel); + this.m_levelUpFx = base.transform.Find("Bg/SkillList/effect"); + this.m_levelUpFx.gameObject.SetActive(false); + this.ScrollView = (base.transform.Find("Bg/SkillList").GetComponent("XUIScrollView") as IXUIScrollView); + GameObject gameObject = base.transform.Find("Bg/SkillList/SkillTpl").gameObject; + this.BuffItemPool.SetupPool(gameObject.transform.parent.gameObject, gameObject, 10u, false); + this.m_PointLeft = (base.transform.Find("Bg/Point/value").GetComponent("XUILabel") as IXUILabel); + this.m_PointClick = (base.transform.Find("Bg/Point/P").GetComponent("XUISprite") as IXUISprite); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffBehavior.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffBehavior.cs.meta new file mode 100644 index 00000000..b0048135 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffBehavior.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6e75f0f337da45a47a73ea750cee35ef +timeCreated: 1611403905 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffView.cs new file mode 100644 index 00000000..891098ce --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffView.cs @@ -0,0 +1,266 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildGrowthBuffView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildGrowth/GuildGrowthBuffDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override int sysid + { + get + { + return XFastEnumIntEqualityComparer.ToInt(XSysDefine.XSys_GuildGrowthBuff); + } + } + + private XGuildGrowthDocument _doc; + + private XGuildDocument _guildDoc; + + private int _currSelectID = 0; + + public int ShowLevelUpFx = -1; + + protected override void Init() + { + this._doc = XDocuments.GetSpecificDocument(XGuildGrowthDocument.uuID); + this._guildDoc = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + } + + private bool OnClose(IXUIButton button) + { + this.SetVisible(false, true); + return false; + } + + private void OnPointClick(IXUISprite iSp) + { + XSingleton.singleton.ShowItemAccess(34, null); + } + + private bool OnHelpBtnClick(IXUIButton btn) + { + DlgBase.singleton.ShowHelp(XSysDefine.XSys_GuildGrowthBuff); + return true; + } + + protected override void OnHide() + { + base.uiBehaviour.m_levelUpFx.gameObject.SetActive(false); + base.OnHide(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + public override void RegisterEvent() + { + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClose)); + base.uiBehaviour.HelpBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHelpBtnClick)); + base.uiBehaviour.LevelUpBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnLevelUpBtnClick)); + base.uiBehaviour.m_PointClick.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnPointClick)); + } + + protected override void OnShow() + { + this._currSelectID = 1; + this.RefreshList(false); + } + + private bool OnCheckBoxClick(IXUICheckBox icb) + { + bool flag = !icb.bChecked; + bool result; + if (flag) + { + result = false; + } + else + { + this._currSelectID = (int)icb.ID; + this.RefreshDetail(); + result = true; + } + return result; + } + + private bool OnLevelUpBtnClick(IXUIButton btn) + { + GuildHall.RowData data = this._doc.GetData(this._doc.BuffList[this._currSelectID].BuffID, this._doc.BuffList[this._currSelectID].BuffLevel + 1u); + bool flag = data == null; + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = this._guildDoc.Level < data.glevel; + if (flag2) + { + XSingleton.singleton.ShowSystemTip(string.Format(XStringDefineProxy.GetString("GuildGrowthHallGuildLevelNeedShow"), data.glevel), "fece00"); + result = false; + } + else + { + bool flag3 = !this._doc.LevelUpEnable; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GuildGrowthAuthorityFail"), "fece00"); + result = false; + } + else + { + this._doc.QueryGuildHallBuffLevelUp(this._doc.BuffList[this._currSelectID].BuffID); + result = true; + } + } + } + return result; + } + + public void RefreshList(bool forceRefreshDetail = false) + { + base.uiBehaviour.BuffItemPool.ReturnAll(false); + Vector3 tplPos = base.uiBehaviour.BuffItemPool.TplPos; + int num = 0; + IXUICheckBox ixuicheckBox = null; + for (int i = 1; i < this._doc.BuffList.Count; i++) + { + GuildHall.RowData data = this._doc.GetData(this._doc.BuffList[i].BuffID, this._doc.BuffList[i].BuffLevel); + bool flag = data == null; + if (!flag) + { + GameObject gameObject = base.uiBehaviour.BuffItemPool.FetchGameObject(false); + gameObject.transform.localPosition = tplPos + new Vector3((float)(num % 2 * base.uiBehaviour.BuffItemPool.TplWidth), (float)(-(float)(num / 2) * base.uiBehaviour.BuffItemPool.TplHeight)); + IXUILabel ixuilabel = gameObject.transform.Find("Level").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel2 = gameObject.transform.Find("Name").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel3 = gameObject.transform.Find("Attr").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + bool flag2 = (long)this.ShowLevelUpFx == (long)((ulong)this._doc.BuffList[i].BuffID); + if (flag2) + { + base.uiBehaviour.m_levelUpFx.position = ixuisprite.transform.position; + base.uiBehaviour.m_levelUpFx.gameObject.SetActive(false); + base.uiBehaviour.m_levelUpFx.gameObject.SetActive(true); + this.ShowLevelUpFx = -1; + } + IXUICheckBox ixuicheckBox2 = gameObject.GetComponent("XUICheckBox") as IXUICheckBox; + ixuicheckBox2.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnCheckBoxClick)); + ixuicheckBox2.ID = (ulong)i; + bool flag3 = i == this._currSelectID; + if (flag3) + { + ixuicheckBox = ixuicheckBox2; + } + ixuilabel.SetText(string.Format("{0}/{1}", this._doc.BuffList[i].BuffLevel, this._doc.BuffList[i].BuffMaxLevel)); + ixuilabel2.SetText(data.name); + ixuilabel3.SetText(data.currentLevelDescription); + ixuisprite.SetSprite(data.icon, data.atlas, false); + num++; + } + } + bool flag4 = ixuicheckBox != null; + if (flag4) + { + ixuicheckBox.bChecked = true; + } + base.uiBehaviour.m_PointLeft.SetText(this._doc.ResourcesPoint.ToString()); + if (forceRefreshDetail) + { + this.RefreshDetail(); + } + } + + public void RefreshDetail() + { + XSingleton.singleton.AddLog(this._currSelectID.ToString(), null, null, null, null, null, XDebugColor.XDebug_None); + bool flag = this._doc.BuffList[this._currSelectID].BuffLevel == this._doc.BuffList[this._currSelectID].BuffMaxLevel; + GuildHall.RowData data = this._doc.GetData(this._doc.BuffList[this._currSelectID].BuffID, this._doc.BuffList[this._currSelectID].BuffLevel); + GuildHall.RowData rowData = flag ? null : this._doc.GetData(this._doc.BuffList[this._currSelectID].BuffID, this._doc.BuffList[this._currSelectID].BuffLevel + 1u); + base.uiBehaviour.m_DetailBuffIcon.SetSprite(data.icon, data.atlas, false); + base.uiBehaviour.m_DetailBuffName.SetText(data.name); + base.uiBehaviour.m_DetailMaxLevel.SetText(this._doc.BuffList[this._currSelectID].BuffMaxLevel.ToString()); + bool flag2 = flag; + if (flag2) + { + base.uiBehaviour.m_DetailCurrLevel.SetVisible(false); + base.uiBehaviour.m_DetailCostArrow.SetVisible(false); + base.uiBehaviour.m_DetailCurrKeepCost.SetText(XStringDefineProxy.GetString("GuildGrowthHallCost")); + base.uiBehaviour.m_DetailNextKeepCost.SetText(data.dailyneed.ToString()); + base.uiBehaviour.m_NextAttrText.SetText(XStringDefineProxy.GetString("GuildGrowthTextMax")); + base.uiBehaviour.m_DetailCost.InputText = "0"; + base.uiBehaviour.LevelUpBtn.SetEnable(false, false); + base.uiBehaviour.LevelUpText.SetText(XStringDefineProxy.GetString("GuildGrowthHallMaxLevel")); + } + else + { + base.uiBehaviour.m_DetailCurrLevel.SetVisible(true); + base.uiBehaviour.m_DetailCostArrow.SetVisible(true); + base.uiBehaviour.m_DetailCurrLevel.SetText(string.Format("{0} {1}", XStringDefineProxy.GetString("GuildGrowthHallLevel"), this._doc.BuffList[this._currSelectID].BuffLevel)); + base.uiBehaviour.m_DetailNextLevel.SetText((this._doc.BuffList[this._currSelectID].BuffLevel + 1u).ToString()); + base.uiBehaviour.m_DetailCurrKeepCost.SetText(string.Format("{0} {1}", XStringDefineProxy.GetString("GuildGrowthHallCost"), data.dailyneed)); + base.uiBehaviour.m_DetailNextKeepCost.SetText(rowData.dailyneed.ToString()); + base.uiBehaviour.m_NextAttrText.SetText(string.Format(XStringDefineProxy.GetString("GuildGrowthNextText"), rowData.currentLevelDescription)); + base.uiBehaviour.m_DetailCost.InputText = string.Format("{0}{1}{2}", (this._doc.ResourcesPoint >= rowData.updateneed) ? "" : "[e60012]", XLabelSymbolHelper.FormatSmallIcon(34), rowData.updateneed); + base.uiBehaviour.LevelUpBtn.SetEnable(true, false); + base.uiBehaviour.LevelUpBtn.SetGrey(this._guildDoc.Level >= rowData.glevel); + base.uiBehaviour.LevelUpText.SetText(XStringDefineProxy.GetString((this._guildDoc.Level >= rowData.glevel) ? "GuildGrowthHallLevelUp" : "GuildGrowthHallGuildLevelNeed")); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffView.cs.meta new file mode 100644 index 00000000..3d4e7b9d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuffView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0eb3b00c95a67de4b98fe17e4225d400 +timeCreated: 1611403205 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildBehavior.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildBehavior.cs new file mode 100644 index 00000000..93bdd319 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildBehavior.cs @@ -0,0 +1,92 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildGrowthBuildBehavior : DlgBehaviourBase + { + public IXUIButton CloseBtn; + + public IXUIButton HelpBtn; + + public Transform m_MyRankTs; + + public IXUIWrapContent m_RankWrapContent; + + public IXUIScrollView m_RankScrollView; + + public IXUILabel m_ProgressNum; + + public IXUIProgress m_Progress; + + public Transform Tag1; + + public IXUILabel Tag1Num; + + public IXUISprite Tag1Click; + + public Transform Tag2; + + public IXUILabel Tag2Num; + + public IXUISprite Tag2Click; + + public IXUILabel m_WeekNumShow; + + public float allDepth; + + public float startX; + + public IXUILabel HuntText; + + public IXUILabel DonateText; + + public IXUISprite HuntTips; + + public IXUISprite DonateTips; + + public IXUIButton HuntBtn; + + public IXUIButton DonateBtn; + + public IXUILabel HuntTimes; + + public IXUILabel DonateTimes; + + public GameObject HuntRedPoint; + + public GameObject DonateRedPoint; + + private void Awake() + { + this.CloseBtn = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.HelpBtn = (base.transform.Find("Bg/Help").GetComponent("XUIButton") as IXUIButton); + this.m_MyRankTs = base.transform.Find("Bg/BuildRank/MyRank"); + this.m_RankWrapContent = (base.transform.Find("Bg/BuildRank/ScrollView/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.m_RankScrollView = (base.transform.Find("Bg/BuildRank/ScrollView").GetComponent("XUIScrollView") as IXUIScrollView); + this.m_ProgressNum = (base.transform.Find("Bg/BossTexture/num").GetComponent("XUILabel") as IXUILabel); + this.m_Progress = (base.transform.Find("Bg/BossTexture/Progress").GetComponent("XUIProgress") as IXUIProgress); + this.Tag1 = base.transform.Find("Bg/BossTexture/Kd1"); + this.Tag1Num = (this.Tag1.transform.Find("Daytpl/num").GetComponent("XUILabel") as IXUILabel); + this.Tag1Click = (this.Tag1.transform.Find("Daytpl").GetComponent("XUISprite") as IXUISprite); + this.Tag2 = base.transform.Find("Bg/BossTexture/Kd2"); + this.Tag2Num = (this.Tag2.transform.Find("Daytpl/num").GetComponent("XUILabel") as IXUILabel); + this.Tag2Click = (this.Tag2.transform.Find("Daytpl").GetComponent("XUISprite") as IXUISprite); + this.allDepth = this.Tag2.localPosition.x - this.Tag1.localPosition.x; + this.startX = this.Tag1.localPosition.x; + this.m_WeekNumShow = (base.transform.Find("Bg/BossTexture/t").GetComponent("XUILabel") as IXUILabel); + this.HuntText = (base.transform.Find("Bg/Go1/label").GetComponent("XUILabel") as IXUILabel); + this.DonateText = (base.transform.Find("Bg/Go2/label").GetComponent("XUILabel") as IXUILabel); + this.HuntTips = (base.transform.Find("Bg/Go1/Help").GetComponent("XUISprite") as IXUISprite); + this.DonateTips = (base.transform.Find("Bg/Go2/Help").GetComponent("XUISprite") as IXUISprite); + this.HuntBtn = (base.transform.Find("Bg/Go1/BtnEnter").GetComponent("XUIButton") as IXUIButton); + this.DonateBtn = (base.transform.Find("Bg/Go2/BtnEnter").GetComponent("XUIButton") as IXUIButton); + this.HuntTimes = (base.transform.Find("Bg/Go1/num").GetComponent("XUILabel") as IXUILabel); + this.DonateTimes = (base.transform.Find("Bg/Go2/num").GetComponent("XUILabel") as IXUILabel); + this.HuntRedPoint = this.HuntBtn.gameObject.transform.Find("RedPoint").gameObject; + this.DonateRedPoint = this.DonateBtn.gameObject.transform.Find("RedPoint").gameObject; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildBehavior.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildBehavior.cs.meta new file mode 100644 index 00000000..f98b2c13 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildBehavior.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b65770b5a791068438849dd7fe0c6ee5 +timeCreated: 1611404397 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildView.cs new file mode 100644 index 00000000..a20ea2f4 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildView.cs @@ -0,0 +1,259 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildGrowthBuildView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildGrowth/GuildGrowthBuildDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + private XGuildGrowthDocument _doc; + + private XGuildDocument _guildDoc; + + protected override void Init() + { + this._doc = XDocuments.GetSpecificDocument(XGuildGrowthDocument.uuID); + this._guildDoc = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + } + + protected override void OnHide() + { + base.OnHide(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + public override void RegisterEvent() + { + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClick)); + base.uiBehaviour.HelpBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHelpBtnClick)); + base.uiBehaviour.m_RankWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.WrapListUpdated)); + base.uiBehaviour.HuntTips.ID = 825UL; + base.uiBehaviour.HuntTips.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnHelpClick)); + base.uiBehaviour.DonateTips.ID = 826UL; + base.uiBehaviour.DonateTips.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnHelpClick)); + base.uiBehaviour.HuntBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHuntClick)); + base.uiBehaviour.DonateBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnDonateClick)); + base.uiBehaviour.Tag1Click.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnTagClickTip1)); + base.uiBehaviour.Tag2Click.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnTagClickTip2)); + } + + protected override void OnShow() + { + base.OnShow(); + this._doc.QueryBuildRank(); + this.RefreshRank(); + } + + public override void StackRefresh() + { + base.StackRefresh(); + this._doc.QueryBuildRank(); + this.RefreshRank(); + } + + private bool OnCloseClick(IXUIButton button) + { + this.SetVisible(false, true); + return false; + } + + private bool OnHelpBtnClick(IXUIButton btn) + { + DlgBase.singleton.ShowHelp(XSysDefine.XSys_GuildLab_Build); + return true; + } + + private void OnHelpClick(IXUISprite iSp) + { + DlgBase.singleton.ShowHelp((XSysDefine)iSp.ID); + } + + public bool OnDonateClick(IXUIButton btn) + { + DlgBase.singleton.DonateType = GuildDonateType.GrowthDonate; + DlgBase.singleton.SetVisible(true, true); + return true; + } + + public void OnTagClickTip1(IXUISprite iSp) + { + GuildConfigTable.RowData dataByLevel = XGuildDocument.GuildConfig.GetDataByLevel(this._guildDoc.Level); + bool flag = dataByLevel == null; + if (flag) + { + XSingleton.singleton.AddErrorLog("can't find guild data form guildconfig, level = ", this._guildDoc.Level.ToString(), null, null, null, null); + } + else + { + string label = string.Format(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("GuildGrowthTagTips1")), dataByLevel.JZSalaryOpen); + XSingleton.singleton.ShowModalDialog(label, XStringDefineProxy.GetString("COMMON_OK")); + } + } + + public void OnTagClickTip2(IXUISprite iSp) + { + GuildConfigTable.RowData dataByLevel = XGuildDocument.GuildConfig.GetDataByLevel(this._guildDoc.Level); + bool flag = dataByLevel == null; + if (flag) + { + XSingleton.singleton.AddErrorLog("can't find guild data form guildconfig, level = ", this._guildDoc.Level.ToString(), null, null, null, null); + } + else + { + string label = string.Format(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("GuildGrowthTagTips2")), dataByLevel.JZSaleOpen); + XSingleton.singleton.ShowModalDialog(label, XStringDefineProxy.GetString("COMMON_OK")); + } + } + + public bool OnHuntClick(IXUIButton btn) + { + bool flag = XSingleton.singleton.SceneID == 4u; + if (flag) + { + this.SetVisible(false, true); + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetVisible(false, true); + } + this._doc.FindNpc(); + } + else + { + this._doc.AutoFindNpc = true; + this._guildDoc.TryEnterGuildScene(); + } + return true; + } + + public void RefreshRank() + { + bool flag = this._doc.RankList.Count == 0; + if (!flag) + { + this.SetRankTpl(base.uiBehaviour.m_MyRankTs, 0, true); + base.uiBehaviour.m_RankWrapContent.SetContentCount(this._doc.RankList.Count, false); + base.uiBehaviour.m_RankScrollView.ResetPosition(); + GuildConfigTable.RowData dataByLevel = XGuildDocument.GuildConfig.GetDataByLevel(this._guildDoc.Level); + bool flag2 = dataByLevel == null; + if (flag2) + { + XSingleton.singleton.AddErrorLog("can't find guild data form guildconfig, level = ", this._guildDoc.Level.ToString(), null, null, null, null); + } + else + { + float num = dataByLevel.JZHallTotalmax + dataByLevel.JZSchoolTotalMax; + base.uiBehaviour.m_ProgressNum.SetText(string.Format("{0}/{1}", this._doc.WeekHallPoint + this._doc.WeekSchoolPoint, dataByLevel.JZHallTotalmax + dataByLevel.JZSchoolTotalMax)); + base.uiBehaviour.m_Progress.value = (this._doc.WeekHallPoint + this._doc.WeekSchoolPoint) / num; + float y = base.uiBehaviour.Tag2.localPosition.y; + base.uiBehaviour.Tag1.transform.localPosition = new Vector3(base.uiBehaviour.startX + base.uiBehaviour.allDepth * dataByLevel.JZSalaryOpen / num, y); + base.uiBehaviour.Tag2.transform.localPosition = new Vector3(base.uiBehaviour.startX + base.uiBehaviour.allDepth * dataByLevel.JZSaleOpen / num, y); + base.uiBehaviour.Tag1Num.SetText(string.Format("{0:F1}{1}", dataByLevel.JZSalaryOpen / 10000f, XStringDefineProxy.GetString("NumberSeparator0"))); + base.uiBehaviour.Tag2Num.SetText(string.Format("{0:F1}{1}", dataByLevel.JZSaleOpen / 10000f, XStringDefineProxy.GetString("NumberSeparator0"))); + base.uiBehaviour.m_WeekNumShow.SetText(string.Format(XStringDefineProxy.GetString("GuildGrowthMyNum"), this._doc.MyData.HallPoint + this._doc.MyData.SchoolPoint)); + base.uiBehaviour.HuntText.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("GuildGrowthHuntTips"))); + base.uiBehaviour.DonateText.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("GuildGrowthDonateTips"))); + int @int = XSingleton.singleton.GetInt("GuildJZHuntMaxCount"); + int int2 = XSingleton.singleton.GetInt("GuildJZDonateMaxCount"); + base.uiBehaviour.HuntTimes.SetText(string.Format("{0}/{1}", this._doc.WeekHuntTimes, @int)); + base.uiBehaviour.DonateTimes.SetText(string.Format("{0}/{1}", this._doc.WeekDonateTimes, int2)); + base.uiBehaviour.HuntRedPoint.SetActive((ulong)this._doc.WeekHuntTimes < (ulong)((long)@int)); + base.uiBehaviour.DonateRedPoint.SetActive((ulong)this._doc.WeekDonateTimes < (ulong)((long)int2)); + } + } + } + + public void WrapListUpdated(Transform t, int index) + { + bool flag = index < 0 || index >= this._doc.RankList.Count; + if (!flag) + { + this.SetRankTpl(t, index, false); + } + } + + public void SetRankTpl(Transform t, int index, bool isMy) + { + XGuildGrowthDocument.GuildGrowthRankData guildGrowthRankData = isMy ? this._doc.MyData : this._doc.RankList[index]; + IXUILabel ixuilabel = t.Find("Rank3").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = t.Find("Rank").GetComponent("XUISprite") as IXUISprite; + IXUILabel ixuilabel2 = t.Find("Name").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel3 = t.Find("Point").GetComponent("XUILabel") as IXUILabel; + int num = isMy ? this._doc.MyRank : index; + bool flag = num < 3; + if (flag) + { + ixuisprite.SetVisible(true); + ixuilabel.SetVisible(false); + ixuisprite.spriteName = string.Format("N{0}", num + 1); + } + else + { + ixuisprite.SetVisible(false); + ixuilabel.SetVisible(true); + ixuilabel.SetText(string.Format("No.{0}", num + 1)); + } + bool flag2 = !isMy; + if (flag2) + { + ixuilabel2.SetText(guildGrowthRankData.Name); + } + ixuilabel3.SetText((guildGrowthRankData.HallPoint + guildGrowthRankData.SchoolPoint).ToString()); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildView.cs.meta new file mode 100644 index 00000000..956151e9 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthBuildView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8ebbc9ab0847d1c4c9fa7661c6afe6be +timeCreated: 1611404130 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDocument.cs new file mode 100644 index 00000000..777d99d8 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDocument.cs @@ -0,0 +1,431 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildGrowthDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildGrowthDocument.uuID; + } + } + + public GuildZiCai GuildZiCaiTableReader + { + get + { + return XGuildGrowthDocument._guildZiCaiTable; + } + } + + public List BuffList + { + get + { + return XGuildGrowthDocument._buffList; + } + } + + public List RankList + { + get + { + return this._rankList; + } + } + + public List RecordList + { + get + { + return this._recordList; + } + } + + public XGuildGrowthDocument.GuildGrowthRankData MyData + { + get + { + return this._myData; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildGrowthDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private static GuildHall _guildHallTable = new GuildHall(); + + private static GuildZiCai _guildZiCaiTable = new GuildZiCai(); + + private static Dictionary _buffDict = new Dictionary(); + + private static readonly uint INTERVALNUM = 10000u; + + public bool LevelUpEnable = false; + + public bool AutoFindNpc = false; + + private static List _buffList = new List(); + + private List _rankList = new List(); + + private List _recordList = new List(); + + private XGuildGrowthDocument.GuildGrowthRankData _myData; + + public int MyRank; + + public uint WeekHallPoint; + + public uint WeekSchoolPoint; + + public uint WeekHuntTimes; + + public uint WeekDonateTimes; + + public uint ResourcesPoint; + + public uint TechnologyPoint; + + public uint ResDeltaPoint = 0u; + + public uint TecDeltaPoint = 0u; + + public class GuildGrowthBuffData + { + public uint BuffID; + + public uint BuffLevel; + + public uint BuffMaxLevel; + + public bool Enable; + + public GuildGrowthBuffData(uint id, uint level, uint maxLevel, bool enable) + { + this.BuffID = id; + this.BuffLevel = level; + this.BuffMaxLevel = maxLevel; + this.Enable = enable; + } + } + + public class GuildGrowthRankData + { + public string Name; + + public ulong Uid; + + public uint HallPoint; + + public uint SchoolPoint; + + public GuildGrowthRankData(string name, ulong uid, uint hallPoint, uint schoolPoint) + { + this.Name = name; + this.Uid = uid; + this.HallPoint = hallPoint; + this.SchoolPoint = schoolPoint; + } + } + + public class GuildCrowthRecordData + { + public string Name; + + public uint ItemID; + + public uint Time; + + public GuildCrowthRecordData(string name, uint itemID, uint time) + { + this.Name = name; + this.ItemID = itemID; + this.Time = time; + } + } + + public void SetPoint(uint resources, uint technology) + { + this.ResourcesPoint = resources; + this.TechnologyPoint = technology; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshList(false); + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshList(false); + } + } + + public void CheckShowItemGet(uint resDelta, uint tecDelta) + { + this.ResDeltaPoint += resDelta; + this.TecDeltaPoint += tecDelta; + this.ShowDeltaPointGet(); + } + + public void ShowDeltaPointGet() + { + bool flag = XSingleton.singleton.CurrentStage.Stage != EXStage.Hall; + if (!flag) + { + bool flag2 = this.ResDeltaPoint > 0u; + if (flag2) + { + XSingleton.singleton.ShowSystemTip(string.Format(XStringDefineProxy.GetReplaceString("GuildGrowthResDelta", new object[0]), this.ResDeltaPoint), "fece00"); + this.ResDeltaPoint = 0u; + } + bool flag3 = this.TecDeltaPoint > 0u; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(string.Format(XStringDefineProxy.GetReplaceString("GuildGrowthTecDelta", new object[0]), this.TecDeltaPoint), "fece00"); + this.TecDeltaPoint = 0u; + } + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public override void OnEnterScene() + { + base.OnEnterScene(); + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + bool autoFindNpc = this.AutoFindNpc; + if (autoFindNpc) + { + this.AutoFindNpc = false; + bool flag = XSingleton.singleton.SceneID == 4u; + if (flag) + { + this.FindNpc(); + } + } + this.ShowDeltaPointGet(); + } + + public void FindNpc() + { + XNpc npc = XSingleton.singleton.GetNpc(19u); + bool flag = npc == null; + if (flag) + { + XSingleton.singleton.AddErrorLog("Can't find guild build npc.", null, null, null, null, null); + } + else + { + XSingleton.singleton.LastNpc = npc; + } + } + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildGrowthDocument.AsyncLoader.AddTask("Table/GuildHall", XGuildGrowthDocument._guildHallTable, false); + XGuildGrowthDocument.AsyncLoader.AddTask("Table/GuildZiCai", XGuildGrowthDocument._guildZiCaiTable, false); + XGuildGrowthDocument.AsyncLoader.Execute(callback); + } + + public static void OnTableLoaded() + { + uint num = 0u; + for (int i = 0; i < XGuildGrowthDocument._guildHallTable.Table.Length; i++) + { + bool flag = XGuildGrowthDocument._guildHallTable.Table[i].skillid > num; + if (flag) + { + num = XGuildGrowthDocument._guildHallTable.Table[i].skillid; + } + } + XGuildGrowthDocument._buffList.Clear(); + for (uint num2 = 0u; num2 <= num; num2 += 1u) + { + XGuildGrowthDocument._buffList.Add(new XGuildGrowthDocument.GuildGrowthBuffData(num2, 0u, 0u, false)); + } + XGuildGrowthDocument._buffDict.Clear(); + for (int j = 0; j < XGuildGrowthDocument._guildHallTable.Table.Length; j++) + { + GuildHall.RowData rowData = XGuildGrowthDocument._guildHallTable.Table[j]; + bool flag2 = rowData.level > XGuildGrowthDocument._buffList[(int)rowData.skillid].BuffMaxLevel; + if (flag2) + { + XGuildGrowthDocument._buffList[(int)rowData.skillid].BuffMaxLevel = rowData.level; + } + XGuildGrowthDocument._buffDict.Add(rowData.skillid * XGuildGrowthDocument.INTERVALNUM + rowData.level, rowData); + } + } + + public GuildHall.RowData GetData(uint skillID, uint skillLevel) + { + uint key = skillID * XGuildGrowthDocument.INTERVALNUM + skillLevel; + GuildHall.RowData result = null; + bool flag = !XGuildGrowthDocument._buffDict.TryGetValue(key, out result); + if (flag) + { + XSingleton.singleton.AddErrorLog("Can't find guild growth data for guildhall.txt, id = ", skillID.ToString() + " level = ", skillLevel.ToString(), null, null, null); + } + return result; + } + + public void QueryBuffList() + { + RpcC2M_GuildHallGetBuffList rpc = new RpcC2M_GuildHallGetBuffList(); + XSingleton.singleton.Send(rpc); + } + + public void OnBuffListReply(GuildHallGetBuffList_M2C oRes) + { + this.LevelUpEnable = oRes.enableUpdate; + for (int i = 0; i < XGuildGrowthDocument._buffList.Count; i++) + { + XGuildGrowthDocument._buffList[i].BuffLevel = 0u; + XGuildGrowthDocument._buffList[i].Enable = false; + } + for (int j = 0; j < oRes.bufflist.Count; j++) + { + XGuildGrowthDocument._buffList[(int)oRes.bufflist[j].buffid].BuffLevel = oRes.bufflist[j].level; + XGuildGrowthDocument._buffList[(int)oRes.bufflist[j].buffid].Enable = oRes.bufflist[j].isenable; + } + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshList(false); + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshGrowthBuffList(); + } + } + + public void QueryGuildHallBuffLevelUp(uint buffid) + { + RpcC2M_GuildHallUpdateBuff rpcC2M_GuildHallUpdateBuff = new RpcC2M_GuildHallUpdateBuff(); + rpcC2M_GuildHallUpdateBuff.oArg.buffid = buffid; + XSingleton.singleton.Send(rpcC2M_GuildHallUpdateBuff); + } + + public void OnBuffLevelUpSuccess(GuildHallBuffData data) + { + XGuildGrowthDocument._buffList[(int)data.buffid].BuffLevel = data.level; + XGuildGrowthDocument._buffList[(int)data.buffid].Enable = data.isenable; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.ShowLevelUpFx = (int)data.buffid; + DlgBase.singleton.RefreshList(true); + } + } + + public void QueryBuildRank() + { + RpcC2M_GuildSchoolHallGetRankList rpc = new RpcC2M_GuildSchoolHallGetRankList(); + XSingleton.singleton.Send(rpc); + } + + public void OnBuildRankGet(List list, uint hallPoint, uint schoolPoint, uint huntCount, uint donateCount) + { + this.WeekHallPoint = hallPoint; + this.WeekSchoolPoint = schoolPoint; + this.WeekHuntTimes = huntCount; + this.WeekDonateTimes = donateCount; + this._rankList.Clear(); + this._myData = null; + for (int i = 0; i < list.Count; i++) + { + this._rankList.Add(new XGuildGrowthDocument.GuildGrowthRankData(list[i].rolename, list[i].roleid, list[i].weeklyhallpoint, list[i].weeklyschoolpoint)); + bool flag = list[i].roleid == XSingleton.singleton.XPlayerData.RoleID; + if (flag) + { + this._myData = new XGuildGrowthDocument.GuildGrowthRankData(list[i].rolename, list[i].roleid, list[i].weeklyhallpoint, list[i].weeklyschoolpoint); + } + } + bool flag2 = this._myData == null; + if (flag2) + { + XSingleton.singleton.AddErrorLog("guild growth rank haven't my data.", null, null, null, null, null); + } + else + { + this._rankList.Sort(new Comparison(this.Compare)); + for (int j = 0; j < this._rankList.Count; j++) + { + bool flag3 = this._rankList[j].Uid == XSingleton.singleton.XPlayerData.RoleID; + if (flag3) + { + this.MyRank = j; + break; + } + } + bool flag4 = DlgBase.singleton.IsVisible(); + if (flag4) + { + DlgBase.singleton.RefreshRank(); + } + bool flag5 = DlgBase.singleton.IsVisible(); + if (flag5) + { + DlgBase.singleton.RefreshGrowthDonateTimes(); + } + } + } + + private int Compare(XGuildGrowthDocument.GuildGrowthRankData x, XGuildGrowthDocument.GuildGrowthRankData y) + { + bool flag = x.Uid == y.Uid; + int result; + if (flag) + { + result = 0; + } + else + { + result = (int)(y.HallPoint + y.SchoolPoint - x.HallPoint - x.SchoolPoint); + } + return result; + } + + public void QueryGuildGrowthDonate(uint itemid) + { + RpcC2M_GuildZiCaiDonate rpcC2M_GuildZiCaiDonate = new RpcC2M_GuildZiCaiDonate(); + rpcC2M_GuildZiCaiDonate.oArg.itemid = itemid; + XSingleton.singleton.Send(rpcC2M_GuildZiCaiDonate); + } + + public void QueryGrowthRecordList() + { + RpcC2M_GuildZiCaiDonateHistory rpc = new RpcC2M_GuildZiCaiDonateHistory(); + XSingleton.singleton.Send(rpc); + } + + public void OnGrowthRecordListGet(List list) + { + this._recordList.Clear(); + for (int i = 0; i < list.Count; i++) + { + this._recordList.Add(new XGuildGrowthDocument.GuildCrowthRecordData(list[i].rolename, list[i].itemid, list[i].time)); + } + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.CheckRecordRefresh(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDocument.cs.meta new file mode 100644 index 00000000..2f964234 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ad2059f05882bdd49aaa7d8ca201cf84 +timeCreated: 1611404334 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDonateView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDonateView.cs new file mode 100644 index 00000000..210107a9 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDonateView.cs @@ -0,0 +1,109 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildGrowthDonateView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildGrowth/GuildGrowthDonate"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + protected override void Init() + { + this.InitProperties(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + public override void RegisterEvent() + { + } + + protected override void OnShow() + { + } + + private void InitProperties() + { + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClose)); + base.uiBehaviour.RecordBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickedRecordBtn)); + base.uiBehaviour.WrapContent.RegisterItemInitEventHandler(new WrapItemInitEventHandler(this.OnInitWrapContent)); + base.uiBehaviour.WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnUpdateWrapContent)); + base.uiBehaviour.RecordWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnUpdateRecordWrapContent)); + } + + private void OnUpdateRecordWrapContent(Transform itemTransform, int index) + { + } + + private bool OnClickedRecordBtn(IXUIButton button) + { + return true; + } + + private void OnUpdateWrapContent(Transform itemTransform, int index) + { + } + + private void OnInitWrapContent(Transform itemTransform, int index) + { + } + + private bool OnClose(IXUIButton button) + { + this.SetVisible(false, true); + return true; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDonateView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDonateView.cs.meta new file mode 100644 index 00000000..a4867fab --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthDonateView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1db7614a065cc1a41bd93286569e7b25 +timeCreated: 1611403357 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthEntranceView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthEntranceView.cs new file mode 100644 index 00000000..9a35f877 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthEntranceView.cs @@ -0,0 +1,110 @@ +using System; +using UILib; +using XMainClient.UI; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildGrowthEntranceView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildGrowth/GuildGrowthEntranceDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + private XGuildGrowthDocument _doc; + + protected override void Init() + { + this.InitProperties(); + this._doc = XDocuments.GetSpecificDocument(XGuildGrowthDocument.uuID); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + public override void RegisterEvent() + { + } + + protected override void OnShow() + { + base.OnShow(); + } + + public override void StackRefresh() + { + base.StackRefresh(); + } + + private void InitProperties() + { + base.uiBehaviour.BuilderBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickBuilderBtn)); + base.uiBehaviour.LabBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickLabBtn)); + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClose)); + } + + private bool OnClose(IXUIButton button) + { + this.SetVisible(false, true); + return true; + } + + private bool OnClickLabBtn(IXUIButton button) + { + DlgBase.singleton.SetVisible(true, true); + return true; + } + + private bool OnClickBuilderBtn(IXUIButton button) + { + DlgBase.singleton.SetVisible(true, true); + return true; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthEntranceView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthEntranceView.cs.meta new file mode 100644 index 00000000..6e6e3fb0 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthEntranceView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ce0191f5bb3e9974496c0cc4bef5458a +timeCreated: 1611404577 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabBehavior.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabBehavior.cs new file mode 100644 index 00000000..9adfecc9 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabBehavior.cs @@ -0,0 +1,64 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildGrowthLabBehavior : DlgBehaviourBase + { + public IXUIButton CloseBtn; + + public IXUIButton HelpBtn; + + public IXUISprite m_DetailBuffIcon; + + public IXUILabel m_DetailBuffName; + + public IXUILabel m_DetailMaxLevel; + + public IXUILabel m_DetailCurrLevel; + + public IXUILabel m_DetailNextLevel; + + public IXUILabel m_DetailCurrKeepCost; + + public IXUILabel m_DetailNextKeepCost; + + public IXUILabelSymbol m_DetailCost; + + public IXUIButton LevelUpBtn; + + public IXUILabel LevelUpText; + + public IXUIScrollView ScrollView; + + public XUIPool BuffItemPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public IXUILabel m_PointLeft; + + public IXUISprite m_PointClick; + + private void Awake() + { + this.CloseBtn = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.HelpBtn = (base.transform.Find("Bg/Help").GetComponent("XUIButton") as IXUIButton); + this.m_DetailBuffIcon = (base.transform.Find("Bg/Detail/Icon").GetComponent("XUISprite") as IXUISprite); + this.m_DetailBuffName = (base.transform.Find("Bg/Detail/Name").GetComponent("XUILabel") as IXUILabel); + this.m_DetailMaxLevel = (base.transform.Find("Bg/Detail/MaxLevel/Num").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCurrLevel = (base.transform.Find("Bg/Detail/CurrentLevel").GetComponent("XUILabel") as IXUILabel); + this.m_DetailNextLevel = (base.transform.Find("Bg/Detail/CurrentLevel/NextLevel").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCurrKeepCost = (base.transform.Find("Bg/Detail/CurrentAttr").GetComponent("XUILabel") as IXUILabel); + this.m_DetailNextKeepCost = (base.transform.Find("Bg/Detail/CurrentAttr/NextAttr").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCost = (base.transform.Find("Bg/Detail/Cost").GetComponent("XUILabelSymbol") as IXUILabelSymbol); + this.LevelUpBtn = (base.transform.Find("Bg/Detail/Levelup").GetComponent("XUIButton") as IXUIButton); + this.LevelUpText = (base.transform.Find("Bg/Detail/Levelup/Text").GetComponent("XUILabel") as IXUILabel); + this.ScrollView = (base.transform.Find("Bg/SkillList").GetComponent("XUIScrollView") as IXUIScrollView); + GameObject gameObject = base.transform.Find("Bg/SkillList/SkillTpl").gameObject; + this.BuffItemPool.SetupPool(gameObject.transform.parent.gameObject, gameObject, 10u, false); + this.m_PointLeft = (base.transform.Find("Bg/Point/value").GetComponent("XUILabel") as IXUILabel); + this.m_PointClick = (base.transform.Find("Bg/Point/P").GetComponent("XUISprite") as IXUISprite); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabBehavior.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabBehavior.cs.meta new file mode 100644 index 00000000..6b3c6e19 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabBehavior.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4ba59a413a00c584cb32846cc8ad9298 +timeCreated: 1611403687 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabView.cs new file mode 100644 index 00000000..711004a9 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabView.cs @@ -0,0 +1,268 @@ +using System; +using System.Collections.Generic; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildGrowthLabView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildGrowth/GuildGrowthLabDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override int sysid + { + get + { + return XFastEnumIntEqualityComparer.ToInt(XSysDefine.XSys_GuildGrowthLab); + } + } + + private XGuildGrowthDocument _doc; + + private XGuildDocument _guildDoc; + + private XGuildSkillDocument _skillDoc = null; + + private int _currSelectID = 0; + + protected override void Init() + { + this._doc = XDocuments.GetSpecificDocument(XGuildGrowthDocument.uuID); + this._guildDoc = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + this._skillDoc = XDocuments.GetSpecificDocument(XGuildSkillDocument.uuID); + } + + private bool OnClose(IXUIButton button) + { + this.SetVisible(false, true); + return false; + } + + private void OnPointClick(IXUISprite iSp) + { + XSingleton.singleton.ShowItemAccess(35, null); + } + + private bool OnHelpBtnClick(IXUIButton btn) + { + DlgBase.singleton.ShowHelp(XSysDefine.XSys_GuildGrowthLab); + return true; + } + + protected override void OnHide() + { + base.OnHide(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + public override void RegisterEvent() + { + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClose)); + base.uiBehaviour.HelpBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHelpBtnClick)); + base.uiBehaviour.LevelUpBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnLevelUpBtnClick)); + base.uiBehaviour.m_PointClick.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnPointClick)); + } + + protected override void OnShow() + { + this._currSelectID = -1; + this.RefreshList(false); + } + + private bool OnCheckBoxClick(IXUICheckBox icb) + { + bool flag = !icb.bChecked; + bool result; + if (flag) + { + result = false; + } + else + { + this._currSelectID = (int)icb.ID; + this.RefreshDetail(); + result = true; + } + return result; + } + + private bool OnLevelUpBtnClick(IXUIButton btn) + { + uint skillID = XGuildSkillDocument.GuildSkillIDs[this._currSelectID]; + uint skillMaxLevel = this._skillDoc.GetSkillMaxLevel(skillID); + GuildSkillTable.RowData guildSkill = this._skillDoc.GetGuildSkill(skillID, skillMaxLevel + 1u); + bool flag = guildSkill == null; + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = this._guildDoc.Level < guildSkill.glevel; + if (flag2) + { + XSingleton.singleton.ShowSystemTip(string.Format(XStringDefineProxy.GetString("GuildGrowthHallGuildLevelNeedShow"), guildSkill.glevel), "fece00"); + result = false; + } + else + { + bool flag3 = !this._doc.LevelUpEnable; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GuildGrowthAuthorityFail"), "fece00"); + result = false; + } + else + { + this._skillDoc.GetStudyGuildSkill(XGuildSkillDocument.GuildSkillIDs[this._currSelectID]); + result = true; + } + } + } + return result; + } + + public void RefreshList(bool forceRefreshDetail = false) + { + base.uiBehaviour.BuffItemPool.ReturnAll(false); + Vector3 tplPos = base.uiBehaviour.BuffItemPool.TplPos; + int num = 0; + IXUICheckBox ixuicheckBox = null; + List guildSkillIDs = XGuildSkillDocument.GuildSkillIDs; + for (int i = 0; i < guildSkillIDs.Count; i++) + { + uint skillMaxLevel = this._skillDoc.GetSkillMaxLevel(guildSkillIDs[i]); + GuildSkillTable.RowData rowData; + bool flag = !this._skillDoc.TryGetGuildSkill(guildSkillIDs[i], skillMaxLevel, out rowData); + if (flag) + { + return; + } + bool flag2 = rowData.needtype == 1u; + if (!flag2) + { + GameObject gameObject = base.uiBehaviour.BuffItemPool.FetchGameObject(false); + gameObject.transform.localPosition = tplPos + new Vector3((float)(num % 2 * base.uiBehaviour.BuffItemPool.TplWidth), (float)(-(float)(num / 2) * base.uiBehaviour.BuffItemPool.TplHeight)); + IXUILabel ixuilabel = gameObject.transform.Find("Level").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel2 = gameObject.transform.Find("Name").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel3 = gameObject.transform.Find("Attr").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + IXUICheckBox ixuicheckBox2 = gameObject.GetComponent("XUICheckBox") as IXUICheckBox; + ixuicheckBox2.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnCheckBoxClick)); + ixuicheckBox2.ID = (ulong)i; + bool flag3 = i == this._currSelectID || this._currSelectID == -1; + if (flag3) + { + ixuicheckBox = ixuicheckBox2; + this._currSelectID = i; + } + ixuilabel.SetText(string.Format("{0}/{1}", skillMaxLevel.ToString(), this._skillDoc.GetLabSkillMaxLevel(guildSkillIDs[i]))); + ixuilabel2.SetText(rowData.name); + ixuilabel3.SetText(string.Format(rowData.currentLevelDescription, rowData.attribute[0, 1])); + ixuisprite.SetSprite(rowData.icon, rowData.atlas, false); + num++; + } + } + bool flag4 = ixuicheckBox != null; + if (flag4) + { + ixuicheckBox.bChecked = true; + } + base.uiBehaviour.m_PointLeft.SetText(this._doc.TechnologyPoint.ToString()); + if (forceRefreshDetail) + { + this.RefreshDetail(); + return; + } + } + + public void RefreshDetail() + { + uint skillID = XGuildSkillDocument.GuildSkillIDs[this._currSelectID]; + uint skillMaxLevel = this._skillDoc.GetSkillMaxLevel(skillID); + uint labSkillMaxLevel = this._skillDoc.GetLabSkillMaxLevel(skillID); + GuildSkillTable.RowData guildSkill = this._skillDoc.GetGuildSkill(skillID, skillMaxLevel); + GuildSkillTable.RowData guildSkill2 = this._skillDoc.GetGuildSkill(skillID, skillMaxLevel + 1u); + bool flag = skillMaxLevel == labSkillMaxLevel; + base.uiBehaviour.m_DetailBuffIcon.SetSprite(guildSkill.icon, guildSkill.atlas, false); + base.uiBehaviour.m_DetailBuffName.SetText(guildSkill.name); + base.uiBehaviour.m_DetailMaxLevel.SetText(labSkillMaxLevel.ToString()); + bool flag2 = flag; + if (flag2) + { + base.uiBehaviour.m_DetailCurrLevel.SetVisible(false); + base.uiBehaviour.m_DetailCurrKeepCost.SetVisible(false); + base.uiBehaviour.m_DetailCost.InputText = "0"; + base.uiBehaviour.LevelUpBtn.SetEnable(false, false); + base.uiBehaviour.LevelUpText.SetText(XStringDefineProxy.GetString("GuildGrowthHallMaxLevel")); + } + else + { + base.uiBehaviour.m_DetailCurrLevel.SetVisible(true); + base.uiBehaviour.m_DetailCurrKeepCost.SetVisible(true); + base.uiBehaviour.m_DetailCurrLevel.SetText(string.Format("{0} {1}", XStringDefineProxy.GetString("GuildGrowthHallLevel"), skillMaxLevel)); + base.uiBehaviour.m_DetailNextLevel.SetText((skillMaxLevel + 1u).ToString()); + base.uiBehaviour.m_DetailCurrKeepCost.SetText(string.Format("{0} {1}", guildSkill.name, guildSkill.attribute[0, 1])); + base.uiBehaviour.m_DetailNextKeepCost.SetText(guildSkill2.attribute[0, 1].ToString()); + base.uiBehaviour.m_DetailCost.InputText = string.Format("{0}{1}{2}", (this._doc.TechnologyPoint >= guildSkill2.rexp) ? "" : "[e60012]", XLabelSymbolHelper.FormatSmallIcon(35), guildSkill2.rexp); + base.uiBehaviour.LevelUpBtn.SetEnable(true, false); + base.uiBehaviour.LevelUpBtn.SetGrey(this._guildDoc.Level >= guildSkill2.glevel); + base.uiBehaviour.LevelUpText.SetText(XStringDefineProxy.GetString((this._guildDoc.Level >= guildSkill2.glevel) ? "GuildGrowthLabLevelUp" : "GuildGrowthHallGuildLevelNeed")); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabView.cs.meta new file mode 100644 index 00000000..b36e6f27 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildGrowthLabView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 81082cdb41f70c64a9e550efea45ac7d +timeCreated: 1611404035 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildHallDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildHallDocument.cs new file mode 100644 index 00000000..98df9a70 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildHallDocument.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildHallDocument : XDocComponent, ILogSource + { + public override uint ID + { + get + { + return XGuildHallDocument.uuID; + } + } + + public XGuildHallView GuildHallView { get; set; } + + private XGuildDocument GuildDoc + { + get + { + bool flag = this._GuildDoc == null; + if (flag) + { + this._GuildDoc = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + } + return this._GuildDoc; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildHallDocument"); + + private List m_LogList = new List(); + + private XGuildDocument _GuildDoc; + + public List GetLogList() + { + return this.m_LogList; + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_GuildPositionChanged, new XComponent.XEventHandler(this.OnPositionChanged)); + base.RegisterEvent(XEventDefine.XEvent_GuildLevelChanged, new XComponent.XEventHandler(this.OnLevelChanged)); + base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.OnInGuildStateChanged)); + } + + protected bool OnPositionChanged(XEventArgs args) + { + XGuildPositionChangedEventArgs xguildPositionChangedEventArgs = args as XGuildPositionChangedEventArgs; + bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible(); + if (flag) + { + this.GuildHallView.RefreshButtonsState(); + } + return true; + } + + protected bool OnLevelChanged(XEventArgs args) + { + XGuildLevelChangedEventArgs xguildLevelChangedEventArgs = args as XGuildLevelChangedEventArgs; + bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible(); + if (flag) + { + this.ReqGuildBrief(); + } + return true; + } + + protected bool OnInGuildStateChanged(XEventArgs args) + { + XInGuildStateChangedEventArgs xinGuildStateChangedEventArgs = args as XInGuildStateChangedEventArgs; + bool flag = !xinGuildStateChangedEventArgs.bIsEnter; + if (flag) + { + bool flag2 = this.GuildHallView != null && this.GuildHallView.IsVisible(); + if (flag2) + { + this.GuildHallView.SetVisibleWithAnimation(false, null); + } + } + return true; + } + + public void ReqExitGuild() + { + RpcC2M_LeaveFromGuild rpcC2M_LeaveFromGuild = new RpcC2M_LeaveFromGuild(); + rpcC2M_LeaveFromGuild.oArg.roleID = XSingleton.singleton.Player.Attributes.EntityID; + XSingleton.singleton.Send(rpcC2M_LeaveFromGuild); + } + + public void OnExitGuild(LeaveGuildRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + } + + public void ReqGuildBrief() + { + RpcC2M_AskGuildBriefInfo rpc = new RpcC2M_AskGuildBriefInfo(); + XSingleton.singleton.Send(rpc); + } + + public void OnGuildBrief(GuildBriefRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + XGuildBasicData basicData = this.GuildDoc.BasicData; + basicData.Init(oRes); + bool flag2 = this.GuildHallView != null && this.GuildHallView.IsVisible(); + if (flag2) + { + this.GuildHallView.Refresh(); + } + XGuildGrowthDocument specificDocument = XDocuments.GetSpecificDocument(XGuildGrowthDocument.uuID); + specificDocument.SetPoint(this.GuildDoc.BasicData.resource, this.GuildDoc.BasicData.technology); + } + } + + public void ReqLogList() + { + RpcC2M_FetchGuildHistoryNew rpc = new RpcC2M_FetchGuildHistoryNew(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetLogList(GuildHistoryRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + for (int i = 0; i < this.m_LogList.Count; i++) + { + (this.m_LogList[i] as XDataBase).Recycle(); + } + this.m_LogList.Clear(); + for (int j = 0; j < oRes.records.Count; j++) + { + GHisRecord ghisRecord = oRes.records[j]; + XGuildLogBase xguildLogBase = XGuildLogBase.CreateLog(ghisRecord.type); + xguildLogBase.SetData(ghisRecord); + this.m_LogList.Add(xguildLogBase); + } + bool flag2 = this.GuildHallView != null && this.GuildHallView.IsVisible(); + if (flag2) + { + bool flag3 = this.GuildHallView.LogView != null && this.GuildHallView.LogView.active; + if (flag3) + { + this.GuildHallView.LogView.Refresh(); + } + } + } + } + + public void ReqEditAnnounce(string s) + { + RpcC2M_ChangeGuildSettingNew rpcC2M_ChangeGuildSettingNew = new RpcC2M_ChangeGuildSettingNew(); + rpcC2M_ChangeGuildSettingNew.oArg.annoucement = s; + XSingleton.singleton.Send(rpcC2M_ChangeGuildSettingNew); + } + + public void OnEditAnnounceSuccess(string s) + { + bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible(); + if (flag) + { + this.GuildHallView.EditAnnounceView.SetVisible(false); + } + } + + public void OnAnnounceChanged(string s) + { + this.GuildDoc.BasicData.announcement = s; + bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible(); + if (flag) + { + this.GuildHallView.RefreshAnnouncement(); + } + } + + public void ReqEditPortrait(int index) + { + RpcC2M_ChangeGuildSettingNew rpcC2M_ChangeGuildSettingNew = new RpcC2M_ChangeGuildSettingNew(); + rpcC2M_ChangeGuildSettingNew.oArg.Icon = index; + XSingleton.singleton.Send(rpcC2M_ChangeGuildSettingNew); + } + + public void OnPortraitChanged(int index) + { + this.GuildDoc.BasicData.portraitIndex = index; + bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible(); + if (flag) + { + this.GuildHallView.RefreshPortrait(); + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = this.GuildHallView != null && this.GuildHallView.IsVisible(); + if (flag) + { + this.ReqGuildBrief(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildHallDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildHallDocument.cs.meta new file mode 100644 index 00000000..754be4ff --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildHallDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f215ff586075646498e34ec54e03a36f +timeCreated: 1611404841 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildInfoChange.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildInfoChange.cs new file mode 100644 index 00000000..e294f2d6 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildInfoChange.cs @@ -0,0 +1,18 @@ +using System; + +namespace XMainClient +{ + internal class XGuildInfoChange : XEventArgs + { + public XGuildInfoChange() + { + this._eDefine = XEventDefine.XEvent_GuildInfoChange; + } + + public override void Recycle() + { + base.Recycle(); + XEventPool.Recycle(this); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildInfoChange.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildInfoChange.cs.meta new file mode 100644 index 00000000..c2ad8ee2 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildInfoChange.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 96ba3f23fb32e44419cadd61168389a7 +timeCreated: 1611404186 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildInheritDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildInheritDocument.cs new file mode 100644 index 00000000..074b6e0d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildInheritDocument.cs @@ -0,0 +1,566 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildInheritDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildInheritDocument.uuID; + } + } + + public uint TeacherCount + { + get + { + return this.m_teacherCount; + } + } + + public uint StudentCount + { + get + { + return this.m_studentCount; + } + } + + private static int InheritLimitRange + { + get + { + XLevelSealDocument specificDocument = XDocuments.GetSpecificDocument(XLevelSealDocument.uuID); + uint sealType = specificDocument.SealType; + SeqList sequenceList = XSingleton.singleton.GetSequenceList("GuildInheritRoleLvlGap", true); + int i = 0; + int count = (int)sequenceList.Count; + while (i < count) + { + bool flag = (long)sequenceList[i, 0] == (long)((ulong)sealType); + if (flag) + { + return sequenceList[i, 1]; + } + i++; + } + return sequenceList[(int)(sequenceList.Count - 1), 1]; + } + } + + public List InheritList + { + get + { + return this.m_inheritList; + } + } + + public uint bHasAvailableIconShow + { + get + { + return this.m_avilableReqCount; + } + set + { + this.m_avilableReqCount = value; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildInherit, true); + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildInheritDocument"); + + private uint m_avilableReqCount = 0u; + + private uint m_teacherCount = 0u; + + private uint m_studentCount = 0u; + + private List m_inheritList = new List(); + + private ulong m_SelectFriend = 0UL; + + private float m_teacherTime = 0f; + + private XFx m_selectEffect = null; + + private bool m_Inheriting = false; + + private float m_bubbleTime = 11f; + + private ulong InheritTeacherID = 0UL; + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + this.SendInheritList(); + } + } + + public string GetTeacherLeftTimeString() + { + bool flag = this.m_teacherTime > 0f; + string result; + if (flag) + { + result = XStringDefineProxy.GetString("GUILD_INHERIT_TEACHER_TIME", new object[] + { + XSingleton.singleton.TimeDuarationFormatString((int)this.m_teacherTime, 5) + }); + } + else + { + result = string.Empty; + } + return result; + } + + public bool TryGetInheritCountString(out string message) + { + message = string.Empty; + bool flag = (ulong)XSingleton.singleton.XPlayerData.Level < (ulong)((long)XSingleton.singleton.StudentMinLevel); + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = (ulong)XSingleton.singleton.XPlayerData.Level < (ulong)((long)XSingleton.singleton.TeacherMinLevel); + if (flag2) + { + message = XStringDefineProxy.GetString("GUILD_INHERIT_MESSAGE2", new object[] + { + XSingleton.singleton.TeacherMinLevel, + this.m_studentCount + }); + } + else + { + message = XStringDefineProxy.GetString("GUILD_INHERIT_MESSAGE1", new object[] + { + this.m_teacherCount, + this.m_studentCount, + XGuildInheritDocument.InheritLimitRange + }); + } + result = true; + } + return result; + } + + public static void TryOutInherit(XEntity entity) + { + bool isPlayer = entity.IsPlayer; + if (isPlayer) + { + XSingleton.singleton.AddGreenLog("Player Out Inherit", null, null, null, null, null); + XSingleton.singleton.Freezed = false; + bool flag = entity.Nav != null; + if (flag) + { + entity.Nav.Interrupt(); + entity.Nav.Enabled = true; + } + XGuildInheritDocument specificDocument = XDocuments.GetSpecificDocument(XGuildInheritDocument.uuID); + specificDocument.StopInherit(); + } + XInheritComponent xinheritComponent = entity.GetXComponent(XInheritComponent.uuID) as XInheritComponent; + bool flag2 = xinheritComponent != null; + if (flag2) + { + entity.DetachComponent(XInheritComponent.uuID); + } + XBubbleComponent xbubbleComponent = entity.GetXComponent(XBubbleComponent.uuID) as XBubbleComponent; + bool flag3 = xbubbleComponent != null; + if (flag3) + { + entity.DetachComponent(XBubbleComponent.uuID); + } + } + + public void StopInherit() + { + this.m_Inheriting = false; + bool flag = this.m_selectEffect != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this.m_selectEffect, true); + this.m_selectEffect = null; + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.HideProcess(); + } + } + + public static void TryInInherit(XEntity entity) + { + bool isPlayer = entity.IsPlayer; + if (isPlayer) + { + XSingleton.singleton.AddGreenLog("Player in Inherit", null, null, null, null, null); + XSingleton.singleton.Freezed = false; + XSingleton.singleton.Freezed = true; + bool flag = entity.Nav != null; + if (flag) + { + entity.Nav.Interrupt(); + entity.Nav.Enabled = false; + } + } + XInheritComponent xinheritComponent = entity.GetXComponent(XInheritComponent.uuID) as XInheritComponent; + bool flag2 = xinheritComponent == null; + if (flag2) + { + XSingleton.singleton.CreateComponent(entity, XInheritComponent.uuID); + } + } + + public static bool IsInherit(uint level) + { + return XGuildInheritDocument.IsInheritInitiator(level) || XGuildInheritDocument.IsInheritReceiver(level); + } + + public static bool IsInheritReceiver(uint level) + { + bool flag = (ulong)XSingleton.singleton.XPlayerData.Level < (ulong)((long)XSingleton.singleton.StudentMinLevel) || (ulong)level < (ulong)((long)XSingleton.singleton.TeacherMinLevel); + return !flag && level - XSingleton.singleton.XPlayerData.Level >= (uint)XGuildInheritDocument.InheritLimitRange; + } + + public static bool IsInheritInitiator(uint level) + { + bool flag = (ulong)XSingleton.singleton.XPlayerData.Level < (ulong)((long)XSingleton.singleton.TeacherMinLevel) || (ulong)level < (ulong)((long)XSingleton.singleton.StudentMinLevel); + return !flag && XSingleton.singleton.XPlayerData.Level - level >= (uint)XGuildInheritDocument.InheritLimitRange; + } + + public override void Update(float fDeltaT) + { + base.Update(fDeltaT); + bool flag = this.m_teacherTime > 0f; + if (flag) + { + this.m_teacherTime -= fDeltaT; + } + else + { + this.m_teacherTime = 0f; + } + bool inheriting = this.m_Inheriting; + if (inheriting) + { + bool flag2 = this.m_bubbleTime > 0f; + if (flag2) + { + this.m_bubbleTime -= fDeltaT; + } + else + { + this.m_bubbleTime = 11f; + this.ShowBubble(); + } + } + } + + public void SynInheritExp(synGuildInheritExp res) + { + XSingleton.singleton.AddGreenLog("SynInheritExp:", res.teacherId.ToString(), null, null, null, null); + bool flag = res.turn == 0u; + if (flag) + { + bool flag2 = XSingleton.singleton.GetSceneType(XSingleton.singleton.SceneID) == SceneType.SCENE_HALL; + if (flag2) + { + XSingleton.singleton.CloseAllUI(); + } + this.InheritTeacherID = res.teacherId; + XSingleton.singleton.AddGreenLog("Start Inherit", null, null, null, null, null); + this.m_Inheriting = true; + this.m_bubbleTime = 11f; + float countdownTime = (float)(XSingleton.singleton.GetInt("GuildInheritTime") * XSingleton.singleton.GetInt("GuildInheritTimes")); + string @string = XStringDefineProxy.GetString("GUILD_INHERIT_PROCESSMESS"); + string string2 = XStringDefineProxy.GetString("GUILD_INHERIT_HELP"); + DlgBase.singleton.ShowProcess(countdownTime, @string, string2, null); + bool flag3 = XSingleton.singleton.GetSceneType(XSingleton.singleton.SceneID) == SceneType.SCENE_GUILD_HALL && XSingleton.singleton.XPlayerData != null; + if (flag3) + { + bool flag4 = XSingleton.singleton.XPlayerData.RoleID == res.teacherId; + if (flag4) + { + this.m_teacherCount -= 1u; + } + else + { + this.m_studentCount -= 1u; + } + } + } + else + { + bool islast = res.islast; + if (islast) + { + this.m_Inheriting = false; + this.InheritTeacherID = 0UL; + DlgBase.singleton.HideProcess(); + XSingleton.singleton.AddGreenLog("Stop Inherit", null, null, null, null, null); + ulong num = 0UL; + bool flag5 = XSingleton.singleton.XPlayerData.RoleID != res.roleOne; + if (flag5) + { + num = res.roleOne; + } + else + { + bool flag6 = XSingleton.singleton.XPlayerData.RoleID != res.roleTwo; + if (flag6) + { + num = res.roleTwo; + } + } + bool flag7 = (ulong)res.turn == (ulong)((long)XSingleton.singleton.GetInt("GuildInheritTimes")); + if (flag7) + { + bool flag8 = XSingleton.singleton.XPlayerData.RoleID != this.InheritTeacherID; + if (flag8) + { + DlgBase.singleton.AddChat(XStringDefineProxy.GetString("GUILD_INHERIT_CHAT2"), ChatChannelType.Guild, null, false); + } + bool flag9 = num != 0UL && !DlgBase.singleton.IsMyFriend(num); + if (flag9) + { + this.m_SelectFriend = num; + XSingleton.singleton.ShowModalDialog(XStringDefineProxy.GetString("GUILD_INHERIT_ADDFRIEND"), XStringDefineProxy.GetString(XStringDefine.COMMON_OK), XStringDefineProxy.GetString(XStringDefine.COMMON_CANCEL), new ButtonClickEventHandler(this.OnAddFriend)); + } + } + } + } + bool flag10 = res.islast || this.m_selectEffect != null; + if (!flag10) + { + XEntity entity = XSingleton.singleton.GetEntity(res.roleOne); + XEntity entity2 = XSingleton.singleton.GetEntity(res.roleTwo); + bool flag11 = entity == null || entity2 == null; + if (!flag11) + { + Vector3 position = entity.EngineObject.Position; + Vector3 position2 = entity2.EngineObject.Position; + Vector3 position3 = (position + position2) / 2f; + this.m_selectEffect = XSingleton.singleton.CreateFx("Effects/FX_Particle/UIfx/UI_cg_lx", null, true); + Quaternion rotation = Quaternion.FromToRotation(position - position2, Vector3.zero); + this.m_selectEffect.Play(position3, rotation, Vector3.one, 1f); + } + } + } + + private void ShowBubble() + { + bool flag = this.InheritTeacherID == 0UL; + if (!flag) + { + XEntity entity = XSingleton.singleton.GetEntity(this.InheritTeacherID); + bool flag2 = entity == null; + if (!flag2) + { + XBubbleEventArgs @event = XEventPool.GetEvent(); + @event.bubbletext = XStringDefineProxy.GetString("GUILD_INHERIT_CHAT1"); + @event.existtime = 3f; + @event.Firer = entity; + @event.speaker = entity.Name; + XBubbleComponent xbubbleComponent = entity.GetXComponent(XBubbleComponent.uuID) as XBubbleComponent; + bool flag3 = xbubbleComponent == null; + if (flag3) + { + XSingleton.singleton.CreateComponent(entity, XBubbleComponent.uuID); + } + XSingleton.singleton.FireEvent(@event); + } + } + } + + private bool OnAddFriend(IXUIButton btn) + { + DlgBase.singleton.AddFriendById(this.m_SelectFriend); + XSingleton.singleton.CloseModalDlg(); + return true; + } + + public void SynInheritBaseInfo(SynGuildInheritNumInfo res) + { + XSingleton.singleton.AddGreenLog("XGuildInheritDocument.SynInheritBaseInfo teacherNumber:", res.teacherNum.ToString(), " teacher:", res.lastTime.ToString(), null, null); + this.bHasAvailableIconShow = res.reqNum; + this.m_studentCount = res.studentNum; + this.m_teacherCount = res.teacherNum; + bool flag = this.m_teacherCount > 0u; + if (flag) + { + this.m_teacherTime = res.lastTime; + } + else + { + this.m_teacherTime = 0f; + } + } + + public void SendInheritList() + { + RpcC2M_ReqGuildInheritInfo rpc = new RpcC2M_ReqGuildInheritInfo(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveInheritList(ReqGuildInheritInfoArg oArg, ReqGuildInheritInfoRes oRes) + { + this.m_inheritList.Clear(); + int num = oRes.data.Count - this.m_inheritList.Count; + bool flag = num < 0; + if (flag) + { + this.m_inheritList.RemoveRange(this.m_inheritList.Count + num, -num); + } + else + { + for (int i = 0; i < num; i++) + { + GuildInheritInfo item = new GuildInheritInfo(); + this.m_inheritList.Add(item); + } + } + int j = 0; + int count = this.m_inheritList.Count; + while (j < count) + { + this.m_inheritList[j].Set(oRes.data[j]); + j++; + } + this.bHasAvailableIconShow = (uint)this.m_inheritList.Count; + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshData(); + } + } + + public void SendDelInherit() + { + RpcC2M_DelGuildInherit rpc = new RpcC2M_DelGuildInherit(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveDelInherit(DelGuildInheritRes res) + { + bool flag = res.errorCode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(res.errorCode, "fece00"); + } + else + { + this.m_inheritList.Clear(); + this.bHasAvailableIconShow = (uint)this.m_inheritList.Count; + } + } + + public void SendReqInherit(ulong uid) + { + RpcC2M_AddGuildInherit rpcC2M_AddGuildInherit = new RpcC2M_AddGuildInherit(); + rpcC2M_AddGuildInherit.oArg.reqRoleId = uid; + XSingleton.singleton.Send(rpcC2M_AddGuildInherit); + } + + public void ReceiveReqInherit(AddGuildInheritArg arg, AddGuildInheritRes res) + { + XSingleton.singleton.AddGreenLog("XGuildInheritDocument.ReceiveReqInherit", null, null, null, null, null); + bool flag = res.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(res.errorcode, "fece00"); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_INHERIT_REQSUCCESS"), "fece00"); + } + } + + public void SendAccpetInherit(int index) + { + bool flag = this.m_inheritList == null || index < 0 || index >= this.m_inheritList.Count; + if (!flag) + { + GuildInheritInfo guildInheritInfo = this.m_inheritList[index]; + bool flag2 = !XGuildInheritDocument.IsInherit(guildInheritInfo.level); + if (flag2) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_GUILD_INHERIT_LVL"), "fece00"); + } + else + { + bool flag3 = XSingleton.singleton.XPlayerData.Outlook.state.type == OutLookStateType.OutLook_Inherit; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_INHERIT_ING"), "fece00"); + } + else + { + RpcC2M_AceptGuildInherit rpcC2M_AceptGuildInherit = new RpcC2M_AceptGuildInherit(); + rpcC2M_AceptGuildInherit.oArg.roleId = guildInheritInfo.uid; + XSingleton.singleton.Send(rpcC2M_AceptGuildInherit); + } + } + } + } + + public void ReceiveAccpetInherit(AceptGuildInheritArg arg, AceptGuildInheritRes res) + { + bool flag = false; + int i = 0; + int count = this.m_inheritList.Count; + while (i < count) + { + bool flag2 = this.m_inheritList[i].uid == arg.roleId; + if (flag2) + { + this.m_inheritList.RemoveAt(i); + flag = true; + break; + } + i++; + } + bool flag3 = flag; + if (flag3) + { + this.bHasAvailableIconShow = (uint)this.m_inheritList.Count; + } + bool flag4 = res.errorcode > ErrorCode.ERR_SUCCESS; + if (flag4) + { + XSingleton.singleton.ShowSystemTip(res.errorcode, "fece00"); + bool flag5 = DlgBase.singleton.IsVisible(); + if (flag5) + { + DlgBase.singleton.RefreshData(); + } + } + else + { + bool flag6 = DlgBase.singleton.IsVisible(); + if (flag6) + { + DlgBase.singleton.SetVisibleWithAnimation(false, null); + } + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildInheritDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildInheritDocument.cs.meta new file mode 100644 index 00000000..e33f9c5e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildInheritDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 07372aaccd9ea234caedeaafcc584f97 +timeCreated: 1611402967 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchDocument.cs new file mode 100644 index 00000000..da183d15 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchDocument.cs @@ -0,0 +1,548 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UILib; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildJockerMatchDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildJockerMatchDocument.uuID; + } + } + + public XGuildJockerMatchStep MatchStep + { + get + { + return this.m_MatchStep; + } + } + + public CardMatchState MatchState + { + get + { + return this.m_matchState; + } + } + + public double TimeLeft + { + get + { + return this.m_timeLeft; + } + set + { + this.m_timeLeft = value; + } + } + + public uint ChangeCount + { + get + { + return this.m_changeount; + } + } + + public uint MatchRound + { + get + { + return this.m_matchRound; + } + } + + public uint MatchResult + { + get + { + return this.m_matchResult; + } + } + + public List MatchJockers + { + get + { + return this.m_matchJokers; + } + } + + public uint MatchJockerStore + { + get + { + return this.m_matchJockerStore; + } + } + + public List MatchBestJockers + { + get + { + return this.m_matchBestJockers; + } + } + + public string MatchBestJockerName + { + get + { + return this.m_matchBestName; + } + } + + public List MatchRankNames + { + get + { + return this.m_matchRankName; + } + } + + public List MatchRankScores + { + get + { + return this.m_matchRankScore; + } + } + + public List MatchItems + { + get + { + return this.m_matchItems; + } + } + + public bool IsBegin + { + get + { + return this.m_isBegion; + } + } + + public bool IsCanBegin + { + get + { + return this.m_isCanBegion; + } + } + + public double BeginTime + { + get + { + return this.m_BeginTime; + } + } + + public bool bAvaiableIconWhenShow + { + get + { + return this.m_bAvaiableIconWhenShow; + } + set + { + bool flag = this.m_bAvaiableIconWhenShow != value; + if (flag) + { + this.m_bAvaiableIconWhenShow = value; + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildRelax_JokerMatch, true); + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildRelax_JokerMatch, true); + } + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildJokerMatchDocument"); + + private bool m_bAvaiableIconWhenShow = false; + + private XGuildJockerMatchStep m_MatchStep = XGuildJockerMatchStep.BeforeGame; + + private CardMatchState m_matchState; + + private double m_timeLeft; + + private uint m_changeount; + + private uint m_matchRound; + + private uint m_matchResult; + + private uint m_matchJockerStore; + + private uint m_oldJockerID = 0u; + + private string m_matchBestName = string.Empty; + + private List m_matchJokers = new List(); + + private List m_matchBestJockers = new List(); + + private List m_matchRankName = new List(); + + private List m_matchRankScore = new List(); + + private uint JokerToken; + + private bool m_isBegion = false; + + private bool m_isCanBegion = false; + + private double m_BeginTime = 0.0; + + public bool wattingPTC = false; + + private List m_matchItems = new List(); + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + this.SendJokerMatchQuery(); + } + } + + public void SendJokerMatchRank() + { + PtcC2M_GuildCardRankReq ptcC2M_GuildCardRankReq = new PtcC2M_GuildCardRankReq(); + ptcC2M_GuildCardRankReq.Data.type = 2u; + XSingleton.singleton.Send(ptcC2M_GuildCardRankReq); + } + + public void ReceiveJokerRank(List names, List scores) + { + this.m_matchRankName.Clear(); + this.m_matchRankName.AddRange(names); + this.m_matchRankScore.Clear(); + this.m_matchRankScore.AddRange(scores); + int score = 0; + int rank = -1; + for (int i = 0; i < names.Count; i++) + { + bool flag = names[i] == XSingleton.singleton.XPlayerData.Name; + if (flag) + { + bool flag2 = i < scores.Count; + if (flag2) + { + score = scores[i]; + rank = i; + break; + } + } + } + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.SetRankInfo(this.m_matchRankName.Count); + DlgBase.singleton.RefreshSelfRank(score, rank); + } + } + + public void SendJokerMatchQuery() + { + this.SendGuildJokerMatchInfo(CardMatchOp.CardMatch_Query, 0u); + } + + public void SendJokerMatchBegion() + { + this.SendGuildJokerMatchInfo(CardMatchOp.CardMatch_Begin, 0u); + } + + public void SendReqJokerMatchJoin() + { + XSingleton.singleton.ShowModalDialog(XStringDefineProxy.GetString("GUILD_JOCKER_MATCH_REQ_JOIN"), XStringDefineProxy.GetString("COMMON_OK"), XStringDefineProxy.GetString("COMMON_CANCEL"), new ButtonClickEventHandler(this.OnReqJokerMatchJoin)); + } + + private bool OnReqJokerMatchJoin(IXUIButton btn) + { + DlgBase.singleton.SetVisible(false, true); + this.SendJokerMatchJoin(); + return true; + } + + public void SendJokerMatchJoin() + { + this.SendGuildJokerMatchInfo(CardMatchOp.CardMatch_Add, 0u); + } + + public void SendJokerMatchExit() + { + bool flag = this.m_matchState == CardMatchState.CardMatch_StateEnd; + if (!flag) + { + this.SendGuildJokerMatchInfo(CardMatchOp.CardMatch_Del, 0u); + } + } + + public void SetJokerMatchRoundOver() + { + this.SendGuildJokerMatchInfo(CardMatchOp.CardMatch_RoundEnd, 0u); + } + + public void SendGuildCardMatchChange(uint card) + { + bool flag = this.wattingPTC; + if (!flag) + { + this.wattingPTC = true; + this.SendGuildJokerMatchInfo(CardMatchOp.CardMatch_RoundChange, card); + } + } + + private void SendGuildJokerMatchInfo(CardMatchOp op, uint card = 0u) + { + PtcC2M_GuildCardMatchReq ptcC2M_GuildCardMatchReq = new PtcC2M_GuildCardMatchReq(); + ptcC2M_GuildCardMatchReq.Data.op = op; + ptcC2M_GuildCardMatchReq.Data.card = card; + this.m_oldJockerID = card; + XSingleton.singleton.Send(ptcC2M_GuildCardMatchReq); + } + + public void ReceiveGuildJokerMatchInfo(GuildCardMatchNtf ntf) + { + switch (ntf.op) + { + case CardMatchOp.CardMatch_Begin: + this.ShowJokerBegin(); + break; + case CardMatchOp.CardMatch_Add: + this.ShowJokerJoin(ntf); + this.SendJokerMatchRank(); + break; + case CardMatchOp.CardMatch_RoundBegin: + this.ShowMatchBegin(ntf); + break; + case CardMatchOp.CardMatch_RoundChange: + this.ChangeJocker(ntf); + break; + case CardMatchOp.CardMatch_RoundEnd: + this.SendJokerMatchRank(); + this.EndJockerGame(ntf); + break; + case CardMatchOp.CardMatch_End: + this.SendJokerMatchRank(); + this.JokerMatchOver(); + break; + case CardMatchOp.CardMatch_Query: + this.ShowJokerQuery(ntf); + break; + case CardMatchOp.CardMatch_RoundWaiting: + this.ShowWaittingJocker(ntf); + this.SendJokerMatchRank(); + break; + } + } + + private void JokerMatchOver() + { + this.m_matchJokers.Clear(); + this.m_timeLeft = 0.0; + this.m_matchState = CardMatchState.CardMatch_StateEnd; + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + DlgBase.singleton.RefreshWhenShow(); + } + } + + private void ShowJokerBegin() + { + this.m_isBegion = true; + this.m_isCanBegion = true; + this.m_BeginTime = 0.0; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.Refresh(XSysDefine.XSys_GuildRelax_JokerMatch); + } + } + + private void SetMatchData(GuildCardMatchNtf ntf) + { + this.m_matchState = ntf.state; + this.m_timeLeft = ntf.timeleft + 1u; + this.m_changeount = ntf.changecount; + this.m_matchResult = ntf.result; + this.m_matchJockerStore = ntf.store; + this.m_matchItems.Clear(); + this.m_matchItems.AddRange(ntf.items); + this.m_matchRound = (uint)((long)XSingleton.singleton.GetInt("CardMatchRound") - (long)((ulong)((ntf.round == uint.MaxValue) ? 0u : (ntf.round + 1u)))); + this.m_matchJokers.Clear(); + this.m_matchJokers.AddRange(ntf.cards); + } + + private void ShowJokerJoin(GuildCardMatchNtf ntf) + { + this.SetMatchData(ntf); + this.ClearBestJoker(); + bool flag = !DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + + private void ShowMatchBegin(GuildCardMatchNtf ntf) + { + this.SetMatchData(ntf); + this.ClearBestJoker(); + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + DlgBase.singleton.RefreshWhenShow(); + } + } + + public override void Update(float fDeltaT) + { + base.Update(fDeltaT); + bool flag = this.m_timeLeft > (double)fDeltaT; + if (flag) + { + this.m_timeLeft -= (double)fDeltaT; + } + else + { + this.m_timeLeft = 0.0; + } + } + + private void ShowJokerQuery(GuildCardMatchNtf ntf) + { + this.m_matchState = ntf.state; + this.m_isBegion = ntf.isbegin; + this.m_isCanBegion = ntf.iscanbegin; + this.m_timeLeft = ntf.timeleft; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.Refresh(XSysDefine.XSys_GuildRelax_JokerMatch); + DlgBase.singleton.RefreshRedPoint(XSysDefine.XSys_GuildRelax_JokerMatch); + } + } + + private void ShowWaittingJocker(GuildCardMatchNtf ntf) + { + this.m_timeLeft = ntf.timeleft + 1u; + this.m_matchState = ntf.state; + this.m_matchJokers.Clear(); + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + DlgBase.singleton.RefreshWhenShow(); + } + } + + public void EndJockerGame(GuildCardMatchNtf ntf) + { + this.m_matchState = CardMatchState.CardMatch_StateRoundEnd; + this.m_matchJockerStore = 5u; + this.MatchJockers.Clear(); + this.m_matchItems.Clear(); + this.m_matchItems.AddRange(ntf.items); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + bool flag2 = this.MatchResult != 8u; + if (flag2) + { + XSingleton.singleton.PlayUISound("Audio/UI/pukeshenli", true, AudioChannel.Action); + DlgBase.singleton.JokerStatus(2); + XSingleton.singleton.KillTimer(this.JokerToken); + this.JokerToken = XSingleton.singleton.SetTimer(1f, DlgBase.singleton.ResetJokerStatusCb, null); + } + else + { + XSingleton.singleton.PlayUISound("Audio/UI/pukeshibai", true, AudioChannel.Action); + DlgBase.singleton.JokerStatus(3); + XSingleton.singleton.KillTimer(this.JokerToken); + this.JokerToken = XSingleton.singleton.SetTimer(1f, DlgBase.singleton.ResetJokerStatusCb, null); + } + } + bool flag3 = !DlgBase.singleton.IsVisible(); + if (!flag3) + { + DlgBase.singleton.RefreshWhenShow(); + } + } + + private void ChangeJocker(GuildCardMatchNtf ntf) + { + this.wattingPTC = false; + this.m_matchResult = ntf.result; + bool flag = this.m_changeount > 0u; + if (flag) + { + this.m_changeount -= 1u; + } + uint oldJockerID = this.m_oldJockerID; + uint newCard = 0u; + int num = 0; + int i = 0; + int count = ntf.cards.Count; + while (i < count) + { + bool flag2 = !this.m_matchJokers.Contains(ntf.cards[i]); + if (flag2) + { + newCard = ntf.cards[i]; + num = this.m_matchJokers.IndexOf(this.m_oldJockerID); + bool flag3 = num > -1; + if (flag3) + { + this.m_matchJokers[num] = ntf.cards[i]; + } + break; + } + i++; + } + bool flag4 = !DlgBase.singleton.IsVisible(); + if (!flag4) + { + DlgBase.singleton.ChangeCard(oldJockerID, newCard, num); + DlgBase.singleton.SetGameCount(); + } + } + + public void SetBestJocker(List jockers, string name) + { + this.m_matchBestJockers.Clear(); + this.m_matchBestJockers.AddRange(jockers); + this.m_matchBestName = name; + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + DlgBase.singleton.SetupBestCard(); + } + } + + private void ClearBestJoker() + { + this.m_matchBestJockers.Clear(); + this.m_matchBestName = string.Empty; + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + DlgBase.singleton.SetupBestCard(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchDocument.cs.meta new file mode 100644 index 00000000..ece8775e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 00a43b93469184245a7e49c03e2edfee +timeCreated: 1611402951 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchStep.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchStep.cs new file mode 100644 index 00000000..bcb9f44f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchStep.cs @@ -0,0 +1,11 @@ +using System; + +namespace XMainClient +{ + internal enum XGuildJockerMatchStep + { + BeforeGame, + InGame, + AfterGame + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchStep.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchStep.cs.meta new file mode 100644 index 00000000..de28d87f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchStep.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6ff3e2b063f6e304cac77a488b9b4165 +timeCreated: 1611403930 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchView.cs new file mode 100644 index 00000000..b4dac759 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchView.cs @@ -0,0 +1,505 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildJockerMatchView : XGuildJokerCommonView + { + public override string fileName + { + get + { + return "Guild/GuildSystem/GuildJokerMatchDlg"; + } + } + + public override bool fullscreenui + { + get + { + return true; + } + } + + private CardMatchState MatchState + { + get + { + return this._Doc.MatchState; + } + } + + protected override string BestName + { + get + { + return this._Doc.MatchBestJockerName; + } + } + + protected override int CurrentCardCount + { + get + { + return this._Doc.MatchJockers.Count; + } + } + + protected override List CurrentCard + { + get + { + return this._Doc.MatchJockers; + } + } + + protected override uint CardResult + { + get + { + return this._Doc.MatchResult; + } + } + + protected override List BestCard + { + get + { + return this._Doc.MatchBestJockers; + } + } + + protected override int CurrentStore + { + get + { + return (int)this._Doc.MatchJockerStore; + } + } + + private XGuildJockerMatchDocument _Doc; + + private IXUILabel m_beginTime; + + private IXUILabel m_roundTime; + + private IXUIScrollView m_RankScrollView; + + private IXUIWrapContent m_RankWrapContent; + + private IXUILabel m_RuleTip; + + public XYuyinView _yuyinHandler; + + public Transform m_MyRank; + + public IXUILabel m_addCountPerRound; + + public IXUILabel m_GameTip2; + + private uint m_changeTimer = 0u; + + private XUIPool m_rewardPool; + + private Transform m_rewardTransform; + + private Transform m_TotalIncomeTransform; + + protected override void Init() + { + base.Init(); + this._Doc = XDocuments.GetSpecificDocument(XGuildJockerMatchDocument.uuID); + this.m_beginTime = (base.uiBehaviour.transform.Find("Bg/BeginTime").GetComponent("XUILabel") as IXUILabel); + this.m_roundTime = (base.uiBehaviour.transform.Find("Bg/RoundTime").GetComponent("XUILabel") as IXUILabel); + this.m_RankScrollView = (base.uiBehaviour.transform.Find("Bg/Ranking/ScrollView").GetComponent("XUIScrollView") as IXUIScrollView); + this.m_RankWrapContent = (base.uiBehaviour.transform.Find("Bg/Ranking/ScrollView/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.m_RankWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnRankWrapItemUpdate)); + this.m_RuleTip = (base.uiBehaviour.transform.Find("Bg/Rule/Bg/RuleTip").GetComponent("XUILabel") as IXUILabel); + IXUIPanel ixuipanel = base.uiBehaviour.transform.GetComponent("XUIPanel") as IXUIPanel; + ixuipanel.SetDepth(2); + this.m_MyRank = base.uiBehaviour.transform.Find("Bg/Ranking/MyRank"); + this.m_addCountPerRound = (base.uiBehaviour.transform.Find("Bg/AddCount/Num").GetComponent("XUILabel") as IXUILabel); + this.m_GameTip2 = (base.uiBehaviour.transform.Find("Bg/GameTip2").GetComponent("XUILabel") as IXUILabel); + this.m_rewardPool = new XUIPool(XSingleton.singleton.m_uiTool); + this.m_TotalIncomeTransform = base.uiBehaviour.transform.Find("Bg/TotalIncome"); + this.m_rewardTransform = base.uiBehaviour.transform.Find("Bg/TotalIncome/RewardList"); + Transform transform = base.uiBehaviour.transform.Find("Bg/TotalIncome/RewardList/Reward"); + this.m_rewardPool.SetupPool(transform.parent.parent.gameObject, transform.gameObject, 4u, true); + } + + protected override SeqListRef GetCardReward(int index) + { + return XGuildJokerDocument._CardRewardTable.Table[index].matchreward; + } + + public void RefreshSelfRank(int score, int rank) + { + this.SetBaseInfo(this.m_MyRank, XSingleton.singleton.XPlayerData.Name, rank, score); + } + + public void SetRankInfo(int count) + { + this.m_RankWrapContent.SetContentCount(count, false); + this.m_RankScrollView.ResetPosition(); + } + + private void SetBaseInfo(Transform t, string name, int index, int score) + { + IXUILabelSymbol ixuilabelSymbol = t.Find("Name").GetComponent("XUILabelSymbol") as IXUILabelSymbol; + IXUILabel ixuilabel = t.Find("Score").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = t.Find("IndexSprite").GetComponent("XUISprite") as IXUISprite; + IXUILabel ixuilabel2 = t.Find("IndexLabel").GetComponent("XUILabel") as IXUILabel; + bool flag = index == -1; + if (flag) + { + ixuilabel2.Alpha = 1f; + ixuisprite.SetAlpha(0f); + ixuilabel2.SetText(XSingleton.singleton.GetString("NoRank")); + } + else + { + bool flag2 = index < 3; + if (flag2) + { + ixuilabel2.Alpha = 0f; + ixuisprite.SetAlpha(1f); + ixuisprite.SetSprite(string.Format("N{0}", index + 1)); + } + else + { + ixuilabel2.Alpha = 1f; + ixuisprite.SetAlpha(0f); + ixuilabel2.SetText((index + 1).ToString()); + } + } + ixuilabel.SetText(score.ToString()); + ixuilabelSymbol.InputText = name; + } + + private void OnRankWrapItemUpdate(Transform t, int index) + { + this.SetBaseInfo(t, (index < this._Doc.MatchRankNames.Count) ? this._Doc.MatchRankNames[index].ToString() : string.Empty, index, (index < this._Doc.MatchRankScores.Count) ? this._Doc.MatchRankScores[index] : 0); + } + + public void SetGameCount() + { + base.uiBehaviour.m_GameCount.SetText(this._Doc.MatchRound.ToString()); + base.uiBehaviour.m_ChangeCount.SetText(this._Doc.ChangeCount.ToString()); + } + + protected override void OnShow() + { + base.OnShow(); + this._Doc.wattingPTC = false; + base.SetupBestCard(); + this.RefreshWhenShow(); + this.SetRankInfo(this._Doc.MatchRankNames.Count); + ShowSettingArgs showSettingArgs = new ShowSettingArgs(); + showSettingArgs.position = 1; + showSettingArgs.needforceshow = true; + showSettingArgs.forceshow = true; + showSettingArgs.needdepth = true; + showSettingArgs.depth = 4; + DlgBase.singleton.ShowChatMiniUI(showSettingArgs); + this.m_RuleTip.SetText(XSingleton.singleton.ReplaceReturn(XSingleton.singleton.GetString("GUILD_JOKER_MATCH_RULE_TIP"))); + this.m_addCountPerRound.SetText(XSingleton.singleton.GetValue("CardMatchChangeAdd")); + bool flag = this._yuyinHandler != null; + if (flag) + { + this._yuyinHandler.Show(YuyinIconType.JOKER, 4); + this._yuyinHandler.Refresh(YuyinIconType.JOKER); + } + } + + public void RefreshWhenShow() + { + this.SetGameCount(); + base.SetCardStore(); + this.SetButtonState(); + this.ShowTimeClock(); + this.SetRoundInfo(); + this.SetRewardList(); + } + + public override void StackRefresh() + { + base.StackRefresh(); + this.RefreshWhenShow(); + } + + private void ShowTimeClock() + { + bool flag = this.MatchState == CardMatchState.CardMatch_StateEnd; + if (flag) + { + this.ShowGameOver(); + } + else + { + bool flag2 = this.MatchState == CardMatchState.CardMatch_StateRoundBegin || this.MatchState == CardMatchState.CardMatch_StateRounding || this.MatchState == CardMatchState.CardMatch_StateRoundEnd; + if (flag2) + { + this.ShowRoundTime(); + } + else + { + this.ShowWattingTime(); + } + } + } + + public void SetRoundInfo() + { + base.RefreshCard(); + this.SetCurrentReward(); + this.SetGameCount(); + base.SetCardStore(); + } + + protected override void OnLoad() + { + base.OnLoad(); + DlgHandlerBase.EnsureCreate(ref this._yuyinHandler, base.uiBehaviour.transform, true, this); + } + + public override void OnUpdate() + { + base.OnUpdate(); + bool flag = this._Doc.TimeLeft > 0.0; + if (flag) + { + string @string = XStringDefineProxy.GetString("GUILD_JOCKER_MATCH_WAITTING_LABEL"); + bool flag2 = this.m_beginTime.IsVisible(); + if (flag2) + { + this.m_beginTime.SetText(string.Format(@string, XSingleton.singleton.TimeDuarationFormatString((int)this._Doc.TimeLeft, 5))); + } + bool flag3 = this.m_roundTime.IsVisible(); + if (flag3) + { + this.m_roundTime.SetText(XSingleton.singleton.TimeDuarationFormatString((int)this._Doc.TimeLeft, 5)); + } + } + } + + protected override void OnHide() + { + this._Doc.SendJokerMatchExit(); + XSingleton.singleton.KillTimer(this.m_changeTimer); + ShowSettingArgs showSettingArgs = new ShowSettingArgs(); + showSettingArgs.position = 0; + showSettingArgs.needforceshow = true; + showSettingArgs.forceshow = false; + showSettingArgs.needdepth = true; + showSettingArgs.depth = 0; + showSettingArgs.anim = false; + DlgBase.singleton.ShowChatMiniUI(showSettingArgs); + base.OnHide(); + } + + protected override void OnUnload() + { + bool flag = this.m_rewardPool != null; + if (flag) + { + this.m_rewardPool = null; + } + DlgHandlerBase.EnsureUnload(ref this._yuyinHandler); + base.OnUnload(); + } + + private void ShowWattingTime() + { + this.m_beginTime.SetVisible(true); + this.m_roundTime.SetVisible(false); + base.SetGameTipStatus(false); + base.uiBehaviour.m_CurrentRewardTransfrom.gameObject.SetActive(false); + } + + private void ShowRoundTime() + { + base.uiBehaviour.m_CurrentRewardTransfrom.gameObject.SetActive(true); + this.m_beginTime.SetVisible(false); + this.m_roundTime.SetVisible(true); + base.SetGameTipStatus(this.MatchState == CardMatchState.CardMatch_StateRounding || this.MatchState == CardMatchState.CardMatch_StateRoundBegin); + } + + private void SetButtonState() + { + this.m_GameTip2.SetVisible(false); + bool flag = this.MatchState == CardMatchState.CardMatch_StateRounding || this.MatchState == CardMatchState.CardMatch_StateRoundBegin; + if (flag) + { + base.uiBehaviour.m_StartGame.SetGrey(this.CurrentCard.Count > 0); + base.uiBehaviour.m_StartGame.SetVisible(true); + base.SetButtonTip("GUILD_JOCKER_MATCH_GET"); + } + else + { + bool flag2 = this.MatchState == CardMatchState.CardMatch_StateRoundWaiting; + if (flag2) + { + base.uiBehaviour.m_StartGame.SetGrey(true); + base.uiBehaviour.m_StartGame.SetVisible(true); + base.SetButtonTip("GUILD_JOCKER_MATCH_WAITTING"); + } + else + { + bool flag3 = this.MatchState == CardMatchState.CardMatch_StateRoundEnd; + if (flag3) + { + base.uiBehaviour.m_StartGame.SetVisible(true); + base.uiBehaviour.m_StartGame.SetGrey(false); + } + else + { + bool flag4 = this.MatchState == CardMatchState.CardMatch_StateEnd; + if (flag4) + { + base.uiBehaviour.m_StartGame.SetVisible(true); + base.uiBehaviour.m_StartGame.SetGrey(true); + base.SetButtonTip("GUILD_REDPACKET_DETAIL_EXIT"); + this.m_GameTip2.SetVisible(true); + this.m_GameTip2.SetText(XSingleton.singleton.GetString("GUILD_JOCKER_MATCH_TIP_END")); + } + else + { + this.m_GameTip2.SetVisible(true); + this.m_GameTip2.SetText(XStringDefineProxy.GetString("GUILD_JOCKER_MATCH_TIP_START", new object[] + { + XSingleton.singleton.GetValue("CardMatchRound"), + XSingleton.singleton.GetValue("CardMatchRounding") + })); + base.uiBehaviour.m_StartGame.SetVisible(false); + } + } + } + } + } + + private void ShowGameOver() + { + XSingleton.singleton.KillTimer(this.m_changeTimer); + base.uiBehaviour.m_CurrentRewardTransfrom.gameObject.SetActive(false); + this.m_beginTime.SetVisible(false); + this.m_roundTime.SetVisible(false); + base.SetGameTipStatus(false); + } + + protected override bool OnCloseClick(IXUIButton button) + { + this.SetVisibleWithAnimation(false, null); + return true; + } + + protected override bool OnStartGameClicked(IXUIButton button) + { + bool flag = (this.MatchState == CardMatchState.CardMatch_StateRounding || this.MatchState == CardMatchState.CardMatch_StateRoundBegin) && this.CurrentCard.Count > 0; + if (flag) + { + this._Doc.SetJokerMatchRoundOver(); + } + else + { + bool flag2 = this.MatchState == CardMatchState.CardMatch_StateEnd; + if (flag2) + { + this.SetVisibleWithAnimation(false, null); + } + } + return true; + } + + protected override void OnCardClick(IXUISprite sp) + { + bool flag = this._changeCardLock || this._cardLock; + if (!flag) + { + bool flag2 = false; + for (int i = 0; i < this._Doc.MatchJockers.Count; i++) + { + bool flag3 = this._Doc.MatchJockers[i] == base.CardReAnalyze((uint)sp.ID); + if (flag3) + { + flag2 = true; + } + } + bool flag4 = !flag2; + if (!flag4) + { + bool flag5 = this._Doc.ChangeCount > 0u; + if (flag5) + { + this._Doc.SendGuildCardMatchChange(base.CardReAnalyze((uint)sp.ID)); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_JOCKER_NOTFREECOUNT"), "fece00"); + } + } + } + } + + public override void SetCurrentReward() + { + string text = string.Format("{0}:", XStringDefineProxy.GetString("CURRENT_REWARD")); + bool flag = this._Doc.MatchJockers.Count == 0; + if (flag) + { + base.SetCurrentRewardStr(text); + } + else + { + bool flag2 = this.CurrentCard.Count == 0; + if (flag2) + { + base.SetCurrentRewardStr(text); + } + else + { + bool flag3 = (ulong)this._Doc.MatchResult >= (ulong)((long)XGuildJokerDocument._CardRewardTable.Table.Length); + if (flag3) + { + text = string.Format("{0} {1}", text, XStringDefineProxy.GetString("NONE")); + } + else + { + CardRewardTable.RowData rowData = XGuildJokerDocument._CardRewardTable.Table[(int)this._Doc.MatchResult]; + for (int i = 0; i < rowData.matchreward.Count; i++) + { + text = string.Format("{0} {1}{2}", text, XLabelSymbolHelper.FormatSmallIcon((int)rowData.matchreward[i, 0]), rowData.matchreward[i, 1]); + } + List stringList = XSingleton.singleton.GetStringList("CardPointIcon"); + text = string.Format("{0} {1}{2}", text, XLabelSymbolHelper.FormatImage(stringList[0], stringList[1]), rowData.point); + } + base.SetCurrentRewardStr(text); + base.RefreshCardSelect(); + } + } + } + + private void SetRewardList() + { + int count = this._Doc.MatchItems.Count; + this.m_TotalIncomeTransform.gameObject.SetActive(count > 0); + this.m_rewardPool.ReturnAll(false); + for (int i = 0; i < count; i++) + { + GameObject gameObject = this.m_rewardPool.FetchGameObject(false); + gameObject.transform.parent = this.m_rewardTransform; + gameObject.transform.localPosition = new Vector3(0f, (float)(-(float)i * 28)); + ItemBrief itemBrief = this._Doc.MatchItems[i]; + IXUILabelSymbol ixuilabelSymbol = gameObject.GetComponent("XUILabelSymbol") as IXUILabelSymbol; + string text = string.Format("{0} X{1}", XLabelSymbolHelper.FormatSmallIcon((int)itemBrief.itemID), itemBrief.itemCount); + XSingleton.singleton.AddGreenLog("StrTemp:", text, null, null, null, null); + ixuilabelSymbol.InputText = text; + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchView.cs.meta new file mode 100644 index 00000000..c47386ab --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJockerMatchView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2e0143ed5bfa4b443ad8d586adc308b3 +timeCreated: 1611403508 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerBehaviour.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerBehaviour.cs new file mode 100644 index 00000000..864c31c7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerBehaviour.cs @@ -0,0 +1,97 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildJokerBehaviour : DlgBehaviourBase + { + public IXUIButton m_Close; + + public IXUIButton m_Help; + + public IXUIButton m_ReCharge; + + public IXUIButton m_AddCoin; + + public Transform[] m_CardPos = new Transform[5]; + + public Transform m_CardBag; + + public Transform[,] m_Card = new Transform[4, 13]; + + public IXUILabel m_GameCount; + + public IXUILabel m_ChangeCount; + + public IXUIButton m_StartGame; + + public Transform m_CurrentRewardTransfrom; + + public IXUILabelSymbol m_CurrentReward; + + public IXUILabel m_JokerLabel; + + public Transform m_Rule; + + public XUIPool m_RuleItemPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public IXUIScrollView m_RuleScrollView; + + public IXUIButton m_RuleClose; + + public IXUILabel m_ButtonTip; + + public IXUILabel m_BestPlayerName; + + public IXUILabel[] m_BestCardNum1 = new IXUILabel[5]; + + public IXUILabel[] m_BestCardNum2 = new IXUILabel[5]; + + public IXUISprite[] m_BestCardColor = new IXUISprite[5]; + + public Transform m_FireWorks; + + public IXUITexture m_JokerPic; + + public Transform m_GameTip; + + protected void Awake() + { + this.m_Close = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_Help = (base.transform.Find("Bg/Help").GetComponent("XUIButton") as IXUIButton); + this.m_ReCharge = (base.transform.Find("Bg/InfoFrame/InfoDC").GetComponent("XUIButton") as IXUIButton); + this.m_AddCoin = (base.transform.Find("Bg/InfoFrame/InfoGold").GetComponent("XUIButton") as IXUIButton); + for (int i = 0; i < 5; i++) + { + this.m_CardPos[i] = base.transform.Find(string.Format("Bg/CardPoint/Card{0}Pos", i + 1)); + this.m_CardPos[i].gameObject.SetActive(false); + } + this.m_CardBag = base.transform.Find("Bg/CardPoint/CardBag"); + this.m_GameCount = (base.transform.Find("Bg/GameCount/Num").GetComponent("XUILabel") as IXUILabel); + this.m_ChangeCount = (base.transform.Find("Bg/FreeChangeCount/Num").GetComponent("XUILabel") as IXUILabel); + this.m_StartGame = (base.transform.Find("Bg/Button").GetComponent("XUIButton") as IXUIButton); + this.m_CurrentRewardTransfrom = base.transform.Find("Bg/CurrentReward"); + this.m_CurrentReward = (base.transform.Find("Bg/CurrentReward/Text").GetComponent("XUILabelSymbol") as IXUILabelSymbol); + this.m_JokerLabel = (base.transform.Find("Bg/Talk/Text").GetComponent("XUILabel") as IXUILabel); + this.m_Rule = base.transform.Find("Bg/Rule"); + Transform transform = this.m_Rule.Find("Bg/RulePanel/Item"); + this.m_RuleItemPool.SetupPool(transform.parent.gameObject, transform.gameObject, 20u, false); + this.m_RuleClose = (this.m_Rule.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_RuleScrollView = (this.m_Rule.Find("Bg/RulePanel").GetComponent("XUIScrollView") as IXUIScrollView); + this.m_ButtonTip = (base.transform.Find("Bg/Button/Tip").GetComponent("XUILabel") as IXUILabel); + this.m_BestPlayerName = (base.transform.Find("Bg/TodayBest/Name").GetComponent("XUILabel") as IXUILabel); + for (int j = 0; j < 5; j++) + { + this.m_BestCardColor[j] = (base.transform.Find(string.Format("Bg/TodayBest/Name/Card{0}/Color", j + 1)).GetComponent("XUISprite") as IXUISprite); + this.m_BestCardNum1[j] = (base.transform.Find(string.Format("Bg/TodayBest/Name/Card{0}/Num1", j + 1)).GetComponent("XUILabel") as IXUILabel); + this.m_BestCardNum2[j] = (base.transform.Find(string.Format("Bg/TodayBest/Name/Card{0}/Num2", j + 1)).GetComponent("XUILabel") as IXUILabel); + } + this.m_FireWorks = base.transform.Find("Bg/FireWorks"); + this.m_JokerPic = (base.transform.Find("Bg/Joker").GetComponent("XUITexture") as IXUITexture); + this.m_GameTip = base.transform.Find("Bg/GameTip"); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerBehaviour.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerBehaviour.cs.meta new file mode 100644 index 00000000..1a69c764 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 94d5ca18b2d70a040a0fed28aa15103b +timeCreated: 1611404156 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerCommonView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerCommonView.cs new file mode 100644 index 00000000..b95c4928 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerCommonView.cs @@ -0,0 +1,740 @@ +using System; +using System.Collections.Generic; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildJokerCommonView : DlgBase where T : IXUIDlg, new() + { + public override int layer + { + get + { + return 1; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + protected virtual int CurrentStore + { + get + { + return 0; + } + } + + protected virtual int CurrentCardCount + { + get + { + return 0; + } + } + + protected virtual uint CardResult + { + get + { + return 0u; + } + } + + protected virtual List BestCard + { + get + { + return new List(); + } + } + + protected virtual string BestName + { + get + { + return string.Empty; + } + } + + protected virtual List CurrentCard + { + get + { + return new List(); + } + } + + protected uint _currentChangeCard; + + private uint _oldCardNum; + + private uint _oldCardType; + + private uint _newCardNum; + + private uint _newCardType; + + private int _cardChangeNum; + + protected bool _changeCardLock; + + protected bool _cardLock; + + public XTimerMgr.ElapsedEventHandler ResetJokerStatusCb = null; + + public XGuildJokerCommonView() + { + this.ResetJokerStatusCb = new XTimerMgr.ElapsedEventHandler(this.ResetJokerStatus); + } + + protected override void Init() + { + base.Init(); + this.CreateCard(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + + protected override void OnShow() + { + base.OnShow(); + base.uiBehaviour.m_Rule.gameObject.SetActive(false); + this.ClearCard(); + this.SetGameTipStatus(false); + this.ResetJokerStatus(null); + this._cardLock = false; + this._changeCardLock = false; + } + + public virtual void SetCurrentReward() + { + } + + protected virtual bool OnCloseClick(IXUIButton button) + { + return false; + } + + protected virtual bool OnEndGameClicked(IXUIButton button) + { + return false; + } + + protected virtual bool OnStartGameClicked(IXUIButton button) + { + return false; + } + + protected virtual void OnCardClick(IXUISprite sp) + { + } + + protected override void OnHide() + { + base.OnHide(); + base.uiBehaviour.m_JokerPic.SetTexturePath(""); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClick)); + base.uiBehaviour.m_Help.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHelpClick)); + base.uiBehaviour.m_ReCharge.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnRechargeClicked)); + base.uiBehaviour.m_AddCoin.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnAddCoinClicked)); + base.uiBehaviour.m_StartGame.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnStartGameClicked)); + base.uiBehaviour.m_RuleClose.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnRuleCloseClicked)); + } + + private bool OnRuleCloseClicked(IXUIButton sp) + { + base.uiBehaviour.m_Rule.gameObject.SetActive(false); + return true; + } + + private bool OnHelpClick(IXUIButton button) + { + base.uiBehaviour.m_Rule.gameObject.SetActive(true); + this.SetupRuleFrame(); + return true; + } + + private bool OnRechargeClicked(IXUIButton button) + { + XSingleton.singleton.OpenSystem(XSysDefine.XSys_Recharge, 0UL); + return true; + } + + private bool OnAddCoinClicked(IXUIButton button) + { + XPurchaseView singleton = DlgBase.singleton; + singleton.ReqQuickCommonPurchase(ItemEnum.GOLD); + return true; + } + + public void SetButtonTip(string tip) + { + base.uiBehaviour.m_ButtonTip.SetText(XStringDefineProxy.GetString(tip)); + } + + private void CreateCard() + { + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 13; j++) + { + string location = string.Format("UI/Guild/Card/Card{0}", j + 1); + base.uiBehaviour.m_Card[i, j] = (XSingleton.singleton.CreateFromPrefab(location, true, false) as GameObject).transform; + bool flag = i == 0; + if (flag) + { + base.uiBehaviour.m_Card[i, j].Find("T1").gameObject.SetActive(false); + (base.uiBehaviour.m_Card[i, j].Find("Hs").GetComponent("XUISprite") as IXUISprite).SetSprite("pk_01"); + } + else + { + bool flag2 = i == 1; + if (flag2) + { + base.uiBehaviour.m_Card[i, j].Find("T1").gameObject.SetActive(false); + (base.uiBehaviour.m_Card[i, j].Find("Hs").GetComponent("XUISprite") as IXUISprite).SetSprite("pk_02"); + } + else + { + bool flag3 = i == 2; + if (flag3) + { + base.uiBehaviour.m_Card[i, j].Find("T2").gameObject.SetActive(false); + (base.uiBehaviour.m_Card[i, j].Find("Hs").GetComponent("XUISprite") as IXUISprite).SetSprite("pk_03"); + } + else + { + bool flag4 = i == 3; + if (flag4) + { + base.uiBehaviour.m_Card[i, j].Find("T2").gameObject.SetActive(false); + (base.uiBehaviour.m_Card[i, j].Find("Hs").GetComponent("XUISprite") as IXUISprite).SetSprite("pk_04"); + } + } + } + } + base.uiBehaviour.m_Card[i, j].parent = base.uiBehaviour.m_CardBag; + base.uiBehaviour.m_Card[i, j].localScale = Vector3.one; + base.uiBehaviour.m_Card[i, j].name = (i * 13 + j).ToString(); + IXUISprite ixuisprite = base.uiBehaviour.m_Card[i, j].GetComponent("XUISprite") as IXUISprite; + ixuisprite.ID = (ulong)((j + 1) * 16 + i); + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnCardClick)); + base.uiBehaviour.m_Card[i, j].gameObject.SetActive(false); + } + } + } + + public void ClearCard() + { + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 13; j++) + { + base.uiBehaviour.m_Card[i, j].gameObject.SetActive(false); + base.uiBehaviour.m_Card[i, j].gameObject.transform.Find("Back").gameObject.SetActive(false); + base.uiBehaviour.m_Card[i, j].gameObject.transform.Find("Select").gameObject.SetActive(false); + (base.uiBehaviour.m_Card[i, j].GetComponent("XUIPlayTween") as IXUITweenTool).ResetTween(true); + } + } + this._changeCardLock = false; + } + + public void RefreshCard() + { + this.ClearCard(); + XSingleton.singleton.AddGreenLog("RefreshCard Times ??????", this.CurrentCardCount.ToString(), null, null, null, null); + bool flag = this.CurrentCardCount != 0; + if (flag) + { + XSingleton.singleton.SetTimer(0.5f, new XTimerMgr.ElapsedEventHandler(this.SetupCard), 0); + this._cardLock = true; + } + else + { + this._cardLock = false; + } + } + + private void SetupCard(object o) + { + int num = (int)o; + bool flag = num >= this.CurrentCardCount; + if (!flag) + { + uint num2 = this.CardAnalyze(this.CurrentCard[num]); + uint num3 = num2 >> 4; + uint num4 = num2 % 16u; + base.uiBehaviour.m_Card[(int)num4, (int)(num3 - 1u)].gameObject.SetActive(true); + (base.uiBehaviour.m_Card[(int)num4, (int)(num3 - 1u)].GetComponent("XUIPlayTween") as IXUITweenTool).ResetTween(true); + base.uiBehaviour.m_Card[(int)num4, (int)(num3 - 1u)].transform.position = base.uiBehaviour.m_CardPos[num].position; + base.uiBehaviour.m_Card[(int)num4, (int)(num3 - 1u)].transform.rotation = base.uiBehaviour.m_CardPos[num].rotation; + this.OnCardTween4Finish(base.uiBehaviour.m_Card[(int)num4, (int)(num3 - 1u)].GetComponent("XUIPlayTween") as IXUITweenTool); + bool flag2 = num + 1 < this.CurrentCardCount; + if (flag2) + { + XSingleton.singleton.SetTimer(0.2f, new XTimerMgr.ElapsedEventHandler(this.SetupCard), num + 1); + } + else + { + this._cardLock = false; + } + } + } + + private uint CardAnalyze(uint cardNum) + { + uint num = cardNum >> 4; + uint num2 = cardNum % 16u; + bool flag = num == 14u; + if (flag) + { + num = 1u; + } + return (num << 4) + num2; + } + + protected uint CardReAnalyze(uint cardNum) + { + uint num = cardNum >> 4; + uint num2 = cardNum % 16u; + bool flag = num == 1u; + if (flag) + { + num = 14u; + } + return (num << 4) + num2; + } + + public void ChangeCard(uint oldCard, uint newCard, int cardNum) + { + bool flag = newCard == 0u || oldCard == 0u || cardNum == -1; + if (!flag) + { + uint num = this.CardAnalyze(oldCard); + uint num2 = this.CardAnalyze(newCard); + this._oldCardNum = num >> 4; + this._oldCardType = num % 16u; + this._newCardNum = num2 >> 4; + this._newCardType = num2 % 16u; + this._cardChangeNum = cardNum; + XSingleton.singleton.AddGreenLog("Change Card:", this._oldCardNum.ToString(), " ", this._oldCardType.ToString(), null, null); + bool flag2 = this._oldCardType < 4u && this._oldCardNum < 14u; + if (flag2) + { + this.ClearCardSelect(); + this.PlayCardTween(base.uiBehaviour.m_Card[(int)this._oldCardType, (int)(this._oldCardNum - 1u)].GetComponent("XUIPlayTween") as IXUITweenTool); + } + } + } + + public void SetCardStore() + { + bool flag = this.CurrentStore >= XGuildJokerDocument._CardStoreTable.Table.Length; + string jokerLabel; + if (flag) + { + jokerLabel = string.Format("{0}", XStringDefineProxy.GetString("NONE")); + } + else + { + jokerLabel = string.Format("{0}", XGuildJokerDocument._CardStoreTable.Table[this.CurrentStore].words); + } + this.SetJokerLabel(jokerLabel); + } + + protected void SetJokerLabel(string strTmp) + { + base.uiBehaviour.m_JokerLabel.SetText(strTmp); + } + + protected void SetCurrentRewardStr(string strTmp) + { + base.uiBehaviour.m_CurrentReward.InputText = strTmp; + } + + private void ClearCardSelect() + { + for (int i = 0; i < this.CurrentCardCount; i++) + { + uint num = this.CardAnalyze(this.CurrentCard[i]); + uint num2 = num >> 4; + uint num3 = num % 16u; + base.uiBehaviour.m_Card[(int)num3, (int)(num2 - 1u)].Find("Select").gameObject.SetActive(false); + } + } + + public void SetupBestCard() + { + bool flag = this.BestCard.Count == 0; + if (flag) + { + for (int i = 0; i < 5; i++) + { + base.uiBehaviour.m_BestCardColor[i].SetVisible(false); + base.uiBehaviour.m_BestCardNum1[i].SetVisible(false); + base.uiBehaviour.m_BestCardNum2[i].SetVisible(false); + } + } + for (int j = 0; j < this.BestCard.Count; j++) + { + uint num = this.CardAnalyze(this.BestCard[j]); + uint num2 = num >> 4; + uint num3 = num % 16u; + base.uiBehaviour.m_BestCardColor[j].SetVisible(true); + base.uiBehaviour.m_BestCardColor[j].SetSprite(string.Format("pk_0{0}", num3 + 1u)); + bool flag2 = num3 < 2u; + if (flag2) + { + base.uiBehaviour.m_BestCardNum1[j].SetVisible(false); + base.uiBehaviour.m_BestCardNum2[j].SetVisible(true); + bool flag3 = num2 > 1u && num2 < 11u; + if (flag3) + { + base.uiBehaviour.m_BestCardNum2[j].SetText(num2.ToString()); + } + else + { + bool flag4 = num2 == 1u; + if (flag4) + { + base.uiBehaviour.m_BestCardNum2[j].SetText("A"); + } + else + { + bool flag5 = num2 == 11u; + if (flag5) + { + base.uiBehaviour.m_BestCardNum2[j].SetText("J"); + } + else + { + bool flag6 = num2 == 12u; + if (flag6) + { + base.uiBehaviour.m_BestCardNum2[j].SetText("Q"); + } + else + { + bool flag7 = num2 == 13u; + if (flag7) + { + base.uiBehaviour.m_BestCardNum2[j].SetText("K"); + } + } + } + } + } + } + else + { + base.uiBehaviour.m_BestCardNum1[j].SetVisible(true); + base.uiBehaviour.m_BestCardNum2[j].SetVisible(false); + bool flag8 = num2 > 1u && num2 < 11u; + if (flag8) + { + base.uiBehaviour.m_BestCardNum1[j].SetText(num2.ToString()); + } + else + { + bool flag9 = num2 == 1u; + if (flag9) + { + base.uiBehaviour.m_BestCardNum1[j].SetText("A"); + } + else + { + bool flag10 = num2 == 11u; + if (flag10) + { + base.uiBehaviour.m_BestCardNum1[j].SetText("J"); + } + else + { + bool flag11 = num2 == 12u; + if (flag11) + { + base.uiBehaviour.m_BestCardNum1[j].SetText("Q"); + } + else + { + bool flag12 = num2 == 13u; + if (flag12) + { + base.uiBehaviour.m_BestCardNum1[j].SetText("K"); + } + } + } + } + } + } + } + base.uiBehaviour.m_BestPlayerName.SetText(this.BestName); + } + + protected virtual SeqListRef GetCardReward(int index) + { + return XGuildJokerDocument._CardRewardTable.Table[index].reward; + } + + public void SetupRuleFrame() + { + base.uiBehaviour.m_RuleItemPool.FakeReturnAll(); + for (int i = 0; i < XGuildJokerDocument._CardRewardTable.Table.Length; i++) + { + string text = string.Format("Bg/RulePanel/RuleTpl{0}/ScoreTip", i + 1); + IXUILabel ixuilabel = base.uiBehaviour.m_Rule.Find(text).GetComponent("XUILabel") as IXUILabel; + bool flag = ixuilabel != null; + if (flag) + { + ixuilabel.SetText(XGuildJokerDocument._CardRewardTable.Table[i].point.ToString()); + } + SeqListRef cardReward = this.GetCardReward(i); + for (int j = 0; j < cardReward.Count; j++) + { + GameObject gameObject = base.uiBehaviour.m_RuleItemPool.FetchGameObject(false); + IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.ID = (ulong)cardReward[j, 0]; + XSingleton.singleton.normalItemDrawer.DrawItem(gameObject, (int)cardReward[j, 0], (int)cardReward[j, 1], false); + gameObject.transform.localPosition = base.uiBehaviour.m_RuleItemPool.TplPos + new Vector3((float)(j * base.uiBehaviour.m_RuleItemPool.TplWidth), (float)(-(float)i * base.uiBehaviour.m_RuleItemPool.TplHeight)); + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton.singleton.OnItemClick)); + } + } + base.uiBehaviour.m_RuleItemPool.ActualReturnAll(false); + base.uiBehaviour.m_RuleScrollView.ResetPosition(); + } + + private void PlayCardTween(IXUITweenTool cardTween) + { + bool flag = !base.IsVisible(); + if (!flag) + { + bool flag2 = this.CurrentCardCount == 0; + if (!flag2) + { + XSingleton.singleton.PlayUISound("Audio/UI/puke", true, AudioChannel.Action); + this._changeCardLock = true; + cardTween.PlayTween(true, -1f); + cardTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnCardTween1Finish)); + } + } + } + + private void OnCardTween1Finish(IXUITweenTool cardTween) + { + bool flag = !base.IsVisible(); + if (!flag) + { + bool flag2 = this.CurrentCardCount == 0; + if (!flag2) + { + Transform transform = cardTween.gameObject.transform.Find("Back"); + transform.gameObject.SetActive(true); + cardTween.PlayTween(false, -1f); + cardTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnCardTween2Finish)); + } + } + } + + private void PlayCardWaitTween(object o) + { + bool flag = !base.IsVisible(); + if (!flag) + { + bool flag2 = this.CurrentCardCount == 0; + if (!flag2) + { + base.uiBehaviour.m_Card[(int)this._oldCardType, (int)(this._oldCardNum - 1u)].gameObject.SetActive(false); + base.uiBehaviour.m_Card[(int)this._newCardType, (int)(this._newCardNum - 1u)].gameObject.SetActive(true); + base.uiBehaviour.m_Card[(int)this._newCardType, (int)(this._newCardNum - 1u)].transform.position = base.uiBehaviour.m_CardPos[this._cardChangeNum].position; + base.uiBehaviour.m_Card[(int)this._newCardType, (int)(this._newCardNum - 1u)].transform.rotation = base.uiBehaviour.m_CardPos[this._cardChangeNum].rotation; + base.uiBehaviour.m_Card[(int)this._newCardType, (int)(this._newCardNum - 1u)].transform.Find("Back").gameObject.SetActive(true); + base.uiBehaviour.m_Card[(int)this._newCardType, (int)(this._newCardNum - 1u)].transform.Find("Select").gameObject.SetActive(false); + IXUITweenTool ixuitweenTool = base.uiBehaviour.m_Card[(int)this._newCardType, (int)(this._newCardNum - 1u)].GetComponent("XUIPlayTween") as IXUITweenTool; + ixuitweenTool.ResetTween(true); + ixuitweenTool.PlayTween(true, -1f); + ixuitweenTool.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnCardTween3Finish)); + } + } + } + + private void OnCardTween2Finish(IXUITweenTool cardTween) + { + bool flag = !base.IsVisible(); + if (!flag) + { + bool flag2 = this.CurrentCardCount == 0; + if (!flag2) + { + XSingleton.singleton.SetTimer(0.3f, new XTimerMgr.ElapsedEventHandler(this.PlayCardWaitTween), cardTween); + cardTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnCardTween3Finish)); + } + } + } + + private void OnCardTween4Finish(IXUITweenTool cardTween) + { + bool flag = !base.IsVisible(); + if (!flag) + { + bool flag2 = this.CurrentCardCount == 0; + if (!flag2) + { + cardTween.gameObject.transform.Find("Back").gameObject.SetActive(true); + cardTween.gameObject.transform.Find("Select").gameObject.SetActive(false); + XSingleton.singleton.PlayUISound("Audio/UI/puke", true, AudioChannel.Action); + this._changeCardLock = true; + cardTween.ResetTween(true); + cardTween.PlayTween(true, -1f); + cardTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnCardTween3Finish)); + } + } + } + + private void OnCardTween3Finish(IXUITweenTool cardTween) + { + bool flag = !base.IsVisible(); + if (!flag) + { + bool flag2 = this.CurrentCardCount == 0; + if (!flag2) + { + Transform transform = cardTween.gameObject.transform.Find("Back"); + transform.gameObject.SetActive(false); + cardTween.PlayTween(false, -1f); + cardTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnCardTweenOver)); + } + } + } + + private void OnCardTweenOver(IXUITweenTool cardTween) + { + bool flag = !base.IsVisible(); + if (!flag) + { + bool flag2 = this.CurrentCardCount == 0; + if (!flag2) + { + this._changeCardLock = false; + this.SetCurrentReward(); + } + } + } + + protected void RefreshCardSelect() + { + bool flag = this.CardResult == 0u || this.CardResult == 2u || this.CardResult == 3u || this.CardResult == 4u; + if (flag) + { + for (int i = 0; i < this.CurrentCardCount; i++) + { + uint num = this.CardAnalyze(this.CurrentCard[i]); + uint num2 = num >> 4; + uint type = num % 16u; + this.SetCardSelected(type, num2 - 1u); + } + } + else + { + for (int j = 0; j < this.CurrentCardCount; j++) + { + uint num3 = this.CardAnalyze(this.CurrentCard[j]); + uint num4 = num3 >> 4; + uint type2 = num3 % 16u; + for (int k = j + 1; k < this.CurrentCardCount; k++) + { + uint num5 = this.CardAnalyze(this.CurrentCard[k]); + uint num6 = num5 >> 4; + uint type3 = num5 % 16u; + bool flag2 = num4 == num6; + if (flag2) + { + this.SetCardSelected(type2, num4 - 1u); + this.SetCardSelected(type3, num6 - 1u); + } + } + } + } + } + + private void SetCardSelected(uint type, uint index) + { + bool flag = type >= 4u || index >= 13u; + if (flag) + { + XSingleton.singleton.AddErrorLog(string.Format("type == {0}, index={1}", type, index), null, null, null, null, null); + } + else + { + bool flag2 = base.uiBehaviour.m_Card[(int)type, (int)index] == null; + if (!flag2) + { + base.uiBehaviour.m_Card[(int)type, (int)index].Find("Select").gameObject.SetActive(true); + } + } + } + + public void JokerStatus(int status) + { + switch (status) + { + case 1: + base.uiBehaviour.m_JokerPic.SetTexturePath("atlas/UI/Social/gh_bg_xcpk_xc0"); + break; + case 2: + base.uiBehaviour.m_JokerPic.SetTexturePath("atlas/UI/Social/gh_bg_xcpk_xc1"); + break; + case 3: + base.uiBehaviour.m_JokerPic.SetTexturePath("atlas/UI/Social/gh_bg_xcpk_xc2"); + break; + } + } + + private void ResetJokerStatus(object o = null) + { + bool flag = !base.IsVisible(); + if (!flag) + { + this.JokerStatus(1); + } + } + + public void SetGameTipStatus(bool status) + { + base.uiBehaviour.m_GameTip.gameObject.SetActive(status); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerCommonView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerCommonView.cs.meta new file mode 100644 index 00000000..00250730 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerCommonView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4b114e4d9d2f96145803606787b50e18 +timeCreated: 1611403685 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerDocument.cs new file mode 100644 index 00000000..d4dfe1c9 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerDocument.cs @@ -0,0 +1,288 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildJokerDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildJokerDocument.uuID; + } + } + + public uint CardResult { get; set; } + + public uint CardStore { get; set; } + + public int GameCount { get; set; } + + public int ChangeCount { get; set; } + + public int BuyChangeCount { get; set; } + + public List RankNames + { + get + { + bool flag = this.m_RankNames == null; + if (flag) + { + this.m_RankNames = new List(); + } + return this.m_RankNames; + } + } + + public List RankScores + { + get + { + bool flag = this.m_RankScores == null; + if (flag) + { + this.m_RankScores = new List(); + } + return this.m_RankScores; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildJokerDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + public static CardRewardTable _CardRewardTable = new CardRewardTable(); + + public static CardStoreTable _CardStoreTable = new CardStoreTable(); + + public List CurrentCard = new List(); + + public List BestCard = new List(); + + public string BestName; + + public uint JokerToken; + + public bool WaitRpc = false; + + private float guildJokerStartTime = 0f; + + private List m_RankNames; + + private List m_RankScores; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildJokerDocument.AsyncLoader.AddTask("Table/CardReward", XGuildJokerDocument._CardRewardTable, false); + XGuildJokerDocument.AsyncLoader.AddTask("Table/CardStore", XGuildJokerDocument._CardStoreTable, false); + XGuildJokerDocument.AsyncLoader.Execute(callback); + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + } + + public override void OnEnterScene() + { + base.OnEnterScene(); + bool flag = XSingleton.singleton.CurrentStage.Stage == EXStage.Hall; + if (flag) + { + this.QueryGameCount(); + } + } + + public void QueryGameCount() + { + RpcC2G_QueryGuildCard rpc = new RpcC2G_QueryGuildCard(); + XSingleton.singleton.Send(rpc); + } + + public void SendJokerRank(uint type) + { + PtcC2M_GuildCardRankReq ptcC2M_GuildCardRankReq = new PtcC2M_GuildCardRankReq(); + ptcC2M_GuildCardRankReq.Data.type = type; + XSingleton.singleton.Send(ptcC2M_GuildCardRankReq); + } + + public void ReceiveJockerRank(List names, List scores) + { + this.m_RankNames = names; + this.m_RankScores = scores; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetRankData(names.Count); + } + } + + public void SendStartGame() + { + bool flag = Time.time - this.guildJokerStartTime < 2f; + if (!flag) + { + this.guildJokerStartTime = Time.time; + RpcC2G_StartGuildCard rpc = new RpcC2G_StartGuildCard(); + XSingleton.singleton.Send(rpc); + } + } + + public void SendChangeCard(uint card) + { + bool waitRpc = this.WaitRpc; + if (!waitRpc) + { + this.WaitRpc = true; + RpcC2G_ChangeGuildCard rpcC2G_ChangeGuildCard = new RpcC2G_ChangeGuildCard(); + rpcC2G_ChangeGuildCard.oArg.card = card; + XSingleton.singleton.Send(rpcC2G_ChangeGuildCard); + } + } + + public void SendGameEnd() + { + RpcC2G_EndGuildCard rpc = new RpcC2G_EndGuildCard(); + XSingleton.singleton.Send(rpc); + } + + public void SetGameCount(uint gameCount, uint changeCount, uint buyChangeCount) + { + this.GameCount = (int)gameCount; + this.ChangeCount = (int)changeCount; + this.BuyChangeCount = (int)buyChangeCount; + XGuildRelaxGameDocument specificDocument = XDocuments.GetSpecificDocument(XGuildRelaxGameDocument.uuID); + specificDocument.RefreshRedPoint(); + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildRelax_Joker, true); + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + DlgBase.singleton.SetGameCount(); + } + } + + public void ShowCard(List card, uint result, uint store) + { + this.CardResult = result; + this.CardStore = store; + this.GameCount = Math.Max(0, this.GameCount - 1); + this.CurrentCard.Clear(); + for (int i = 0; i < card.Count; i++) + { + this.CurrentCard.Add(card[i]); + } + XGuildRelaxGameDocument specificDocument = XDocuments.GetSpecificDocument(XGuildRelaxGameDocument.uuID); + specificDocument.RefreshRedPoint(); + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + DlgBase.singleton.RefreshCard(); + DlgBase.singleton.SetCurrentReward(); + DlgBase.singleton.SetGameTipStatus(true); + DlgBase.singleton.SetGameCount(); + DlgBase.singleton.SetCardStore(); + bool flag2 = this.CardResult != 8u; + if (flag2) + { + DlgBase.singleton.SetButtonTip("GET_REWARD"); + } + else + { + DlgBase.singleton.SetButtonTip("END_GAME"); + } + } + } + + public void ChangeCard(uint oldCard, uint newCard, uint result) + { + this.WaitRpc = false; + bool flag = this.ChangeCount != 0; + if (flag) + { + this.ChangeCount--; + } + else + { + this.BuyChangeCount++; + } + this.CardResult = result; + int cardNum = 0; + for (int i = 0; i < this.CurrentCard.Count; i++) + { + bool flag2 = this.CurrentCard[i] != oldCard; + if (!flag2) + { + this.CurrentCard[i] = newCard; + cardNum = i; + } + } + bool flag3 = !DlgBase.singleton.IsVisible(); + if (!flag3) + { + DlgBase.singleton.ChangeCard(oldCard, newCard, cardNum); + DlgBase.singleton.SetGameCount(); + } + } + + public void EndCardGame(uint result) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshRank(); + bool flag2 = this.CardResult != 8u; + if (flag2) + { + XSingleton.singleton.PlayUISound("Audio/UI/pukeshenli", true, AudioChannel.Action); + DlgBase.singleton.JokerStatus(2); + XSingleton.singleton.KillTimer(this.JokerToken); + this.JokerToken = XSingleton.singleton.SetTimer(1f, DlgBase.singleton.ResetJokerStatusCb, null); + } + else + { + XSingleton.singleton.PlayUISound("Audio/UI/pukeshibai", true, AudioChannel.Action); + DlgBase.singleton.JokerStatus(3); + XSingleton.singleton.KillTimer(this.JokerToken); + this.JokerToken = XSingleton.singleton.SetTimer(1f, DlgBase.singleton.ResetJokerStatusCb, null); + } + } + this.CurrentCard.Clear(); + this.CardResult = 8u; + this.CardStore = 5u; + bool flag3 = !DlgBase.singleton.IsVisible(); + if (!flag3) + { + DlgBase.singleton.ClearCard(); + DlgBase.singleton.SetGameTipStatus(false); + DlgBase.singleton.SetButtonTip("START_GAME"); + DlgBase.singleton.SetCurrentReward(); + DlgBase.singleton.SetCardStore(); + } + } + + public void SetBestCard(List card, string name) + { + this.BestCard.Clear(); + for (int i = 0; i < card.Count; i++) + { + this.BestCard.Add(card[i]); + } + this.BestName = name; + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + DlgBase.singleton.SetupBestCard(); + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + this.WaitRpc = false; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerDocument.cs.meta new file mode 100644 index 00000000..b68448bc --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ddefee189f7d07b459976e4ffc822af7 +timeCreated: 1611404684 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerView.cs new file mode 100644 index 00000000..7d213864 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerView.cs @@ -0,0 +1,375 @@ +using System; +using System.Collections.Generic; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildJokerView : XGuildJokerCommonView + { + public override string fileName + { + get + { + return "Guild/GuildSystem/GuildJokerDlg"; + } + } + + public override bool fullscreenui + { + get + { + return true; + } + } + + protected override string BestName + { + get + { + return this._doc.BestName; + } + } + + protected override int CurrentCardCount + { + get + { + return this._doc.CurrentCard.Count; + } + } + + protected override List CurrentCard + { + get + { + return this._doc.CurrentCard; + } + } + + protected override uint CardResult + { + get + { + return this._doc.CardResult; + } + } + + protected override int CurrentStore + { + get + { + return (int)this._doc.CardStore; + } + } + + protected override List BestCard + { + get + { + return this._doc.BestCard; + } + } + + private XGuildJokerDocument _doc = null; + + private IXUIScrollView m_ScrollView; + + private IXUIWrapContent m_WrapContent; + + private IXUICheckBox m_TeamCheck; + + private IXUICheckBox m_GuildCheck; + + private XGuildJokerView.TabType m_CurrType = XGuildJokerView.TabType.Team; + + private IXUILabel m_RuleTip; + + public enum TabType + { + Team, + Guild + } + + protected override void Init() + { + base.Init(); + this._doc = XDocuments.GetSpecificDocument(XGuildJokerDocument.uuID); + this.m_ScrollView = (base.uiBehaviour.transform.Find("Bg/Ranking/ScrollView").GetComponent("XUIScrollView") as IXUIScrollView); + this.m_WrapContent = (base.uiBehaviour.transform.Find("Bg/Ranking/ScrollView/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.m_WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnRankWrapItemUpdate)); + this.m_TeamCheck = (base.uiBehaviour.transform.Find("Bg/Ranking/Team").GetComponent("XUICheckBox") as IXUICheckBox); + this.m_GuildCheck = (base.uiBehaviour.transform.Find("Bg/Ranking/Guild").GetComponent("XUICheckBox") as IXUICheckBox); + this.m_RuleTip = (base.uiBehaviour.transform.Find("Bg/Rule/Bg/RuleTip").GetComponent("XUILabel") as IXUILabel); + } + + protected override void OnShow() + { + base.OnShow(); + this._doc.WaitRpc = false; + this._doc.CardStore = 5u; + this.m_TeamCheck.bChecked = true; + this._doc.QueryGameCount(); + this.RefreshRank(); + this.m_RuleTip.SetText(XSingleton.singleton.ReplaceReturn(XSingleton.singleton.GetString("GUILD_JOKER_RULE_TIP"))); + this.WhenReturnShow(); + } + + protected override void OnHide() + { + bool flag = this._doc != null; + if (flag) + { + this._doc.CurrentCard.Clear(); + this._doc.WaitRpc = false; + } + base.OnHide(); + } + + private void WhenReturnShow() + { + bool flag = this._doc.CurrentCard.Count == 0; + if (flag) + { + base.SetButtonTip("START_GAME"); + } + else + { + bool flag2 = this.CardResult != 8u; + if (flag2) + { + base.SetButtonTip("GET_REWARD"); + } + else + { + base.SetButtonTip("END_GAME"); + } + } + base.SetCardStore(); + base.RefreshCard(); + this.SetGameCount(); + base.SetGameTipStatus(true); + this.SetCurrentReward(); + } + + protected override SeqListRef GetCardReward(int index) + { + return XGuildJokerDocument._CardRewardTable.Table[index].reward; + } + + public void SetRankData(int length) + { + this.m_WrapContent.SetContentCount(length, false); + this.m_ScrollView.ResetPosition(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + this.m_TeamCheck.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.TeamCheckHandler)); + this.m_GuildCheck.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.GuildCheckHandler)); + } + + private bool TeamCheckHandler(IXUICheckBox check) + { + this.m_WrapContent.SetContentCount(0, false); + bool flag = !check.bChecked; + bool result; + if (flag) + { + result = false; + } + else + { + this.m_CurrType = XGuildJokerView.TabType.Team; + this._doc.SendJokerRank(0u); + result = true; + } + return result; + } + + private bool GuildCheckHandler(IXUICheckBox check) + { + this.m_WrapContent.SetContentCount(0, false); + bool flag = !check.bChecked; + bool result; + if (flag) + { + result = false; + } + else + { + this.m_CurrType = XGuildJokerView.TabType.Guild; + this._doc.SendJokerRank(1u); + result = true; + } + return result; + } + + private void OnRankWrapItemUpdate(Transform t, int index) + { + IXUILabelSymbol ixuilabelSymbol = t.Find("Name").GetComponent("XUILabelSymbol") as IXUILabelSymbol; + IXUILabel ixuilabel = t.Find("Score").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = t.Find("IndexSprite").GetComponent("XUISprite") as IXUISprite; + IXUILabel ixuilabel2 = t.Find("IndexLabel").GetComponent("XUILabel") as IXUILabel; + bool flag = index < 3; + if (flag) + { + ixuilabel2.Alpha = 0f; + ixuisprite.SetAlpha(1f); + ixuisprite.SetSprite(string.Format("N{0}", index + 1)); + } + else + { + ixuilabel2.Alpha = 1f; + ixuisprite.SetAlpha(0f); + ixuilabel2.SetText((index + 1).ToString()); + } + ixuilabel.SetText((index < this._doc.RankScores.Count) ? this._doc.RankScores[index].ToString() : "0"); + ixuilabelSymbol.InputText = ((index < this._doc.RankNames.Count) ? this._doc.RankNames[index].ToString() : string.Empty); + } + + private bool OnBuyChangeCount(IXUIButton button) + { + this._doc.SendChangeCard(base.CardReAnalyze(this._currentChangeCard)); + XSingleton.singleton.CloseModalDlg(); + return true; + } + + protected override bool OnStartGameClicked(IXUIButton button) + { + bool flag = this._changeCardLock || this._cardLock; + bool result; + if (flag) + { + result = true; + } + else + { + bool flag2 = this._doc.CurrentCard.Count == 0; + if (flag2) + { + this._doc.SendStartGame(); + } + else + { + this._doc.SendGameEnd(); + } + result = true; + } + return result; + } + + public void RefreshRank() + { + bool flag = this.m_CurrType == XGuildJokerView.TabType.Team; + if (flag) + { + this._doc.SendJokerRank(0u); + } + bool flag2 = this.m_CurrType == XGuildJokerView.TabType.Guild; + if (flag2) + { + this._doc.SendJokerRank(1u); + } + } + + protected override bool OnEndGameClicked(IXUIButton button) + { + this._doc.SendGameEnd(); + DlgBase.singleton.SetVisible(false, true); + this.SetVisible(false, true); + return true; + } + + protected override bool OnCloseClick(IXUIButton button) + { + bool flag = this._doc.CurrentCard.Count != 0; + if (flag) + { + XSingleton.singleton.ShowModalDialog(XStringDefineProxy.GetString("LEAVE_JOKER_CARD_GAME"), XStringDefineProxy.GetString("COMMON_OK"), XStringDefineProxy.GetString("COMMON_CANCEL"), new ButtonClickEventHandler(this.OnEndGameClicked)); + } + else + { + this.SetVisible(false, true); + } + return true; + } + + public void SetGameCount() + { + base.uiBehaviour.m_GameCount.SetText(this._doc.GameCount.ToString()); + base.uiBehaviour.m_ChangeCount.SetText(this._doc.ChangeCount.ToString()); + } + + protected override void OnCardClick(IXUISprite sp) + { + bool flag = this._changeCardLock || this._cardLock; + if (!flag) + { + bool flag2 = false; + for (int i = 0; i < this._doc.CurrentCard.Count; i++) + { + bool flag3 = this._doc.CurrentCard[i] == base.CardReAnalyze((uint)sp.ID); + if (flag3) + { + flag2 = true; + } + } + bool flag4 = !flag2; + if (!flag4) + { + bool flag5 = this._doc.ChangeCount == 0; + if (flag5) + { + CostInfo costInfo = XSingleton.singleton.QueryCost("BuyCardChangeCost", this._doc.BuyChangeCount); + this._currentChangeCard = (uint)sp.ID; + XSingleton.singleton.ShowModalDialog(XStringDefineProxy.GetString("CHANGE_CARD_COST", new object[] + { + XLabelSymbolHelper.FormatCostWithIcon((int)costInfo.count, ItemEnum.DRAGON_COIN), + costInfo.count + 1u + }), XStringDefineProxy.GetString("COMMON_OK"), XStringDefineProxy.GetString("COMMON_CANCEL"), new ButtonClickEventHandler(this.OnBuyChangeCount)); + } + else + { + this._doc.SendChangeCard(base.CardReAnalyze((uint)sp.ID)); + } + } + } + } + + public override void SetCurrentReward() + { + string text = string.Format("{0}:", XStringDefineProxy.GetString("CURRENT_REWARD")); + bool flag = this._doc.CurrentCard.Count == 0; + if (flag) + { + base.SetCurrentRewardStr(text); + } + else + { + bool flag2 = (ulong)this._doc.CardResult >= (ulong)((long)XGuildJokerDocument._CardRewardTable.Table.Length); + if (flag2) + { + text = string.Format("{0} {1}", text, XStringDefineProxy.GetString("NONE")); + DlgBase.singleton.SetButtonTip("END_GAME"); + } + else + { + for (int i = 0; i < XGuildJokerDocument._CardRewardTable.Table[(int)this._doc.CardResult].reward.Count; i++) + { + text = string.Format("{0} {1}{2}", text, XLabelSymbolHelper.FormatSmallIcon((int)XGuildJokerDocument._CardRewardTable.Table[(int)this._doc.CardResult].reward[i, 0]), XGuildJokerDocument._CardRewardTable.Table[(int)this._doc.CardResult].reward[i, 1]); + } + DlgBase.singleton.SetButtonTip("GET_REWARD"); + List stringList = XSingleton.singleton.GetStringList("CardPointIcon"); + text = string.Format("{0} {1}{2}", text, XLabelSymbolHelper.FormatImage(stringList[0], stringList[1]), XGuildJokerDocument._CardRewardTable.Table[(int)this._doc.CardResult].point); + } + base.SetCurrentRewardStr(text); + base.RefreshCardSelect(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerView.cs.meta new file mode 100644 index 00000000..70c5745e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildJokerView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f8907a906c8b13441bfd2728c48a1f33 +timeCreated: 1611404893 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLevelChangedEventArgs.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildLevelChangedEventArgs.cs new file mode 100644 index 00000000..7e5303a6 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLevelChangedEventArgs.cs @@ -0,0 +1,21 @@ +using System; + +namespace XMainClient +{ + internal class XGuildLevelChangedEventArgs : XEventArgs + { + public uint level = 0u; + + public XGuildLevelChangedEventArgs() + { + this._eDefine = XEventDefine.XEvent_GuildLevelChanged; + } + + public override void Recycle() + { + base.Recycle(); + this.level = 0u; + XEventPool.Recycle(this); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLevelChangedEventArgs.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildLevelChangedEventArgs.cs.meta new file mode 100644 index 00000000..0d4c06c1 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLevelChangedEventArgs.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 97a611a26b3a9dd4098f9b7ee51bacae +timeCreated: 1611404188 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildListData.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildListData.cs new file mode 100644 index 00000000..c602bd1b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildListData.cs @@ -0,0 +1,33 @@ +using System; +using KKSG; + +namespace XMainClient +{ + internal class XGuildListData : XGuildBasicData + { + public bool bIsApplying; + + public bool bNeedApprove; + + public uint requiredPPT; + + public static int[] DefaultSortDirection = new int[] + { + 1, + 1, + -1, + -1, + -1, + 1, + 1 + }; + + public override void Init(GuildInfo info) + { + base.Init(info); + this.bIsApplying = info.isSendApplication; + this.requiredPPT = (uint)info.ppt; + this.bNeedApprove = (info.needapproval == 1); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildListData.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildListData.cs.meta new file mode 100644 index 00000000..c4c727fd --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildListData.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 681744ba608cfaa44bec78b5fedfaec9 +timeCreated: 1611403881 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildListDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildListDocument.cs new file mode 100644 index 00000000..f6bee6c7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildListDocument.cs @@ -0,0 +1,307 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildListDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildListDocument.uuID; + } + } + + public XGuildListView GuildListView { get; set; } + + public List ListData + { + get + { + return this._ListData; + } + } + + public GuildSortType SortType + { + get + { + return this.m_SortType; + } + set + { + bool flag = this.m_SortType != value; + if (flag) + { + this.m_Direction = XGuildListData.DefaultSortDirection[XFastEnumIntEqualityComparer.ToInt(value)]; + } + else + { + this.m_Direction = -this.m_Direction; + } + this.m_SortType = value; + } + } + + public int SortDirection + { + get + { + return this.m_Direction; + } + } + + public string SearchText { get; set; } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildListDocument"); + + private static readonly int COUNT_PER_PULL = 5; + + private static readonly int COUNT_ALL = 500; + + private static readonly int NAME_LENGTH_LIMIT = 8; + + private List _ListData = new List(); + + private GuildSortType m_SortType = GuildSortType.GuildSortByLevel; + + private int m_Direction = XGuildListData.DefaultSortDirection[XFastEnumIntEqualityComparer.ToInt(GuildSortType.GuildSortByLevel)]; + + private void _ClearAllList() + { + for (int i = 0; i < this._ListData.Count; i++) + { + this._ListData[i].Recycle(); + } + this._ListData.Clear(); + } + + private void _AddTail() + { + XGuildListData data = XDataPool.GetData(); + data.uid = 0UL; + this._ListData.Add(data); + } + + private void _RemoveTail() + { + bool flag = this._ListData.Count > 0 && this._ListData[this._ListData.Count - 1].uid == 0UL; + if (flag) + { + this._ListData[this._ListData.Count - 1].Recycle(); + this._ListData.RemoveAt(this._ListData.Count - 1); + } + } + + private void _ReqGuildList(int start, int count) + { + RpcC2M_ReqGuildList rpcC2M_ReqGuildList = new RpcC2M_ReqGuildList(); + rpcC2M_ReqGuildList.oArg.start = start; + rpcC2M_ReqGuildList.oArg.count = count; + rpcC2M_ReqGuildList.oArg.reason = 1; + rpcC2M_ReqGuildList.oArg.sortType = XFastEnumIntEqualityComparer.ToInt(this.m_SortType); + rpcC2M_ReqGuildList.oArg.name = this.SearchText; + rpcC2M_ReqGuildList.oArg.reverse = (this.m_Direction * XGuildListData.DefaultSortDirection[XFastEnumIntEqualityComparer.ToInt(this.m_SortType)] != 1); + XSingleton.singleton.Send(rpcC2M_ReqGuildList); + } + + public void ReqGuildList() + { + this._ClearAllList(); + this._ReqGuildList(0, XGuildListDocument.COUNT_PER_PULL); + } + + public void OnGetGuildList(FetchGuildListArg oArg, FetchGuildListRes oRes) + { + int num = Math.Min(this._ListData.Count, oArg.start); + for (int i = 0; i < oRes.guilds.Count; i++) + { + GuildInfo guildInfo = oRes.guilds[i]; + for (int j = 0; j < num; j++) + { + bool flag = this._ListData[j].uid == guildInfo.id; + if (flag) + { + this._ClearAllList(); + this._ReqGuildList(0, oArg.start + oArg.count); + return; + } + } + int num2 = oArg.start + i; + bool flag2 = num2 < this._ListData.Count; + XGuildListData xguildListData; + if (flag2) + { + xguildListData = this._ListData[num2]; + } + else + { + xguildListData = XDataPool.GetData(); + this._ListData.Add(xguildListData); + } + xguildListData.Init(guildInfo); + } + bool flag3 = oRes.guilds.Count != 0 && oArg.count != XGuildListDocument.COUNT_ALL; + if (flag3) + { + this._AddTail(); + } + else + { + bool flag4 = this._ListData.Count > 0; + if (flag4) + { + bool flag5 = oArg.count != XGuildListDocument.COUNT_ALL; + if (flag5) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_LIST_NO_MORE_GUILDS"), "fece00"); + } + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_LIST_NO_GUILDS"), "fece00"); + } + } + bool flag6 = this.GuildListView != null && this.GuildListView.IsVisible(); + if (flag6) + { + bool flag7 = oArg.start == 0 && (oArg.count == XGuildListDocument.COUNT_PER_PULL || oArg.count == XGuildListDocument.COUNT_ALL); + if (flag7) + { + this.GuildListView.RefreshPage(true); + } + else + { + this.GuildListView.NewContentAppended(); + } + return; + } + } + + public void ReqMoreGuilds() + { + this._RemoveTail(); + this._ReqGuildList(this._ListData.Count, XGuildListDocument.COUNT_PER_PULL); + } + + public void ReqQuickJoin() + { + this.ReqApplyGuild(0UL, ""); + } + + public void ReqSearch(string text) + { + this.SearchText = text; + this._ClearAllList(); + bool flag = this.SearchText != ""; + if (flag) + { + this._ReqGuildList(0, XGuildListDocument.COUNT_ALL); + } + else + { + this.ReqGuildList(); + } + } + + public void ReqCreateGuild(string name, int portraitIndex) + { + bool flag = name.Length > XGuildListDocument.NAME_LENGTH_LIMIT; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_NAME_LENGTH_LIMIT", new object[] + { + XGuildListDocument.NAME_LENGTH_LIMIT + }), "fece00"); + } + else + { + RpcC2M_CreateOrEnterGuild rpcC2M_CreateOrEnterGuild = new RpcC2M_CreateOrEnterGuild(); + rpcC2M_CreateOrEnterGuild.oArg.iscreate = true; + rpcC2M_CreateOrEnterGuild.oArg.gname = name; + rpcC2M_CreateOrEnterGuild.oArg.icon = portraitIndex; + XSingleton.singleton.Send(rpcC2M_CreateOrEnterGuild); + } + } + + public void OnCreateGuild(CreateOrJoinGuild oArg, CreateOrJoinGuildRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SetVisibleWithAnimation(false, null); + } + DlgBase.singleton.SetVisibleWithAnimation(false, null); + XSingleton.singleton.OpenGuildSystem(XSysDefine.XSys_GuildHall); + } + } + + public void ReqApplyGuild(ulong uid, string name) + { + RpcC2M_CreateOrEnterGuild rpcC2M_CreateOrEnterGuild = new RpcC2M_CreateOrEnterGuild(); + rpcC2M_CreateOrEnterGuild.oArg.iscreate = false; + rpcC2M_CreateOrEnterGuild.oArg.gid = uid; + rpcC2M_CreateOrEnterGuild.oArg.gname = name; + XSingleton.singleton.Send(rpcC2M_CreateOrEnterGuild); + } + + public void OnApplyGuild(CreateOrJoinGuild oArg, CreateOrJoinGuildRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + bool flag2 = oRes.result != ErrorCode.ERR_GUILD_WAITAPPROVAL; + if (flag2) + { + return; + } + } + DlgBase.singleton.Hide(); + bool flag3 = oRes.result == ErrorCode.ERR_GUILD_WAITAPPROVAL; + if (flag3) + { + for (int i = 0; i < this._ListData.Count; i++) + { + bool flag4 = this._ListData[i].uid == oArg.gid; + if (flag4) + { + this._ListData[i].bIsApplying = true; + break; + } + } + bool flag5 = this.GuildListView != null && this.GuildListView.IsVisible(); + if (flag5) + { + this.GuildListView.RefreshPage(false); + } + } + else + { + bool flag6 = DlgBase.singleton.IsVisible(); + if (flag6) + { + DlgBase.singleton.SetVisibleWithAnimation(false, null); + } + DlgBase.singleton.SetVisibleWithAnimation(false, null); + XSingleton.singleton.OpenGuildSystem(XSysDefine.XSys_GuildHall); + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildListDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildListDocument.cs.meta new file mode 100644 index 00000000..2abcfbff --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildListDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 89b3dd22c2f2766488f5518110368867 +timeCreated: 1611404089 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogAppoint.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogAppoint.cs new file mode 100644 index 00000000..7d57a7ec --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogAppoint.cs @@ -0,0 +1,32 @@ +using System; +using KKSG; + +namespace XMainClient +{ + internal class XGuildLogAppoint : XGuildLogBase + { + private GuildPosition position; + + public XGuildLogAppoint() + { + this.eType = GuildLogType.GLT_APPOINT; + } + + public override string GetContent() + { + return XLabelSymbolHelper.FormatName(this.name, this.uid, "00ffff") + XStringDefineProxy.GetString("GUILD_LOG_APPOINT") + XGuildDocument.GuildPP.GetPositionName(this.position, true); + } + + public override void Recycle() + { + base.Recycle(); + XDataPool.Recycle(this); + } + + public override void SetData(GHisRecord data) + { + base.SetData(data); + this.position = (GuildPosition)data.position; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogAppoint.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogAppoint.cs.meta new file mode 100644 index 00000000..838ae615 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogAppoint.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4c603db3cda53b143b9172da20f25654 +timeCreated: 1611403691 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBase.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBase.cs new file mode 100644 index 00000000..870c729a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBase.cs @@ -0,0 +1,79 @@ +using System; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildLogBase : XDataBase, ILogData, IComparable + { + public GuildLogType eType; + + public ulong uid; + + public string name; + + public int time; + + public virtual string GetContent() + { + return ""; + } + + public string GetTime() + { + return XSingleton.singleton.TimeAgoFormatString(this.time); + } + + public virtual void SetData(GHisRecord data) + { + this.uid = data.roleid; + this.name = data.rolename; + this.time = (int)data.time; + } + + public static XGuildLogBase CreateLog(uint type) + { + XGuildLogBase result; + switch (type) + { + case 1u: + result = XDataPool.GetData(); + break; + case 2u: + result = XDataPool.GetData(); + break; + case 3u: + result = XDataPool.GetData(); + break; + default: + if (type != 9u) + { + result = null; + } + else + { + result = XDataPool.GetData(); + } + break; + } + return result; + } + + public int CompareTo(ILogData otherLog) + { + XGuildLogBase xguildLogBase = otherLog as XGuildLogBase; + bool flag = xguildLogBase.time == this.time; + int result; + if (flag) + { + result = this.uid.CompareTo(xguildLogBase.uid); + } + else + { + result = this.time.CompareTo(xguildLogBase.time); + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBase.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBase.cs.meta new file mode 100644 index 00000000..f6b822a7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 46ed451f4e6a02e4ca5d4cb766c05557 +timeCreated: 1611403651 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBossMVP.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBossMVP.cs new file mode 100644 index 00000000..80b2de6a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBossMVP.cs @@ -0,0 +1,23 @@ +using System; + +namespace XMainClient +{ + internal class XGuildLogBossMVP : XGuildLogBase + { + public XGuildLogBossMVP() + { + this.eType = GuildLogType.GLT_MVP; + } + + public override string GetContent() + { + return XLabelSymbolHelper.FormatName(this.name, this.uid, "00ffff") + XStringDefineProxy.GetString("GUILD_LOG_MVP"); + } + + public override void Recycle() + { + base.Recycle(); + XDataPool.Recycle(this); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBossMVP.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBossMVP.cs.meta new file mode 100644 index 00000000..25c3651e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogBossMVP.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f8fe84d685ea59f4d90976f4d8ec1520 +timeCreated: 1611404897 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogJoin.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogJoin.cs new file mode 100644 index 00000000..3473851d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogJoin.cs @@ -0,0 +1,23 @@ +using System; + +namespace XMainClient +{ + internal class XGuildLogJoin : XGuildLogBase + { + public XGuildLogJoin() + { + this.eType = GuildLogType.GLT_JOIN; + } + + public override string GetContent() + { + return XLabelSymbolHelper.FormatName(this.name, this.uid, "00ffff") + XStringDefineProxy.GetString("GUILD_LOG_JOIN"); + } + + public override void Recycle() + { + base.Recycle(); + XDataPool.Recycle(this); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogJoin.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogJoin.cs.meta new file mode 100644 index 00000000..df09f7f8 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogJoin.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 889c9d3b5a44f8e4fbb593205d0885d7 +timeCreated: 1611404085 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogLeave.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogLeave.cs new file mode 100644 index 00000000..b0f36d5c --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogLeave.cs @@ -0,0 +1,23 @@ +using System; + +namespace XMainClient +{ + internal class XGuildLogLeave : XGuildLogBase + { + public XGuildLogLeave() + { + this.eType = GuildLogType.GLT_LEAVE; + } + + public override string GetContent() + { + return XLabelSymbolHelper.FormatName(this.name, this.uid, "00ffff") + XStringDefineProxy.GetString("GUILD_LOG_LEAVE"); + } + + public override void Recycle() + { + base.Recycle(); + XDataPool.Recycle(this); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildLogLeave.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogLeave.cs.meta new file mode 100644 index 00000000..355522a9 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildLogLeave.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 561c51d268fd9e64cb69b84147d08752 +timeCreated: 1611403742 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs new file mode 100644 index 00000000..6c3331c3 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs @@ -0,0 +1,114 @@ +using System; +using KKSG; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildMember : XGuildMemberBasicInfo, IComparable + { + public uint contribution; + + public bool canSend; + + public uint taskLuck; + + public uint taskScore; + + public bool canRefresh; + + public FetchState fetchState; + + public void Set(GuildMemberData data) + { + this.uid = data.roleid; + this.name = data.name; + this.position = (GuildPosition)data.position; + this.ppt = data.ppt; + this.contribution = data.contribute; + this.level = data.level; + this.profession = XFastEnumIntEqualityComparer.ToInt(data.profession); + this.time = (int)data.lastlogin; + this.vip = data.vip; + this.paymemberid = data.paymemberid; + this.isOnline = data.isonline; + this.liveness = data.activity; + this.taskLuck = data.task_luck; + this.taskScore = data.task_score; + this.canRefresh = data.can_refresh; + bool flag = data.lastlogin == 0u; + if (flag) + { + this.time = XGuildMemberBasicInfo.ONLINE_TIME; + } + this.titleID = data.title; + this.canSend = (((ulong)data.flag & (ulong)((long)XFastEnumIntEqualityComparer.ToInt(GuildMemberFlag.SEND_FATIGUE))) > 0UL); + bool flag2 = ((ulong)data.flag & (ulong)((long)XFastEnumIntEqualityComparer.ToInt(GuildMemberFlag.RECV_FATIGUE))) > 0UL; + if (flag2) + { + this.fetchState = FetchState.FS_CAN_FETCH; + } + else + { + bool flag3 = ((ulong)data.flag & (ulong)((long)XFastEnumIntEqualityComparer.ToInt(GuildMemberFlag.RECVED_FATIGUE))) > 0UL; + if (flag3) + { + this.fetchState = FetchState.FS_FETCHED; + } + else + { + this.fetchState = FetchState.FS_CANNOT_FETCH; + } + } + } + + public int CompareTo(XGuildMember other) + { + bool flag = XGuildMemberBasicInfo.playerID != 0UL && this.uid != other.uid; + if (flag) + { + bool flag2 = this.uid == XGuildMemberBasicInfo.playerID; + if (flag2) + { + return -1; + } + bool flag3 = other.uid == XGuildMemberBasicInfo.playerID; + if (flag3) + { + return 1; + } + } + int num = 0; + GuildMemberSortType sortType = XGuildMemberBasicInfo.sortType; + if (sortType != GuildMemberSortType.GMST_CONTRIBUTION) + { + if (sortType == GuildMemberSortType.GMST_TASKSCORE) + { + bool flag4 = this.canRefresh ^ other.canRefresh; + if (flag4) + { + num = (this.canRefresh ? -1 : 1); + } + else + { + num = (int)(this.taskScore - other.taskScore); + } + } + } + else + { + num = this.contribution.CompareTo(other.contribution); + } + bool flag5 = num == 0; + int result; + if (flag5) + { + result = base.CompareTo(other); + } + else + { + result = num * XGuildMemberBasicInfo.dir; + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs.meta new file mode 100644 index 00000000..9168e285 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMember.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a22bf0b0392e90944999c31fc055bf30 +timeCreated: 1611404256 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberBasicInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberBasicInfo.cs new file mode 100644 index 00000000..4891a8f2 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberBasicInfo.cs @@ -0,0 +1,119 @@ +using System; + +namespace XMainClient +{ + internal class XGuildMemberBasicInfo : IComparable + { + public static int ONLINE_TIME = -1; + + public ulong uid; + + public string name; + + public int profession = 1; + + public uint ppt; + + public uint level; + + public GuildPosition position; + + public int time; + + public uint vip; + + public bool isOnline; + + public uint liveness; + + public uint paymemberid; + + public uint titleID; + + public bool isInherit; + + public static GuildMemberSortType sortType = GuildMemberSortType.GMST_ID; + + public static ulong playerID = 0UL; + + public static int dir = -1; + + public static int[] DefaultSortDirection = new int[] + { + 1, + 1, + 1, + -1, + -1, + -1, + 1, + -1, + 1, + -1, + 1 + }; + + public string GetLiveness() + { + return this.liveness.ToString(); + } + + public int CompareTo(XGuildMemberBasicInfo other) + { + int num = 0; + bool flag = XGuildMemberBasicInfo.playerID != 0UL && this.uid != other.uid; + if (flag) + { + bool flag2 = this.uid == XGuildMemberBasicInfo.playerID; + if (flag2) + { + return -1; + } + bool flag3 = other.uid == XGuildMemberBasicInfo.playerID; + if (flag3) + { + return 1; + } + } + switch (XGuildMemberBasicInfo.sortType) + { + case GuildMemberSortType.GMST_NAME: + num = this.name.CompareTo(other.name); + break; + case GuildMemberSortType.GMST_PROFESSION: + num = this.profession.CompareTo(other.profession); + break; + case GuildMemberSortType.GMST_TITLE: + num = this.titleID.CompareTo(other.titleID); + break; + case GuildMemberSortType.GMST_LEVEL: + num = this.level.CompareTo(other.level); + break; + case GuildMemberSortType.GMST_POSITION: + num = -this.position.CompareTo(other.position); + break; + case GuildMemberSortType.GMST_TIME: + num = this.time.CompareTo(other.time); + break; + case GuildMemberSortType.GMST_ACTIVE: + num = this.liveness.CompareTo(other.liveness); + break; + case GuildMemberSortType.GMST_INHERIT: + num = this.isInherit.CompareTo(other.isInherit); + break; + case GuildMemberSortType.GMST_ONLINE: + num = this.isOnline.CompareTo(other.isOnline); + break; + case GuildMemberSortType.GMST_PPT: + num = this.ppt.CompareTo(other.ppt); + break; + } + bool flag4 = num == 0; + if (flag4) + { + num = this.uid.CompareTo(other.uid); + } + return num * XGuildMemberBasicInfo.dir; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberBasicInfo.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberBasicInfo.cs.meta new file mode 100644 index 00000000..69befe8d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberBasicInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8a5a9bfc98e9f6645ba55f0966f02a9e +timeCreated: 1611404091 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberDocument.cs new file mode 100644 index 00000000..9cb2c82a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberDocument.cs @@ -0,0 +1,483 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildMemberDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildMemberDocument.uuID; + } + } + + public XGuildMembersView GuildMembersView { get; set; } + + public List MemberList + { + get + { + return this.m_MemberList; + } + } + + public GuildMemberSortType SortType + { + get + { + return this.m_SortType; + } + set + { + bool flag = this.m_SortType != value; + if (flag) + { + this.m_Direction = XGuildMemberBasicInfo.DefaultSortDirection[XFastEnumIntEqualityComparer.ToInt(value)]; + } + else + { + this.m_Direction = -this.m_Direction; + } + this.m_SortType = value; + } + } + + public int SortDirection + { + get + { + return this.m_Direction; + } + } + + public uint MaxFatigue + { + get + { + return this.m_FatigueMax; + } + } + + public uint FetchedFatigue + { + get + { + return this.m_FatigueFetched; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildMemberDocument"); + + private List m_MemberList = new List(); + + private List m_GuildInheritUids = new List(); + + private GuildMemberSortType m_SortType = GuildMemberSortType.GMST_CONTRIBUTION; + + private int m_Direction = -1; + + private uint m_FatigueMax; + + private uint m_FatigueFetched; + + private int REDPOINT_FATIGUE_COUNT = 20; + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + this.REDPOINT_FATIGUE_COUNT = XSingleton.singleton.GetInt("GuildFatigueRedPointCount"); + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_GuildPositionChanged, new XComponent.XEventHandler(this.OnPositionChanged)); + base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.OnInGuildStateChanged)); + } + + protected bool OnPositionChanged(XEventArgs args) + { + bool flag = this.GuildMembersView != null && this.GuildMembersView.IsVisible(); + if (flag) + { + XGuildPositionChangedEventArgs xguildPositionChangedEventArgs = args as XGuildPositionChangedEventArgs; + ulong entityID = XSingleton.singleton.Player.Attributes.EntityID; + for (int i = 0; i < this.m_MemberList.Count; i++) + { + bool flag2 = this.m_MemberList[i].uid == entityID; + if (flag2) + { + this.m_MemberList[i].position = xguildPositionChangedEventArgs.position; + this.GuildMembersView.Refresh(); + break; + } + } + } + return true; + } + + public bool CheckGuildInheritUids(ulong uid) + { + return this.m_GuildInheritUids.Contains(uid); + } + + protected bool OnInGuildStateChanged(XEventArgs args) + { + XInGuildStateChangedEventArgs xinGuildStateChangedEventArgs = args as XInGuildStateChangedEventArgs; + bool flag = !xinGuildStateChangedEventArgs.bIsEnter; + if (flag) + { + XSingleton.singleton.SetSysRedPointState(XSysDefine.XSys_GuildHall_Member, false); + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_Member, true); + } + return true; + } + + public void ReqMemberList() + { + RpcC2M_AskGuildMembers rpc = new RpcC2M_AskGuildMembers(); + XSingleton.singleton.Send(rpc); + } + + public void onGetMemberList(GuildMemberRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + this.m_GuildInheritUids.Clear(); + this.m_GuildInheritUids.AddRange(oRes.guildinheritid); + int num = oRes.members.Count - this.m_MemberList.Count; + for (int i = 0; i < num; i++) + { + XGuildMember item = new XGuildMember(); + this.m_MemberList.Add(item); + } + bool flag2 = num < 0; + if (flag2) + { + this.m_MemberList.RemoveRange(this.m_MemberList.Count + num, -num); + } + for (int j = 0; j < oRes.members.Count; j++) + { + bool flag3 = oRes.members[j] == null; + if (!flag3) + { + this.m_MemberList[j].Set(oRes.members[j]); + this.m_MemberList[j].isInherit = this.CheckGuildInheritUids(oRes.members[j].roleid); + } + } + this.m_FatigueMax = oRes.FatigueMax; + this.m_FatigueFetched = oRes.recvFatigue; + XSingleton.singleton.AddGreenLog("m_GuildInheritUids", oRes.guildinheritid.Count.ToString(), null, null, null, null); + bool flag4 = this.GuildMembersView != null && this.GuildMembersView.IsVisible(); + if (flag4) + { + this.GuildMembersView.RefreshFatigue(); + this.SortAndShow(); + } + this.RefreshRedPointState(); + XGuildMemberListEventArgs @event = XEventPool.GetEvent(); + @event.Firer = XSingleton.singleton.Doc; + XSingleton.singleton.FireEvent(@event); + } + } + + public void SortAndShow() + { + XGuildMemberBasicInfo.playerID = XSingleton.singleton.Player.Attributes.EntityID; + XGuildMemberBasicInfo.dir = this.m_Direction; + XGuildMemberBasicInfo.sortType = this.m_SortType; + CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; + Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(XSingleton.singleton.GetValue("Culture")); + this.m_MemberList.Sort(); + Thread.CurrentThread.CurrentCulture = currentCulture; + bool flag = this.GuildMembersView != null && this.GuildMembersView.IsVisible(); + if (flag) + { + this.GuildMembersView.RefreshAll(true); + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = this.GuildMembersView != null && this.GuildMembersView.IsVisible(); + if (flag) + { + this.ReqMemberList(); + } + } + + public void ReqChangePosition(ulong uid, bool bIncrease) + { + GuildPosition guildPosition = GuildPosition.GPOS_COUNT; + for (int i = 0; i < this.m_MemberList.Count; i++) + { + bool flag = this.m_MemberList[i].uid == uid; + if (flag) + { + guildPosition = this.m_MemberList[i].position; + break; + } + } + bool flag2 = guildPosition == GuildPosition.GPOS_COUNT; + if (!flag2) + { + RpcC2M_ChangeMemberPositionNew rpcC2M_ChangeMemberPositionNew = new RpcC2M_ChangeMemberPositionNew(); + rpcC2M_ChangeMemberPositionNew.oArg.roleid = uid; + rpcC2M_ChangeMemberPositionNew.oArg.position = (bIncrease ? XGuildDocument.GuildPP.GetHigherPosition(guildPosition) : XGuildDocument.GuildPP.GetLowerPosition(guildPosition)); + XSingleton.singleton.Send(rpcC2M_ChangeMemberPositionNew); + } + } + + public GuildPosition GetMemberPosition(ulong memberID) + { + GuildPosition result = GuildPosition.GPOS_COUNT; + for (int i = 0; i < this.m_MemberList.Count; i++) + { + bool flag = this.m_MemberList[i].uid == memberID; + if (flag) + { + result = this.m_MemberList[i].position; + break; + } + } + return result; + } + + public void ReqChangePosition(ulong uid, GuildPosition toPosition) + { + RpcC2M_ChangeMemberPositionNew rpcC2M_ChangeMemberPositionNew = new RpcC2M_ChangeMemberPositionNew(); + rpcC2M_ChangeMemberPositionNew.oArg.roleid = uid; + rpcC2M_ChangeMemberPositionNew.oArg.position = XFastEnumIntEqualityComparer.ToInt(toPosition); + XSingleton.singleton.Send(rpcC2M_ChangeMemberPositionNew); + } + + public void OnChangePosition(ChangeGuildPositionArg oArg, ChangeGuildPositionRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + for (int i = 0; i < this.m_MemberList.Count; i++) + { + bool flag2 = this.m_MemberList[i].uid == oArg.roleid; + if (flag2) + { + this.m_MemberList[i].position = (GuildPosition)oArg.position; + bool flag3 = this.GuildMembersView != null && this.GuildMembersView.IsVisible(); + if (flag3) + { + this.GuildMembersView.Refresh(); + } + break; + } + } + } + } + + public void ReqKickAss(ulong uid) + { + RpcC2M_LeaveFromGuild rpcC2M_LeaveFromGuild = new RpcC2M_LeaveFromGuild(); + rpcC2M_LeaveFromGuild.oArg.roleID = uid; + XSingleton.singleton.Send(rpcC2M_LeaveFromGuild); + } + + public void OnKickAss(LeaveGuildArg oArg, LeaveGuildRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + for (int i = 0; i < this.m_MemberList.Count; i++) + { + bool flag2 = this.m_MemberList[i].uid == oArg.roleID; + if (flag2) + { + this.m_MemberList.RemoveAt(i); + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + specificDocument.BasicData.memberCount -= 1u; + bool flag3 = this.GuildMembersView != null && this.GuildMembersView.IsVisible(); + if (flag3) + { + this.GuildMembersView.RefreshAll(false); + } + break; + } + } + } + } + + public void RefreshRedPointState() + { + bool flag = (ulong)(this.MaxFatigue - this.FetchedFatigue) < (ulong)((long)this.REDPOINT_FATIGUE_COUNT); + if (flag) + { + XSingleton.singleton.SetSysRedPointState(XSysDefine.XSys_GuildHall_Member, false); + } + else + { + int num = 0; + for (int i = 0; i < this.m_MemberList.Count; i++) + { + bool flag2 = this.m_MemberList[i].fetchState == FetchState.FS_CAN_FETCH; + if (flag2) + { + num++; + } + } + XSingleton.singleton.SetSysRedPointState(XSysDefine.XSys_GuildHall_Member, num >= this.REDPOINT_FATIGUE_COUNT); + } + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_Member, true); + } + + public void ReqSendFatigue(int index) + { + RpcC2M_GuildFatigueOPNew rpcC2M_GuildFatigueOPNew = new RpcC2M_GuildFatigueOPNew(); + bool flag = index < 0 || index >= this.m_MemberList.Count; + if (!flag) + { + rpcC2M_GuildFatigueOPNew.oArg.targetID = this.m_MemberList[index].uid; + rpcC2M_GuildFatigueOPNew.oArg.optype = 0; + XSingleton.singleton.Send(rpcC2M_GuildFatigueOPNew); + } + } + + public void ReqOneKeySendFatigue() + { + RpcC2M_GuildFatigueOPNew rpcC2M_GuildFatigueOPNew = new RpcC2M_GuildFatigueOPNew(); + rpcC2M_GuildFatigueOPNew.oArg.targetID = 0UL; + rpcC2M_GuildFatigueOPNew.oArg.optype = 0; + XSingleton.singleton.Send(rpcC2M_GuildFatigueOPNew); + } + + public void ReqReceiveFatigue(int index) + { + RpcC2M_GuildFatigueOPNew rpcC2M_GuildFatigueOPNew = new RpcC2M_GuildFatigueOPNew(); + bool flag = index < 0 || index >= this.m_MemberList.Count; + if (!flag) + { + rpcC2M_GuildFatigueOPNew.oArg.targetID = this.m_MemberList[index].uid; + rpcC2M_GuildFatigueOPNew.oArg.optype = 1; + XSingleton.singleton.Send(rpcC2M_GuildFatigueOPNew); + } + } + + public void ReqOneKeyReceiveFatigue() + { + RpcC2M_GuildFatigueOPNew rpcC2M_GuildFatigueOPNew = new RpcC2M_GuildFatigueOPNew(); + rpcC2M_GuildFatigueOPNew.oArg.targetID = 0UL; + rpcC2M_GuildFatigueOPNew.oArg.optype = 1; + XSingleton.singleton.Send(rpcC2M_GuildFatigueOPNew); + } + + public void OnOperateFatigue(GuildFatigueArg oArg, GuildFatigueRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + bool flag2 = oRes.totalrecv > 0; + if (flag2) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("FATIGUE_RECEIVED", new object[] + { + oRes.totalrecv + }), "fece00"); + } + bool flag3 = oRes.totalsend > 0; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("FATIGUE_SENT", new object[] + { + oRes.totalsend + }), "fece00"); + } + bool flag4 = oArg.targetID == 0UL; + if (flag4) + { + bool flag5 = oArg.optype == 0; + if (flag5) + { + for (int i = 0; i < this.m_MemberList.Count; i++) + { + this.m_MemberList[i].canSend = false; + } + } + else + { + this.ReqMemberList(); + } + } + else + { + for (int j = 0; j < this.m_MemberList.Count; j++) + { + bool flag6 = this.m_MemberList[j].uid == oArg.targetID; + if (flag6) + { + bool flag7 = oArg.optype == 0; + if (flag7) + { + this.m_MemberList[j].canSend = false; + } + else + { + bool flag8 = this.m_MemberList[j].fetchState == FetchState.FS_CAN_FETCH; + if (flag8) + { + this.m_MemberList[j].fetchState = FetchState.FS_FETCHED; + } + this.m_FatigueFetched += 1u; + bool flag9 = this.GuildMembersView != null && this.GuildMembersView.IsVisible(); + if (flag9) + { + this.GuildMembersView.RefreshFatigue(); + } + } + break; + } + } + } + bool flag10 = this.GuildMembersView != null && this.GuildMembersView.IsVisible(); + if (flag10) + { + this.GuildMembersView.Refresh(); + } + this.RefreshRedPointState(); + } + } + + public void RefreshMemberTaskScore(ulong roleid, uint score) + { + for (int i = 0; i < this.MemberList.Count; i++) + { + bool flag = this.MemberList[i].uid == roleid; + if (flag) + { + this.MemberList[i].taskScore = score; + break; + } + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberDocument.cs.meta new file mode 100644 index 00000000..36082184 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1d10d7aa9b2a2434a98c40cd4bc2048d +timeCreated: 1611403350 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberListEventArgs.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberListEventArgs.cs new file mode 100644 index 00000000..8434546b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberListEventArgs.cs @@ -0,0 +1,18 @@ +using System; + +namespace XMainClient +{ + internal class XGuildMemberListEventArgs : XEventArgs + { + public XGuildMemberListEventArgs() + { + this._eDefine = XEventDefine.XEvent_GuildMemberList; + } + + public override void Recycle() + { + base.Recycle(); + XEventPool.Recycle(this); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberListEventArgs.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberListEventArgs.cs.meta new file mode 100644 index 00000000..1937464e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberListEventArgs.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7ced1a9a955492e4ea53174f61577c1f +timeCreated: 1611403999 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankInfo.cs new file mode 100644 index 00000000..bf605a0f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankInfo.cs @@ -0,0 +1,16 @@ +using System; +using KKSG; + +namespace XMainClient +{ + public class XGuildMemberRankInfo : XBaseRankInfo + { + public void ProcessData(RoleGuildContribute info) + { + this.id = info.roleId; + this.value = (ulong)info.contribute; + this.name = info.RoleName; + this.formatname = XTitleDocument.GetTitleWithFormat(0u, info.RoleName); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankInfo.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankInfo.cs.meta new file mode 100644 index 00000000..a9c9bc7c --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: aac90b07f77d3524ca3839f8b8a56bdb +timeCreated: 1611404305 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankList.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankList.cs new file mode 100644 index 00000000..2273f353 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankList.cs @@ -0,0 +1,12 @@ +using System; + +namespace XMainClient +{ + public class XGuildMemberRankList : XBaseRankList + { + public override XBaseRankInfo CreateNewInfo() + { + return new XGuildMemberRankInfo(); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankList.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankList.cs.meta new file mode 100644 index 00000000..22a82f1d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMemberRankList.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bccb31e1383b7274f9d42182ef796c90 +timeCreated: 1611404448 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMineBattleDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineBattleDocument.cs new file mode 100644 index 00000000..3edaf267 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineBattleDocument.cs @@ -0,0 +1,248 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildMineBattleDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildMineBattleDocument.uuID; + } + } + + public XBetterDictionary UserIdToRole + { + get + { + return this._UserIdToRole; + } + } + + public uint MyTeam + { + get + { + return this._MyTeam; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildMineBattleDocument"); + + public GuildMinePVPBattleHandler BattleHandler = null; + + public GuildMinePVPInfoHandler InfoHandler = null; + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private XBetterDictionary _UserIdToRole = new XBetterDictionary(0); + + private static GuildMineralBattleReward _GuildMineralBattleRewardTable = new GuildMineralBattleReward(); + + private uint _MyTeam = 0u; + + private bool _CanPlayAnim = false; + + public struct RoleData + { + public ulong uid; + + public string name; + + public uint teamID; + + public uint lv; + + public uint job; + + public uint ppt; + + public ulong guildID; + + public string guildname; + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + } + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildMineBattleDocument.AsyncLoader.AddTask("Table/GuildMineralBattleReward", XGuildMineBattleDocument._GuildMineralBattleRewardTable, false); + XGuildMineBattleDocument.AsyncLoader.Execute(callback); + } + + public static GuildMineralBattleReward.RowData GetReward(uint rankId) + { + GuildMineralBattleReward.RowData rowData = null; + for (int i = 0; i < XGuildMineBattleDocument._GuildMineralBattleRewardTable.Table.Length; i++) + { + bool flag = XGuildMineBattleDocument._GuildMineralBattleRewardTable.Table[i].LevelSeal <= XLevelSealDocument.Doc.SealType && XGuildMineBattleDocument._GuildMineralBattleRewardTable.Table[i].Rank == rankId; + if (flag) + { + rowData = XGuildMineBattleDocument._GuildMineralBattleRewardTable.Table[i]; + } + } + bool flag2 = rowData == null; + if (flag2) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "_GuildMineralBattleRewardTable No Find\nSealType", + XLevelSealDocument.Doc.SealType, + " Rank:", + rankId + }), null, null, null, null, null); + } + return rowData; + } + + public override void OnEnterSceneFinally() + { + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_RESWAR_PVE; + if (flag) + { + this.ReqGuildMinePVEAllInfo(); + } + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_RESWAR_PVP; + if (flag) + { + this.ReqGuildMinePVPAllInfo(); + } + bool flag2 = XSingleton.singleton.SceneType == SceneType.SCENE_RESWAR_PVE; + if (flag2) + { + this.ReqGuildMinePVEAllInfo(); + } + } + + private void PlayStartTween() + { + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_RESWAR_PVP; + if (flag) + { + bool flag2 = this.InfoHandler == null; + if (!flag2) + { + bool canPlayAnim = this._CanPlayAnim; + if (canPlayAnim) + { + this.InfoHandler.PlayStartTween(); + this._CanPlayAnim = false; + } + } + } + } + + public void ReqGuildMinePVPAllInfo() + { + RpcC2G_ResWarAllInfoReqOne rpc = new RpcC2G_ResWarAllInfoReqOne(); + XSingleton.singleton.Send(rpc); + } + + public void ReqGuildMinePVEAllInfo() + { + RpcC2G_ResWarBuff rpc = new RpcC2G_ResWarBuff(); + XSingleton.singleton.Send(rpc); + } + + public void SetBattleTeamInfo(PtcG2C_ResWarTeamResOne roPtc) + { + XSingleton.singleton.AddGreenLog("PlayVSTween", null, null, null, null, null); + bool flag = roPtc.Data == null; + if (!flag) + { + this.SetBattleTeamInfo(roPtc.Data); + this._CanPlayAnim = true; + this.PlayStartTween(); + } + } + + public void SetBattleTeamInfo(ResWarAllTeamBaseInfo data) + { + bool flag = data == null; + if (!flag) + { + this._UserIdToRole.Clear(); + for (int i = 0; i < data.info.Count; i++) + { + XGuildMineBattleDocument.RoleData roleData; + roleData.uid = data.info[i].uid; + roleData.name = data.info[i].name; + roleData.job = data.info[i].job; + roleData.lv = data.info[i].lv; + roleData.teamID = data.info[i].teamid; + roleData.ppt = data.info[i].ppt; + roleData.guildID = data.info[i].guildid; + roleData.guildname = data.info[i].guildname; + this._UserIdToRole.Add(roleData.uid, roleData); + bool flag2 = XSingleton.singleton.XPlayerData.RoleID == roleData.uid; + if (flag2) + { + this._MyTeam = roleData.teamID; + } + } + bool flag3 = this._MyTeam == 0u; + if (flag3) + { + XSingleton.singleton.AddErrorLog("No Find My Team", null, null, null, null, null); + } + } + } + + public void SetBattleInfo(PtcG2C_ResWarBattleDataNtf roPtc) + { + this.SetBattleInfo(roPtc.Data); + } + + public void SetBattleInfo(ResWarAllInfo data) + { + bool flag = data == null; + if (!flag) + { + bool flag2 = this.BattleHandler == null; + if (!flag2) + { + this.BattleHandler.RefreshStatusTime(data.lefttime); + XSingleton.singleton.AddGreenLog("lefttime" + data.lefttime, null, null, null, null, null); + List groupdata = data.groupdata; + for (int i = 0; i < groupdata.Count; i++) + { + this.BattleHandler.SetDamage((ulong)groupdata[i].totaldamage, groupdata[i].teamid == this._MyTeam); + this.BattleHandler.SetScore(groupdata[i].killcount, groupdata[i].teamid == this._MyTeam); + } + } + } + } + + public void SetBattleAllInfo(ResWarArg oArg, ResWarRes oRes) + { + this.SetBattleTeamInfo(oRes.baseinfo); + this.SetBattleInfo(oRes.allinfo); + } + + public void HideVSInfo() + { + bool flag = this.InfoHandler != null; + if (flag) + { + XSingleton.singleton.AddGreenLog("HideVSInfo", null, null, null, null, null); + this.InfoHandler.CloseTween(null); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMineBattleDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineBattleDocument.cs.meta new file mode 100644 index 00000000..773759a2 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineBattleDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6beefbad7ed348745b165d6efa15670b +timeCreated: 1611403893 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMineEntranceDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineEntranceDocument.cs new file mode 100644 index 00000000..6b07dfef --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineEntranceDocument.cs @@ -0,0 +1,92 @@ +using System; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildMineEntranceDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildMineEntranceDocument.uuID; + } + } + + public GuildMineEntranceView View + { + get + { + return this._view; + } + set + { + this._view = value; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildMineEntranceDocument"); + + private GuildMineEntranceView _view = null; + + public bool MainInterfaceState = false; + + public bool MainInterfaceStateEnd = false; + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + } + + public override void OnEnterSceneFinally() + { + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + } + + public override void Update(float fDeltaT) + { + base.Update(fDeltaT); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public void SetMainInterfaceBtnState(bool state) + { + bool flag = !state && state != this.MainInterfaceState && DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetVisibleWithAnimation(false, null); + } + this.MainInterfaceState = state; + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool bImmUpdateUI = XGuildDocument.GuildConfig.IsSysUnlock(XSysDefine.XSys_GuildMine, specificDocument.Level); + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildMine, bImmUpdateUI); + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildMineMainInterface, true); + } + + public void SetMainInterfaceBtnStateEnd(bool state) + { + this.MainInterfaceStateEnd = state; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildMineEnd, true); + } + + public void ReqEnterMine() + { + XGuildMineMainDocument specificDocument = XDocuments.GetSpecificDocument(XGuildMineMainDocument.uuID); + RpcC2M_QueryResWar rpcC2M_QueryResWar = new RpcC2M_QueryResWar(); + XGuildResContentionBuffDocument.Doc.SendPersonalBuffOpReq(XSingleton.singleton.XPlayerData.RoleID, 0u, PersonalBuffOpType.PullMySelfOwned); + XGuildResContentionBuffDocument.Doc.SendPersonalBuffOpReq(XSingleton.singleton.XPlayerData.RoleID, 0u, PersonalBuffOpType.PullMySelfActing); + rpcC2M_QueryResWar.oArg.param = QueryResWarEnum.RESWAR_BATTLE; + XSingleton.singleton.Send(rpcC2M_QueryResWar); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMineEntranceDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineEntranceDocument.cs.meta new file mode 100644 index 00000000..eba58689 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineEntranceDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 712eece29eec9ec439ad1a8f3804912d +timeCreated: 1611403933 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMineMainDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineMainDocument.cs new file mode 100644 index 00000000..a9b851ab --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineMainDocument.cs @@ -0,0 +1,432 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildMineMainDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildMineMainDocument.uuID; + } + } + + public GuildMineMainView View + { + get + { + return this._view; + } + set + { + this._view = value; + } + } + + internal List ResRankInfoList + { + get + { + return this._resRankInfoList; + } + set + { + this._resRankInfoList = value; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildMineMainDocument"); + + private GuildMineMainView _view = null; + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private static GuildMineralBattle _GuildMineralBattleTable = new GuildMineralBattle(); + + private static GuildMineralBufflist _GuildMineralBufflistTable = new GuildMineralBufflist(); + + public GuildMineRankHandler GuildResRankHanler; + + public static readonly uint GUILD_NUM_MAX = 3u; + + public static readonly uint BOSS_NUM_MAX = 4u; + + public static readonly uint MINE_NUM_MAX = 5u; + + public bool IsNeedShowMainUI = false; + + private List _resRankInfoList = new List(); + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + } + + public override void OnEnterSceneFinally() + { + bool flag = this.IsNeedShowMainUI && XSingleton.singleton.CurrentStage.Stage == EXStage.Hall; + if (flag) + { + XGuildMineEntranceDocument specificDocument = XDocuments.GetSpecificDocument(XGuildMineEntranceDocument.uuID); + bool mainInterfaceState = specificDocument.MainInterfaceState; + if (mainInterfaceState) + { + specificDocument.ReqEnterMine(); + } + this.IsNeedShowMainUI = false; + } + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_LeaveTeam, new XComponent.XEventHandler(this.OnLeaveTeam)); + base.RegisterEvent(XEventDefine.XEvent_TeamMemberCountChanged, new XComponent.XEventHandler(this.OnTeamMemberCountChanged)); + } + + public bool OnLeaveTeam(XEventArgs args) + { + this.ClearUI(); + return true; + } + + public bool OnTeamMemberCountChanged(XEventArgs args) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshMemberTips(); + } + return true; + } + + public void ClearUI() + { + DlgBase.singleton.BossMine.Clear(); + DlgBase.singleton.BossMineBuff.Clear(); + DlgBase.singleton.CanPlayNewFindAnim = true; + DlgBase.singleton.CurExploreLeftTime = 0f; + DlgBase.singleton.ExploreTimeMax = 0u; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshBoss(); + DlgBase.singleton.RefreshExploreTime(); + DlgBase.singleton.RefreshButton(); + } + } + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildMineMainDocument.AsyncLoader.AddTask("Table/GuildMineralBattle", XGuildMineMainDocument._GuildMineralBattleTable, false); + XGuildMineMainDocument.AsyncLoader.AddTask("Table/GuildMineralBufflist", XGuildMineMainDocument._GuildMineralBufflistTable, false); + XGuildMineMainDocument.AsyncLoader.Execute(callback); + } + + public static GuildMineralBattle.RowData GetMineData(uint mineID) + { + return XGuildMineMainDocument._GuildMineralBattleTable.GetByID(mineID); + } + + public static GuildMineralBufflist.RowData GetMineBuffData(uint BuffID) + { + return XGuildMineMainDocument._GuildMineralBufflistTable.GetByBuffID(BuffID); + } + + public override void Update(float fDeltaT) + { + base.Update(fDeltaT); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + XGuildMineEntranceDocument specificDocument = XDocuments.GetSpecificDocument(XGuildMineEntranceDocument.uuID); + specificDocument.ReqEnterMine(); + } + } + + public void ReqExplore(bool iscancel) + { + RpcC2M_ResWarExplore rpcC2M_ResWarExplore = new RpcC2M_ResWarExplore(); + rpcC2M_ResWarExplore.oArg.iscancel = iscancel; + XSingleton.singleton.Send(rpcC2M_ResWarExplore); + } + + public void ReqChallenge(int mineIndex) + { + RpcC2M_StartResWarPVE rpcC2M_StartResWarPVE = new RpcC2M_StartResWarPVE(); + rpcC2M_StartResWarPVE.oArg.mine = (uint)mineIndex; + XSingleton.singleton.Send(rpcC2M_StartResWarPVE); + } + + public void ReqResWarRank() + { + RpcC2M_QueryResWarRoleRank rpc = new RpcC2M_QueryResWarRoleRank(); + XSingleton.singleton.Send(rpc); + } + + public void SetAllInfo(QueryResWarArg arg, QueryResWarRes res) + { + bool flag = res.data == null || XSingleton.singleton.CurrentStage.Stage != EXStage.Hall; + if (!flag) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + XGuildResContentionBuffDocument.Doc.OnGetBuffAllInfo(res.data); + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + ResWarGuildBrief data = res.data; + bool flag2 = data.mineid.Count == this.View.BossMine.Count && data.mineid.Count != 0; + if (flag2) + { + for (int i = 0; i < data.mineid.Count; i++) + { + bool flag3 = data.mineid[i] != this.View.BossMine[i]; + if (flag3) + { + this.View.CanPlayNewFindAnim = true; + break; + } + } + } + else + { + this.View.CanPlayNewFindAnim = true; + } + bool flag4 = data.mineid.Count != data.buffid.Count; + if (flag4) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "GuildMine mineid.Count!=buffid.Count: ", + data.mineid.Count, + "!=", + data.buffid.Count + }), null, null, null, null, null); + } + this.View.BossMine.Clear(); + this.View.BossMineBuff.Clear(); + for (int j = 0; j < data.mineid.Count; j++) + { + bool flag5 = (long)j == (long)((ulong)XGuildMineMainDocument.BOSS_NUM_MAX); + if (flag5) + { + break; + } + this.View.BossMine.Add(data.mineid[j]); + } + for (int k = 0; k < data.buffid.Count; k++) + { + bool flag6 = (long)k == (long)((ulong)XGuildMineMainDocument.BOSS_NUM_MAX); + if (flag6) + { + break; + } + this.View.BossMineBuff.Add(data.buffid[k]); + } + bool cdSpecified = data.cdSpecified; + if (cdSpecified) + { + this.View.CurExploreLeftTime = res.data.cd; + } + else + { + this.View.CurExploreLeftTime = 0f; + } + bool totalcdSpecified = data.totalcdSpecified; + if (totalcdSpecified) + { + this.View.ExploreTimeMax = res.data.totalcd; + } + else + { + this.View.ExploreTimeMax = 0u; + } + bool timecoutdownSpecified = data.timecoutdownSpecified; + if (timecoutdownSpecified) + { + this.View.CurActivityLeftTime = data.timecoutdown; + } + else + { + this.View.CurActivityLeftTime = 0f; + } + bool timetypeSpecified = data.timetypeSpecified; + if (timetypeSpecified) + { + this.View.ActivityStatus = (GuildMineActivityStatus)data.timetype; + } + else + { + this.View.ActivityStatus = GuildMineActivityStatus.None; + } + this.View.RefreshUI(); + XSingleton.singleton.AddGreenLog("Open:" + this.View.CurExploreLeftTime.ToString(), null, null, null, null, null); + } + } + + public void SetNewInfo(PtcM2C_ResWarGuildBriefNtf roPtc) + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + ResWarGuildBrief data = roPtc.Data; + bool flag = data.guildid == specificDocument.UID; + if (flag) + { + bool flag2 = data.mineid.Count != data.buffid.Count; + if (flag2) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "GuildMine mineid.Count!=buffid.Count: ", + data.mineid.Count, + "!=", + data.buffid.Count + }), null, null, null, null, null); + } + bool flag3 = DlgBase.singleton.BossMine.Count == 0 && data.mineid.Count != 0; + if (flag3) + { + for (int i = 0; i < data.mineid.Count; i++) + { + bool flag4 = (long)i == (long)((ulong)XGuildMineMainDocument.BOSS_NUM_MAX); + if (flag4) + { + break; + } + DlgBase.singleton.BossMine.Add(data.mineid[i]); + } + for (int j = 0; j < data.buffid.Count; j++) + { + bool flag5 = (long)j == (long)((ulong)XGuildMineMainDocument.BOSS_NUM_MAX); + if (flag5) + { + break; + } + DlgBase.singleton.BossMineBuff.Add(data.buffid[j]); + } + bool flag6 = DlgBase.singleton.IsVisible(); + if (flag6) + { + DlgBase.singleton.RefreshBoss(); + } + } + else + { + bool flag7 = DlgBase.singleton.BossMine.Count != 0 && data.mineid.Count == 0; + if (flag7) + { + DlgBase.singleton.BossMine.Clear(); + DlgBase.singleton.BossMineBuff.Clear(); + DlgBase.singleton.CanPlayNewFindAnim = true; + bool flag8 = DlgBase.singleton.IsVisible(); + if (flag8) + { + DlgBase.singleton.RefreshBoss(); + } + } + } + bool cdSpecified = data.cdSpecified; + if (cdSpecified) + { + DlgBase.singleton.CurExploreLeftTime = data.cd; + } + else + { + DlgBase.singleton.CurExploreLeftTime = 0f; + } + bool totalcdSpecified = data.totalcdSpecified; + if (totalcdSpecified) + { + DlgBase.singleton.ExploreTimeMax = data.totalcd; + } + else + { + DlgBase.singleton.ExploreTimeMax = 0u; + } + bool flag9 = DlgBase.singleton.IsVisible(); + if (flag9) + { + DlgBase.singleton.RefreshExploreTime(); + } + bool flag10 = DlgBase.singleton.IsVisible(); + if (flag10) + { + DlgBase.singleton.RefreshButton(); + } + bool timetypeSpecified = data.timetypeSpecified; + if (timetypeSpecified) + { + bool timecoutdownSpecified = data.timecoutdownSpecified; + if (timecoutdownSpecified) + { + DlgBase.singleton.CurActivityLeftTime = data.timecoutdown; + } + else + { + DlgBase.singleton.CurActivityLeftTime = 0f; + } + DlgBase.singleton.ActivityStatus = (GuildMineActivityStatus)data.timetype; + bool flag11 = DlgBase.singleton.IsVisible(); + if (flag11) + { + DlgBase.singleton.RefreshActivityTime(); + } + } + XSingleton.singleton.AddGreenLog("Refresh:" + DlgBase.singleton.CurExploreLeftTime.ToString(), null, null, null, null, null); + } + } + + public void ActivityStatusChange(PtcM2C_ResWarTimeNtf roPtc) + { + DlgBase.singleton.CurActivityLeftTime = roPtc.Data.nTime; + DlgBase.singleton.ActivityStatus = GuildMineActivityStatus.Start; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshActivityTime(); + } + } + + public void OnGetRankInfo(ResWarRoleRankRes oRes) + { + this._resRankInfoList.Clear(); + for (int i = 0; i < oRes.data.Count; i++) + { + ResWarRoleRank resWarRoleRank = oRes.data[i]; + this._resRankInfoList.Add(new ResRankInfo + { + guildName = resWarRoleRank.guildname, + roleID = resWarRoleRank.roleid, + roleName = resWarRoleRank.rolename, + donateValue = resWarRoleRank.res + }); + } + bool flag = this.GuildResRankHanler != null && this.GuildResRankHanler.IsVisible(); + if (flag) + { + this.GuildResRankHanler.RefreshUI(); + } + } + + public void TeamLeaderOperate(PtcM2C_ResWarStateNtf roPtc) + { + bool flag = roPtc.Data.state == ResWarState.ResWarExploreState; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("GUILD_MINE_EXPLORE_LEADER_START"), "fece00"); + } + bool flag2 = roPtc.Data.state == ResWarState.ResWarCancelState; + if (flag2) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("GUILD_MINE_EXPLORE_LEADER_CANCEL"), "fece00"); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildMineMainDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineMainDocument.cs.meta new file mode 100644 index 00000000..85b21a4b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildMineMainDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5199fec7802cd00448098ade1fcc8db9 +timeCreated: 1611403707 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildPP.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildPP.cs new file mode 100644 index 00000000..ac4ac63e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildPP.cs @@ -0,0 +1,195 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildPP + { + public static int POSITION_COUNT; + + private List PositionName = new List(); + + private List PositionColor = new List(); + + private List PositionNameWithColor = new List(); + + public static int PERMISSION_COUNT; + + private int[][] GuildPermissionMatrix; + + public static int PemissionNameToIndex(string pemstr) + { + return XGuildPP.Permission2Int((GuildPermission)Enum.Parse(typeof(GuildPermission), pemstr)); + } + + public void InitTable(GuildPermissionTable table) + { + this.PositionName.Clear(); + this.PositionColor.Clear(); + this.PositionNameWithColor.Clear(); + XGuildPP.POSITION_COUNT = XGuildPP.Position2Int(GuildPosition.GPOS_COUNT); + for (int i = 0; i < XGuildPP.POSITION_COUNT; i++) + { + GuildPosition guildPosition = (GuildPosition)i; + string @string = XStringDefineProxy.GetString(guildPosition.ToString()); + this.PositionName.Add(@string); + this.PositionColor.Add(XSingleton.singleton.GetItemQualityColor(XGuildPP.POSITION_COUNT - 1 - i)); + this.PositionNameWithColor.Add(string.Format("[{0}]{1}[-]", XSingleton.singleton.GetItemQualityRGB(XGuildPP.POSITION_COUNT - 1 - i), @string)); + } + XGuildPP.PERMISSION_COUNT = XGuildPP.Permission2Int(GuildPermission.GPEM_MAX); + this.GuildPermissionMatrix = new int[XGuildPP.PERMISSION_COUNT][]; + for (int j = 0; j < this.GuildPermissionMatrix.Length; j++) + { + this.GuildPermissionMatrix[j] = new int[XGuildPP.POSITION_COUNT]; + } + for (int k = 0; k < table.Table.Length; k++) + { + GuildPermissionTable.RowData rowData = table.Table[k]; + int num = XGuildPP.PemissionNameToIndex(rowData.GuildID); + this.GuildPermissionMatrix[num][XGuildPP.Position2Int(GuildPosition.GPOS_LEADER)] = rowData.GPOS_LEADER; + this.GuildPermissionMatrix[num][XGuildPP.Position2Int(GuildPosition.GPOS_VICELEADER)] = rowData.GPOS_VICELEADER; + this.GuildPermissionMatrix[num][XGuildPP.Position2Int(GuildPosition.GPOS_OFFICER)] = rowData.GPOS_OFFICER; + this.GuildPermissionMatrix[num][XGuildPP.Position2Int(GuildPosition.GPOS_ELITEMEMBER)] = rowData.GPOS_ELITEMEMBER; + this.GuildPermissionMatrix[num][XGuildPP.Position2Int(GuildPosition.GPOS_MEMBER)] = rowData.GPOS_MEMBER; + } + } + + public string GetPositionName(GuildPosition position, bool bWithColor = false) + { + bool flag = position == GuildPosition.GPOS_COUNT; + string result; + if (flag) + { + result = ""; + } + else + { + result = (bWithColor ? this.PositionNameWithColor[XGuildPP.Position2Int(position)] : this.PositionName[XGuildPP.Position2Int(position)]); + } + return result; + } + + public Color GetPositionColor(GuildPosition position) + { + bool flag = position == GuildPosition.GPOS_COUNT; + Color result; + if (flag) + { + result = Color.white; + } + else + { + result = this.PositionColor[XGuildPP.Position2Int(position)]; + } + return result; + } + + public bool HasPermission(GuildPosition pos, GuildPermission pem) + { + bool flag = pem == GuildPermission.GPEM_DONOTHING; + bool result; + if (flag) + { + result = true; + } + else + { + bool flag2 = pos == GuildPosition.GPOS_COUNT || pem == GuildPermission.GPEM_MAX || pos == GuildPosition.GPOS_INVALID || pem == GuildPermission.GPEM_INVALID; + result = (!flag2 && this.GuildPermissionMatrix[XGuildPP.Permission2Int(pem)][XGuildPP.Position2Int(pos)] == 1); + } + return result; + } + + public bool HasLowerPosition(GuildPosition pos) + { + int num = XFastEnumIntEqualityComparer.ToInt(pos); + bool flag = num >= XGuildPP.POSITION_COUNT - 1; + return !flag; + } + + public int GetLowerPosition(GuildPosition pos) + { + int num = XFastEnumIntEqualityComparer.ToInt(pos); + bool flag = num > XGuildPP.POSITION_COUNT - 1; + int result; + if (flag) + { + result = num; + } + else + { + result = num + 1; + } + return result; + } + + public bool HasHigherPosition(GuildPosition pos) + { + int num = XFastEnumIntEqualityComparer.ToInt(pos); + bool flag = num <= 0; + return !flag; + } + + public int GetHigherPosition(GuildPosition pos) + { + int num = XFastEnumIntEqualityComparer.ToInt(pos); + bool flag = num < 0; + int result; + if (flag) + { + result = num; + } + else + { + result = num - 1; + } + return result; + } + + public GuildPermission GetSetPositionPermission(GuildPosition higherPos, GuildPosition targetPos) + { + bool flag = targetPos == GuildPosition.GPOS_COUNT || targetPos == GuildPosition.GPOS_INVALID; + GuildPermission result; + if (flag) + { + result = GuildPermission.GPEM_MAX; + } + else + { + switch (higherPos) + { + case GuildPosition.GPOS_LEADER: + result = GuildPermission.GPEM_CHANGELEADER; + break; + case GuildPosition.GPOS_VICELEADER: + result = GuildPermission.GPEM_SET_VICELEADER; + break; + case GuildPosition.GPOS_OFFICER: + result = GuildPermission.GPEM_SET_OFFICER; + break; + case GuildPosition.GPOS_ELITEMEMBER: + case GuildPosition.GPOS_MEMBER: + result = GuildPermission.GPEM_SET_ELITEMEMBER; + break; + default: + result = GuildPermission.GPEM_MAX; + break; + } + } + return result; + } + + private static int Position2Int(GuildPosition pos) + { + return XFastEnumIntEqualityComparer.ToInt(pos); + } + + private static int Permission2Int(GuildPermission pem) + { + return XFastEnumIntEqualityComparer.ToInt(pem); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildPP.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildPP.cs.meta new file mode 100644 index 00000000..3675de8a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildPP.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 51bd48e154e1cb0488a41aa07fd8bac5 +timeCreated: 1611403707 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildPositionChangedEventArgs.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildPositionChangedEventArgs.cs new file mode 100644 index 00000000..1b1df61e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildPositionChangedEventArgs.cs @@ -0,0 +1,21 @@ +using System; + +namespace XMainClient +{ + internal class XGuildPositionChangedEventArgs : XEventArgs + { + public GuildPosition position = GuildPosition.GPOS_COUNT; + + public XGuildPositionChangedEventArgs() + { + this._eDefine = XEventDefine.XEvent_GuildPositionChanged; + } + + public override void Recycle() + { + base.Recycle(); + XEventPool.Recycle(this); + this.position = GuildPosition.GPOS_COUNT; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildPositionChangedEventArgs.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildPositionChangedEventArgs.cs.meta new file mode 100644 index 00000000..6677872b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildPositionChangedEventArgs.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ee57be74e0c64714bae815065044096b +timeCreated: 1611404796 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildQualifierDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildQualifierDocument.cs new file mode 100644 index 00000000..7a840401 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildQualifierDocument.cs @@ -0,0 +1,319 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildQualifierDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildQualifierDocument.uuID; + } + } + + public bool ServerActive + { + get + { + return this.m_ServerActive; + } + } + + public double ActiveTime + { + get + { + return this.m_activeTime; + } + } + + public bool bHasAvailableLadderIcon + { + get + { + return this.m_bHasAvailableLadderIcon; + } + set + { + bool flag = this.m_bHasAvailableLadderIcon != value; + if (flag) + { + this.m_bHasAvailableLadderIcon = value; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildQualifier, true); + } + } + } + + public GuildQualifierDlg QualifierView { get; set; } + + public GuildQualifierSelect Select + { + get + { + return this.m_qualifierSelect; + } + set + { + this.m_qualifierSelect = value; + } + } + + public List GuildRoleRankList + { + get + { + this.m_SelectRoleRankList.Clear(); + bool flag = this.m_GuildRoleRankList != null; + if (flag) + { + bool flag2 = this.Select == GuildQualifierSelect.SELF; + if (flag2) + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + ulong uid = specificDocument.BasicData.uid; + int i = 0; + int count = this.m_GuildRoleRankList.Count; + while (i < count) + { + bool flag3 = this.m_GuildRoleRankList[i].guildid == uid; + if (flag3) + { + this.m_SelectRoleRankList.Add(this.m_GuildRoleRankList[i]); + } + i++; + } + } + else + { + this.m_SelectRoleRankList.AddRange(this.m_GuildRoleRankList); + } + this.m_SelectRoleRankList.Sort(new Comparison(this.RankSortCompare)); + } + return this.m_SelectRoleRankList; + } + } + + public List GuildRankList + { + get + { + return this.m_GuildRankList; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildQualifierDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + public static GuildPkRankReward m_GuildPKRankRewardTable = new GuildPkRankReward(); + + private List m_GuildRankList; + + private List m_GuildRoleRankList; + + private List m_SelectRoleRankList = new List(); + + private Dictionary m_GuildIconDic = new Dictionary(); + + private GuildQualifierSelect m_qualifierSelect = GuildQualifierSelect.ALL; + + private uint m_lastRewardCount = 3u; + + private bool m_sendState = false; + + private double m_ServerTime = 0.0; + + private double m_activeTime = 0.0; + + private bool m_ServerActive = false; + + private bool m_bHasAvailableLadderIcon; + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + this.m_sendState = false; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + this.SendSelectQualifierList(); + } + } + + public override void Update(float fDeltaT) + { + base.Update(fDeltaT); + bool flag = this.m_activeTime > (double)fDeltaT; + if (flag) + { + this.m_activeTime -= (double)fDeltaT; + } + else + { + this.m_activeTime = 0.0; + } + } + + public uint GetLastRewardCount() + { + return this.m_lastRewardCount; + } + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildQualifierDocument.AsyncLoader.AddTask("Table/GuildPkRankReward", XGuildQualifierDocument.m_GuildPKRankRewardTable, false); + XGuildQualifierDocument.AsyncLoader.Execute(callback); + } + + public static bool TryGetRankReward(int index, out GuildPkRankReward.RowData rewardData) + { + rewardData = XGuildQualifierDocument.m_GuildPKRankRewardTable.GetByrank((uint)index); + return rewardData != null; + } + + private int RankSortCompare(GuildLadderRoleRank r1, GuildLadderRoleRank r2) + { + return (int)(r2.wintimes - r1.wintimes); + } + + public bool TryGetGuildIcon(ulong guildID, out uint guildIcon) + { + return this.m_GuildIconDic.TryGetValue(guildID, out guildIcon); + } + + public bool CheckActive() + { + bool flag = this.m_ServerTime <= 0.0; + bool result; + if (flag) + { + result = false; + } + else + { + DateTime dateTime = XSingleton.singleton.TimeNow(this.m_ServerTime, true); + int num = dateTime.Hour * 3600 + dateTime.Minute * 60 + dateTime.Second; + XSingleton.singleton.AddGreenLog(XSingleton.singleton.StringCombine("ServerTime:", num.ToString()), null, null, null, null, null); + SeqList sequence3List = XSingleton.singleton.GetSequence3List("GuildLadderTime", true); + int i = 0; + int count = (int)sequence3List.Count; + while (i < count) + { + int num2 = sequence3List[i, 0]; + int num3 = sequence3List[i, 1]; + int num4 = sequence3List[i, 2]; + bool flag2 = XFastEnumIntEqualityComparer.ToInt(dateTime.DayOfWeek) == num2; + if (flag2) + { + int num5 = num3 / 100 * 3600 + num3 % 100 * 60; + int num6 = num4 / 100 * 3600 + num4 % 100 * 60; + bool flag3 = num >= num5 && num < num6; + if (flag3) + { + return true; + } + } + i++; + } + result = false; + } + return result; + } + + public void SendSelectQualifierList() + { + RpcC2M_ReqGuildLadderInfo rpcC2M_ReqGuildLadderInfo = new RpcC2M_ReqGuildLadderInfo(); + rpcC2M_ReqGuildLadderInfo.oArg.roleId = XSingleton.singleton.XPlayerData.RoleID; + XSingleton.singleton.Send(rpcC2M_ReqGuildLadderInfo); + } + + public void ReceiveSelectQualifierList(ReqGuildLadderInfoAgr oArg, ReqGuildLadderInfoRes oRes) + { + bool flag = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + this.m_ServerActive = false; + } + else + { + this.m_ServerActive = true; + this.m_activeTime = oRes.lastTime; + this.m_lastRewardCount = oRes.lestRewardTimes; + this.m_GuildRoleRankList = oRes.roleRanks; + this.m_GuildRankList = oRes.guildRanks; + this.m_ServerTime = oRes.nowTime; + XSingleton.singleton.AddGreenLog("ServerTime:", XSingleton.singleton.TimeFormatSince1970((int)oRes.nowTime, "yyyy年MM月dd日HH点", true), null, null, null, null); + this.SetGuildIconDic(this.m_GuildRankList); + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshData(); + } + } + + private void SetGuildIconDic(List list) + { + int i = 0; + int count = list.Count; + while (i < count) + { + bool flag = this.m_GuildIconDic.ContainsKey(list[i].guildid); + if (flag) + { + this.m_GuildIconDic[list[i].guildid] = list[i].icon; + } + else + { + this.m_GuildIconDic.Add(list[i].guildid, list[i].icon); + } + i++; + } + } + + public void SendGuildLadderRankInfo() + { + bool sendState = this.m_sendState; + if (!sendState) + { + RpcC2M_ReqGuildLadderRnakInfo rpcC2M_ReqGuildLadderRnakInfo = new RpcC2M_ReqGuildLadderRnakInfo(); + rpcC2M_ReqGuildLadderRnakInfo.oArg.roleid = XSingleton.singleton.XPlayerData.RoleID; + XSingleton.singleton.Send(rpcC2M_ReqGuildLadderRnakInfo); + this.m_sendState = true; + } + } + + public void ReceiveGuildLandderRankList(ReqGuildLadderRnakInfoArg arg, ReqGuildLadderRnakInfoRes res) + { + this.m_sendState = false; + bool flag = res.errorcode == ErrorCode.ERR_SUCCESS; + if (flag) + { + this.m_activeTime = res.lastTime; + this.m_ServerActive = true; + this.m_GuildRankList = res.guildrank; + this.SetGuildIconDic(this.m_GuildRankList); + } + else + { + bool flag2 = res.errorcode == ErrorCode.ERR_GUILD_LADDER_NOT_OPEN; + if (!flag2) + { + XSingleton.singleton.ShowSystemTip(res.errorcode, "fece00"); + return; + } + this.m_ServerActive = false; + } + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshGuildQualifier(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildQualifierDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildQualifierDocument.cs.meta new file mode 100644 index 00000000..ba8c86fb --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildQualifierDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 199d7235677035e4e80ca7d617ae7623 +timeCreated: 1611403303 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs new file mode 100644 index 00000000..ba8cd65b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs @@ -0,0 +1,102 @@ +using System; +using KKSG; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildRankDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildRankDocument.uuID; + } + } + + public uint EndTime + { + get + { + return this.m_EndTime; + } + } + + public uint KeepTime + { + get + { + return this.m_KeepTime; + } + } + + public uint RankIndex + { + get + { + return this.m_rankIndex; + } + } + + public int LastTime + { + get + { + return this.m_lastTime; + } + set + { + this.m_lastTime = value; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildRankDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + public static GuildRankRewardTable m_RankRewardTable = new GuildRankRewardTable(); + + private uint m_EndTime; + + private uint m_KeepTime; + + private uint m_rankIndex; + + public int m_lastTime = 0; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildRankDocument.AsyncLoader.AddTask("Table/GuildRankReward", XGuildRankDocument.m_RankRewardTable, false); + XGuildRankDocument.AsyncLoader.Execute(callback); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + this.SendGuildRankInfo(); + } + } + + public void SendGuildRankInfo() + { + RpcC2M_ReqGuildRankInfo rpc = new RpcC2M_ReqGuildRankInfo(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveGuildRankInfo(ReqGuildRankInfoRes res) + { + this.m_EndTime = res.endTime; + this.m_KeepTime = res.keepTime; + this.m_rankIndex = res.rank; + this.LastTime = (int)(res.endTime - res.nowTime); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.Refresh(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs.meta new file mode 100644 index 00000000..c00dd621 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 11c73dc1627c88b44a0deb6e99f1e54a +timeCreated: 1611403240 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRankInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankInfo.cs new file mode 100644 index 00000000..19e30288 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankInfo.cs @@ -0,0 +1,28 @@ +using System; +using KKSG; + +namespace XMainClient +{ + public class XGuildRankInfo : XBaseRankInfo + { + public string formatname2; + + public string name2; + + public uint exp; + + public uint presitge; + + public void ProcessData(GuildInfo guildInfo) + { + this.id = guildInfo.id; + this.value = (ulong)guildInfo.level; + this.presitge = guildInfo.prestige; + this.name = guildInfo.name; + this.formatname = XBaseRankInfo.GetUnderLineName(this.name); + this.name2 = guildInfo.leaderName; + this.formatname2 = XTitleDocument.GetTitleWithFormat(0u, guildInfo.leaderName); + this.exp = guildInfo.guildExp; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRankInfo.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankInfo.cs.meta new file mode 100644 index 00000000..68b55d89 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b9d0bb842f7c8844aa4c0812004e0590 +timeCreated: 1611404432 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRankList.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankList.cs new file mode 100644 index 00000000..0ab1f628 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankList.cs @@ -0,0 +1,17 @@ +using System; + +namespace XMainClient +{ + public class XGuildRankList : XBaseRankList + { + public XGuildRankList() + { + this.type = XRankType.GuildRank; + } + + public override XBaseRankInfo CreateNewInfo() + { + return new XGuildRankInfo(); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRankList.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankList.cs.meta new file mode 100644 index 00000000..b1c18bd5 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRankList.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cb7b787fd9ae6234e895ac9871d3b4e0 +timeCreated: 1611404546 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPackageSendBrief.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPackageSendBrief.cs new file mode 100644 index 00000000..f5de4284 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPackageSendBrief.cs @@ -0,0 +1,56 @@ +using System; +using KKSG; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildRedPackageSendBrief : IComparable + { + public uint typeID; + + public ulong uid; + + public uint itemid; + + public string senderName; + + public uint fetchedCount; + + public uint maxCount; + + public float endTime; + + public BonusSender senderType; + + public GuildBonusTable.RowData bonusInfo; + + public void SendData(GuildBonusAppear data) + { + this.typeID = data.bonusContentType; + this.uid = (ulong)data.bonusID; + this.itemid = data.bonusType; + this.senderName = data.sourceName; + this.fetchedCount = data.alreadyGetPeopleNum; + this.maxCount = data.maxPeopleNum; + this.endTime = Time.time + data.leftOpenTime; + this.bonusInfo = XGuildRedPacketDocument.GetRedPacketConfig(this.typeID); + this.senderType = ((XSingleton.singleton.XPlayerData.RoleID == data.sourceID) ? BonusSender.Bonus_Self : BonusSender.Bonus_Other); + } + + public int CompareTo(XGuildRedPackageSendBrief other) + { + bool flag = this.senderType == other.senderType; + int result; + if (flag) + { + result = this.endTime.CompareTo(other.endTime); + } + else + { + result = this.senderType.CompareTo(other.senderType); + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPackageSendBrief.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPackageSendBrief.cs.meta new file mode 100644 index 00000000..bfab032e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPackageSendBrief.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8bec5b4cf81a34b4eaeec54aa46a729b +timeCreated: 1611404097 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBehaviour.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBehaviour.cs new file mode 100644 index 00000000..6315ecaa --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBehaviour.cs @@ -0,0 +1,32 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildRedPacketBehaviour : DlgBehaviourBase + { + public Transform m_root; + + public IXUIButton m_Close; + + public IXUIButton m_Help; + + public IXUIScrollView m_ScrollView; + + public IXUIWrapContent m_WrapContent; + + public GameObject m_Empty; + + private void Awake() + { + this.m_root = base.transform.Find("Bg"); + this.m_Close = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_Help = (base.transform.Find("Bg/Help").GetComponent("XUIButton") as IXUIButton); + this.m_ScrollView = (base.transform.Find("Bg/Panel").GetComponent("XUIScrollView") as IXUIScrollView); + this.m_WrapContent = (base.transform.Find("Bg/Panel/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.m_Empty = base.transform.Find("Bg/Empty").gameObject; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBehaviour.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBehaviour.cs.meta new file mode 100644 index 00000000..cde0a16f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 92115eec10580d9458bf64d4949dfbc8 +timeCreated: 1611404145 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs new file mode 100644 index 00000000..810dc1a2 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs @@ -0,0 +1,84 @@ +using System; +using KKSG; +using UnityEngine; + +namespace XMainClient +{ + internal class XGuildRedPacketBrief : IComparable + { + public uint typeid; + + public ulong uid; + + public int itemid; + + public string senderName; + + public uint fetchedCount; + + public uint maxCount; + + public float endTime; + + public string iconUrl; + + public ulong sourceID; + + public string sourceName; + + public FetchState fetchState; + + public void SetData(GuildBonusAppear data) + { + this.uid = (ulong)data.bonusID; + this.itemid = (int)data.bonusType; + this.senderName = data.sourceName; + this.fetchedCount = data.alreadyGetPeopleNum; + this.maxCount = data.maxPeopleNum; + this.iconUrl = data.iconUrl; + this.sourceID = data.sourceID; + this.sourceName = data.sourceName; + bool flag = data.bonusStatus == 0u; + if (flag) + { + this.fetchState = FetchState.FS_CAN_FETCH; + } + else + { + bool flag2 = data.bonusStatus == 1u; + if (flag2) + { + this.fetchState = FetchState.FS_CANNOT_FETCH; + } + else + { + bool flag3 = data.bonusStatus == 2u; + if (flag3) + { + this.fetchState = FetchState.FS_ALREADY_FETCH; + } + else + { + this.fetchState = FetchState.FS_FETCHED; + } + } + } + this.endTime = Time.time + data.leftOpenTime; + } + + public int CompareTo(XGuildRedPacketBrief other) + { + bool flag = this.fetchState == other.fetchState; + int result; + if (flag) + { + result = this.endTime.CompareTo(other.endTime); + } + else + { + result = this.fetchState.CompareTo(other.fetchState); + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs.meta new file mode 100644 index 00000000..a807ab67 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketBrief.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 420dd53d21934894d9aa4834b7a5736f +timeCreated: 1611403638 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDetail.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDetail.cs new file mode 100644 index 00000000..a04b0f04 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDetail.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; + +namespace XMainClient +{ + internal class XGuildRedPacketDetail + { + public XGuildRedPacketBrief brif = new XGuildRedPacketBrief(); + + public int itemTotalCount; + + public uint getTotalCount; + + public int getCount; + + public string content; + + public ulong leaderID; + + public ulong luckestID; + + public bool canThank; + + public List logList = new List(); + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDetail.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDetail.cs.meta new file mode 100644 index 00000000..a31f5be3 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDetail.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 114e548942873494c80bf0cc76e1093c +timeCreated: 1611403222 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDocument.cs new file mode 100644 index 00000000..21c3288f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDocument.cs @@ -0,0 +1,644 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildRedPacketDocument : XDocComponent, ILogSource + { + public override uint ID + { + get + { + return XGuildRedPacketDocument.uuID; + } + } + + public XGuildRedPacketView GuildRedPacketView { get; set; } + + public List PacketList + { + get + { + return this.m_PacketList; + } + } + + public XGuildRedPacketDetail PacketDetail + { + get + { + return this.m_PacketDetail; + } + } + + public XGuildCheckInBonusInfo GuildBonus + { + get + { + return this.m_guildBonus; + } + } + + public List GuildBonusSendList + { + get + { + return this.m_GuildBonusSendBriefList; + } + } + + public bool bHasAvailableRedPacket + { + get + { + return this._bHasAvailableRedPacket; + } + set + { + this._bHasAvailableRedPacket = value; + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildRedPacket, true); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshRedPoint(); + } + } + } + + public bool bHasAvailableFixedRedPoint + { + get + { + return this._bHasAvailableFixedRedPoint; + } + set + { + this._bHasAvailableFixedRedPoint = value; + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildBoon_FixedRedPacket, true); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshRedPoint(); + } + } + } + + public int bHasShowIconRedPacket + { + get + { + return this._bHasShowIconRedPacket; + } + set + { + bool flag = this._bHasShowIconRedPacket != value; + if (flag) + { + this._bHasShowIconRedPacket = value; + this._showIconTimer = (double)((this._bHasShowIconRedPacket > 0) ? 300 : 0); + SceneType sceneType = XSingleton.singleton.GetSceneType(XSingleton.singleton.SceneID); + bool flag2 = sceneType == SceneType.SCENE_HALL || sceneType == SceneType.SCENE_GUILD_HALL; + if (flag2) + { + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildBoon_RedPacket, true); + } + } + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildRedPacketDocument"); + + private static GuildBonusTable m_BonusReader = new GuildBonusTable(); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private List m_PacketList = new List(); + + private List m_bonusBriefInfos = new List(); + + private XGuildRedPacketDetail m_PacketDetail = new XGuildRedPacketDetail(); + + private XGuildCheckInBonusInfo m_guildBonus = new XGuildCheckInBonusInfo(); + + private List m_GuildBonusSendBriefList = new List(); + + private bool _bHasAvailableRedPacket = false; + + private bool _bHasAvailableFixedRedPoint = false; + + private int _bHasShowIconRedPacket = 0; + + private double _showIconTimer = 0.0; + + public override void Update(float fDeltaT) + { + base.Update(fDeltaT); + bool flag = this._showIconTimer > (double)fDeltaT; + if (flag) + { + this._showIconTimer -= (double)fDeltaT; + bool flag2 = this._showIconTimer <= 0.0; + if (flag2) + { + this._showIconTimer = 0.0; + this.bHasShowIconRedPacket = 0; + } + } + bool flag3 = this.m_guildBonus == null; + if (!flag3) + { + this.m_guildBonus.timeofday += (double)fDeltaT; + bool flag4 = this.m_guildBonus.leftAskBonusTime > 0.0; + if (flag4) + { + this.m_guildBonus.leftAskBonusTime -= (double)fDeltaT; + } + else + { + this.m_guildBonus.leftAskBonusTime = 0.0; + } + } + } + + private void OnShowIconTimer(object o) + { + this.bHasShowIconRedPacket = 0; + } + + public bool CheckLeader(ulong uid) + { + return this.m_PacketDetail.leaderID == uid; + } + + public bool CheckLuckest(ulong uid) + { + return this.m_PacketDetail.luckestID == uid; + } + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildRedPacketDocument.AsyncLoader.AddTask("Table/GuildBonus", XGuildRedPacketDocument.m_BonusReader, false); + XGuildRedPacketDocument.AsyncLoader.Execute(callback); + } + + public static GuildBonusTable.RowData GetRedPacketConfig(uint id) + { + for (int i = 0; i < XGuildRedPacketDocument.m_BonusReader.Table.Length; i++) + { + bool flag = XGuildRedPacketDocument.m_BonusReader.Table[i].GuildBonusID == id; + if (flag) + { + return XGuildRedPacketDocument.m_BonusReader.Table[i]; + } + } + return null; + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + this._bHasAvailableRedPacket = false; + this._bHasShowIconRedPacket = 0; + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.OnInGuildStateChanged)); + } + + protected bool OnInGuildStateChanged(XEventArgs args) + { + XInGuildStateChangedEventArgs xinGuildStateChangedEventArgs = args as XInGuildStateChangedEventArgs; + bool flag = !xinGuildStateChangedEventArgs.bIsEnter; + if (flag) + { + this.bHasAvailableRedPacket = false; + } + return true; + } + + public List GetLogList() + { + return this.m_PacketDetail.logList; + } + + public void CheckAvailableRedPackets() + { + bool bHasAvailableRedPacket = false; + for (int i = 0; i < this.m_PacketList.Count; i++) + { + bool flag = this.m_PacketList[i].fetchState == FetchState.FS_CAN_FETCH; + if (flag) + { + bHasAvailableRedPacket = true; + break; + } + } + this.bHasAvailableRedPacket = bHasAvailableRedPacket; + } + + public void GetGuildCheckInBonusInfo() + { + RpcC2G_GuildCheckInBonusInfo rpc = new RpcC2G_GuildCheckInBonusInfo(); + XSingleton.singleton.Send(rpc); + } + + public void OnGuildCheckInBonusInfo(GuildCheckInBonusInfoRes oRes) + { + bool flag = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + } + else + { + this.m_guildBonus.isCheckIn = oRes.isCheckedIn; + this.m_guildBonus.guildMemberNum = oRes.guildMemberNum; + this.m_guildBonus.checkInNumber = oRes.checkInNum; + this.m_guildBonus.onLineNum = oRes.onlineNum; + this.m_guildBonus.leftAskBonusTime = (double)oRes.leftAskBonusTime; + this.m_guildBonus.timeofday = (double)oRes.timeofday; + this.m_guildBonus.SetBonusBrief(oRes.checkInBonusInfo); + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshSignInfo(); + } + } + } + + public void GetSendGuildBonus() + { + RpcC2G_SendGuildBonus rpc = new RpcC2G_SendGuildBonus(); + XSingleton.singleton.Send(rpc); + } + + public void OnSendGuildBonus(SendGuildBonusRes sRes) + { + bool flag = sRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(sRes.errorcode, "fece00"); + } + else + { + XInvitationDocument specificDocument = XDocuments.GetSpecificDocument(XInvitationDocument.uuID); + specificDocument.SendOpenSysInvitation(XSysDefine.XSys_GuildBoon_RedPacket, new ulong[0]); + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("INVITATION_SENT_NOTIFICATION"), "fece00"); + this.GetGuildCheckInBonusInfo(); + } + } + + public void SendGuildBonusSendList() + { + RpcC2M_GetGuildBonusSendList rpc = new RpcC2M_GetGuildBonusSendList(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveGuildBonusSendList(GetGuildBonusSendListRes res) + { + bool flag = res.error > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(res.error); + } + else + { + this.m_GuildBonusSendBriefList.Clear(); + int i = 0; + int count = res.sendList.Count; + while (i < count) + { + XGuildRedPackageSendBrief xguildRedPackageSendBrief = new XGuildRedPackageSendBrief(); + xguildRedPackageSendBrief.SendData(res.sendList[i]); + this.m_GuildBonusSendBriefList.Add(xguildRedPackageSendBrief); + i++; + } + this.m_GuildBonusSendBriefList.Sort(); + this.UpdateSelfSend(); + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.Refresh(); + } + } + } + + public void SendGuildBonusInSend(uint bonusID) + { + RpcC2M_SendGuildBonusInSendList rpcC2M_SendGuildBonusInSendList = new RpcC2M_SendGuildBonusInSendList(); + rpcC2M_SendGuildBonusInSendList.oArg.bonusID = bonusID; + XSingleton.singleton.Send(rpcC2M_SendGuildBonusInSendList); + } + + public void ReceiveGuildBonusInSend(SendGuildBonusInSendListArg arg, SendGuildBonusInSendListRes res) + { + bool flag = res.error > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(res.error); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("INVITATION_SENT_NOTIFICATION"), "fece00"); + bool flag2 = false; + int i = 0; + int count = this.m_GuildBonusSendBriefList.Count; + while (i < count) + { + bool flag3 = this.m_GuildBonusSendBriefList[i].uid == (ulong)arg.bonusID; + if (flag3) + { + flag2 = true; + this.m_GuildBonusSendBriefList.RemoveAt(i); + break; + } + i++; + } + this.UpdateSelfSend(); + this.ReqFetch(arg.bonusID); + bool flag4 = flag2 && DlgBase.singleton.IsVisible(); + if (flag4) + { + DlgBase.singleton.Refresh(); + } + } + } + + private void UpdateSelfSend() + { + bool bHasAvailableFixedRedPoint = false; + int i = 0; + int count = this.m_GuildBonusSendBriefList.Count; + while (i < count) + { + bool flag = this.m_GuildBonusSendBriefList[i].senderType == BonusSender.Bonus_Self; + if (flag) + { + bHasAvailableFixedRedPoint = true; + break; + } + i++; + } + this.bHasAvailableFixedRedPoint = bHasAvailableFixedRedPoint; + } + + public void ReqList() + { + RpcC2G_GetGuildBonusList rpc = new RpcC2G_GetGuildBonusList(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetList(GetGuildBonusListResult oRes) + { + bool flag = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + } + else + { + int num = oRes.bonusList.Count - this.m_PacketList.Count; + for (int i = 0; i < num; i++) + { + this.m_PacketList.Add(new XGuildRedPacketBrief()); + } + bool flag2 = num < 0; + if (flag2) + { + this.m_PacketList.RemoveRange(this.m_PacketList.Count + num, -num); + } + for (int j = 0; j < this.m_PacketList.Count; j++) + { + this.m_PacketList[j].SetData(oRes.bonusList[j]); + } + this.m_PacketList.Sort(); + this.CheckAvailableRedPackets(); + bool flag3 = this.GuildRedPacketView != null && this.GuildRedPacketView.IsVisible(); + if (flag3) + { + this.GuildRedPacketView.Refresh(true); + } + } + } + + public void ReqDetail(uint uid) + { + bool flag = uid == 0u; + if (!flag) + { + RpcC2G_GetGuildBonusDetailInfo rpcC2G_GetGuildBonusDetailInfo = new RpcC2G_GetGuildBonusDetailInfo(); + rpcC2G_GetGuildBonusDetailInfo.oArg.bonusID = uid; + XSingleton.singleton.Send(rpcC2G_GetGuildBonusDetailInfo); + } + } + + public void OnGetDetail(GetGuildBonusDetailInfoResult oRes) + { + bool flag = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + } + else + { + bool flag2 = oRes.bonusInfo == null; + if (flag2) + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + XSingleton.singleton.AddErrorLog("RedPackage bonus is null", oRes.leaderID.ToString(), null, null, null, null); + } + else + { + this.m_PacketDetail.brif.SetData(oRes.bonusInfo); + this.m_PacketDetail.brif.typeid = oRes.bonusContentType; + this.m_PacketDetail.itemTotalCount = (int)oRes.bonusNum; + this.m_PacketDetail.content = oRes.content; + this.m_PacketDetail.leaderID = oRes.leaderID; + this.m_PacketDetail.luckestID = oRes.luckestID; + this.m_PacketDetail.canThank = oRes.canThank; + this.m_PacketDetail.getCount = oRes.getBonusRoleList.Count; + int num = oRes.getBonusRoleList.Count - this.m_PacketDetail.logList.Count; + for (int i = 0; i < num; i++) + { + this.m_PacketDetail.logList.Add(new XGuildRedPacketLog()); + } + bool flag3 = num < 0; + if (flag3) + { + this.m_PacketDetail.logList.RemoveRange(this.m_PacketDetail.logList.Count + num, -num); + } + uint num2 = 0u; + for (int j = 0; j < this.m_PacketDetail.logList.Count; j++) + { + XGuildRedPacketLog xguildRedPacketLog = this.m_PacketDetail.logList[j] as XGuildRedPacketLog; + xguildRedPacketLog.SetData(oRes.getBonusRoleList[j]); + num2 += oRes.getBonusRoleList[j].getNum; + xguildRedPacketLog.itemid = this.m_PacketDetail.brif.itemid; + } + this.m_PacketDetail.getTotalCount = num2; + this.m_PacketDetail.logList.Sort(); + bool flag4 = DlgBase.singleton.IsVisible(); + if (flag4) + { + DlgBase.singleton.Refresh(); + } + } + } + } + + public void SetCanThank(bool thank = false) + { + this.m_PacketDetail.canThank = thank; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.Refresh(); + } + } + + public void ReqFetch(uint uid) + { + RpcC2G_GetGuildBonusReward rpcC2G_GetGuildBonusReward = new RpcC2G_GetGuildBonusReward(); + rpcC2G_GetGuildBonusReward.oArg.bonusID = uid; + XSingleton.singleton.Send(rpcC2G_GetGuildBonusReward); + } + + public void OnFetch(GetGuildBonusRewardArg oArg, GetGuildBonusRewardResult oRes) + { + bool flag = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + bool flag2 = this.GuildRedPacketView != null && this.GuildRedPacketView.IsVisible(); + if (flag2) + { + this.GuildRedPacketView.ShowResult(null); + } + } + else + { + XGuildRedPacketBrief xguildRedPacketBrief = null; + for (int i = 0; i < this.m_PacketList.Count; i++) + { + bool flag3 = this.m_PacketList[i].uid == (ulong)oArg.bonusID; + if (flag3) + { + xguildRedPacketBrief = this.m_PacketList[i]; + xguildRedPacketBrief.fetchState = FetchState.FS_ALREADY_FETCH; + xguildRedPacketBrief.fetchedCount += 1u; + break; + } + } + this.CheckAvailableRedPackets(); + DlgBase.singleton.ShowEffect(true, oArg.bonusID); + bool flag4 = this.GuildRedPacketView != null && this.GuildRedPacketView.IsVisible(); + if (flag4) + { + this.ReqList(); + this.GuildRedPacketView.Refresh(false); + this.GuildRedPacketView.ShowResult(xguildRedPacketBrief); + } + } + } + + public void SendGuildBonuesLeft() + { + XSingleton.singleton.AddGreenLog("SendGuildBonuesLeft", null, null, null, null, null); + RpcC2G_GetGuildBonusLeft rpc = new RpcC2G_GetGuildBonusLeft(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveGuildBonusLeft(GetGuildBonusLeftRes res) + { + XSingleton.singleton.AddGreenLog("ReceiveGuildBonusLeft", null, null, null, null, null); + bool flag = res.errorCode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(res.errorCode, "fece00"); + } + else + { + this.m_bonusBriefInfos.Clear(); + this.m_bonusBriefInfos.AddRange(res.bonusInfos); + this.bHasShowIconRedPacket = this.m_bonusBriefInfos.Count; + } + } + + public void ReqGetLast() + { + uint num = 0u; + bool flag = this.m_bonusBriefInfos.Count > 0; + if (flag) + { + int sendTime = this.m_bonusBriefInfos[0].sendTime; + num = this.m_bonusBriefInfos[0].bonusID; + int i = 1; + int count = this.m_bonusBriefInfos.Count; + while (i < count) + { + bool flag2 = this.m_bonusBriefInfos[i].sendTime > sendTime; + if (flag2) + { + sendTime = this.m_bonusBriefInfos[i].sendTime; + num = this.m_bonusBriefInfos[i].bonusID; + } + i++; + } + } + bool flag3 = num > 0u; + if (flag3) + { + this.ReqFetch(num); + this.ReceiveGuildBonusGetAll(num); + } + } + + public void ReceiveGuildBonusGetAll(uint bonusID) + { + bool flag = false; + int i = 0; + int count = this.m_bonusBriefInfos.Count; + while (i < count) + { + bool flag2 = this.m_bonusBriefInfos[i].bonusID == bonusID; + if (flag2) + { + flag = true; + this.m_bonusBriefInfos.RemoveAt(i); + break; + } + i++; + } + bool flag3 = flag; + if (flag3) + { + this.bHasShowIconRedPacket = this.m_bonusBriefInfos.Count; + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = this.GuildRedPacketView != null && this.GuildRedPacketView.IsVisible(); + if (flag) + { + this.ReqList(); + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + this.GetGuildCheckInBonusInfo(); + } + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + this.SendGuildBonusSendList(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDocument.cs.meta new file mode 100644 index 00000000..24fec70f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f63322b78da087046b3b3cafd0584edc +timeCreated: 1611404880 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketLog.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketLog.cs new file mode 100644 index 00000000..7ba1f2bc --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketLog.cs @@ -0,0 +1,58 @@ +using System; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildRedPacketLog : ILogData, IComparable + { + public ulong uid; + + public string name; + + public int itemid; + + public int itemcount; + + public int time; + + public void SetData(GetGuildBonusInfo data) + { + this.uid = data.roleID; + this.name = data.roleName; + this.itemcount = (int)data.getNum; + this.time = (int)data.getTime; + } + + public string GetContent() + { + return XStringDefineProxy.GetString("GUILD_REDPACKET_LOG", new object[] + { + XLabelSymbolHelper.FormatName(this.name, this.uid, "00ffff"), + XLabelSymbolHelper.FormatCostWithIcon(this.itemcount, (ItemEnum)this.itemid) + }); + } + + public string GetTime() + { + return XSingleton.singleton.TimeAgoFormatString(this.time); + } + + public int CompareTo(ILogData otherLog) + { + XGuildRedPacketLog xguildRedPacketLog = otherLog as XGuildRedPacketLog; + bool flag = xguildRedPacketLog.time == this.time; + int result; + if (flag) + { + result = this.uid.CompareTo(xguildRedPacketLog.uid); + } + else + { + result = this.time.CompareTo(xguildRedPacketLog.time); + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketLog.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketLog.cs.meta new file mode 100644 index 00000000..c405c02b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRedPacketLog.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c8e7637333cf9004591b13747996e5e0 +timeCreated: 1611404536 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameBehaviour.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameBehaviour.cs new file mode 100644 index 00000000..494d99eb --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameBehaviour.cs @@ -0,0 +1,24 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildRelaxGameBehaviour : DlgBehaviourBase + { + public IXUIButton m_Close; + + public GameObject m_GameTemp; + + public IXUIScrollView m_GameScrollView; + + private void Awake() + { + this.m_GameTemp = base.transform.Find("Bg/GameList/GameTpl").gameObject; + this.m_Close = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_GameScrollView = (base.transform.Find("Bg/GameList").GetComponent("XUIScrollView") as IXUIScrollView); + this.m_GameTemp.gameObject.SetActive(false); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameBehaviour.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameBehaviour.cs.meta new file mode 100644 index 00000000..f5abfac1 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1c7e89bfeaabbef45898f1ed8a310805 +timeCreated: 1611403344 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameDocument.cs new file mode 100644 index 00000000..e411898b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameDocument.cs @@ -0,0 +1,129 @@ +using System; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildRelaxGameDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildRelaxGameDocument.uuID; + } + } + + public uint GuildVoiceQAState + { + get + { + return this._guildVoiceQAState; + } + } + + public float GuildVoiceQAWaitTime + { + get + { + return this._guildVoiceQAWaitTime; + } + } + + public bool RedPoint { get; set; } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildRelaxGameDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + public static GuildRelaxGameList GameList = new GuildRelaxGameList(); + + private uint _guildVoiceQAState = 0u; + + private float _guildVoiceQAWaitTime = 0f; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildRelaxGameDocument.AsyncLoader.AddTask("Table/GuildRelaxGameList", XGuildRelaxGameDocument.GameList, false); + XGuildRelaxGameDocument.AsyncLoader.Execute(callback); + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.GuildStatusChanged)); + } + + public bool GuildStatusChanged(XEventArgs args) + { + this.RefreshRedPoint(); + return true; + } + + public void OpenGuildVoiceQuery() + { + RpcC2G_OpenGuildQAReq rpc = new RpcC2G_OpenGuildQAReq(); + XSingleton.singleton.Send(rpc); + } + + public void GetGuildVoiceInfo() + { + RpcC2G_GetGuildQADataReq rpc = new RpcC2G_GetGuildQADataReq(); + XSingleton.singleton.Send(rpc); + } + + public void JoinGuildVoiceInfo() + { + XVoiceQADocument specificDocument = XDocuments.GetSpecificDocument(XVoiceQADocument.uuID); + bool isVoiceQAIng = specificDocument.IsVoiceQAIng; + if (isVoiceQAIng) + { + DlgBase.singleton.SetVisible(true, true); + } + else + { + specificDocument.VoiceQAJoinChoose(true, 3u); + } + } + + public void SetGuildVoiceInfo(uint state, float time) + { + this._guildVoiceQAState = state; + XSingleton.singleton.AddLog(string.Format("Get guild voice open state = {0} by server", state), null, null, null, null, null, XDebugColor.XDebug_None); + this._guildVoiceQAWaitTime = time; + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.Refresh(XSysDefine.XSys_GuildRelax_VoiceQA); + DlgBase.singleton.RefreshRedPoint(XSysDefine.XSys_GuildRelax_VoiceQA); + } + } + + public void RefreshRedPoint() + { + XGuildJokerDocument specificDocument = XDocuments.GetSpecificDocument(XGuildJokerDocument.uuID); + XGuildDocument specificDocument2 = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + this.RedPoint = false; + bool flag = !specificDocument2.bInGuild; + if (flag) + { + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildRelax_Joker, true); + } + else + { + this.RedPoint = (specificDocument.GameCount > 0); + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildRelax_Joker, true); + bool flag2 = !DlgBase.singleton.IsVisible(); + if (!flag2) + { + DlgBase.singleton.RefreshRedPoint(XSysDefine.XSys_GuildRelax_VoiceQA); + } + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameDocument.cs.meta new file mode 100644 index 00000000..7de0b727 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e26dfb8c5981f3a4c97b5e023fbbe70e +timeCreated: 1611404705 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameView.cs new file mode 100644 index 00000000..6c38f39e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameView.cs @@ -0,0 +1,221 @@ +using System; +using System.Collections.Generic; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildRelaxGameView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildSystem/GuildRelaxGameDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool fullscreenui + { + get + { + return true; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + private List m_realxSysList; + + private List m_relaxChildren; + + private int m_RelaxIndex = 0; + + protected override void Init() + { + base.Init(); + this.m_realxSysList = new List(); + this.m_relaxChildren = new List(); + this.m_RelaxIndex = 0; + this.RegisterHandler(XSysDefine.XSys_GuildRelax_VoiceQA); + this.RegisterHandler(XSysDefine.XSys_GuildRelax_JokerMatch); + this.RegisterHandler(XSysDefine.XSys_GuildCollect); + base.uiBehaviour.m_GameScrollView.ResetPosition(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClick)); + } + + private bool OnCloseClick(IXUIButton button) + { + this.SetVisibleWithAnimation(false, null); + return true; + } + + protected override void OnUnload() + { + this.RemoveHandler(XSysDefine.XSys_GuildRelax_VoiceQA); + this.RemoveHandler(XSysDefine.XSys_GuildRelax_JokerMatch); + this.RemoveHandler(XSysDefine.XSys_GuildCollect); + this.m_realxSysList.Clear(); + this.m_relaxChildren.Clear(); + this.m_realxSysList = null; + this.m_relaxChildren = null; + base.OnUnload(); + } + + public override void StackRefresh() + { + base.StackRefresh(); + int i = 0; + int count = this.m_relaxChildren.Count; + while (i < count) + { + this.m_relaxChildren[i].StackRefresh(); + i++; + } + } + + public bool TryGetRelaxChild(XSysDefine define, out GuildRelaxChildHandler handler) + { + int num = this.m_realxSysList.IndexOf(define); + bool flag = num < 0; + bool result; + if (flag) + { + handler = null; + result = false; + } + else + { + handler = this.m_relaxChildren[num]; + result = true; + } + return result; + } + + protected override void OnHide() + { + int i = 0; + int count = this.m_relaxChildren.Count; + while (i < count) + { + this.m_relaxChildren[i].SetVisible(false); + i++; + } + base.OnHide(); + } + + protected override void OnShow() + { + base.OnShow(); + int i = 0; + int count = this.m_relaxChildren.Count; + while (i < count) + { + this.m_relaxChildren[i].SetVisible(true); + i++; + } + } + + public override void OnUpdate() + { + base.OnUpdate(); + int i = 0; + int count = this.m_relaxChildren.Count; + while (i < count) + { + this.m_relaxChildren[i].OnUpdate(); + i++; + } + } + + private void RegisterHandler(XSysDefine define) where T : GuildRelaxChildHandler, new() + { + bool flag = this.m_realxSysList.IndexOf(define) < 0; + if (flag) + { + T t = default(T); + GameObject gameObject = XCommon.Instantiate(base.uiBehaviour.m_GameTemp); + gameObject.SetActive(true); + gameObject.transform.parent = this.m_uiBehaviour.m_GameScrollView.gameObject.transform; + gameObject.transform.localScale = Vector3.one; + gameObject.transform.localPosition = new Vector3((float)(-340 + this.m_RelaxIndex * 360), -28f, 0f); + gameObject.name = define.ToString(); + t = DlgHandlerBase.EnsureCreate(ref t, gameObject, null, false); + this.m_realxSysList.Add(define); + this.m_relaxChildren.Add(t); + t.SetGuildRelex(define); + this.m_RelaxIndex++; + } + } + + private void RemoveHandler(XSysDefine define) + { + int num = this.m_realxSysList.IndexOf(define); + bool flag = num < 0; + if (!flag) + { + GuildRelaxChildHandler guildRelaxChildHandler = this.m_relaxChildren[num]; + DlgHandlerBase.EnsureUnload(ref guildRelaxChildHandler); + this.m_relaxChildren.RemoveAt(num); + this.m_realxSysList.RemoveAt(num); + } + } + + public void Refresh(XSysDefine define) + { + GuildRelaxChildHandler guildRelaxChildHandler; + bool flag = this.TryGetRelaxChild(define, out guildRelaxChildHandler); + if (flag) + { + guildRelaxChildHandler.RefreshData(); + } + } + + public void RefreshRedPoint(XSysDefine define) + { + GuildRelaxChildHandler guildRelaxChildHandler; + bool flag = this.TryGetRelaxChild(define, out guildRelaxChildHandler); + if (flag) + { + guildRelaxChildHandler.RefreshRedPoint(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameView.cs.meta new file mode 100644 index 00000000..0c7605f6 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildRelaxGameView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c209863dcda8dc74db010b5267f16a79 +timeCreated: 1611404492 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildResContentionBuffDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildResContentionBuffDocument.cs new file mode 100644 index 00000000..8e45aa75 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildResContentionBuffDocument.cs @@ -0,0 +1,676 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildResContentionBuffDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildResContentionBuffDocument.uuID; + } + } + + public static XGuildResContentionBuffDocument Doc + { + get + { + return XSingleton.singleton.Doc.GetXComponent(XGuildResContentionBuffDocument.uuID) as XGuildResContentionBuffDocument; + } + } + + public static GuildBuffTable GuildBuffData + { + get + { + return XGuildResContentionBuffDocument._guildBuffTable; + } + } + + public static GuildMineralStorage GuildMineralStorageTable + { + get + { + return XGuildResContentionBuffDocument._guildMineralStorageTable; + } + } + + public uint GuildBuffCDTime + { + get + { + return this._guildBuffCDTime; + } + set + { + this._guildBuffCDTime = value; + } + } + + public ulong GuildID + { + get + { + return this._guildID; + } + set + { + this._guildID = value; + } + } + + public List MineUsedBuffRecordList + { + get + { + return this._guildBuffUsedRecords; + } + set + { + this._guildBuffUsedRecords = value; + } + } + + public uint GuildMaxResource + { + get + { + return this._guildMaxResource; + } + set + { + this._guildMaxResource = value; + } + } + + public List MyselfOwnedBuffs + { + get + { + return this._myselfOwnedBuffs; + } + set + { + this._myselfOwnedBuffs = value; + } + } + + public List MySelfActingBuffList + { + get + { + return this._mySelfActingBuffList; + } + set + { + this._mySelfActingBuffList = value; + } + } + + public List MyGuildOwnedBuffs + { + get + { + return this._myGuildOwnedBuffs; + } + set + { + this._myGuildOwnedBuffs = value; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildResContentionBuffDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private static GuildBuffTable _guildBuffTable = new GuildBuffTable(); + + private static GuildMineralStorage _guildMineralStorageTable = new GuildMineralStorage(); + + private List _myGuildOwnedBuffs = new List(); + + private List _myselfOwnedBuffs = new List(); + + private List _mySelfActingBuffList = new List(); + + private List _guildBuffUsedRecords = new List(); + + private List _guildInfoList = new List(); + + private Dictionary> _guildsBuffedInfos = new Dictionary>(); + + private uint _guildBuffCDTime = 0u; + + private ulong _guildID = 0UL; + + private uint _guildCdTimerID = 0u; + + private uint _guildMaxResource = 1u; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildResContentionBuffDocument.AsyncLoader.AddTask("Table/GuildBuff", XGuildResContentionBuffDocument._guildBuffTable, false); + XGuildResContentionBuffDocument.AsyncLoader.AddTask("Table/GuildMineralStorage", XGuildResContentionBuffDocument._guildMineralStorageTable, false); + XGuildResContentionBuffDocument.AsyncLoader.Execute(callback); + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + } + + public override void OnDetachFromHost() + { + base.OnDetachFromHost(); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + } + + public GuildBuffTable.RowData GetGuildBuffDataByItemID(uint itemID) + { + for (int i = 0; i < XGuildResContentionBuffDocument._guildBuffTable.Table.Length; i++) + { + bool flag = XGuildResContentionBuffDocument._guildBuffTable.Table[i].itemid == itemID; + if (flag) + { + return XGuildResContentionBuffDocument._guildBuffTable.Table[i]; + } + } + return null; + } + + public GuildBuffTable.RowData GetGuildBuffDataByBuffID(uint buffID) + { + for (int i = 0; i < XGuildResContentionBuffDocument._guildBuffTable.Table.Length; i++) + { + bool flag = XGuildResContentionBuffDocument._guildBuffTable.Table[i].id == buffID; + if (flag) + { + return XGuildResContentionBuffDocument._guildBuffTable.Table[i]; + } + } + return null; + } + + public GuildMineralStorage.RowData GetMineralStorageByID(uint id) + { + for (int i = 0; i < XGuildResContentionBuffDocument._guildMineralStorageTable.Table.Length; i++) + { + bool flag = XGuildResContentionBuffDocument._guildMineralStorageTable.Table[i].itemid == id; + if (flag) + { + return XGuildResContentionBuffDocument._guildMineralStorageTable.Table[i]; + } + } + return null; + } + + public void SendGuildBuffReq(ulong guildID, uint itemID) + { + RpcC2M_UseGuildBuff rpcC2M_UseGuildBuff = new RpcC2M_UseGuildBuff(); + rpcC2M_UseGuildBuff.oArg.guildid = guildID; + rpcC2M_UseGuildBuff.oArg.itemid = itemID; + XSingleton.singleton.Send(rpcC2M_UseGuildBuff); + } + + public void SendPersonalBuffOpReq(ulong entityID, uint itemID, PersonalBuffOpType opType) + { + RpcC2G_ItemBuffOp rpcC2G_ItemBuffOp = new RpcC2G_ItemBuffOp(); + rpcC2G_ItemBuffOp.oArg.itemcount = 1u; + rpcC2G_ItemBuffOp.oArg.itemid = itemID; + rpcC2G_ItemBuffOp.oArg.op = (uint)opType; + XSingleton.singleton.Send(rpcC2G_ItemBuffOp); + } + + public void OnGetUseGuildBuffResult(UseGuildBuffArg oArg, UseGuildBuffRes oRes) + { + bool flag = oRes.error == ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("BuffUseSuc"), "fece00"); + this._guildBuffCDTime = oRes.cd; + DlgBase.singleton.RefreshOwnedBuffItem(oArg.itemid, this._guildBuffCDTime); + } + else + { + XSingleton.singleton.ShowSystemTip(oRes.error, "fece00"); + } + } + + public void OnGetPersonalBuffOperationResult(ItemBuffOpArg oArg, ItemBuffOpRes oRes) + { + bool flag = oRes.errorcode == ErrorCode.ERR_SUCCESS; + if (flag) + { + bool flag2 = oArg.op == 0u; + if (flag2) + { + this._myselfOwnedBuffs.Clear(); + for (int i = 0; i < oRes.itemid.Count; i++) + { + this._myselfOwnedBuffs.Add(new GuildBuffInfo + { + itemID = oRes.itemid[i], + count = oRes.itemcount[i] + }); + } + } + else + { + bool flag3 = oArg.op == 1u; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("BuffUseSuc"), "fece00"); + for (int j = 0; j < this._myselfOwnedBuffs.Count; j++) + { + bool flag4 = this._myselfOwnedBuffs[j].itemID == oArg.itemid; + if (flag4) + { + bool flag5 = this._myselfOwnedBuffs[j].count <= 1u; + if (flag5) + { + this._myselfOwnedBuffs.RemoveAt(j); + } + else + { + this._myselfOwnedBuffs[j].count -= 1u; + } + break; + } + } + ItemBuffTable.RowData itembuffDataByID = XHomeCookAndPartyDocument.Doc.GetItembuffDataByID(oArg.itemid); + bool flag6 = itembuffDataByID != null; + if (flag6) + { + for (int k = 0; k < itembuffDataByID.Buffs.Count; k++) + { + BuffTable.RowData buffData = XSingleton.singleton.GetBuffData((int)itembuffDataByID.Buffs[k, 0], (int)itembuffDataByID.Buffs[k, 1]); + bool flag7 = buffData.BuffDuration > 0f; + if (flag7) + { + bool flag8 = false; + for (int l = 0; l < this._mySelfActingBuffList.Count; l++) + { + bool flag9 = (ulong)this._mySelfActingBuffList[l].buffID == (ulong)((long)buffData.BuffID); + if (flag9) + { + this._mySelfActingBuffList[l].time = (uint)buffData.BuffDuration; + flag8 = true; + break; + } + } + bool flag10 = !flag8; + if (flag10) + { + this._mySelfActingBuffList.Add(new GuildUsingBuffInfo + { + buffID = (uint)buffData.BuffID, + time = (uint)buffData.BuffDuration + }); + } + } + } + } + bool flag11 = DlgBase.singleton.IsVisible(); + if (flag11) + { + DlgBase.singleton.RefreshOwnedBuffItem(oArg.itemid, 0u); + DlgBase.singleton.RefreshMySelfActingBuff(); + } + } + else + { + bool flag12 = oArg.op == 2u; + if (flag12) + { + this.MySelfActingBuffList.Clear(); + for (int m = 0; m < oRes.buffid.Count; m++) + { + this._mySelfActingBuffList.Add(new GuildUsingBuffInfo + { + buffID = oRes.buffid[m], + time = oRes.lefttime[m] + }); + } + bool flag13 = DlgBase.singleton.IsVisible(); + if (flag13) + { + DlgBase.singleton.RefreshMySelfActingBuff(); + } + } + else + { + bool flag14 = oArg.op == 3u; + if (flag14) + { + bool flag15 = XSingleton.singleton.SceneType == SceneType.SCENE_HORSE_RACE || XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_HORSERACING; + if (flag15) + { + XRaceDocument specificDocument = XDocuments.GetSpecificDocument(XRaceDocument.uuID); + specificDocument.UseDoodad(oArg, oRes); + } + else + { + bool flag16 = XSingleton.singleton.SceneType == SceneType.SCENE_SURVIVE; + if (flag16) + { + } + } + } + } + } + } + } + else + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + } + } + + public void OnGetBuffAllInfo(ResWarGuildBrief res) + { + bool flag = res != null && res.error == ErrorCode.ERR_SUCCESS; + if (flag) + { + this.GuildBuffCDTime = res.cardcd; + this.GuildID = res.guildid; + this.GuildMaxResource = (uint)XSingleton.singleton.GetInt("GuildResMax"); + List item = res.item; + bool flag2 = item != null; + if (flag2) + { + this.UpdateOwnedBuffList(item); + } + this.OnGetGuildInfoList(res.rankinfo); + this.OnGetGuildBuffList(res.buffinfo); + this.UpdateBuffRecords(res.chatinfo); + } + } + + public WarResGuildInfo GetPKGuildInfos(int index) + { + bool flag = index < this._guildInfoList.Count; + WarResGuildInfo result; + if (flag) + { + result = this._guildInfoList[index]; + } + else + { + result = null; + } + return result; + } + + public List GetAllGuildInfos() + { + return this._guildInfoList; + } + + public List GetGuildUsedBuffList(ulong guildID) + { + List result = null; + foreach (KeyValuePair> keyValuePair in this._guildsBuffedInfos) + { + bool flag = keyValuePair.Key == guildID; + if (flag) + { + result = this._guildsBuffedInfos[keyValuePair.Key]; + return result; + } + } + return result; + } + + public GuildBuffInfo GetGuildOwnedSomeCardInfo(uint itemID) + { + for (int i = 0; i < this.MyGuildOwnedBuffs.Count; i++) + { + bool flag = this.MyGuildOwnedBuffs[i].itemID == itemID && this.MyGuildOwnedBuffs[i].count > 0u; + if (flag) + { + return this.MyGuildOwnedBuffs[i]; + } + } + return null; + } + + public GuildBuffInfo GetMyOwnedSomeCardInfo(uint itemID) + { + for (int i = 0; i < this._myselfOwnedBuffs.Count; i++) + { + bool flag = this._myselfOwnedBuffs[i].itemID == itemID; + if (flag) + { + return this._myselfOwnedBuffs[i]; + } + } + return null; + } + + public void StartCDTimer() + { + this.StopCDTimer(); + this._guildCdTimerID = XSingleton.singleton.SetTimerAccurate(1f, new XTimerMgr.AccurateElapsedEventHandler(this.RefreshCardCD), null); + } + + public void StopCDTimer() + { + XSingleton.singleton.KillTimer(this._guildCdTimerID); + this._guildCdTimerID = 0u; + } + + private void RefreshCardCD(object param, float delay) + { + this.MinusGuildBuffCDTime(); + this.RefreshUICD(); + this.StartCDTimer(); + } + + private void RefreshUICD() + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshGuildBuffCD(); + DlgBase.singleton.RefreshMySelfActingBuff(); + } + GuildBuffOperationHandler guildBuffHandler = DlgBase.singleton.GuildBuffHandler; + bool flag2 = guildBuffHandler != null && guildBuffHandler.IsVisible(); + if (flag2) + { + guildBuffHandler.RefreshCardCd(); + } + } + + private void MinusGuildBuffCDTime() + { + this._guildBuffCDTime = ((this._guildBuffCDTime > 0u) ? (this._guildBuffCDTime - 1u) : 0u); + foreach (List list in this._guildsBuffedInfos.Values) + { + for (int i = 0; i < list.Count; i++) + { + list[i].time = ((list[i].time > 0u) ? (list[i].time - 1u) : 0u); + } + } + for (int j = this._mySelfActingBuffList.Count - 1; j >= 0; j--) + { + bool flag = this._mySelfActingBuffList[j].time == 0u; + if (flag) + { + this._mySelfActingBuffList.RemoveAt(j); + } + else + { + this._mySelfActingBuffList[j].time -= 1u; + } + } + } + + private void UpdateOwnedBuffList(List buffItems) + { + bool flag = buffItems == null; + if (!flag) + { + this.MyGuildOwnedBuffs.Clear(); + for (int i = 0; i < buffItems.Count; i++) + { + this.MyGuildOwnedBuffs.Add(new GuildBuffInfo + { + itemID = buffItems[i].itemid, + count = buffItems[i].count + }); + } + } + } + + private void UpdateBuffRecords(List usedBuffs) + { + bool flag = usedBuffs != null; + if (flag) + { + this._guildBuffUsedRecords.Clear(); + XChatDocument specificDocument = XDocuments.GetSpecificDocument(XChatDocument.uuID); + for (int i = 0; i < usedBuffs.Count; i++) + { + this._guildBuffUsedRecords.Add(new GuildBuffUsedRecordItem + { + MainMessage = specificDocument.ProcessText(usedBuffs[i]) + }); + } + } + } + + internal void OnGetGuildBuffList(List buffs) + { + bool flag = buffs == null; + if (!flag) + { + this._guildsBuffedInfos.Clear(); + for (int i = 0; i < buffs.Count; i++) + { + GuildBuffSimpleInfo guildBuffSimpleInfo = buffs[i]; + this._guildsBuffedInfos.Add(guildBuffSimpleInfo.guildid, new List()); + for (int j = 0; j < guildBuffSimpleInfo.buff.Count; j++) + { + this._guildsBuffedInfos[guildBuffSimpleInfo.guildid].Add(new GuildUsingBuffInfo + { + buffID = guildBuffSimpleInfo.buff[j].id, + time = guildBuffSimpleInfo.buff[j].time + }); + } + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.RefreshTopRightBuffs(); + } + } + } + + internal void OnGetGuildInfoList(ResWarRankSimpleInfo infos) + { + bool flag = infos.rank == null; + if (!flag) + { + this._guildInfoList.Clear(); + List rank = infos.rank; + for (int i = 0; i < rank.Count; i++) + { + ResWarRank resWarRank = rank[i]; + WarResGuildInfo warResGuildInfo = new WarResGuildInfo + { + guildID = resWarRank.id, + guildName = resWarRank.name, + resValue = resWarRank.value, + guildIcon = resWarRank.icon + }; + this.GuildMaxResource = Math.Max(this.GuildMaxResource, resWarRank.value); + this._guildInfoList.Add(warResGuildInfo); + bool flag2 = warResGuildInfo.guildID == this._guildID; + if (flag2) + { + this._guildInfoList[i] = this._guildInfoList[0]; + this._guildInfoList[0] = warResGuildInfo; + } + } + } + } + + internal void OnGetOwnedGuildBuffList(PtcM2C_GuildBuffSimpleItemNtf roPtc) + { + bool flag = roPtc.Data != null; + if (flag) + { + bool flag2 = roPtc.Data.guildid == this._guildID; + if (flag2) + { + this.UpdateOwnedBuffList(roPtc.Data.item); + this.UpdateBuffRecords(roPtc.Data.chatinfo); + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshBuffsRecord(); + } + } + } + } + + public void OnGetGuildResUpdate(ResWarMineData data) + { + bool flag = data != null; + if (flag) + { + for (int i = 0; i < this._guildInfoList.Count; i++) + { + bool flag2 = this._guildInfoList[i].guildID == data.guildid; + if (flag2) + { + this.GuildMaxResource = Math.Max(this.GuildMaxResource, data.mine); + this._guildInfoList[i].resValue = data.mine; + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshTopRightBuffs(); + } + break; + } + } + } + } + + public void OnGetGuildBuffCD(GuildBuffCDParam data) + { + this._guildBuffCDTime = data.param; + bool flag = this._guildBuffCDTime > 0u; + if (flag) + { + GuildBuffOperationHandler guildBuffHandler = DlgBase.singleton.GuildBuffHandler; + bool flag2 = guildBuffHandler != null && guildBuffHandler.IsVisible(); + if (flag2) + { + guildBuffHandler.FoldByHasGuildBuffCd(); + guildBuffHandler.RefreshCardCd(); + } + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildResContentionBuffDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildResContentionBuffDocument.cs.meta new file mode 100644 index 00000000..34d2b948 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildResContentionBuffDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cd571160702b02545ab23d47076de453 +timeCreated: 1611404554 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryDocument.cs new file mode 100644 index 00000000..e68de93c --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryDocument.cs @@ -0,0 +1,594 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSalaryDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildSalaryDocument.uuID; + } + } + + public List TopPlayers + { + get + { + return this.m_topPlayers; + } + } + + public bool HasRedPoint + { + get + { + return this.m_hasRedPoint; + } + set + { + this.m_hasRedPoint = value; + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildBoon_Salay, true); + } + } + + public bool NotHasLastSalaryInfo + { + get + { + return this.m_lastLevel == 0u; + } + } + + public uint CurScore + { + get + { + return this.m_curScore; + } + } + + public XGuildSalaryInfo Activity + { + get + { + return this.m_activity; + } + } + + public XGuildSalaryInfo RoleNum + { + get + { + return this.m_roleNum; + } + } + + public XGuildSalaryInfo Prestige + { + get + { + return this.m_prestige; + } + } + + public XGuildSalaryInfo Exp + { + get + { + return this.m_exp; + } + } + + public uint CurGrade + { + get + { + return this.m_curGrade; + } + } + + public uint LastScore + { + get + { + return this.m_lastScore; + } + } + + public uint MulMaxScore + { + get + { + return this.m_mulMaxScore; + } + } + + public WageRewardState RewardState + { + get + { + return this.m_rewardState; + } + } + + public uint LastGrade + { + get + { + return this.m_lastGrade; + } + } + + public GuildPosition LastPosition + { + get + { + return this.m_lastPosition; + } + } + + public uint LastLevel + { + get + { + return this.m_lastLevel; + } + } + + public int SelectTabs { get; set; } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildSalaryDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + public static GuildSalaryDesc m_guildSalaryDesc = new GuildSalaryDesc(); + + public static GuildSalaryTable m_guildSalaryTable = new GuildSalaryTable(); + + public static List TabIndexs = new List(); + + public static List TabNames = new List(); + + public static Dictionary> GuildSalaryDescDic = new Dictionary>(); + + private XGuildSalaryInfo m_activity = new XGuildSalaryInfo(); + + private XGuildSalaryInfo m_exp = new XGuildSalaryInfo(); + + private XGuildSalaryInfo m_roleNum = new XGuildSalaryInfo(); + + private XGuildSalaryInfo m_prestige = new XGuildSalaryInfo(); + + private List m_topPlayers; + + private uint m_curGrade; + + private uint m_curScore; + + private WageRewardState m_rewardState; + + private uint m_lastLevel; + + private uint m_lastGrade; + + private uint m_lastScore; + + private GuildPosition m_lastPosition; + + private uint m_mulMaxScore; + + private bool m_hasRedPoint = false; + + public uint CurMulScore; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildSalaryDocument.AsyncLoader.AddTask("Table/GuildSalaryDesc", XGuildSalaryDocument.m_guildSalaryDesc, false); + XGuildSalaryDocument.AsyncLoader.AddTask("Table/Guildsalary", XGuildSalaryDocument.m_guildSalaryTable, false); + XGuildSalaryDocument.AsyncLoader.Execute(callback); + } + + public static void OnTableLoaded() + { + XGuildSalaryDocument.TabIndexs.Clear(); + XGuildSalaryDocument.TabNames.Clear(); + XGuildSalaryDocument.GuildSalaryDescDic.Clear(); + int i = 0; + int num = XGuildSalaryDocument.m_guildSalaryDesc.Table.Length; + while (i < num) + { + bool flag = !XGuildSalaryDocument.TabIndexs.Contains(XGuildSalaryDocument.m_guildSalaryDesc.Table[i].Type); + if (flag) + { + XGuildSalaryDocument.TabIndexs.Add(XGuildSalaryDocument.m_guildSalaryDesc.Table[i].Type); + XGuildSalaryDocument.TabNames.Add(XSingleton.singleton.StringCombine("GuildSalaryTitle", XGuildSalaryDocument.m_guildSalaryDesc.Table[i].Type.ToString())); + } + List list; + bool flag2 = !XGuildSalaryDocument.GuildSalaryDescDic.TryGetValue(XGuildSalaryDocument.m_guildSalaryDesc.Table[i].Type, out list); + if (flag2) + { + list = new List(); + XGuildSalaryDocument.GuildSalaryDescDic.Add(XGuildSalaryDocument.m_guildSalaryDesc.Table[i].Type, list); + } + list.Add(XGuildSalaryDocument.m_guildSalaryDesc.Table[i]); + i++; + } + } + + public static string GetGrade(int grade) + { + int num = grade - 1; + List stringList = XSingleton.singleton.GetStringList("GuildGrade"); + bool flag = num < stringList.Count && num >= 0; + string result; + if (flag) + { + result = stringList[num]; + } + else + { + result = string.Empty; + } + return result; + } + + public static string GetGradeName(int grade) + { + int num = grade - 1; + List stringList = XSingleton.singleton.GetStringList("GuildGradeName"); + bool flag = num < stringList.Count && num >= 0; + string result; + if (flag) + { + result = stringList[num]; + } + else + { + result = string.Empty; + } + return result; + } + + public XGuildSalaryInfo GetValue(int type) + { + XGuildSalaryInfo result = null; + switch (type) + { + case 0: + result = this.m_roleNum; + break; + case 1: + result = this.m_prestige; + break; + case 2: + result = this.m_activity; + break; + case 3: + result = this.m_exp; + break; + } + return result; + } + + public bool TryGetGuildSalary(uint guildLevel, out GuildSalaryTable.RowData rowData) + { + rowData = XGuildSalaryDocument.m_guildSalaryTable.GetByGuildLevel(guildLevel); + return rowData != null; + } + + public void SendGuildWageReward() + { + bool flag = this.m_rewardState == WageRewardState.notreward; + if (flag) + { + RpcC2M_GetGuildWageReward rpc = new RpcC2M_GetGuildWageReward(); + XSingleton.singleton.Send(rpc); + } + } + + public void ReceiveGuildWageReward(GetGuildWageReward res) + { + bool flag = res.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(res.errorcode); + } + else + { + this.HasRedPoint = false; + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("CarnivalSuccess"), "fece00"); + this.m_rewardState = WageRewardState.rewarded; + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.Refresh(); + } + } + } + + public void SendAskGuildWageInfo() + { + RpcC2M_AskGuildWageInfo rpc = new RpcC2M_AskGuildWageInfo(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveAskGuildWageInfo(AskGuildWageInfoRes res) + { + bool flag = res.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(res.errorcode); + } + else + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + uint level = specificDocument.BasicData.level; + GuildSalaryTable.RowData byGuildLevel = XGuildSalaryDocument.m_guildSalaryTable.GetByGuildLevel(level); + this.m_topPlayers = res.roles; + this.m_roleNum.Init(res.rolenum, byGuildLevel, 0u); + this.m_prestige.Init(res.prestige, byGuildLevel, 1u); + this.m_exp.Init(res.exp, byGuildLevel, 3u); + this.m_activity.Init(res.activity, byGuildLevel, 2u); + this.m_rewardState = res.rewardstate; + this.m_curScore = (this.m_roleNum.Score + this.m_prestige.Score + this.m_exp.Score + this.m_activity.Score) / 4u; + this.m_curGrade = this.CalculateGrade(byGuildLevel.GuildReview, this.CurScore); + this.m_lastScore = res.lastScore; + this.m_lastGrade = res.wagelvl; + this.m_lastLevel = res.guildlvl; + this.m_lastPosition = (GuildPosition)res.lastposition; + this.HasRedPoint = (res.rewardstate == WageRewardState.notreward); + uint num = this.CalculateGradeMaxScore(byGuildLevel.GuildReview, this.m_lastScore); + this.m_mulMaxScore = ((this.m_lastScore < num) ? (num - this.m_lastScore) : 0u); + num = this.CalculateGradeMaxScore(byGuildLevel.GuildReview, this.m_curScore); + this.CurMulScore = ((this.m_curScore < num) ? (num - this.m_curScore) : 0u); + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.Refresh(); + } + } + } + + public uint GetNextGradeScore(uint GuildLevel, int Grade) + { + GuildSalaryTable.RowData byGuildLevel = XGuildSalaryDocument.m_guildSalaryTable.GetByGuildLevel(GuildLevel); + int num = 4 - Grade; + bool flag = num < 0; + uint result; + if (flag) + { + result = byGuildLevel.GuildReview[0]; + } + else + { + bool flag2 = num >= 4; + if (flag2) + { + result = 0u; + } + else + { + result = byGuildLevel.GuildReview[num]; + } + } + return result; + } + + public SeqListRef GetGuildSalayList(uint guildLevel, GuildPosition pos, uint grade) + { + GuildSalaryTable.RowData byGuildLevel = XGuildSalaryDocument.m_guildSalaryTable.GetByGuildLevel(guildLevel); + XSingleton.singleton.AddGreenLog("rowData == null ?", guildLevel.ToString(), pos.ToString(), grade.ToString(), null, null); + bool flag = byGuildLevel == null; + SeqListRef result; + if (flag) + { + result = default(SeqListRef); + } + else + { + bool flag2 = pos == GuildPosition.GPOS_LEADER; + if (flag2) + { + switch (grade) + { + case 1u: + result = byGuildLevel.SSalary1; + break; + case 2u: + result = byGuildLevel.ASalary1; + break; + case 3u: + result = byGuildLevel.BSalary1; + break; + case 4u: + result = byGuildLevel.CSalary1; + break; + case 5u: + result = byGuildLevel.DSalary1; + break; + default: + result = byGuildLevel.DSalary1; + break; + } + } + else + { + bool flag3 = pos == GuildPosition.GPOS_VICELEADER; + if (flag3) + { + switch (grade) + { + case 1u: + result = byGuildLevel.SSalary2; + break; + case 2u: + result = byGuildLevel.ASalary2; + break; + case 3u: + result = byGuildLevel.BSalary2; + break; + case 4u: + result = byGuildLevel.CSalary2; + break; + case 5u: + result = byGuildLevel.DSalary2; + break; + default: + result = byGuildLevel.DSalary2; + break; + } + } + else + { + bool flag4 = pos == GuildPosition.GPOS_OFFICER; + if (flag4) + { + switch (grade) + { + case 1u: + result = byGuildLevel.SSalary3; + break; + case 2u: + result = byGuildLevel.ASalary3; + break; + case 3u: + result = byGuildLevel.BSalary3; + break; + case 4u: + result = byGuildLevel.CSalary3; + break; + case 5u: + result = byGuildLevel.DSalary3; + break; + default: + result = byGuildLevel.DSalary3; + break; + } + } + else + { + bool flag5 = pos == GuildPosition.GPOS_ELITEMEMBER; + if (flag5) + { + switch (grade) + { + case 1u: + result = byGuildLevel.SSalary4; + break; + case 2u: + result = byGuildLevel.ASalary4; + break; + case 3u: + result = byGuildLevel.BSalary4; + break; + case 4u: + result = byGuildLevel.CSalary4; + break; + case 5u: + result = byGuildLevel.DSalary4; + break; + default: + result = byGuildLevel.DSalary4; + break; + } + } + else + { + bool flag6 = pos == GuildPosition.GPOS_MEMBER; + if (flag6) + { + switch (grade) + { + case 1u: + result = byGuildLevel.SSalary5; + break; + case 2u: + result = byGuildLevel.ASalary5; + break; + case 3u: + result = byGuildLevel.BSalary5; + break; + case 4u: + result = byGuildLevel.CSalary5; + break; + case 5u: + result = byGuildLevel.DSalary5; + break; + default: + result = byGuildLevel.DSalary5; + break; + } + } + else + { + result = default(SeqListRef); + } + } + } + } + } + } + return result; + } + + private uint CalculateGrade(uint[] scores, uint cur) + { + uint num = 1u; + bool flag = scores != null; + if (flag) + { + for (int i = scores.Length - 1; i >= 0; i--) + { + bool flag2 = cur < scores[i]; + if (!flag2) + { + break; + } + num += 1u; + } + } + return num; + } + + private uint CalculateGradeMaxScore(uint[] scores, uint cur) + { + bool flag = scores != null && scores.Length != 0; + uint result; + if (flag) + { + uint num = scores[scores.Length - 1]; + for (int i = scores.Length - 1; i >= 0; i--) + { + bool flag2 = cur < scores[i]; + if (!flag2) + { + break; + } + num = scores[i]; + } + result = num; + } + else + { + result = 0u; + } + return result; + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + this.SendAskGuildWageInfo(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryDocument.cs.meta new file mode 100644 index 00000000..7fe76548 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 399a40cac6cff4e46add5a226ccc6e43 +timeCreated: 1611403592 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs new file mode 100644 index 00000000..e8ed5ef7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs @@ -0,0 +1,118 @@ +using System; +using XUtliPoolLib; + +namespace XMainClient +{ + public class XGuildSalaryInfo + { + public uint Score + { + get + { + return this.m_score; + } + } + + public uint TotalScore + { + get + { + return this.m_totalScore; + } + } + + public uint Grade + { + get + { + return this.m_grade; + } + } + + public uint Value + { + get + { + return this.m_value; + } + } + + public float Percent + { + get + { + return this.m_Percent; + } + } + + private uint m_score = 0u; + + private uint m_totalScore = 0u; + + private uint m_grade = 0u; + + private uint m_value; + + private float m_Percent = 0f; + + public void Init(uint value, GuildSalaryTable.RowData rowData, uint index) + { + this.m_value = value; + bool flag = rowData == null; + if (!flag) + { + switch (index) + { + case 0u: + this.CalculateScore(ref rowData.NumberTransformation, value); + break; + case 1u: + this.CalculateScore(ref rowData.PrestigeTransformation, value); + break; + case 2u: + this.CalculateScore(ref rowData.ActiveTransformation, value); + break; + case 3u: + this.CalculateScore(ref rowData.EXPTransformation, value); + break; + } + this.CalculateGrade(rowData.GuildReview, this.m_score); + } + } + + private void CalculateScore(ref SeqListRef transformation, uint value) + { + uint num = transformation[0, 0]; + uint num2 = transformation[0, 1]; + uint num3 = transformation[1, 0]; + uint num4 = transformation[1, 1]; + this.m_totalScore = num2; + bool flag = value > num2; + if (flag) + { + value = num2; + } + this.m_Percent = value / num2; + float num5 = this.m_Percent * num4; + this.m_score = (uint)Math.Floor((double)num5); + } + + private void CalculateGrade(uint[] scores, uint cur) + { + this.m_grade = 1u; + bool flag = scores != null; + if (flag) + { + for (int i = scores.Length - 1; i >= 0; i--) + { + bool flag2 = cur < scores[i]; + if (!flag2) + { + break; + } + this.m_grade += 1u; + } + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs.meta new file mode 100644 index 00000000..1ae2e12d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSalaryInfo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0987453f80604344797f8326802e6125 +timeCreated: 1611403157 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInDocument.cs new file mode 100644 index 00000000..506d73b9 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInDocument.cs @@ -0,0 +1,333 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSignInDocument : XDocComponent, ILogSource + { + public override uint ID + { + get + { + return XGuildSignInDocument.uuID; + } + } + + public XGuildSignInView GuildSignInView { get; set; } + + public uint TotalCount { get; set; } + + public uint CurrentCount { get; set; } + + public uint SignInSelection + { + get + { + return this._SignInSelection; + } + set + { + this._SignInSelection = value; + this._CheckCanSignIn(); + } + } + + public uint Progress + { + get + { + return this._Progress; + } + } + + public int CanSignInSelection + { + get + { + return this._CanSignInSelection; + } + } + + public bool bHasAvailableChest + { + get + { + return this._bHasAvailableChest; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildSignInDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private static GuildCheckinTable m_SignInTable = new GuildCheckinTable(); + + private static GuildCheckinBoxTable m_BoxTable = new GuildCheckinBoxTable(); + + private List m_LogList = new List(); + + private uint _SignInSelection; + + private uint _Progress; + + private int _CanSignInSelection; + + private bool _bHasAvailableChest; + + private uint _BoxState; + + public List GetLogList() + { + return this.m_LogList; + } + + public void SetChestStateAndProgress(uint progress, uint chest) + { + this._BoxState = chest; + this._Progress = progress; + bool flag = this.CheckAvailableChest(); + if (flag) + { + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_SignIn, true); + } + bool flag2 = this.GuildSignInView != null && this.GuildSignInView.IsVisible(); + if (flag2) + { + this.GuildSignInView.RefreshProgress(); + } + } + + public int _CheckCanSignIn() + { + this._CanSignInSelection = 0; + bool flag = this.SignInSelection == 0u; + if (flag) + { + for (int i = XGuildSignInDocument.m_SignInTable.Table.Length - 1; i >= 0; i--) + { + GuildCheckinTable.RowData rowData = XGuildSignInDocument.m_SignInTable.Table[i]; + ulong virtualItemCount = XSingleton.singleton.Doc.XBagDoc.GetVirtualItemCount((ItemEnum)rowData.consume[0]); + bool flag2 = virtualItemCount >= (ulong)rowData.consume[1]; + if (flag2) + { + this._CanSignInSelection = i + 1; + break; + } + } + } + return this._CanSignInSelection; + } + + private bool CheckAvailableChest() + { + this._bHasAvailableChest = false; + for (int i = 0; i < XGuildSignInDocument.m_BoxTable.Table.Length; i++) + { + bool flag = XGuildSignInDocument.m_BoxTable.Table[i].process <= this._Progress && !this.IsBoxOpen(i); + if (flag) + { + this._bHasAvailableChest = true; + break; + } + } + return this._bHasAvailableChest; + } + + public bool IsBoxOpen(int index) + { + return ((ulong)this._BoxState & (ulong)(1L << (index & 31))) > 0UL; + } + + public void SetBoxOpen(int index) + { + this._BoxState |= 1u << index; + } + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildSignInDocument.AsyncLoader.AddTask("Table/GuildCheckin", XGuildSignInDocument.m_SignInTable, false); + XGuildSignInDocument.AsyncLoader.AddTask("Table/GuildCheckinBox", XGuildSignInDocument.m_BoxTable, false); + XGuildSignInDocument.AsyncLoader.Execute(callback); + } + + public static GuildCheckinTable.RowData[] GetSignInTableData() + { + return XGuildSignInDocument.m_SignInTable.Table; + } + + public static GuildCheckinBoxTable.RowData[] GetBoxTableData() + { + return XGuildSignInDocument.m_BoxTable.Table; + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + this._Progress = 0u; + this._BoxState = 0u; + this._bHasAvailableChest = false; + this.SignInSelection = 100u; + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.OnInGuildStateChanged)); + base.RegisterEvent(XEventDefine.XEvent_VirtualItemChanged, new XComponent.XEventHandler(this.OnVirtualItemChanged)); + } + + protected bool OnVirtualItemChanged(XEventArgs args) + { + bool flag = this.SignInSelection > 0u; + bool result; + if (flag) + { + result = true; + } + else + { + this._CheckCanSignIn(); + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_SignIn, true); + result = true; + } + return result; + } + + protected bool OnInGuildStateChanged(XEventArgs args) + { + XInGuildStateChangedEventArgs xinGuildStateChangedEventArgs = args as XInGuildStateChangedEventArgs; + bool flag = !xinGuildStateChangedEventArgs.bIsEnter; + if (flag) + { + this.SignInSelection = 100u; + this._bHasAvailableChest = false; + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_SignIn, true); + } + return true; + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = this.GuildSignInView != null && this.GuildSignInView.IsVisible(); + if (flag) + { + this.ReqAllInfo(); + } + } + + public void ReqAllInfo() + { + RpcC2M_QueryGuildCheckinNew rpc = new RpcC2M_QueryGuildCheckinNew(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetAllInfo(QueryGuildCheckinRes oRes) + { + this.SignInSelection = oRes.checkin; + this.CurrentCount = oRes.checkincount; + this.TotalCount = oRes.allcount; + this._BoxState = oRes.boxmask; + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_SignIn, true); + bool flag = this.GuildSignInView != null && this.GuildSignInView.IsVisible(); + if (flag) + { + this.GuildSignInView.Refresh(); + } + } + + public void ReqFetchBox(uint index) + { + RpcC2G_GetGuildCheckinBox rpcC2G_GetGuildCheckinBox = new RpcC2G_GetGuildCheckinBox(); + rpcC2G_GetGuildCheckinBox.oArg.index = index; + XSingleton.singleton.Send(rpcC2G_GetGuildCheckinBox); + } + + public void OnFetchBox(GetGuildCheckinBoxArg oArg, GetGuildCheckinBoxRes oRes) + { + bool flag = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + } + else + { + this.SetBoxOpen((int)oArg.index); + bool flag2 = this.GuildSignInView != null && this.GuildSignInView.IsVisible(); + if (flag2) + { + this.GuildSignInView.OpenBox((int)oArg.index); + } + bool flag3 = !this.CheckAvailableChest(); + if (flag3) + { + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_SignIn, true); + } + } + } + + public void ReqSignIn(uint index) + { + RpcC2M_GuildCheckinNew rpcC2M_GuildCheckinNew = new RpcC2M_GuildCheckinNew(); + rpcC2M_GuildCheckinNew.oArg.type = index; + XSingleton.singleton.Send(rpcC2M_GuildCheckinNew); + } + + public void OnSignIn(GuildCheckinArg oArg, GuildCheckinRes oRes) + { + bool flag = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_SIGNIN_SUCCESS"), "fece00"); + this.SignInSelection = oArg.type; + uint currentCount = this.CurrentCount + 1u; + this.CurrentCount = currentCount; + bool flag2 = this.GuildSignInView != null && this.GuildSignInView.IsVisible(); + if (flag2) + { + this.GuildSignInView.Refresh(); + } + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_SignIn, true); + } + } + + public void ReqLogList() + { + RpcC2M_GetGuildCheckinRecordsNew rpc = new RpcC2M_GetGuildCheckinRecordsNew(); + XSingleton.singleton.Send(rpc); + } + + public void onGetLogList(GetGuildCheckinRecordsRes oRes) + { + int num = oRes.name.Count - this.m_LogList.Count; + for (int i = 0; i < num; i++) + { + this.m_LogList.Add(new XGuildSignInLog()); + } + bool flag = num < 0; + if (flag) + { + this.m_LogList.RemoveRange(this.m_LogList.Count + num, -num); + } + for (int j = 0; j < this.m_LogList.Count; j++) + { + XGuildSignInLog xguildSignInLog = this.m_LogList[this.m_LogList.Count - j - 1] as XGuildSignInLog; + xguildSignInLog.name = oRes.name[j]; + xguildSignInLog.uid = oRes.roleid[j]; + xguildSignInLog.type = oRes.type[j]; + xguildSignInLog.time = (int)oRes.timestamp[j]; + } + bool flag2 = this.GuildSignInView != null && this.GuildSignInView.IsVisible(); + if (flag2) + { + this.GuildSignInView.LogView.Refresh(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInDocument.cs.meta new file mode 100644 index 00000000..fd6014ba --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 46f13386805a8654f83c03fdb413124a +timeCreated: 1611403651 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInLog.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInLog.cs new file mode 100644 index 00000000..aa83e26e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInLog.cs @@ -0,0 +1,47 @@ +using System; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSignInLog : ILogData, IComparable + { + public ulong uid; + + public string name; + + public uint type; + + public int time; + + public string GetContent() + { + return XStringDefineProxy.GetString("GUILD_SIGNIN_CONTENT", new object[] + { + XLabelSymbolHelper.FormatName(this.name, this.uid, "00ffff"), + XStringDefineProxy.GetString("GUILD_SIGNIN_TYPE" + this.type.ToString()) + }); + } + + public string GetTime() + { + return XSingleton.singleton.TimeAgoFormatString(this.time); + } + + public int CompareTo(ILogData otherLog) + { + XGuildSignInLog xguildSignInLog = otherLog as XGuildSignInLog; + bool flag = xguildSignInLog.time == this.time; + int result; + if (flag) + { + result = this.uid.CompareTo(xguildSignInLog.uid); + } + else + { + result = this.time.CompareTo(xguildSignInLog.time); + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInLog.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInLog.cs.meta new file mode 100644 index 00000000..d21cc223 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignInLog.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e565c4943d47610499c4b31b11f2dbb8 +timeCreated: 1611404742 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSignNode.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignNode.cs new file mode 100644 index 00000000..cb0a8806 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignNode.cs @@ -0,0 +1,105 @@ +using System; +using UILib; +using UnityEngine; + +namespace XMainClient +{ + internal class XGuildSignNode + { + public BonusState bonusState + { + get + { + return this.m_bonusState; + } + } + + private Transform m_ProgressGo; + + private Transform m_CircleGo; + + private IXUISlider m_slider; + + private IXUISprite m_Filled; + + private IXUISprite m_Packeton; + + private IXUISprite m_Finish; + + private IXUILabel m_SignNumber; + + public IXUISprite m_pressCircle; + + public IXUISprite m_redSprite; + + private BonusState m_bonusState; + + public XGuildSignNode(int key, Transform pGo, Transform cGo) + { + this.m_ProgressGo = pGo; + this.m_CircleGo = cGo; + this.m_pressCircle = (this.m_CircleGo.GetComponent("XUISprite") as IXUISprite); + this.m_pressCircle.ID = (ulong)((long)key); + this.m_slider = (this.m_ProgressGo.GetComponent("XUISlider") as IXUISlider); + this.m_Filled = (this.m_CircleGo.Find("filled").GetComponent("XUISprite") as IXUISprite); + this.m_Packeton = (this.m_CircleGo.Find("Packeton").GetComponent("XUISprite") as IXUISprite); + this.m_Finish = (this.m_CircleGo.Find("Sprite").GetComponent("XUISprite") as IXUISprite); + this.m_SignNumber = (this.m_CircleGo.Find("T").GetComponent("XUILabel") as IXUILabel); + this.m_redSprite = (this.m_CircleGo.Find("RedPoint").GetComponent("XUISprite") as IXUISprite); + this.Reset(); + } + + public void SetSignNumber(uint number) + { + this.m_SignNumber.SetText(number.ToString()); + } + + public void SetBonusProgress(float p) + { + float value = (p > 0f) ? (p * 0.9f + 0.1f) : 0f; + this.m_slider.Value = value; + } + + public void SetBonusStatu(BonusState _bonusState) + { + this.Reset(); + this.m_bonusState = _bonusState; + switch (_bonusState) + { + case BonusState.Bonus_Active: + this.m_Filled.SetVisible(true); + this.m_Finish.SetVisible(false); + this.m_Packeton.SetVisible(true); + this.m_redSprite.SetVisible(false); + break; + case BonusState.Bonus_UnActive: + this.m_Filled.SetVisible(false); + this.m_Packeton.SetVisible(false); + this.m_Finish.SetVisible(false); + this.m_redSprite.SetVisible(false); + break; + case BonusState.Bonus_Actived: + this.m_Filled.SetVisible(true); + this.m_Packeton.SetVisible(true); + this.m_Finish.SetVisible(false); + this.m_redSprite.SetVisible(true); + break; + case BonusState.Bouns_Over: + this.m_Filled.SetVisible(true); + this.m_Finish.SetVisible(true); + this.m_Packeton.SetVisible(true); + this.m_redSprite.SetVisible(false); + break; + } + } + + public void Reset() + { + this.m_slider.Value = 0f; + this.m_Filled.SetVisible(false); + this.m_Packeton.SetVisible(false); + this.m_Finish.SetVisible(false); + this.m_redSprite.SetVisible(false); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSignNode.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignNode.cs.meta new file mode 100644 index 00000000..c51a8052 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignNode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7a8b96bf3e2feb0438bbcc26ff8e60cb +timeCreated: 1611403989 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSignRedPackageBehaviour.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignRedPackageBehaviour.cs new file mode 100644 index 00000000..ce717a97 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignRedPackageBehaviour.cs @@ -0,0 +1,81 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildSignRedPackageBehaviour : DlgBehaviourBase + { + public IXUILabel m_OnlineValue; + + public IXUILabel m_BufferValue; + + public IXUILabel m_SignValue; + + public IXUILabel m_CurSignValue; + + public IXUILabel m_AakLabel; + + public IXUILabel m_signLabel; + + public IXUILabel m_redNumber; + + public IXUILabel m_instructionTitle; + + public IXUIScrollView m_scrollView; + + public IXUILabel m_scrollContent; + + public IXUIButton m_Close; + + public IXUIButton m_History; + + public IXUIButton m_sign; + + public IXUIButton m_Ask; + + public IXUIButton m_Send; + + public IXUIButton m_Fiexd; + + public Transform m_redPoint; + + public Transform m_fixedRedPoint; + + public XGuildSignNode[] m_SignNodes = new XGuildSignNode[4]; + + public IXUISprite[] m_redPakages = new IXUISprite[4]; + + private void Awake() + { + this.m_Close = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_History = (base.transform.Find("Bg/History").GetComponent("XUIButton") as IXUIButton); + this.m_sign = (base.transform.Find("Bg/Bg/Dontbelazy").GetComponent("XUIButton") as IXUIButton); + this.m_Ask = (base.transform.Find("Bg/RedPacketFrame/p/Status/Ask").GetComponent("XUIButton") as IXUIButton); + this.m_Send = (base.transform.Find("Bg/RedPacketFrame/p/Status/Send").GetComponent("XUIButton") as IXUIButton); + this.m_Fiexd = (base.transform.Find("Bg/Fiexd").GetComponent("XUIButton") as IXUIButton); + this.m_fixedRedPoint = base.transform.Find("Bg/Fiexd/RedPoint"); + this.m_AakLabel = (base.transform.Find("Bg/RedPacketFrame/p/Status/Ask/Require").GetComponent("XUILabel") as IXUILabel); + this.m_signLabel = (base.transform.Find("Bg/Bg/Dontbelazy/Gogogo").GetComponent("XUILabel") as IXUILabel); + this.m_OnlineValue = (base.transform.Find("Bg/RedPacketFrame/p/Status/OnlineValue").GetComponent("XUILabel") as IXUILabel); + this.m_BufferValue = (base.transform.Find("Bg/RedPacketFrame/p/Status/Buff/Value").GetComponent("XUILabel") as IXUILabel); + this.m_SignValue = (base.transform.Find("Bg/Sign/Label").GetComponent("XUILabel") as IXUILabel); + this.m_CurSignValue = (base.transform.Find("Bg/ProgressBar/Thumb/CurrentNum/T").GetComponent("XUILabel") as IXUILabel); + this.m_redNumber = (base.transform.Find("Bg/RedPacketFrame/p/Status/Number/Label").GetComponent("XUILabel") as IXUILabel); + this.m_instructionTitle = (base.transform.Find("Bg/RedPacketFrame/p/Instruction/Title").GetComponent("XUILabel") as IXUILabel); + this.m_scrollView = (base.transform.Find("Bg/RedPacketFrame/p/Instruction/ScrollView").GetComponent("XUIScrollView") as IXUIScrollView); + this.m_scrollContent = (base.transform.Find("Bg/RedPacketFrame/p/Instruction/ScrollView/Content").GetComponent("XUILabel") as IXUILabel); + this.m_redPoint = base.transform.Find("Bg/History/RedPoint"); + for (int i = 0; i < 4; i++) + { + int num = i + 1; + string text = string.Format("Bg/ProgressBar/BarBack/bar/progress{0}", num); + string text2 = string.Format("Bg/ProgressBar/BarBack/circle/circle{0}", num); + string text3 = string.Format("Bg/RedPacketFrame/p/Status/Panel/red{0}", num); + this.m_SignNodes[i] = new XGuildSignNode(i, base.transform.Find(text), base.transform.Find(text2)); + this.m_redPakages[i] = (base.transform.Find(text3).GetComponent("XUISprite") as IXUISprite); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSignRedPackageBehaviour.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignRedPackageBehaviour.cs.meta new file mode 100644 index 00000000..26c74894 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSignRedPackageBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: eb16845c0572a3646a92abbd860a0dc4 +timeCreated: 1611404782 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillBehaviour.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillBehaviour.cs new file mode 100644 index 00000000..f5dc95b8 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillBehaviour.cs @@ -0,0 +1,73 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSkillBehaviour : DlgBehaviourBase + { + public IXUIButton m_Close; + + public IXUILabel m_GuildPoint; + + public IXUISprite m_DetailSkillIcon; + + public IXUILabel m_DetailSkillName; + + public IXUILabel m_DetailCurrLevel; + + public IXUILabel m_DetailNextLevel; + + public IXUILabel m_DetailCurrAttr; + + public IXUILabel m_DetailNextAttr; + + public IXUILabel m_DetailMaxLevelLabel; + + public IXUILabel m_DetailMaxLevel; + + public IXUIButton m_DetailUpMaxLevel; + + public IXUILabel m_DetailTip; + + public IXUILabelSymbol m_DetailCost; + + public IXUILabelSymbol m_DetailCostRed; + + public IXUIButton m_LevelUp; + + public IXUILabel m_LevelUpLabel; + + public Transform m_RedPoint; + + public XUIPool m_SkillPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public IXUIScrollView m_SkillScroll; + + private void Awake() + { + this.m_Close = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_GuildPoint = (base.transform.Find("Bg/Point/value").GetComponent("XUILabel") as IXUILabel); + this.m_DetailSkillIcon = (base.transform.Find("Bg/Detail/Icon").GetComponent("XUISprite") as IXUISprite); + this.m_DetailSkillName = (base.transform.Find("Bg/Detail/Name").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCurrLevel = (base.transform.Find("Bg/Detail/CurrentLevel").GetComponent("XUILabel") as IXUILabel); + this.m_DetailNextLevel = (base.transform.Find("Bg/Detail/CurrentLevel/NextLevel").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCurrAttr = (base.transform.Find("Bg/Detail/CurrentAttr").GetComponent("XUILabel") as IXUILabel); + this.m_DetailNextAttr = (base.transform.Find("Bg/Detail/CurrentAttr/NextAttr").GetComponent("XUILabel") as IXUILabel); + this.m_DetailMaxLevel = (base.transform.Find("Bg/Detail/MaxLevel/NextAttr").GetComponent("XUILabel") as IXUILabel); + this.m_DetailMaxLevelLabel = (base.transform.Find("Bg/Detail/MaxLevel").GetComponent("XUILabel") as IXUILabel); + this.m_DetailUpMaxLevel = (base.transform.Find("Bg/Detail/MaxLevel/Study").GetComponent("XUIButton") as IXUIButton); + this.m_RedPoint = base.transform.Find("Bg/Detail/MaxLevel/Study/RedPoint"); + this.m_DetailTip = (base.transform.Find("Bg/Detail/Tip").GetComponent("XUILabel") as IXUILabel); + this.m_DetailCost = (base.transform.Find("Bg/Detail/Cost").GetComponent("XUILabelSymbol") as IXUILabelSymbol); + this.m_DetailCostRed = (base.transform.Find("Bg/Detail/CostRed").GetComponent("XUILabelSymbol") as IXUILabelSymbol); + this.m_LevelUp = (base.transform.Find("Bg/Detail/Levelup").GetComponent("XUIButton") as IXUIButton); + this.m_LevelUpLabel = (base.transform.Find("Bg/Detail/Levelup/Text").GetComponent("XUILabel") as IXUILabel); + Transform transform = base.transform.Find("Bg/SkillList/SkillTpl"); + this.m_SkillPool.SetupPool(transform.parent.gameObject, transform.gameObject, 10u, false); + this.m_SkillScroll = (base.transform.Find("Bg/SkillList").GetComponent("XUIScrollView") as IXUIScrollView); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillBehaviour.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillBehaviour.cs.meta new file mode 100644 index 00000000..9dacbd83 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 81d66cf59950e7240982b74906c9be2a +timeCreated: 1611404038 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillDocument.cs new file mode 100644 index 00000000..73a36893 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillDocument.cs @@ -0,0 +1,512 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSkillDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildSkillDocument.uuID; + } + } + + public XPlayerAttributes Player { get; set; } + + public XBagDocument BagDoc { get; set; } + + public XGuildDocument GuildDoc { get; set; } + + public uint CurrentSkillID { get; set; } + + public int LastGuildExp { get; set; } + + public bool RedPoint + { + get + { + return this.m_RedPoint; + } + set + { + this.m_RedPoint = value; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildSkillDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + public static GuildSkillTable m_guidlSkillTable = new GuildSkillTable(); + + public static Dictionary> GuildSkllDic = new Dictionary>(); + + private static Dictionary m_guildSkillMaxLevels = new Dictionary(); + + private static Dictionary m_guildSkillInitLevels = new Dictionary(); + + public static List GuildSkillIDs = new List(); + + private Dictionary m_guildSkillDataDic = new Dictionary(); + + private Dictionary m_curGuildSkillLevel = new Dictionary(); + + private static Dictionary _labSkillMaxLevel = new Dictionary(); + + private bool m_RedPoint = true; + + private bool m_SendPoint = false; + + public XGuildSkillView SKillView = null; + + public XGuildGrowthLabView LabView = null; + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_VirtualItemChanged, new XComponent.XEventHandler(this.GuildPointChanged)); + base.RegisterEvent(XEventDefine.XEvent_GuildInfoChange, new XComponent.XEventHandler(this.GuildStatusChanged)); + base.RegisterEvent(XEventDefine.XEvent_PlayerLevelChange, new XComponent.XEventHandler(this.OnPlayerLevelChange)); + base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.OnPlayerLeaveGuild)); + } + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildSkillDocument.AsyncLoader.AddTask("Table/GuildSkill", XGuildSkillDocument.m_guidlSkillTable, false); + XGuildSkillDocument.AsyncLoader.Execute(callback); + XGuildSkillDocument.m_guildSkillMaxLevels.Clear(); + XGuildSkillDocument.m_guildSkillInitLevels.Clear(); + XGuildSkillDocument.GuildSkllDic.Clear(); + } + + public static void OnTableLoaded() + { + XGuildSkillDocument.GuildSkllDic.Clear(); + XGuildSkillDocument._labSkillMaxLevel.Clear(); + int i = 0; + int num = XGuildSkillDocument.m_guidlSkillTable.Table.Length; + while (i < num) + { + GuildSkillTable.RowData rowData = XGuildSkillDocument.m_guidlSkillTable.Table[i]; + bool flag = rowData.needtype == 2u; + if (flag) + { + uint num2 = 0u; + bool flag2 = XGuildSkillDocument._labSkillMaxLevel.TryGetValue(rowData.skillid, out num2); + if (flag2) + { + bool flag3 = num2 < rowData.level; + if (flag3) + { + XGuildSkillDocument._labSkillMaxLevel[rowData.skillid] = rowData.level; + } + } + else + { + XGuildSkillDocument._labSkillMaxLevel.Add(rowData.skillid, rowData.level); + } + } + Dictionary dictionary; + bool flag4 = !XGuildSkillDocument.GuildSkllDic.TryGetValue(rowData.skillid, out dictionary); + if (flag4) + { + XGuildSkillDocument.GuildSkillIDs.Add(rowData.skillid); + dictionary = new Dictionary(); + XGuildSkillDocument.GuildSkllDic.Add(rowData.skillid, dictionary); + } + bool flag5 = !dictionary.ContainsKey(rowData.level); + if (flag5) + { + dictionary.Add(rowData.level, rowData); + bool flag6 = XGuildSkillDocument.m_guildSkillMaxLevels.ContainsKey(rowData.skillid); + if (flag6) + { + XGuildSkillDocument.m_guildSkillMaxLevels[rowData.skillid] = Math.Max(rowData.level, XGuildSkillDocument.m_guildSkillMaxLevels[rowData.skillid]); + } + else + { + XGuildSkillDocument.m_guildSkillMaxLevels.Add(rowData.skillid, rowData.level); + } + bool flag7 = rowData.glevel > 0u; + if (!flag7) + { + bool flag8 = XGuildSkillDocument.m_guildSkillInitLevels.ContainsKey(rowData.skillid); + if (flag8) + { + XGuildSkillDocument.m_guildSkillInitLevels[rowData.skillid] = Math.Max(rowData.level, XGuildSkillDocument.m_guildSkillInitLevels[rowData.skillid]); + } + else + { + XGuildSkillDocument.m_guildSkillInitLevels.Add(rowData.skillid, rowData.level); + } + } + } + else + { + XSingleton.singleton.AddErrorLog(string.Format("the skill[{0}] has same level[{1}] in GuildSKill.txt", rowData.skillid, rowData.level), null, null, null, null, null); + } + i++; + } + } + + public uint GetGuildSkillInitLevel(uint skillID) + { + uint num = 0u; + bool flag = XGuildSkillDocument.m_guildSkillInitLevels.TryGetValue(skillID, out num); + uint result; + if (flag) + { + result = num; + } + else + { + result = 0u; + } + return result; + } + + public uint GetGuildSkillMaxLevel(uint skillID) + { + uint num = 0u; + bool flag = XGuildSkillDocument.m_guildSkillMaxLevels.TryGetValue(skillID, out num); + uint result; + if (flag) + { + result = num; + } + else + { + result = 0u; + } + return result; + } + + public bool TryGetGuildSkillMaxLevel(uint skillID, out uint maxLevel) + { + return XGuildSkillDocument.m_guildSkillMaxLevels.TryGetValue(skillID, out maxLevel); + } + + public GuildSkillTable.RowData GetGuildSkill(uint skillID, uint level) + { + GuildSkillTable.RowData rowData; + bool flag = this.TryGetGuildSkill(skillID, level, out rowData); + GuildSkillTable.RowData result; + if (flag) + { + result = rowData; + } + else + { + result = null; + } + return result; + } + + public bool TryGetGuildSkill(uint skillID, uint level, out GuildSkillTable.RowData skillData) + { + skillData = null; + Dictionary dictionary; + bool flag = XGuildSkillDocument.GuildSkllDic.TryGetValue(skillID, out dictionary) && dictionary.TryGetValue(level, out skillData); + bool result = false;//! + if (flag) + { + result = true; + } + else + { + skillData = null; + result = false; + } + return result; + } + + public uint GetCurGuildSkillLevel(uint skillID) + { + uint result = 0u; + this.m_curGuildSkillLevel.TryGetValue(skillID, out result); + return result; + } + + public void SendLearnGuildSkill() + { + RpcC2G_LearnGuildSkill rpcC2G_LearnGuildSkill = new RpcC2G_LearnGuildSkill(); + rpcC2G_LearnGuildSkill.oArg.skillId = this.CurrentSkillID; + XSingleton.singleton.Send(rpcC2G_LearnGuildSkill); + this.m_SendPoint = true; + } + + public void ReceiveLearnGuildSKill(LearnGuildSkillAgr oArg, LearnGuildSkillRes oRes) + { + bool flag = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowErrorCode(oRes.errorcode); + } + else + { + bool sendPoint = this.m_SendPoint; + if (sendPoint) + { + this.m_SendPoint = false; + this.SetRedPointValid(); + } + bool flag2 = this.m_curGuildSkillLevel.ContainsKey(oArg.skillId); + if (flag2) + { + uint value = this.m_curGuildSkillLevel[oArg.skillId] + 1u; + this.m_curGuildSkillLevel[oArg.skillId] = value; + } + else + { + this.m_curGuildSkillLevel.Add(oArg.skillId, 1u); + } + this.Refresh(); + } + } + + public void GetSkillList() + { + RpcC2M_AskGuildSkillInfoNew rpc = new RpcC2M_AskGuildSkillInfoNew(); + XSingleton.singleton.Send(rpc); + } + + public void OnSkillList(AskGuildSkillInfoReq org) + { + bool flag = org.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(org.errorcode, "fece00"); + } + else + { + this.LastGuildExp = org.LastGuildExp; + this.m_guildSkillDataDic.Clear(); + int i = 0; + int count = org.SkillLel.Count; + while (i < count) + { + this.m_guildSkillDataDic[(uint)org.SkillLel[i].SkillId] = (uint)org.SkillLel[i].MaxLvl; + i++; + } + this.m_curGuildSkillLevel.Clear(); + i = 0; + count = org.roleSkills.Count; + while (i < count) + { + this.m_curGuildSkillLevel[(uint)org.roleSkills[i].SkillId] = (uint)org.roleSkills[i].MaxLvl; + i++; + } + this.Refresh(); + } + } + + public void OnUpdateGuildSkillData(GuildSkillAllData org) + { + this.LastGuildExp = org.lastGuildExp; + int i = 0; + int count = org.skillLevel.Count; + while (i < count) + { + this.m_guildSkillDataDic[(uint)org.skillLevel[i].SkillId] = (uint)org.skillLevel[i].MaxLvl; + i++; + } + this.Refresh(); + } + + public void GetStudyGuildSkill(uint skillID) + { + RpcC2M_StudyGuildSkillNew rpcC2M_StudyGuildSkillNew = new RpcC2M_StudyGuildSkillNew(); + rpcC2M_StudyGuildSkillNew.oArg.skillId = skillID; + XSingleton.singleton.Send(rpcC2M_StudyGuildSkillNew); + } + + public void OnStudyGuildSkill(StudyGuildSkillRes oRes) + { + bool flag = oRes.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.errorcode, "fece00"); + } + else + { + this.m_guildSkillDataDic[oRes.skillId] = oRes.skillLel; + this.LastGuildExp = (int)oRes.lastExp; + bool flag2 = DlgBase.singleton.IsVisible() && DlgBase.singleton._StudyHandle.active; + if (flag2) + { + DlgBase.singleton._StudyHandle.ShowEffectDetailInfo(); + } + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshList(true); + } + } + } + + public uint GetSkillMaxLevel(uint skillID) + { + uint result = 0u; + this.m_guildSkillDataDic.TryGetValue(skillID, out result); + return result; + } + + public uint GetLabSkillMaxLevel(uint skillID) + { + uint result = 0u; + XGuildSkillDocument._labSkillMaxLevel.TryGetValue(skillID, out result); + return result; + } + + public override void OnEnterScene() + { + base.OnEnterScene(); + bool flag = XSingleton.singleton.CurrentStage.Stage == EXStage.Hall; + if (flag) + { + } + } + + public bool GuildPointChanged(XEventArgs args) + { + XVirtualItemChangedEventArgs xvirtualItemChangedEventArgs = args as XVirtualItemChangedEventArgs; + ItemEnum itemID = (ItemEnum)xvirtualItemChangedEventArgs.itemID; + bool flag = itemID != ItemEnum.GUILD_CONTRIBUTE; + bool result; + if (flag) + { + result = true; + } + else + { + this.RefreshRedPoint(); + result = true; + } + return result; + } + + public bool GuildStatusChanged(XEventArgs args) + { + this.RefreshRedPoint(); + return true; + } + + public void Refresh() + { + this.RefreshRedPoint(); + bool flag = !DlgBase.singleton.IsVisible(); + if (!flag) + { + DlgBase.singleton.SetupSkillList(false, false); + } + } + + public void RefreshRedPoint() + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + this.m_RedPoint = false; + bool flag = !specificDocument.bInGuild; + if (flag) + { + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_Skill, true); + } + else + { + int num = (int)XDocuments.GetSpecificDocument(XBagDocument.uuID).VirtualItems[22]; + for (int i = 0; i < XGuildSkillDocument.GuildSkillIDs.Count; i++) + { + uint curGuildSkillLevel = this.GetCurGuildSkillLevel(XGuildSkillDocument.GuildSkillIDs[i]); + GuildSkillTable.RowData rowData; + bool flag2 = this.TryGetGuildSkill(XGuildSkillDocument.GuildSkillIDs[i], curGuildSkillLevel, out rowData); + if (flag2) + { + uint skillMaxLevel = this.GetSkillMaxLevel(XGuildSkillDocument.GuildSkillIDs[i]); + bool flag3 = this.GetRedPointValid() && curGuildSkillLevel < skillMaxLevel && (ulong)rowData.need[0, 1] <= (ulong)((long)num) && rowData.roleLevel <= XSingleton.singleton.XPlayerData.Level && rowData.glevel <= specificDocument.Level; + if (flag3) + { + this.m_RedPoint = true; + break; + } + bool flag4 = specificDocument.IHavePermission(GuildPermission.GPEM_STUDY_SKILL) && this.CanMaxLevelUp(XGuildSkillDocument.GuildSkillIDs[i], skillMaxLevel); + if (flag4) + { + this.m_RedPoint = true; + break; + } + } + } + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildHall_Skill, true); + } + } + + public bool GetRedPointValid() + { + return XDocuments.GetSpecificDocument(XOptionsDocument.uuID).GetValue(XOptionsDefine.OD_GUILD_SKILL_LOCK) == 1; + } + + public void SetRedPointValid() + { + XOptionsDocument specificDocument = XDocuments.GetSpecificDocument(XOptionsDocument.uuID); + bool flag = specificDocument.GetValue(XOptionsDefine.OD_GUILD_SKILL_LOCK) == 1; + if (flag) + { + specificDocument.SetValue(XOptionsDefine.OD_GUILD_SKILL_LOCK, 0, false); + } + } + + public bool CanMaxLevelUp(uint skillId, uint skillLevel) + { + uint num; + bool flag = !this.TryGetGuildSkillMaxLevel(skillId, out num) || num <= skillLevel; + bool result; + if (flag) + { + result = false; + } + else + { + GuildSkillTable.RowData rowData; + bool flag2 = !this.TryGetGuildSkill(skillId, num, out rowData); + if (flag2) + { + result = false; + } + else + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + uint num2 = XGuildDocument.GuildConfig.GetTotalStudyCount((int)rowData.glevel, (int)specificDocument.Level) + this.GetGuildSkillInitLevel(skillId); + result = (num2 > num && (ulong)rowData.rexp <= (ulong)((long)this.LastGuildExp)); + } + } + return result; + } + + private bool OnPlayerLevelChange(XEventArgs args) + { + this.RefreshRedPoint(); + return true; + } + + private bool OnPlayerLeaveGuild(XEventArgs args) + { + XInGuildStateChangedEventArgs xinGuildStateChangedEventArgs = args as XInGuildStateChangedEventArgs; + bool bIsEnter = xinGuildStateChangedEventArgs.bIsEnter; + if (bIsEnter) + { + RpcC2M_AskGuildSkillInfoNew rpc = new RpcC2M_AskGuildSkillInfoNew(); + XSingleton.singleton.Send(rpc); + } + return true; + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillDocument.cs.meta new file mode 100644 index 00000000..2304405b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b0eef0e5848e99249997a4185b1c49dd +timeCreated: 1611404354 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillStudyHandle.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillStudyHandle.cs new file mode 100644 index 00000000..44245719 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillStudyHandle.cs @@ -0,0 +1,179 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSkillStudyHandle : DlgHandlerBase + { + protected override string FileName + { + get + { + return "Guild/GuildGrowth/GuildBuffLevelupPanel"; + } + } + + private IXUISprite m_SkillIcon; + + private IXUILabel m_SkillName; + + private IXUILabel m_CurrentSkillLevel; + + private IXUILabel m_NextSkillLevel; + + private IXUILabel m_CurrentSkillAttr; + + private IXUILabel m_NextSkillAttr; + + private IXUILabel m_MaxSlillLevel; + + private IXUILabel m_UseGuildExp; + + private IXUILabel m_CurrentGuildExp; + + private IXUIButton m_StudyButton; + + private IXUISprite m_maskSprite; + + private IXUISlider m_costProgress; + + private XGuildSkillDocument _Doc = null; + + private bool m_onSend = false; + + protected override void Init() + { + base.Init(); + this._Doc = XDocuments.GetSpecificDocument(XGuildSkillDocument.uuID); + this.m_SkillIcon = (base.PanelObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite); + this.m_SkillName = (base.PanelObject.transform.Find("Name").GetComponent("XUILabel") as IXUILabel); + this.m_CurrentSkillLevel = (base.PanelObject.transform.Find("CurrentLevel").GetComponent("XUILabel") as IXUILabel); + this.m_NextSkillLevel = (base.PanelObject.transform.Find("CurrentLevel/NextLevel").GetComponent("XUILabel") as IXUILabel); + this.m_MaxSlillLevel = (base.PanelObject.transform.Find("MaxLevel").GetComponent("XUILabel") as IXUILabel); + this.m_CurrentSkillAttr = (base.PanelObject.transform.Find("CurrentAttr").GetComponent("XUILabel") as IXUILabel); + this.m_NextSkillAttr = (base.PanelObject.transform.Find("CurrentAttr/NextAttr").GetComponent("XUILabel") as IXUILabel); + this.m_UseGuildExp = (base.PanelObject.transform.Find("UseExp").GetComponent("XUILabel") as IXUILabel); + this.m_CurrentGuildExp = (base.PanelObject.transform.Find("CostRed").GetComponent("XUILabel") as IXUILabel); + this.m_StudyButton = (base.PanelObject.transform.Find("Study").GetComponent("XUIButton") as IXUIButton); + this.m_maskSprite = (base.PanelObject.transform.Find("Mask").GetComponent("XUISprite") as IXUISprite); + this.m_costProgress = (base.PanelObject.transform.Find("CostRed/CostProgress").GetComponent("XUISlider") as IXUISlider); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + this.m_maskSprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnCloseClick)); + this.m_StudyButton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnStudyClick)); + } + + public void ShowEffectDetailInfo() + { + XSingleton.singleton.CreateAndPlay("Effects/FX_Particle/UIfx/UI_qianghua_03", this.m_SkillIcon.gameObject.transform, Vector3.zero, Vector3.one, 1f, true, 1f, true); + this.SetDetailInfo(); + } + + public void SetDetailInfo() + { + uint currentSkillID = this._Doc.CurrentSkillID; + uint skillMaxLevel = this._Doc.GetSkillMaxLevel(currentSkillID); + uint level = this._Doc.GuildDoc.Level; + GuildSkillTable.RowData guildSkill = this._Doc.GetGuildSkill(currentSkillID, skillMaxLevel); + GuildSkillTable.RowData guildSkill2 = this._Doc.GetGuildSkill(currentSkillID, skillMaxLevel + 1u); + this.m_SkillIcon.SetSprite(guildSkill.icon, guildSkill.atlas, false); + this.m_SkillName.SetText(guildSkill.name); + this.m_CurrentSkillLevel.SetText(string.Format("{0} {1}", XStringDefineProxy.GetString("XAttr_Level"), skillMaxLevel)); + this.m_NextSkillLevel.SetText((skillMaxLevel + 1u).ToString()); + this.m_CurrentSkillAttr.SetText(string.Format(guildSkill.currentLevelDescription, guildSkill.attribute[0, 1])); + this.m_NextSkillAttr.SetText(guildSkill2.attribute[0, 1].ToString()); + uint num = XGuildDocument.GuildConfig.GetTotalStudyCount((int)guildSkill.glevel, (int)level) + this._Doc.GetGuildSkillInitLevel(guildSkill.skillid); + this.m_MaxSlillLevel.SetText(XStringDefineProxy.GetString("GUILD_SKILL_MAX_UP_VALUE", new object[] + { + num + })); + this.m_UseGuildExp.SetText(guildSkill2.rexp.ToString()); + this.SetGuildExp(this._Doc.GuildDoc.CurrentTotalExp, this._Doc.LastGuildExp); + uint maxLevel = XGuildDocument.GuildConfig.MaxLevel; + bool flag = skillMaxLevel < num; + if (flag) + { + int rexp = (int)guildSkill2.rexp; + bool flag2 = this._Doc.LastGuildExp < rexp; + if (flag2) + { + this.m_StudyButton.SetGrey(false); + } + else + { + this.m_StudyButton.SetGrey(true); + } + } + else + { + this.m_StudyButton.SetGrey(false); + } + this.m_onSend = true; + } + + private void SetGuildExp(uint totalExp, int curExp) + { + this.m_CurrentGuildExp.SetText(string.Format("{0}/{1}", curExp, totalExp)); + float value = (totalExp > 0u) ? ((float)curExp / totalExp) : 0f; + this.m_costProgress.Value = value; + } + + private void OnCloseClick(IXUISprite sprite) + { + base.SetVisible(false); + } + + private bool OnStudyClick(IXUIButton btn) + { + bool flag = !this.m_onSend; + bool result; + if (flag) + { + result = false; + } + else + { + uint maxLevel = XGuildDocument.GuildConfig.MaxLevel; + uint level = this._Doc.GuildDoc.Level; + uint skillMaxLevel = this._Doc.GetSkillMaxLevel(this._Doc.CurrentSkillID); + GuildSkillTable.RowData guildSkill = this._Doc.GetGuildSkill(this._Doc.CurrentSkillID, skillMaxLevel + 1u); + uint num = XGuildDocument.GuildConfig.GetTotalStudyCount((int)guildSkill.glevel, (int)level) + this._Doc.GetGuildSkillInitLevel(guildSkill.skillid); + bool flag2 = skillMaxLevel < num; + if (flag2) + { + int rexp = (int)guildSkill.rexp; + bool flag3 = this._Doc.LastGuildExp < rexp; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_SKILL_UNDER_EXP"), "fece00"); + } + else + { + this._Doc.GetStudyGuildSkill(this._Doc.CurrentSkillID); + this.m_onSend = false; + } + } + else + { + bool flag4 = maxLevel == level; + if (flag4) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_SKILL_MAX_ALLMAX"), "fece00"); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("GUILD_SKILL_MAX_CURMAX"), "fece00"); + } + } + result = true; + } + return result; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillStudyHandle.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillStudyHandle.cs.meta new file mode 100644 index 00000000..c6d5d684 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillStudyHandle.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 361e66ce63595dd4791c119249df2ca6 +timeCreated: 1611403562 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillView.cs new file mode 100644 index 00000000..d78f7781 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillView.cs @@ -0,0 +1,487 @@ +using System; +using System.Collections.Generic; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSkillView : DlgBase + { + public override int layer + { + get + { + return 1; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override string fileName + { + get + { + return "Guild/GuildSystem/GuildSkillDlg"; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool fullscreenui + { + get + { + return true; + } + } + + public XGuildSkillDocument _doc = null; + + public XGuildSkillStudyHandle _StudyHandle = null; + + private Transform m_studyHandlePanel = null; + + private bool m_showEffect = false; + + protected override void OnLoad() + { + base.OnLoad(); + this.m_studyHandlePanel = base.uiBehaviour.transform.Find("Bg"); + this._StudyHandle = DlgHandlerBase.EnsureCreate(ref this._StudyHandle, this.m_studyHandlePanel, false, this); + } + + protected override void OnUnload() + { + DlgHandlerBase.EnsureUnload(ref this._StudyHandle); + base.OnUnload(); + } + + protected override void Init() + { + base.Init(); + this._doc = XDocuments.GetSpecificDocument(XGuildSkillDocument.uuID); + this._doc.SKillView = this; + this._doc.Player = XSingleton.singleton.XPlayerData; + this._doc.BagDoc = XDocuments.GetSpecificDocument(XBagDocument.uuID); + this._doc.GuildDoc = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + } + + protected override void OnShow() + { + base.OnShow(); + this._doc.GetSkillList(); + this.SetupSkillList(true, false); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClick)); + base.uiBehaviour.m_LevelUp.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnLevelUpClick)); + base.uiBehaviour.m_DetailUpMaxLevel.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnUpMaxLevelClick)); + } + + private bool OnCloseClick(IXUIButton button) + { + this.SetVisibleWithAnimation(false, null); + return true; + } + + private bool OnUpMaxLevelClick(IXUIButton button) + { + this._StudyHandle.SetVisible(true); + this._StudyHandle.SetDetailInfo(); + return false; + } + + private bool OnLevelUpClick(IXUIButton button) + { + string empty = string.Empty; + uint currentSkillID = this._doc.CurrentSkillID; + uint curGuildSkillLevel = this._doc.GetCurGuildSkillLevel(currentSkillID); + GuildSkillTable.RowData rowData; + bool flag = !this._doc.TryGetGuildSkill(currentSkillID, curGuildSkillLevel, out rowData); + bool result; + if (flag) + { + result = false; + } + else + { + uint skillMaxLevel = this._doc.GetSkillMaxLevel(currentSkillID); + bool flag2 = curGuildSkillLevel < skillMaxLevel; + if (flag2) + { + this._doc.SendLearnGuildSkill(); + } + else + { + uint num = XGuildDocument.GuildConfig.GetTotalStudyCount((int)rowData.glevel, (int)this._doc.GuildDoc.Level) + this._doc.GetGuildSkillInitLevel(rowData.skillid); + bool flag3 = skillMaxLevel < num; + if (flag3) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_GUILD_SKILL_STUDY_LEVEL_DOWN"), "fece00"); + } + else + { + bool flag4 = this._doc.GuildDoc.Level < XGuildDocument.GuildConfig.MaxLevel; + if (flag4) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_GUILD_SKILL_GUILD_LEVEL_DOWN"), "fece00"); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_GUILD_SKILL_LEVEL_FULL"), "fece00"); + } + } + } + result = true; + } + return result; + } + + private void OnSkillClick(IXUISprite sp) + { + bool flag = this._doc.CurrentSkillID == (uint)sp.ID; + if (!flag) + { + this._doc.CurrentSkillID = (uint)sp.ID; + this.RefreshSkillLight(); + this.SetupDetailSkill(); + } + } + + public void SetupSkillList(bool refresh = true, bool showEffect = false) + { + base.uiBehaviour.m_SkillPool.FakeReturnAll(); + this.m_showEffect = showEffect; + List guildSkillIDs = XGuildSkillDocument.GuildSkillIDs; + int num = base.uiBehaviour.m_SkillPool.TplWidth + 30; + guildSkillIDs.Sort(new Comparison(XGuildSkillView.SkillSortCompare)); + int num2 = 0; + for (int i = 0; i < guildSkillIDs.Count; i++) + { + GameObject gameObject = base.uiBehaviour.m_SkillPool.FetchGameObject(false); + gameObject.name = string.Format("Skill{0}", ++num2); + this.SetupSkill(gameObject, guildSkillIDs[i]); + gameObject.transform.localPosition = base.uiBehaviour.m_SkillPool.TplPos + new Vector3((float)(i % 2 * base.uiBehaviour.m_SkillPool.TplWidth), (float)(-(float)i / 2 * base.uiBehaviour.m_SkillPool.TplHeight)); + } + base.uiBehaviour.m_SkillPool.ActualReturnAll(false); + if (refresh) + { + this._doc.CurrentSkillID = guildSkillIDs[0]; + base.uiBehaviour.m_SkillScroll.ResetPosition(); + } + this.RefreshSkillLight(); + this.SetupDetailSkill(); + this.RefreshGuildPoint(); + } + + private void SetupSkill(GameObject go, uint skillID) + { + uint level = this._doc.GuildDoc.BasicData.level; + uint curGuildSkillLevel = this._doc.GetCurGuildSkillLevel(skillID); + GuildSkillTable.RowData rowData; + bool flag = !this._doc.TryGetGuildSkill(skillID, curGuildSkillLevel, out rowData); + if (!flag) + { + uint glevel = rowData.glevel; + uint skillMaxLevel = this._doc.GetSkillMaxLevel(skillID); + IXUISprite ixuisprite = go.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + IXUILabel ixuilabel = go.transform.Find("Name").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel2 = go.transform.Find("Level").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel3 = go.transform.Find("Attr").GetComponent("XUILabel") as IXUILabel; + Transform transform = go.transform.Find("Light"); + IXUISprite ixuisprite2 = go.GetComponent("XUISprite") as IXUISprite; + Transform transform2 = go.transform.Find("RedPoint"); + IXUISprite ixuisprite3 = go.transform.Find("Bg").GetComponent("XUISprite") as IXUISprite; + IXUILabel ixuilabel4 = go.transform.Find("LevelText").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel5 = go.transform.Find("GuildLevel").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite4 = go.transform.Find("Profecssion").GetComponent("XUISprite") as IXUISprite; + ixuilabel5.SetText(XStringDefineProxy.GetString("OPEN_AT_GUILD_LEVEL", new object[] + { + glevel + })); + bool flag2 = false; + bool flag3 = rowData.needtype == 2u; + if (flag3) + { + flag2 = true; + } + else + { + bool flag4 = rowData.profecssion != null; + if (flag4) + { + int i = 0; + int num = rowData.profecssion.Length; + while (i < num) + { + bool flag5 = XBagDocument.IsProfMatched(rowData.profecssion[i]); + if (flag5) + { + flag2 = true; + break; + } + i++; + } + } + } + ixuisprite4.SetVisible(flag2); + bool flag6 = flag2; + if (flag6) + { + bool flag7 = rowData.needtype == 2u; + if (flag7) + { + ixuisprite4.SetSprite("icon_yjs", "Social/Guild", false); + } + else + { + ixuisprite4.SetSprite("Recharge_tj", "ReCharge/ReCharge", false); + } + } + bool flag8 = curGuildSkillLevel == 0u; + if (flag8) + { + ixuisprite3.SetEnabled(false); + ixuisprite.SetEnabled(false); + ixuilabel.SetEnabled(false); + ixuilabel2.SetEnabled(false); + ixuilabel3.SetEnabled(false); + ixuilabel4.SetEnabled(false); + } + else + { + ixuisprite3.SetEnabled(true); + ixuisprite.SetEnabled(true); + ixuilabel.SetEnabled(true); + ixuilabel2.SetEnabled(true); + ixuilabel3.SetEnabled(true); + ixuilabel4.SetEnabled(true); + } + bool flag9 = this.m_showEffect && skillID == this._doc.CurrentSkillID; + if (flag9) + { + this.m_showEffect = false; + XSingleton.singleton.CreateAndPlay("Effects/FX_Particle/UIfx/UI_qianghua_03", ixuisprite.gameObject.transform, Vector3.zero, Vector3.one, 1f, true, 2f, true); + } + bool flag10 = level < glevel; + ixuilabel4.SetVisible(!flag10); + ixuilabel2.SetVisible(!flag10); + ixuilabel3.SetVisible(!flag10); + ixuilabel5.SetVisible(flag10); + transform.gameObject.SetActive(false); + ixuisprite.SetSprite(rowData.icon, rowData.atlas, false); + ixuilabel.SetText(rowData.name); + ixuilabel2.SetText(string.Format("{0}/{1}", curGuildSkillLevel.ToString(), skillMaxLevel)); + ixuilabel3.SetText(string.Format(string.Format(rowData.currentLevelDescription, rowData.attribute[0, 1]), new object[0])); + transform2.gameObject.SetActive(false); + ixuisprite2.ID = (ulong)skillID; + ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSkillClick)); + } + } + + public void SetupDetailSkill() + { + uint currentSkillID = this._doc.CurrentSkillID; + uint curGuildSkillLevel = this._doc.GetCurGuildSkillLevel(currentSkillID); + uint skillMaxLevel = this._doc.GetSkillMaxLevel(currentSkillID); + GuildSkillTable.RowData guildSkill = this._doc.GetGuildSkill(currentSkillID, curGuildSkillLevel); + GuildSkillTable.RowData guildSkill2 = this._doc.GetGuildSkill(currentSkillID, curGuildSkillLevel + 1u); + base.uiBehaviour.m_DetailSkillIcon.SetSprite(guildSkill.icon, guildSkill.atlas, false); + base.uiBehaviour.m_DetailSkillName.SetText(guildSkill.name); + base.uiBehaviour.m_DetailCurrLevel.SetText(string.Format("{0} {1}", XStringDefineProxy.GetString("XAttr_Level"), curGuildSkillLevel)); + base.uiBehaviour.m_DetailNextLevel.SetText((curGuildSkillLevel + 1u).ToString()); + base.uiBehaviour.m_DetailMaxLevel.SetText(skillMaxLevel.ToString()); + base.uiBehaviour.m_DetailCurrAttr.SetText(string.Format(guildSkill.currentLevelDescription, guildSkill.attribute[0, 1])); + base.uiBehaviour.m_DetailNextAttr.SetText(guildSkill2.attribute[0, 1].ToString()); + base.uiBehaviour.m_RedPoint.gameObject.SetActive(false); + string text = ""; + bool flag = false; + bool flag2 = !flag && !this.TryCheckRedGuildLevel(guildSkill, curGuildSkillLevel, out text); + if (flag2) + { + flag = true; + base.uiBehaviour.m_DetailSkillName.SetText(guildSkill.name); + } + else + { + base.uiBehaviour.m_DetailSkillName.SetText(string.Format("{0}({1}/{2})", guildSkill.name, curGuildSkillLevel, skillMaxLevel)); + } + bool flag3 = !flag && !this.TryCheckRoleLevel(guildSkill, curGuildSkillLevel, out text); + if (flag3) + { + } + base.uiBehaviour.m_DetailTip.SetText(text); + bool flag4 = this._doc.GuildDoc.IHavePermission(GuildPermission.GPEM_STUDY_SKILL) && guildSkill.needtype == 1u; + if (flag4) + { + base.uiBehaviour.m_DetailUpMaxLevel.SetVisible(true); + } + else + { + base.uiBehaviour.m_DetailUpMaxLevel.SetVisible(false); + } + string text2 = string.Empty; + bool flag5 = curGuildSkillLevel < skillMaxLevel; + bool flag6; + if (flag5) + { + text2 = XStringDefineProxy.GetString("GUILD_SKILL_UPDATE"); + flag6 = false; + } + else + { + flag6 = true; + uint num = XGuildDocument.GuildConfig.GetTotalStudyCount((int)guildSkill.glevel, (int)this._doc.GuildDoc.Level) + this._doc.GetGuildSkillInitLevel(currentSkillID); + bool flag7 = skillMaxLevel < num; + if (flag7) + { + text2 = XStringDefineProxy.GetString("GUILD_SKILL_STUDY_LEVEL_DOWN"); + } + else + { + bool flag8 = this._doc.GuildDoc.Level < XGuildDocument.GuildConfig.MaxLevel; + if (flag8) + { + text2 = XStringDefineProxy.GetString("GUILD_SKILL_GUILD_LEVEL_DOWN"); + } + else + { + text2 = XStringDefineProxy.GetString("GUILD_SKILL_LEVEL_FULL"); + } + } + } + base.uiBehaviour.m_LevelUpLabel.SetText(text2); + base.uiBehaviour.m_LevelUp.SetGrey(!flag6); + bool flag9 = this.TryCheckLevelUpCost(guildSkill, curGuildSkillLevel, out text); + if (flag9) + { + base.uiBehaviour.m_DetailCost.SetVisible(false); + base.uiBehaviour.m_DetailCostRed.SetVisible(true); + base.uiBehaviour.m_DetailCostRed.InputText = text; + } + else + { + base.uiBehaviour.m_DetailCost.SetVisible(true); + base.uiBehaviour.m_DetailCostRed.SetVisible(false); + base.uiBehaviour.m_DetailCost.InputText = text; + } + } + + private bool TryCheckFullLevel(GuildSkillTable.RowData currData, uint skillLevel, out string strTemp) + { + strTemp = string.Empty; + uint num = XGuildDocument.GuildConfig.GetTotalStudyCount((int)currData.glevel, (int)this._doc.GuildDoc.Level) + this._doc.GetGuildSkillInitLevel(currData.skillid); + bool flag = skillLevel >= num; + bool result; + if (flag) + { + strTemp = XStringDefineProxy.GetString("GUILD_SKILL_LEVEL_FULL"); + result = true; + } + else + { + result = false; + } + return result; + } + + private bool TryCheckLevelUpCost(GuildSkillTable.RowData currData, uint skillLevel, out string strTemp) + { + strTemp = ""; + uint num = currData.need[0, 1]; + strTemp = string.Format("{0}{1}", XLabelSymbolHelper.FormatSmallIcon(22), num); + return (ulong)num > (ulong)((long)((int)XSingleton.singleton.Doc.XBagDoc.GetVirtualItemCount(ItemEnum.GUILD_CONTRIBUTE))); + } + + private bool TryCheckRoleLevel(GuildSkillTable.RowData currData, uint skillLevel, out string strTemp) + { + strTemp = ""; + bool flag = currData.roleLevel > XSingleton.singleton.XPlayerData.Level; + bool result; + if (flag) + { + strTemp = string.Format("{0}{1}: {2}\n", strTemp, XStringDefineProxy.GetString("NEED_PLAYER_LEVEL"), currData.glevel); + result = false; + } + else + { + result = true; + } + return result; + } + + private bool TryCheckRedGuildLevel(GuildSkillTable.RowData currData, uint skillLevel, out string strTemp) + { + uint glevel = currData.glevel; + strTemp = ""; + bool flag = glevel > this._doc.GuildDoc.Level; + bool result; + if (flag) + { + strTemp = string.Format("{0}{1}: {2}\n", strTemp, XStringDefineProxy.GetString("NEED_GUILD_LEVEL"), glevel); + result = false; + } + else + { + result = true; + } + return result; + } + + private void RefreshSkillLight() + { + List list = ListPool.Get(); + base.uiBehaviour.m_SkillPool.GetActiveList(list); + for (int i = 0; i < list.Count; i++) + { + IXUISprite ixuisprite = list[i].GetComponent("XUISprite") as IXUISprite; + bool flag = ixuisprite.ID == (ulong)this._doc.CurrentSkillID; + if (flag) + { + list[i].transform.Find("Light").gameObject.SetActive(true); + } + else + { + list[i].transform.Find("Light").gameObject.SetActive(false); + } + } + ListPool.Release(list); + } + + private void RefreshGuildPoint() + { + base.uiBehaviour.m_GuildPoint.SetText(this._doc.BagDoc.VirtualItems[22].ToString()); + } + + private static int SkillSortCompare(uint skill1, uint skill2) + { + return skill1.CompareTo(skill2); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillView.cs.meta new file mode 100644 index 00000000..23220f82 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSkillView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 395a671b66c9810459bcd9918c1ba666 +timeCreated: 1611403591 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterBehaviour.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterBehaviour.cs new file mode 100644 index 00000000..b70f7552 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterBehaviour.cs @@ -0,0 +1,62 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSmallMonsterBehaviour : DlgBehaviourBase + { + public IXUIButton m_Close; + + public Transform m_DetailFrame; + + public Transform m_RankFrame; + + public XUIPool m_DropItemPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public IXUILabel m_CurrentLevel; + + public IXUIButton m_BeginGame; + + public IXUILabel m_RemainTime; + + public IXUILabel m_lblWin; + + public IXUILabel m_lblThisday; + + public IXUILabel m_lblNextday; + + public IXUIButton m_btnrwdRank; + + public IXUIButton m_btnHelp; + + public IXUILabel m_lblEmpt; + + public IXUILabel m_lblType; + + public XUIPool m_KillRankPool = new XUIPool(XSingleton.singleton.m_uiTool); + + private void Awake() + { + this.m_Close = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton); + this.m_DetailFrame = base.transform.Find("Bg/DetailFrame"); + this.m_RankFrame = base.transform.Find("Bg/RankFrame"); + Transform transform = this.m_DetailFrame.Find("DropFrame/Item"); + this.m_DropItemPool.SetupPool(transform.parent.gameObject, transform.gameObject, 3u, false); + this.m_CurrentLevel = (this.m_DetailFrame.Find("CurrentLevel").GetComponent("XUILabel") as IXUILabel); + this.m_BeginGame = (this.m_DetailFrame.Find("BeginGame").GetComponent("XUIButton") as IXUIButton); + this.m_RemainTime = (this.m_DetailFrame.Find("Pic/RemainTime").GetComponent("XUILabel") as IXUILabel); + this.m_lblWin = (this.m_DetailFrame.Find("WinCondition").GetComponent("XUILabel") as IXUILabel); + this.m_lblThisday = (this.m_DetailFrame.Find("Pic/Name").GetComponent("XUILabel") as IXUILabel); + this.m_lblNextday = (this.m_DetailFrame.Find("Tomorrow").GetComponent("XUILabel") as IXUILabel); + this.m_btnrwdRank = (this.m_DetailFrame.Find("RwdRank").GetComponent("XUIButton") as IXUIButton); + this.m_btnHelp = (this.m_DetailFrame.Find("Help").GetComponent("XUIButton") as IXUIButton); + transform = this.m_RankFrame.Find("Bg/Panel/MemberTpl"); + this.m_KillRankPool.SetupPool(transform.parent.gameObject, transform.gameObject, 20u, false); + this.m_lblEmpt = (this.m_RankFrame.Find("Bg/Empty").GetComponent("XUILabel") as IXUILabel); + this.m_lblType = (this.m_RankFrame.Find("Bg/title/title2").GetComponent("XUILabel") as IXUILabel); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterBehaviour.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterBehaviour.cs.meta new file mode 100644 index 00000000..a3af0a78 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f14c34ebcd3fa9642a2554ff62386182 +timeCreated: 1611404837 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterDocument.cs new file mode 100644 index 00000000..b5121302 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterDocument.cs @@ -0,0 +1,250 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSmallMonsterDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildSmallMonsterDocument.uuID; + } + } + + public int LeftEnterCount + { + get + { + return this._leftEnterCount; + } + } + + public int DayLimit + { + get + { + return XSingleton.singleton.GetInt("GuildCampDayCount"); + } + } + + public GuildCamp.RowData currCamp + { + get + { + for (int i = 0; i < XGuildSmallMonsterDocument._guildCampTable.Table.Length; i++) + { + bool flag = (long)XGuildSmallMonsterDocument._guildCampTable.Table[i].ID == (long)((ulong)this.DNExpId); + if (flag) + { + return XGuildSmallMonsterDocument._guildCampTable.Table[i]; + } + } + return null; + } + } + + public GuildCamp.RowData nextCamp + { + get + { + for (int i = 0; i < XGuildSmallMonsterDocument._guildCampTable.Table.Length; i++) + { + bool flag = (long)XGuildSmallMonsterDocument._guildCampTable.Table[i].ID == (long)((ulong)this.NextdayDneId); + if (flag) + { + return XGuildSmallMonsterDocument._guildCampTable.Table[i]; + } + } + return null; + } + } + + public uint Small_Monster_SceneID + { + get + { + XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument(XExpeditionDocument.uuID); + ExpeditionTable.RowData expeditionDataByID = specificDocument.GetExpeditionDataByID((int)this.DNExpId); + bool flag = expeditionDataByID != null; + if (flag) + { + List randomSceneList = specificDocument.GetRandomSceneList(expeditionDataByID.RandomSceneIDs[0]); + bool flag2 = randomSceneList.Count > 0; + if (flag2) + { + return randomSceneList[0]; + } + } + return 4500u; + } + } + + public List RankList + { + get + { + return this._rankList; + } + } + + public bool isKillType + { + get + { + bool flag = this.currCamp != null; + return flag && this.currCamp.Type == 2; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildSmallMonsterDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + public uint DNExpId = 11u; + + public uint NextdayDneId = 12u; + + private int _leftEnterCount = 0; + + private List _rankList = new List(); + + public static GuildCamp _guildCampTable = new GuildCamp(); + + public static GuildCampRank _guildRankTable = new GuildCampRank(); + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildSmallMonsterDocument.AsyncLoader.AddTask("Table/GuildCamp", XGuildSmallMonsterDocument._guildCampTable, false); + XGuildSmallMonsterDocument.AsyncLoader.AddTask("Table/GuildCampRank", XGuildSmallMonsterDocument._guildRankTable, false); + XGuildSmallMonsterDocument.AsyncLoader.Execute(callback); + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + base.RegisterEvent(XEventDefine.XEvent_InGuildStateChanged, new XComponent.XEventHandler(this.GuildStateChanged)); + base.RegisterEvent(XEventDefine.XEvent_PlayerLevelChange, new XComponent.XEventHandler(this.OnPlayerLevelChange)); + } + + public bool IsOpen(ExpeditionTable.RowData rowData) + { + return (long)rowData.DNExpeditionID == (long)((ulong)this.DNExpId); + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + bool flag = XSingleton.singleton.CurrentStage.Stage == EXStage.Hall; + if (flag) + { + this.SendQuerySmallMonterInfo(); + } + } + + public bool CheckEnterLevel() + { + XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument(XExpeditionDocument.uuID); + ExpeditionTable.RowData expeditionDataByID = specificDocument.GetExpeditionDataByID((int)this.DNExpId); + return specificDocument.TeamCategoryMgr.IsExpOpened(expeditionDataByID); + } + + public int GetEnterLevel() + { + XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument(XExpeditionDocument.uuID); + int expIDBySceneID = specificDocument.GetExpIDBySceneID(this.Small_Monster_SceneID); + ExpeditionTable.RowData expeditionDataByID = specificDocument.GetExpeditionDataByID(expIDBySceneID); + return (expeditionDataByID == null) ? 24 : expeditionDataByID.RequiredLevel; + } + + private bool GuildStateChanged(XEventArgs args) + { + XInGuildStateChangedEventArgs xinGuildStateChangedEventArgs = args as XInGuildStateChangedEventArgs; + bool bIsEnter = xinGuildStateChangedEventArgs.bIsEnter; + if (bIsEnter) + { + this.SendQuerySmallMonterInfo(); + } + else + { + this._leftEnterCount = 0; + } + return true; + } + + public void SendQuerySmallMonterInfo() + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag = !specificDocument.bInGuild; + if (!flag) + { + bool flag2 = !XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_GuildDungeon_SmallMonter); + if (!flag2) + { + RpcC2M_GuildCampInfo rpc = new RpcC2M_GuildCampInfo(); + XSingleton.singleton.Send(rpc); + } + } + } + + public void SetGuildSmallMonsterInfo(int leftEnterCount, int currID, int nextID, List rankList) + { + this._leftEnterCount = leftEnterCount; + this._rankList.Clear(); + DlgBase.singleton.RefreshRedp(); + bool flag = currID != 0 && nextID != 0; + if (flag) + { + this.DNExpId = (uint)currID; + this.NextdayDneId = (uint)nextID; + } + else + { + XSingleton.singleton.AddGreenLog("currID is 0", null, null, null, null, null); + } + for (int i = 0; i < rankList.Count; i++) + { + GuildCampRankInfo guildCampRankInfo = new GuildCampRankInfo(); + guildCampRankInfo.rankVar = rankList[i].rankVar; + guildCampRankInfo.rank = rankList[i].rank; + guildCampRankInfo.roles.Clear(); + for (int j = 0; j < rankList[i].roles.Count; j++) + { + guildCampRankInfo.roles.Add(rankList[i].roles[j]); + } + this._rankList.Add(guildCampRankInfo); + } + bool flag2 = !DlgBase.singleton.IsVisible(); + if (!flag2) + { + DlgBase.singleton.SetupDetailFrame(); + DlgBase.singleton.SetupRankFrame(); + } + } + + public void OpenTeamView() + { + XTeamDocument specificDocument = XDocuments.GetSpecificDocument(XTeamDocument.uuID); + specificDocument.SetAndMatch((int)this.DNExpId); + } + + private bool OnPlayerLevelChange(XEventArgs arg) + { + this.SendQuerySmallMonterInfo(); + return true; + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = XSingleton.singleton.CurrentStage.Stage == EXStage.Hall; + if (flag) + { + this.SendQuerySmallMonterInfo(); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterDocument.cs.meta new file mode 100644 index 00000000..02195601 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6dde25c39bc7b3a4bab464ce39e9ea77 +timeCreated: 1611403903 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterView.cs new file mode 100644 index 00000000..7bb667ed --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterView.cs @@ -0,0 +1,215 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildSmallMonsterView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildSystem/GuildSmallMonsterDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool hideMainMenu + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + private XGuildSmallMonsterDocument _doc = null; + + private GuildCampRankHandler _rankHandler; + + protected override void Init() + { + base.Init(); + this._doc = XDocuments.GetSpecificDocument(XGuildSmallMonsterDocument.uuID); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClicked)); + base.uiBehaviour.m_BeginGame.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnBeginGameClicked)); + base.uiBehaviour.m_btnrwdRank.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnRwdRankClick)); + base.uiBehaviour.m_btnHelp.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHelpClick)); + } + + protected override void OnLoad() + { + base.OnLoad(); + DlgHandlerBase.EnsureCreate(ref this._rankHandler, base.uiBehaviour.gameObject.transform, false, this); + } + + protected override void OnUnload() + { + DlgHandlerBase.EnsureUnload(ref this._rankHandler); + base.OnUnload(); + } + + private bool OnCloseClicked(IXUIButton button) + { + this.SetVisibleWithAnimation(false, null); + return true; + } + + private bool OnBeginGameClicked(IXUIButton button) + { + this._doc.OpenTeamView(); + return true; + } + + private bool OnRwdRankClick(IXUIButton button) + { + this._rankHandler.SetVisible(true); + return true; + } + + private bool OnHelpClick(IXUIButton button) + { + DlgBase.singleton.ShowHelp(this._doc.currCamp.Name, this._doc.currCamp.Description); + return true; + } + + public bool CloseRankHandler(IXUIButton btn) + { + this._rankHandler.SetVisible(false); + return true; + } + + protected override void OnShow() + { + base.OnShow(); + this.RefreshRedp(); + this._doc.SendQuerySmallMonterInfo(); + this.SetupDetailFrame(); + this.SetupRankFrame(); + } + + public void SetupDetailFrame() + { + base.uiBehaviour.m_RemainTime.SetText(string.Format("{0}/{1}", this._doc.LeftEnterCount, this._doc.DayLimit)); + base.uiBehaviour.m_CurrentLevel.SetText(string.Format("Lv.{0}", 0)); + SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(this._doc.Small_Monster_SceneID); + base.uiBehaviour.m_DropItemPool.FakeReturnAll(); + bool flag = sceneData.ViewableDropList != null; + if (flag) + { + for (int i = 0; i < sceneData.ViewableDropList.Length; i++) + { + GameObject gameObject = base.uiBehaviour.m_DropItemPool.FetchGameObject(false); + gameObject.name = "drop" + sceneData.ViewableDropList[i]; + XSingleton.singleton.normalItemDrawer.DrawItem(gameObject, sceneData.ViewableDropList[i], 0, false); + gameObject.transform.localPosition = base.uiBehaviour.m_DropItemPool.TplPos + new Vector3((float)(i * base.uiBehaviour.m_DropItemPool.TplWidth), 0f); + IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.ID = (ulong)sceneData.ViewableDropList[i]; + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton.singleton.OnItemClick)); + } + } + base.uiBehaviour.m_lblThisday.SetText(this._doc.currCamp.Name); + base.uiBehaviour.m_lblNextday.SetText(this._doc.nextCamp.Name); + base.uiBehaviour.m_lblWin.SetText(this._doc.currCamp.Condition); + base.uiBehaviour.m_DropItemPool.ActualReturnAll(false); + } + + public void SetupRankFrame() + { + base.uiBehaviour.m_KillRankPool.FakeReturnAll(); + base.uiBehaviour.m_lblEmpt.SetVisible(this._doc.RankList.Count <= 0); + base.uiBehaviour.m_lblType.SetText(this._doc.currCamp.RankDes); + for (int i = 0; i < this._doc.RankList.Count; i++) + { + GameObject gameObject = base.uiBehaviour.m_KillRankPool.FetchGameObject(false); + IXUILabel ixuilabel = gameObject.transform.Find("Rank").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel2 = gameObject.transform.Find("Name").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel3 = gameObject.transform.Find("Condition").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = gameObject.transform.Find("RankImage").GetComponent("XUISprite") as IXUISprite; + ixuilabel.SetVisible(i >= 3); + ixuilabel.SetText(string.Format("No.{0}", i + 1)); + ixuisprite.SetVisible(i < 3); + ixuisprite.SetSprite("N" + (i + 1)); + ixuisprite.MakePixelPerfect(); + string text = string.Empty; + for (int j = 0; j < this._doc.RankList[i].roles.Count; j++) + { + text += this._doc.RankList[i].roles[j].name; + bool flag = j < this._doc.RankList[i].roles.Count - 1; + if (flag) + { + text += "\n"; + } + } + ixuilabel2.SetText(text); + bool flag2 = this._doc.currCamp.Type == 2; + if (flag2) + { + ixuilabel3.SetText(this._doc.RankList[i].rankVar.ToString()); + } + else + { + int num = this._doc.RankList[i].rankVar / 60; + int num2 = this._doc.RankList[i].rankVar % 60; + string str = (num < 10) ? ("0" + num) : num.ToString(); + string str2 = (num2 < 10) ? ("0" + num2) : num2.ToString(); + ixuilabel3.SetText(str + ":" + str2); + } + gameObject.transform.localPosition = base.uiBehaviour.m_KillRankPool.TplPos - new Vector3(0f, (float)(i * base.uiBehaviour.m_KillRankPool.TplHeight)); + } + base.uiBehaviour.m_KillRankPool.ActualReturnAll(false); + } + + public void RefreshRedp() + { + bool flag = this._doc == null; + if (flag) + { + this._doc = XDocuments.GetSpecificDocument(XGuildSmallMonsterDocument.uuID); + } + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag2 = XGuildDocument.GuildConfig.IsSysUnlock(XSysDefine.XSys_GuildDungeon_SmallMonter, specificDocument.Level); + XSingleton.singleton.SetSysRedState(XSysDefine.XSys_GuildDungeon_SmallMonter, this._doc.LeftEnterCount > 0 && flag2 && this._doc.CheckEnterLevel()); + XSingleton.singleton.RecalculateRedPointState(XSysDefine.XSys_GuildDungeon_SmallMonter, true); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterView.cs.meta new file mode 100644 index 00000000..4ea75cf7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildSmallMonsterView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d0a95e53ed7248744b5a5eeb36f1a0e8 +timeCreated: 1611404588 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs new file mode 100644 index 00000000..c35b8f4a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs @@ -0,0 +1,151 @@ +using System; +using UILib; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildTaskRefreshResultDlg : DlgBase + { + public override string fileName + { + get + { + return "Guild/DailyTaskResult"; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public uint AfterScore { get; set; } + + public uint BeforeScore { get; set; } + + private XFx _fx1; + + private XFx _fx2; + + private uint _fx1Token; + + private uint _fx2Token; + + protected override void OnLoad() + { + base.OnLoad(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + } + + protected override void OnUnload() + { + XSingleton.singleton.KillTimer(this._fx1Token); + XSingleton.singleton.KillTimer(this._fx2Token); + this._fx1Token = 0u; + this._fx2Token = 0u; + bool flag = this._fx1 != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this._fx1, true); + this._fx1 = null; + } + bool flag2 = this._fx2 != null; + if (flag2) + { + XSingleton.singleton.DestroyFx(this._fx2, true); + this._fx2 = null; + } + base.OnUnload(); + } + + protected override void Init() + { + base.Init(); + base.uiBehaviour.blockBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClose)); + } + + protected override void OnShow() + { + base.OnShow(); + base.uiBehaviour.TweenGroup.ResetTween(true); + base.uiBehaviour.TweenGroup.PlayTween(true); + base.uiBehaviour.beforeSprite.SetSprite(base.uiBehaviour.beforeSprite.spriteName.Substring(0, base.uiBehaviour.beforeSprite.spriteName.Length - 1) + this.BeforeScore); + base.uiBehaviour.afterSprite.SetSprite(base.uiBehaviour.afterSprite.spriteName.Substring(0, base.uiBehaviour.afterSprite.spriteName.Length - 1) + this.AfterScore); + bool flag = this.BeforeScore < this.AfterScore; + if (flag) + { + base.uiBehaviour.resultLabel.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("DailyTaskRefreshUp"))); + } + else + { + bool flag2 = this.BeforeScore == this.AfterScore; + if (flag2) + { + base.uiBehaviour.resultLabel.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("DailyTaskRefreshEqual"))); + } + else + { + base.uiBehaviour.resultLabel.SetText(XSingleton.singleton.ReplaceReturn(XStringDefineProxy.GetString("DailyTaskRefreshDown"))); + } + } + IXPositionGroup ixpositionGroup = base.uiBehaviour.transform.GetComponent("PositionGroup") as IXPositionGroup; + this._fx1Token = XSingleton.singleton.SetTimer(ixpositionGroup.GetGroup(0).x, new XTimerMgr.ElapsedEventHandler(this.DelayCreateFx), 1); + this._fx2Token = XSingleton.singleton.SetTimer(ixpositionGroup.GetGroup(1).x, new XTimerMgr.ElapsedEventHandler(this.DelayCreateFx), 2); + } + + protected override void OnHide() + { + XSingleton.singleton.KillTimer(this._fx1Token); + XSingleton.singleton.KillTimer(this._fx2Token); + this._fx1Token = 0u; + this._fx2Token = 0u; + bool flag = this._fx1 != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this._fx1, true); + this._fx1 = null; + } + bool flag2 = this._fx2 != null; + if (flag2) + { + XSingleton.singleton.DestroyFx(this._fx2, true); + this._fx2 = null; + } + base.OnHide(); + } + + private void DelayCreateFx(object o = null) + { + int num = (int)o; + bool flag = num == 1; + if (flag) + { + this._fx1 = XSingleton.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_fptx_Clip01", base.uiBehaviour.m_FxDepth, false); + } + else + { + this._fx2 = XSingleton.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_fptx_Clip02", base.uiBehaviour.m_FxDepth2, false); + } + } + + public override void StackRefresh() + { + base.StackRefresh(); + } + + private bool OnClose(IXUIButton uiSprite) + { + this.SetVisible(false, true); + return true; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs.meta new file mode 100644 index 00000000..60555e34 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlg.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3d1f4f350de608a4ba54106516039e3f +timeCreated: 1611403603 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlgBehavior.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlgBehavior.cs new file mode 100644 index 00000000..807d6e66 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlgBehavior.cs @@ -0,0 +1,35 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + internal class XGuildTaskRefreshResultDlgBehavior : DlgBehaviourBase + { + public IXUISprite beforeSprite; + + public IXUISprite afterSprite; + + public IXUIButton blockBtn; + + public Transform m_FxDepth; + + public Transform m_FxDepth2; + + public IXUILabel resultLabel; + + public IXUIPlayTweenGroup TweenGroup; + + private void Awake() + { + this.beforeSprite = (base.transform.Find("P2/TaskLevelBefore").GetComponent("XUISprite") as IXUISprite); + this.afterSprite = (base.transform.Find("P2/TaskLevelAfter").GetComponent("XUISprite") as IXUISprite); + this.blockBtn = (base.transform.Find("Block").GetComponent("XUIButton") as IXUIButton); + this.resultLabel = (base.transform.Find("P2/ResultText").GetComponent("XUILabel") as IXUILabel); + this.m_FxDepth = base.transform.Find("Fx/FxDepth"); + this.m_FxDepth2 = base.transform.Find("Fx/FxDepth2"); + this.TweenGroup = (base.transform.Find("P2").GetComponent("XUIPlayTweenGroup") as IXUIPlayTweenGroup); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlgBehavior.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlgBehavior.cs.meta new file mode 100644 index 00000000..c01d014d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildTaskRefreshResultDlgBehavior.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a8e30566e5d298e4b8027366bd4bfc47 +timeCreated: 1611404296 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildTerritoryDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildTerritoryDocument.cs new file mode 100644 index 00000000..897ec27d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildTerritoryDocument.cs @@ -0,0 +1,1220 @@ +using System; +using System.Collections.Generic; +using System.Text; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildTerritoryDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildTerritoryDocument.uuID; + } + } + + public uint bHavaTerritoryRecCount + { + get + { + return this.mHaveTerritoryCount; + } + set + { + this.mHaveTerritoryCount = value; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildTerritoryAllianceInterface, true); + } + } + + public XGuildTerritoryDocument.GuildTerritoryStyle TerritoryStyle + { + get + { + return this.mCurTerritoryStyle; + } + set + { + this.mCurTerritoryStyle = value; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildTerritoryIconInterface, true); + this.RefreshGuildTerritoryInfo(); + } + } + + public bool bHavaShowMessageIcon + { + get + { + return this.mShowMessageIcon; + } + set + { + this.mShowMessageIcon = value; + DlgBase.singleton.RefreshH5ButtonState(XSysDefine.XSys_GuildTerritoryMessageInterface, true); + } + } + + public List GuildTerrChallList + { + get + { + return this.mGuildTerrChall; + } + } + + public List CityDataList + { + get + { + return this.mCityDataList; + } + } + + public List GuildTerrAllianceInfos + { + get + { + return this.mGuildTerritoryAllianceList; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildTerritoryDocument"); + + public static readonly uint GAME_INFO = 1u; + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private static FightDesignation mGuildDestination = new FightDesignation(); + + public static GuildTransfer mGuildTransfer = new GuildTransfer(); + + public static TerritoryBattle mGuildTerritoryList = new TerritoryBattle(); + + public static TerritoryRewd mTerritoryRewd = new TerritoryRewd(); + + public XFx[] fxJvDians = new XFx[9]; + + public Vector3[] fxJvPos = new Vector3[3]; + + private float lastShowInfoTime; + + public Queue qInfo = new Queue(); + + public uint mapid = 0u; + + public List jvdians = new List(); + + public List guilds = new List(); + + public List roles = new List(); + + public List fields = new List(); + + public List rwds = new List(); + + public GCFRoleBrief mmyinfo = new GCFRoleBrief(); + + public uint feats = 0u; + + public GCFGuildBrief winguild; + + public uint ready_lefttime = 0u; + + public uint fight_lefttime = 0u; + + public uint territoryid = 0u; + + public bool myPostion = true; + + private uint[] maptoken = new uint[3]; + + private string[] fxs = new string[] + { + "Effects/FX_Particle/UIfx/UI_xdtts_white", + "Effects/FX_Particle/UIfx/UI_xdtts_bule", + "Effects/FX_Particle/UIfx/UI_xdtts_red" + }; + + private Dictionary mCityDataDic = new Dictionary(); + + private List mCityDataList = new List(); + + private List mGuildTerrChall = new List(); + + private List mGuildTerritoryAllianceList = new List(); + + private uint mHaveTerritoryCount = 0u; + + private XGuildTerritoryDocument.GuildTerritoryStyle mCurTerritoryStyle = XGuildTerritoryDocument.GuildTerritoryStyle.NONE; + + public ulong Allianceid = 0UL; + + public GUILDTERRTYPE CurrentType = GUILDTERRTYPE.TERR_NOT_OPEN; + + public uint SelfGuildTerritoryID = 0u; + + public uint SelfTargetTerritoryID = 0u; + + public List guildAllianceInfos; + + public bool mShowMessage = true; + + public bool mShowMessageIcon = false; + + public ulong SelfAllianceID = 0UL; + + public uint CurrentTerritoryID = 0u; + + public uint EnterBattleTime = 0u; + + public enum GuildTerritoryStyle + { + NONE, + INFORM, + ACTIVITY + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + this.SendGCFCommonReq(GCFReqType.GCF_FIGHT_REPORT); + } + } + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildTerritoryDocument.AsyncLoader.AddTask("Table/TerritoryBattleDesignation", XGuildTerritoryDocument.mGuildDestination, false); + XGuildTerritoryDocument.AsyncLoader.AddTask("Table/TerritoryBattleTransfer", XGuildTerritoryDocument.mGuildTransfer, false); + XGuildTerritoryDocument.AsyncLoader.AddTask("Table/territorybattle", XGuildTerritoryDocument.mGuildTerritoryList, false); + XGuildTerritoryDocument.AsyncLoader.AddTask("Table/TerritoryRewd", XGuildTerritoryDocument.mTerritoryRewd, false); + XGuildTerritoryDocument.AsyncLoader.Execute(callback); + } + + public static void OnLoadcallback() + { + } + + public override void OnEnterScene() + { + base.OnEnterScene(); + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_HALL; + if (flag) + { + GuildMiniReportHandler.msgs.Clear(); + } + bool flag2 = XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT; + if (flag2) + { + XSingleton.singleton.InitBoard(); + } + bool flag3 = XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT; + if (flag3) + { + for (int i = 0; i < this.fxJvDians.Length; i++) + { + bool flag4 = i % 3 == 0; + if (flag4) + { + this.fxJvDians[i] = XSingleton.singleton.CreateFx("Effects/FX_Particle/Roles/Lzg_Ty/Ty_ldzd_fanwei_grey", null, true); + } + else + { + bool flag5 = i % 3 == 1; + if (flag5) + { + this.fxJvDians[i] = XSingleton.singleton.CreateFx("Effects/FX_Particle/Roles/Lzg_Ty/Ty_ldzd_fanwei_red", null, true); + } + else + { + this.fxJvDians[i] = XSingleton.singleton.CreateFx("Effects/FX_Particle/Roles/Lzg_Ty/Ty_ldzd_fanwei_blue", null, true); + } + } + bool flag6 = i / 3 == 0; + if (flag6) + { + List floatList = XSingleton.singleton.GetFloatList("GuildTerritoryUpPos"); + Vector3 vector; + vector= new Vector3(floatList[0], floatList[1], floatList[2]); + float num = float.Parse(XSingleton.singleton.GetValue("TerritoryBattleUpRadius")) * float.Parse(XSingleton.singleton.GetValue("TerritoryBattleClientRadiusK")); + this.fxJvDians[i].Play(vector, Quaternion.identity, new Vector3(num, 1f, num), 1f); + this.fxJvPos[0] = vector; + } + else + { + bool flag7 = i / 3 == 1; + if (flag7) + { + List floatList2 = XSingleton.singleton.GetFloatList("GuildTerritoryMidPos"); + Vector3 vector2; + vector2= new Vector3(floatList2[0], floatList2[1], floatList2[2]); + float num2 = float.Parse(XSingleton.singleton.GetValue("TerritoryBattleMidRadius")) * float.Parse(XSingleton.singleton.GetValue("TerritoryBattleClientRadiusK")); + this.fxJvDians[i].Play(vector2, Quaternion.identity, new Vector3(num2, 1f, num2), 1f); + this.fxJvPos[1] = vector2; + } + else + { + List floatList3 = XSingleton.singleton.GetFloatList("GuildTerritoryBtmPos"); + Vector3 vector3; + vector3= new Vector3(floatList3[0], floatList3[1], floatList3[2]); + float num3 = float.Parse(XSingleton.singleton.GetValue("TerritoryBattleBtmRadius")) * float.Parse(XSingleton.singleton.GetValue("TerritoryBattleClientRadiusK")); + this.fxJvDians[i].Play(vector3, Quaternion.identity, new Vector3(num3, 1f, num3), 1f); + this.fxJvPos[2] = vector3; + } + } + } + } + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + this.CheckJvDianState(); + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT; + if (flag) + { + bool flag2 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SkillHandler.SetVisible(false); + } + } + bool flag3 = Process_RpcC2G_DoEnterScene.runstate > 0u; + if (flag3) + { + bool flag4 = XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT || XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT; + if (flag4) + { + XLevelRewardDocument specificDocument = XDocuments.GetSpecificDocument(XLevelRewardDocument.uuID); + bool flag5 = specificDocument != null; + if (flag5) + { + bool flag6 = DlgBase.singleton.IsLoaded(); + if (flag6) + { + DlgBase.singleton.SkillHandler.ResetPressState(); + DlgBase.singleton.SetVisiblePure(false); + DlgBase.singleton.Show(false); + DlgBase.singleton.SetFakeHide(true); + } + specificDocument.ShowLevelReward(); + } + } + } + } + + public override void OnLeaveScene() + { + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT; + if (flag) + { + XSingleton.singleton.ClearAll(); + bool flag2 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (flag2) + { + DlgBase.singleton.SkillHandler.SetVisible(true); + } + } + bool flag3 = XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT; + if (flag3) + { + for (int i = 0; i < this.fxJvDians.Length; i++) + { + bool flag4 = this.fxJvDians[i] != null; + if (flag4) + { + XSingleton.singleton.DestroyFx(this.fxJvDians[i], true); + } + this.fxJvDians[i] = null; + } + XBattleDocument.DelMiniMapFx(this.maptoken[0]); + XBattleDocument.DelMiniMapFx(this.maptoken[1]); + XBattleDocument.DelMiniMapFx(this.maptoken[2]); + } + base.OnLeaveScene(); + } + + public override void OnDetachFromHost() + { + this.jvdians.Clear(); + this.roles.Clear(); + this.guilds.Clear(); + this.rwds.Clear(); + base.OnDetachFromHost(); + } + + public override void PostUpdate(float fDeltaT) + { + base.PostUpdate(fDeltaT); + bool flag = Time.frameCount % 60 == 0; + if (flag) + { + bool flag2 = XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_WAIT; + if (flag2) + { + this.SendGCFReadysInfo(); + this.SendGFCFightInfo(); + } + else + { + bool flag3 = XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT; + if (flag3) + { + this.SendGFCFightInfo(); + } + } + } + bool flag4 = Time.time > this.lastShowInfoTime + 10f; + if (flag4) + { + bool flag5 = this.qInfo.Count != 0; + if (flag5) + { + this.qInfo.Clear(); + } + bool flag6 = DlgBase.singleton.IsVisible() && DlgBase.singleton.m_miniReportHandler != null; + if (flag6) + { + DlgBase.singleton.m_miniReportHandler.ShowBuffs(); + } + } + } + + public FightDesignation.RowData GetDesignation(uint hit) + { + FightDesignation.RowData[] table = XGuildTerritoryDocument.mGuildDestination.Table; + for (int i = table.Length - 1; i >= 0; i--) + { + bool flag = table[i].ID <= hit; + if (flag) + { + return table[i]; + } + } + return null; + } + + public void ActiveJvDian(GCFJvDianType type, int index) + { + bool flag = type == GCFJvDianType.GCF_JUDIAN_UP; + if (flag) + { + bool flag2 = this.fxJvDians[0] != null && this.fxJvDians[1] != null && this.fxJvDians[2] != null; + if (flag2) + { + this.fxJvDians[0].SetActive(index == 0); + this.fxJvDians[1].SetActive(index == 1); + this.fxJvDians[2].SetActive(index == 2); + } + } + else + { + bool flag3 = type == GCFJvDianType.GCF_JUDIAN_MID; + if (flag3) + { + bool flag4 = this.fxJvDians[3] != null && this.fxJvDians[4] != null && this.fxJvDians[5] != null; + if (flag4) + { + this.fxJvDians[3].SetActive(index == 0); + this.fxJvDians[4].SetActive(index == 1); + this.fxJvDians[5].SetActive(index == 2); + } + } + else + { + bool flag5 = this.fxJvDians[6] != null && this.fxJvDians[7] != null && this.fxJvDians[8] != null; + if (flag5) + { + this.fxJvDians[6].SetActive(index == 0); + this.fxJvDians[7].SetActive(index == 1); + this.fxJvDians[8].SetActive(index == 2); + } + } + } + } + + public void SendGCFEnterin(int index) + { + this.mapid = XGuildTerritoryDocument.mGuildTransfer.GetByid((uint)index).sceneid; + this.SendGCFCommonReq(GCFReqType.GCF_JOIN_FIGHT_SCENE); + } + + public void SendWaitScene(uint tid) + { + this.territoryid = tid; + this.SendGCFCommonReq(GCFReqType.GCF_JOIN_READY_SCENE); + } + + public void SendGCFCommonReq(GCFReqType type) + { + RpcC2M_GCFCommonReq rpcC2M_GCFCommonReq = new RpcC2M_GCFCommonReq(); + rpcC2M_GCFCommonReq.oArg.mapid = this.mapid; + rpcC2M_GCFCommonReq.oArg.reqtype = type; + rpcC2M_GCFCommonReq.oArg.territoryid = this.territoryid; + XSingleton.singleton.Send(rpcC2M_GCFCommonReq); + } + + public void RespGCFCommon(GCFReqType type, GCFCommonRes res) + { + this.jvdians = res.jvdians; + this.guilds.Clear(); + for (int i = 0; i < res.guilds.Count; i++) + { + GCFGuild gcfguild = new GCFGuild(); + gcfguild.brief = res.guilds[i]; + gcfguild.groupScore = this.GetGroupPoint(res.guilds, gcfguild.brief.group); + this.guilds.Add(gcfguild); + } + this.roles = res.roles; + this.rwds = res.rewards; + this.fields = res.fields; + this.mmyinfo = res.myinfo; + bool flag = this.mmyinfo != null; + if (flag) + { + this.feats = this.mmyinfo.feats; + } + this.territoryid = res.territoryid; + this.winguild = res.winguild; + bool flag2 = type == GCFReqType.GCF_FIGHT_REPORT; + if (flag2) + { + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshAll(); + } + } + else + { + bool flag4 = type == GCFReqType.GCF_JOIN_READY_SCENE; + if (!flag4) + { + bool flag5 = type == GCFReqType.GCF_FIGHT_RESULT; + if (flag5) + { + LevelRewardTerritoryHandler territoryHandler = DlgBase.singleton.GetTerritoryHandler(); + bool flag6 = territoryHandler != null; + if (flag6) + { + territoryHandler.RefreshAll(); + } + else + { + XSingleton.singleton.AddErrorLog("level reward is nil", null, null, null, null, null); + } + } + else + { + bool flag7 = type == GCFReqType.GCF_JOIN_FIGHT_SCENE; + if (flag7) + { + } + } + } + } + } + + public void SendGCFReadysInfo() + { + RpcC2M_GCFReadysInfoReq rpc = new RpcC2M_GCFReadysInfoReq(); + XSingleton.singleton.Send(rpc); + } + + public void RespGCFReadysInfo(GCFReadyInfoRes ores) + { + this.ready_lefttime = ores.lefttime; + bool flag = DlgBase.singleton.IsVisible() && !XSingleton.singleton.isOpen && this.ready_lefttime > 0u; + if (flag) + { + DlgBase.singleton.SetLeftTime(this.ready_lefttime, -1); + } + XSingleton.singleton.UpdateInfo(ores.allinfo); + } + + public void SendGFCFightInfo() + { + RpcC2M_GCFFightInfoReqC2M rpc = new RpcC2M_GCFFightInfoReqC2M(); + XSingleton.singleton.Send(rpc); + } + + public void RespGCFFightInfo(GCFFightInfoRes res) + { + this.fight_lefttime = res.lefttime; + bool flag = DlgBase.singleton.IsVisible() && XSingleton.singleton.isOpen && this.fight_lefttime > 0u; + if (flag) + { + DlgBase.singleton.SetLeftTime(this.fight_lefttime, -1); + } + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + this.guilds.Clear(); + for (int i = 0; i < res.guilds.Count; i++) + { + GCFGuild gcfguild = new GCFGuild(); + gcfguild.brief = res.guilds[i]; + gcfguild.groupScore = this.GetGroupPoint(res.guilds, gcfguild.brief.group); + gcfguild.isPartern = (res.guilds[i].group == res.mygroup); + bool flag2 = gcfguild.brief.guildid == specificDocument.UID; + if (flag2) + { + this.myPostion = gcfguild.isPartern; + } + this.guilds.Add(gcfguild); + } + this.jvdians = res.JvDians; + this.guilds.Sort(new Comparison(this.SortGuildsInfo)); + GuildBattleMiniRankHandler miniRankHandler = DlgBase.singleton.m_miniRankHandler; + bool flag3 = miniRankHandler != null; + if (flag3) + { + miniRankHandler.RefreshAll(); + } + this.CheckJvDianState(); + GuildMiniReportHandler miniReportHandler = DlgBase.singleton.m_miniReportHandler; + bool flag4 = miniReportHandler != null; + if (flag4) + { + miniReportHandler.RefreshMyInfo(res.myinfo); + } + } + + private uint GetGroupPoint(List guilds, int group) + { + uint num = 0u; + for (int i = 0; i < guilds.Count; i++) + { + bool flag = guilds[i].group == group; + if (flag) + { + num += guilds[i].point; + } + } + return num; + } + + private int SortGuildsInfo(GCFGuild x, GCFGuild y) + { + bool flag = x.groupScore != y.groupScore; + int result; + if (flag) + { + result = (int)(y.groupScore - x.groupScore); + } + else + { + result = (int)(y.brief.point - x.brief.point); + } + return result; + } + + public void OnFeatsChange(uint feat) + { + this.feats = feat; + } + + public void OnZhanLingNotify(GCFZhanLingPara data) + { + GCFZhanLingType zltype = data.zltype; + XEntity entity = XSingleton.singleton.GetEntity(data.roleID); + bool flag = entity == null || entity.Attributes == null; + if (!flag) + { + XTerritoryComponent xterritoryComponent = entity.GetXComponent(XTerritoryComponent.uuID) as XTerritoryComponent; + bool flag2 = zltype == GCFZhanLingType.GCFZL_BEGIN; + if (flag2) + { + xterritoryComponent.ToStart(); + } + else + { + bool flag3 = zltype == GCFZhanLingType.GCFZL_BREAK; + if (flag3) + { + xterritoryComponent.Interupt(); + } + else + { + bool flag4 = zltype == GCFZhanLingType.GCFZL_END; + if (flag4) + { + xterritoryComponent.Success(); + } + } + } + } + } + + public void ModifyMinimapState(GCFJvDianType type1, int index2) + { + int num = XFastEnumIntEqualityComparer.ToInt(type1); + Vector3 pos = this.fxJvPos[num - 1]; + string fx = this.fxs[index2]; + bool flag = type1 == GCFJvDianType.GCF_JUDIAN_UP; + if (flag) + { + XBattleDocument.DelMiniMapFx(this.maptoken[0]); + this.maptoken[0] = XBattleDocument.AddMiniMapFx(pos, fx); + } + else + { + bool flag2 = type1 == GCFJvDianType.GCF_JUDIAN_MID; + if (flag2) + { + XBattleDocument.DelMiniMapFx(this.maptoken[1]); + this.maptoken[1] = XBattleDocument.AddMiniMapFx(pos, fx); + } + else + { + XBattleDocument.DelMiniMapFx(this.maptoken[2]); + this.maptoken[2] = XBattleDocument.AddMiniMapFx(pos, fx); + } + } + } + + public void OnGCFSynG2CNtf(GCFG2CSynPara data) + { + GuildMiniReportHandler miniReportHandler = DlgBase.singleton.m_miniReportHandler; + bool flag = miniReportHandler != null; + if (flag) + { + miniReportHandler.Push(data.type, data); + } + bool flag2 = data.type == GCFG2CSynType.GCF_G2C_SYN_KILL_COUNT; + if (flag2) + { + XEntity entity = XSingleton.singleton.GetEntity(data.roleid); + bool flag3 = entity != null; + if (flag3) + { + bool flag4 = entity.BillBoard != null; + if (flag4) + { + entity.BillBoard.OnFightDesignationInfoChange(data.killcount); + } + } + } + } + + public void ReceiveBattleSkill(PvpBattleKill battleSkillInfo) + { + bool flag = XSingleton.singleton.SceneType != SceneType.SCENE_CASTLE_FIGHT; + if (!flag) + { + GVGBattleSkill gvgbattleSkill = new GVGBattleSkill(); + gvgbattleSkill.killerID = battleSkillInfo.killID; + gvgbattleSkill.deadID = battleSkillInfo.deadID; + gvgbattleSkill.contiKillCount = battleSkillInfo.contiKillCount; + XEntity entityConsiderDeath = XSingleton.singleton.GetEntityConsiderDeath(gvgbattleSkill.killerID); + XEntity entityConsiderDeath2 = XSingleton.singleton.GetEntityConsiderDeath(gvgbattleSkill.deadID); + bool flag2 = entityConsiderDeath == null || entityConsiderDeath2 == null; + if (flag2) + { + XSingleton.singleton.AddErrorLog("entity id: " + gvgbattleSkill.killerID, " dead id: " + gvgbattleSkill.deadID, null, null, null, null); + } + else + { + gvgbattleSkill.killerName = entityConsiderDeath.Name; + gvgbattleSkill.deadName = entityConsiderDeath2.Name; + bool flag3 = XSingleton.singleton.IsAlly(entityConsiderDeath); + gvgbattleSkill.killerPosition = (this.myPostion ? flag3 : (!flag3)); + DlgBase.singleton.AddBattleSkill(gvgbattleSkill); + XSingleton.singleton.AddGreenLog(string.Format("ReceiveBattleSkill:{0} --- ,{1} ,.... {2}", gvgbattleSkill.killerName, gvgbattleSkill.deadName, gvgbattleSkill.contiKillCount), null, null, null, null, null); + } + } + } + + private void CheckJvDianState() + { + bool flag = XSingleton.singleton.SceneType == SceneType.SCENE_CASTLE_FIGHT; + if (flag) + { + for (int i = 0; i < this.jvdians.Count; i++) + { + bool flag2 = string.IsNullOrEmpty(this.jvdians[i].guildname); + if (flag2) + { + this.ActiveJvDian(this.jvdians[i].type, 0); + this.ModifyMinimapState(this.jvdians[i].type, 0); + } + else + { + this.ActiveJvDian(this.jvdians[i].type, this.IsPartener(this.jvdians[i].guildname) ? 2 : 1); + this.ModifyMinimapState(this.jvdians[i].type, this.IsPartener(this.jvdians[i].guildname) ? 1 : 2); + } + } + } + } + + private bool IsPartener(string guildname) + { + for (int i = 0; i < this.guilds.Count; i++) + { + bool flag = this.guilds[i].brief.guildname == guildname; + if (flag) + { + return this.guilds[i].isPartern; + } + } + return false; + } + + public void OnAddBuff(ulong roleID, uint doodadID) + { + BuffTable.RowData buffData = XSingleton.singleton.GetBuffData((int)doodadID, 1); + string text = string.Empty; + bool flag = buffData == null; + if (flag) + { + XSingleton.singleton.AddErrorLog(string.Format("GuildTerritory: Buff data not found: [{0} {1}]", doodadID, 1), null, null, null, null, null); + } + else + { + text = buffData.BuffName; + } + XEntity entity = XSingleton.singleton.GetEntity(roleID); + bool flag2 = entity == null; + if (flag2) + { + XSingleton.singleton.AddWarningLog("entity is null", null, null, null, null, null); + } + else + { + string name = entity.Name; + StringBuilder stringBuilder = new StringBuilder(); + bool flag3 = false; + for (int i = 0; i < text.Length; i++) + { + bool flag4 = text[i] == '['; + if (flag4) + { + flag3 = true; + } + bool flag5 = text[i] == ')'; + if (flag5) + { + flag3 = false; + } + bool flag6 = flag3; + if (flag6) + { + stringBuilder.Append(text[i]); + } + bool flag7 = text[i] == '('; + if (flag7) + { + flag3 = true; + } + bool flag8 = text[i] == ']'; + if (flag8) + { + flag3 = false; + } + } + this.AddBuffInfo(name, stringBuilder.ToString()); + } + } + + private void AddBuffInfo(string left, string right) + { + this.lastShowInfoTime = Time.time; + XBattleCaptainPVPDocument.KillInfo item = default(XBattleCaptainPVPDocument.KillInfo); + item.KillName = left; + item.DeadName = right; + this.qInfo.Enqueue(item); + bool flag = (long)this.qInfo.Count > (long)((ulong)XGuildTerritoryDocument.GAME_INFO); + if (flag) + { + this.qInfo.Dequeue(); + } + bool flag2 = DlgBase.singleton.IsVisible() && DlgBase.singleton.m_miniReportHandler != null; + if (flag2) + { + DlgBase.singleton.m_miniReportHandler.ShowBuffs(); + } + } + + public void OnClickTerritoryIcon() + { + XGuildTerritoryDocument.GuildTerritoryStyle territoryStyle = this.TerritoryStyle; + if (territoryStyle != XGuildTerritoryDocument.GuildTerritoryStyle.INFORM) + { + if (territoryStyle == XGuildTerritoryDocument.GuildTerritoryStyle.ACTIVITY) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + else + { + this.TerritoryStyle = XGuildTerritoryDocument.GuildTerritoryStyle.NONE; + XSingleton.singleton.ShowModalDialog(XStringDefineProxy.GetString("NOTICE_TERRITORY_STRING"), XStringDefineProxy.GetString("NOTICE_TERRITORY_STRING_GO"), XStringDefineProxy.GetString("NOTICE_TERRITORY_STRING_ENSURE"), new ButtonClickEventHandler(this.OnInformClick)); + } + } + + private bool OnInformClick(IXUIButton btn) + { + XSingleton.singleton.CloseModalDlg(); + DlgBase.singleton.SetVisibleWithAnimation(true, null); + return false; + } + + public bool TryTerritoryAlliance(uint terriroryID, out int messageID) + { + bool result = false; + messageID = 0; + bool flag = terriroryID == this.SelfGuildTerritoryID; + if (flag) + { + messageID = 4; + } + else + { + uint targetTerrioryType = this.GetTargetTerrioryType(terriroryID); + uint targetTerrioryType2 = this.GetTargetTerrioryType(this.SelfGuildTerritoryID); + bool flag2 = targetTerrioryType == 0u; + if (flag2) + { + messageID = 0; + } + int num = (int)(targetTerrioryType - targetTerrioryType2); + bool flag3 = num > 1; + if (flag3) + { + bool flag4 = targetTerrioryType == 3u; + if (flag4) + { + messageID = 2; + } + else + { + bool flag5 = targetTerrioryType == 2u; + if (flag5) + { + messageID = 1; + } + } + } + else + { + bool flag6 = num < 1; + if (flag6) + { + bool flag7 = targetTerrioryType2 == 3u; + if (flag7) + { + messageID = 5; + } + else + { + messageID = 3; + } + } + else + { + result = true; + } + } + } + return result; + } + + public uint GetTargetTerrioryType(uint cityID) + { + uint result = 0u; + bool flag = cityID > 0u; + if (flag) + { + TerritoryBattle.RowData byID = XGuildTerritoryDocument.mGuildTerritoryList.GetByID(cityID); + bool flag2 = byID != null; + if (flag2) + { + result = byID.territorylevel; + } + } + return result; + } + + public bool TryGetCityData(uint cityID, out CityData data) + { + return this.mCityDataDic.TryGetValue(cityID, out data); + } + + public void SendGuildTerritoryCityInfo() + { + RpcC2M_ReqGuildTerrCityInfo rpc = new RpcC2M_ReqGuildTerrCityInfo(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveGuildTerritoryCityInfo(ReqGuildTerrCityInfo res) + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + this.CurrentType = res.type; + this.SelfTargetTerritoryID = res.targetid; + this.SelfGuildTerritoryID = 0u; + this.SelfAllianceID = res.allianceId; + this.mCityDataList.Clear(); + XSingleton.singleton.AddGreenLog("ReceiveGuildTerritoryCityInfo:", this.CurrentType.ToString(), res.targetid.ToString(), res.cityinfo.Count.ToString(), null, null); + int i = 0; + int count = res.cityinfo.Count; + while (i < count) + { + bool flag = this.mCityDataDic.ContainsKey(res.cityinfo[i].id); + if (flag) + { + this.mCityDataDic[res.cityinfo[i].id] = res.cityinfo[i]; + } + else + { + this.mCityDataDic.Add(res.cityinfo[i].id, res.cityinfo[i]); + } + bool flag2 = res.cityinfo[i].guildid > 0UL; + if (flag2) + { + this.mCityDataList.Add(res.cityinfo[i]); + } + bool flag3 = specificDocument.BasicData.uid == res.cityinfo[i].guildid; + if (flag3) + { + this.SelfGuildTerritoryID = res.cityinfo[i].id; + } + i++; + } + this.mCityDataList.Sort(new Comparison(this.CompareCityData)); + bool flag4 = DlgBase.singleton.IsVisible(); + if (flag4) + { + DlgBase.singleton.RefreshData(); + } + } + + public void SetGuildTerritoryCityInfo(uint cityID, ulong guildID) + { + this.RefreshGuildTerritoryInfo(); + } + + private int CompareCityData(CityData city1, CityData city2) + { + return (int)(city2.id - city1.id); + } + + public void RefreshGuildTerritoryInfo() + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + this.SendGuildTerritoryCityInfo(); + } + bool flag2 = DlgBase.singleton.IsVisible(); + if (flag2) + { + this.SendGuildTerritoryChallInfo(this.CurrentTerritoryID); + } + } + + public void SendGuildTerritoryChallInfo(uint uid) + { + bool flag = uid == 0u; + if (!flag) + { + RpcC2M_ReqGuildTerrChallInfo rpcC2M_ReqGuildTerrChallInfo = new RpcC2M_ReqGuildTerrChallInfo(); + rpcC2M_ReqGuildTerrChallInfo.oArg.id = uid; + this.CurrentTerritoryID = uid; + XSingleton.singleton.Send(rpcC2M_ReqGuildTerrChallInfo); + } + } + + public void ReceiveGuildTerritoryChallInfo(ReqGuildTerrChallInfoArg arg, ReqGuildTerrChallInfoRes res) + { + XSingleton.singleton.AddGreenLog("ReceiveGuildTerritoryChallInfo:", res.challinfo.Count.ToString(), null, null, null, null); + this.mGuildTerrChall.Clear(); + this.mGuildTerrChall.AddRange(res.challinfo); + this.mGuildTerritoryAllianceList.Clear(); + this.EnterBattleTime = res.cdtime; + Dictionary dictionary = new Dictionary(); + int i = 0; + int count = res.challinfo.Count; + while (i < count) + { + bool flag = dictionary.ContainsKey(res.challinfo[i].allianceid); + if (flag) + { + dictionary[res.challinfo[i].allianceid].Add(res.challinfo[i]); + } + else + { + bool flag2 = !dictionary.ContainsKey(res.challinfo[i].guildid); + if (flag2) + { + GuildTerritoryAllianceInfo guildTerritoryAllianceInfo = new GuildTerritoryAllianceInfo(); + guildTerritoryAllianceInfo.Set(res.challinfo[i]); + dictionary.Add(res.challinfo[i].guildid, guildTerritoryAllianceInfo); + } + } + i++; + } + this.mGuildTerritoryAllianceList.AddRange(dictionary.Values); + bool flag3 = this.CurrentTerritoryID > 0u; + if (flag3) + { + bool flag4 = DlgBase.singleton.IsVisible(); + if (flag4) + { + DlgBase.singleton.RefreshWhenShow(); + } + else + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + } + + public void SendReceiveTerritroyInfo() + { + RpcC2M_ReqGuildTerrIntellInfo rpc = new RpcC2M_ReqGuildTerrIntellInfo(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveTerritoryInterllInfo(ReqGuildTerrIntellInfoRes oRes) + { + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetNewInfo(oRes.intellInfo); + } + } + + public bool TryGetTerritoryGuildName(ulong guildid, out string guildName) + { + guildName = string.Empty; + int i = 0; + int count = this.mGuildTerrChall.Count; + while (i < count) + { + bool flag = this.mGuildTerrChall[i].guildid == guildid; + if (flag) + { + guildName = this.mGuildTerrChall[i].guildname; + return true; + } + i++; + } + return false; + } + + public void SendGuildTerrAllianceInfo() + { + RpcC2M_ReqGuildTerrAllianceInfo rpc = new RpcC2M_ReqGuildTerrAllianceInfo(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveGuildTerrAllianceInfo(ReqGuildTerrAllianceInfoRes res) + { + this.Allianceid = res.allianceid; + this.guildAllianceInfos = res.allianceinfo; + DlgBase.singleton.RefreshData(); + } + + public void SendAllianceGuildTerr(uint territoryID) + { + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag = specificDocument.Position == GuildPosition.GPOS_LEADER || specificDocument.Position == GuildPosition.GPOS_VICELEADER; + if (flag) + { + RpcC2M_AllianceGuildTerr rpcC2M_AllianceGuildTerr = new RpcC2M_AllianceGuildTerr(); + rpcC2M_AllianceGuildTerr.oArg.id = territoryID; + XSingleton.singleton.Send(rpcC2M_AllianceGuildTerr); + } + else + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_TB_DECLEAR_NO_PERMISSON"), "fece00"); + } + } + + public void ReceiveAllianceGuildTerr(AllianceGuildTerrArg arg, AllianceGuildTerrRes res) + { + bool flag = res.errorcod > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(res.errorcod, "fece00"); + bool flag2 = res.errorcod == ErrorCode.ERR_DECLAREWAR_OUT_TIME; + if (flag2) + { + this.RefreshGuildTerritoryInfo(); + } + } + else + { + this.RefreshGuildTerritoryInfo(); + } + } + + public void SendTryAlliance(ulong guildID) + { + XSingleton.singleton.AddGreenLog("SendTryAlliance", guildID.ToString(), null, null, null, null); + RpcC2M_TryAlliance rpcC2M_TryAlliance = new RpcC2M_TryAlliance(); + rpcC2M_TryAlliance.oArg.guild = guildID; + XSingleton.singleton.Send(rpcC2M_TryAlliance); + } + + public void ReceiveTryAlliance(TryAllianceArg arg, TryAlliance res) + { + XSingleton.singleton.AddGreenLog("ReceiveTryAlliance", null, null, null, null, null); + bool flag = res.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(res.errorcode, "fece00"); + } + else + { + this.SendGuildTerritoryChallInfo(this.CurrentTerritoryID); + } + } + + public void SendRecAlliance(ulong guildID) + { + RpcC2M_RecAlliance rpcC2M_RecAlliance = new RpcC2M_RecAlliance(); + rpcC2M_RecAlliance.oArg.guildid = guildID; + XSingleton.singleton.Send(rpcC2M_RecAlliance); + } + + public void ReceiveRecAlliance(RecAllianceArg arg, RecAllianceRes res) + { + bool flag = res.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(res.errorcode, "fece00"); + } + else + { + this.bHavaTerritoryRecCount = 0u; + DlgBase.singleton.SetVisibleWithAnimation(false, null); + } + } + + public void SendClearGuildTerrAlliance() + { + RpcC2M_ClearGuildTerrAlliance rpc = new RpcC2M_ClearGuildTerrAlliance(); + XSingleton.singleton.Send(rpc); + } + + public void ReceiveClearGuildTerrAlliance(ClearGuildTerrAllianceRes res) + { + bool flag = res.errorcode > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(res.errorcode, "fece00"); + } + else + { + this.bHavaTerritoryRecCount = 0u; + DlgBase.singleton.SetVisibleWithAnimation(false, null); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildTerritoryDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildTerritoryDocument.cs.meta new file mode 100644 index 00000000..153fe97e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildTerritoryDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8fa2df8e10fc42046812629fdee8444e +timeCreated: 1611404135 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildViewDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildViewDocument.cs new file mode 100644 index 00000000..9ff9a979 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildViewDocument.cs @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildViewDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildViewDocument.uuID; + } + } + + public XGuildViewView GuildViewView { get; set; } + + public List MemberList + { + get + { + return this.m_MemberList; + } + } + + public XGuildBasicData BasicData + { + get + { + return this.m_BasicData; + } + } + + public GuildApproveSetting ApproveSetting + { + get + { + return this._ApproveSetting; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("GuildViewDocument"); + + private List m_MemberList = new List(); + + private XGuildBasicData m_BasicData = new XGuildBasicData(); + + private GuildApproveSetting _ApproveSetting = new GuildApproveSetting(); + + public void View(XGuildBasicData basicData) + { + this.m_BasicData = basicData; + this.ReqInfo(basicData.uid); + bool flag = !DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + + public void View(ulong id) + { + this.m_BasicData.uid = id; + this.ReqInfo(this.m_BasicData.uid); + bool flag = !DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.SetVisibleWithAnimation(true, null); + } + } + + public void ReqInfo(ulong uid) + { + RpcC2M_AskGuildBriefInfo rpcC2M_AskGuildBriefInfo = new RpcC2M_AskGuildBriefInfo(); + rpcC2M_AskGuildBriefInfo.oArg.guildid = uid; + XSingleton.singleton.Send(rpcC2M_AskGuildBriefInfo); + RpcC2M_AskGuildMembers rpcC2M_AskGuildMembers = new RpcC2M_AskGuildMembers(); + rpcC2M_AskGuildMembers.oArg.guildid = uid; + XSingleton.singleton.Send(rpcC2M_AskGuildMembers); + } + + public void OnGuildBrief(GuildBriefRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + this.m_BasicData.Init(oRes); + this.ApproveSetting.autoApprove = (oRes.needApproval == 0); + this.ApproveSetting.PPT = (int)oRes.recuritppt; + bool flag2 = this.GuildViewView != null && this.GuildViewView.IsVisible(); + if (flag2) + { + this.GuildViewView.RefreshBasicInfo(); + } + } + } + + public void onGetMemberList(GuildMemberRes oRes) + { + bool flag = oRes.result > ErrorCode.ERR_SUCCESS; + if (flag) + { + XSingleton.singleton.ShowSystemTip(oRes.result, "fece00"); + } + else + { + int num = oRes.members.Count - this.m_MemberList.Count; + for (int i = 0; i < num; i++) + { + XGuildMemberBasicInfo item = new XGuildMemberBasicInfo(); + this.m_MemberList.Add(item); + } + bool flag2 = num < 0; + if (flag2) + { + this.m_MemberList.RemoveRange(this.m_MemberList.Count + num, -num); + } + for (int j = 0; j < oRes.members.Count; j++) + { + XGuildMemberBasicInfo xguildMemberBasicInfo = this.m_MemberList[j]; + GuildMemberData guildMemberData = oRes.members[j]; + xguildMemberBasicInfo.uid = guildMemberData.roleid; + xguildMemberBasicInfo.name = guildMemberData.name; + xguildMemberBasicInfo.position = (GuildPosition)guildMemberData.position; + xguildMemberBasicInfo.profession = XFastEnumIntEqualityComparer.ToInt(guildMemberData.profession); + xguildMemberBasicInfo.level = guildMemberData.level; + xguildMemberBasicInfo.ppt = guildMemberData.ppt; + xguildMemberBasicInfo.time = (int)guildMemberData.lastlogin; + } + bool flag3 = this.GuildViewView != null && this.GuildViewView.IsVisible(); + if (flag3) + { + this.GuildViewView.RefreshMembers(); + } + } + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + bool flag = this.GuildViewView != null && this.GuildViewView.IsVisible(); + if (flag) + { + this.ReqInfo(this.m_BasicData.uid); + } + } + + public static void OnGuildHyperLinkClick(string param) + { + ulong id = ulong.Parse(param); + XGuildViewDocument specificDocument = XDocuments.GetSpecificDocument(XGuildViewDocument.uuID); + specificDocument.View(id); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildViewDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildViewDocument.cs.meta new file mode 100644 index 00000000..1cbe500f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildViewDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2c0f9c23f5d991448b6f1029ecc7a7e8 +timeCreated: 1611403501 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyBehavior.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyBehavior.cs new file mode 100644 index 00000000..c0d1d61d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyBehavior.cs @@ -0,0 +1,108 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildWeeklyBountyBehavior : DlgBehaviourBase + { + public XUIPool BountyItemPool = new XUIPool(XSingleton.singleton.m_uiTool); + + public Transform BountyListTrans; + + public IXUILabel TaskDecLabel; + + public IXUILabel GetLabel; + + public Transform RewardsParentTrans; + + public IXUIButton CloseBtn; + + public IXUIButton RefreshBtn; + + public IXUIButton HelpBtn; + + public IXUIButton CommitBtn; + + public IXUIButton GetBtn; + + public Transform ChestX; + + public IXUILabel ChestXExpLabel; + + public IXUILabel DragonCoinCostLabel; + + public IXUILabel WeeklyAskLabel; + + public IXUILabel CommitLabel; + + public IXUILabel HelpBtnLabel; + + public IXUILabel LeftTimeLabel; + + public IXUILabel CurrentValueLabel; + + public IXUILabel SingleTaskBountyLabel; + + public IXUILabel ProgressLabel; + + public IXUIScrollView BountyListScrollView; + + public IXUIButton AboutBtn; + + public GameObject FreeLabelObj; + + public Transform MailRoot; + + public Transform effectRoot; + + public IXUISprite MailCloseSprite; + + public IXUIWrapContent MailWrapContent; + + public IXUIScrollView MailScrollView; + + public IXUIButton SendGrateFulBtn; + + public GameObject CommitBtnRedpoint; + + public GameObject RightItem; + + private void Awake() + { + this.AboutBtn = (base.transform.Find("Help").GetComponent("XUIButton") as IXUIButton); + this.BountyListTrans = base.transform.Find("BountyList"); + this.BountyItemPool.SetupPool(this.BountyListTrans.gameObject, this.BountyListTrans.Find("BountyItem").gameObject, 12u, false); + this.TaskDecLabel = (base.transform.Find("Text/TaskDec").GetComponent("XUILabel") as IXUILabel); + this.GetLabel = (base.transform.transform.Find("GetBtn/GetLabel").GetComponent("XUILabel") as IXUILabel); + this.RewardsParentTrans = base.transform.Find("TaskRewards"); + this.CloseBtn = (base.transform.Find("Close").GetComponent("XUIButton") as IXUIButton); + this.RefreshBtn = (base.transform.Find("RefreshBtn").GetComponent("XUIButton") as IXUIButton); + this.HelpBtn = (base.transform.Find("ReqHelp").GetComponent("XUIButton") as IXUIButton); + this.CommitBtn = (base.transform.Find("CommitBtn").GetComponent("XUIButton") as IXUIButton); + this.CommitBtnRedpoint = base.transform.Find("CommitBtn/RedPoint").gameObject; + this.GetBtn = (base.transform.Find("GetBtn").GetComponent("XUIButton") as IXUIButton); + this.ChestX = base.transform.transform.Find("ChestX"); + this.ChestXExpLabel = (this.ChestX.Find("Exp").GetComponent("XUILabel") as IXUILabel); + this.FreeLabelObj = base.transform.Find("RefreshBtn/FreeLabel").gameObject; + this.DragonCoinCostLabel = (base.transform.Find("RefreshBtn/godLabel").GetComponent("XUILabel") as IXUILabel); + this.WeeklyAskLabel = (base.transform.Find("AskTimesLabel").GetComponent("XUILabel") as IXUILabel); + this.CommitLabel = (base.transform.Find("CommitBtn/T").GetComponent("XUILabel") as IXUILabel); + this.HelpBtnLabel = (base.transform.Find("ReqHelp/GetLabel").GetComponent("XUILabel") as IXUILabel); + this.LeftTimeLabel = (base.transform.Find("LeftTimeLabel").GetComponent("XUILabel") as IXUILabel); + this.CurrentValueLabel = (base.transform.Find("CurrentOwnedNum").GetComponent("XUILabel") as IXUILabel); + this.SingleTaskBountyLabel = (base.transform.Find("SingleTaskBountyValue").GetComponent("XUILabel") as IXUILabel); + this.ProgressLabel = (base.transform.Find("SingleTaskBountyValue/t").GetComponent("XUILabel") as IXUILabel); + this.MailRoot = base.transform.Find("mail"); + this.MailCloseSprite = (this.MailRoot.Find("Bg/Black").GetComponent("XUISprite") as IXUISprite); + this.MailWrapContent = (this.MailRoot.Find("MailDlg/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent); + this.MailScrollView = (this.MailRoot.Find("MailDlg").GetComponent("XUIScrollView") as IXUIScrollView); + this.SendGrateFulBtn = (this.MailRoot.Find("OK").GetComponent("XUIButton") as IXUIButton); + this.BountyListScrollView = (this.BountyListTrans.GetComponent("XUIScrollView") as IXUIScrollView); + this.RightItem = base.transform.Find("RightItem").gameObject; + this.effectRoot = base.transform.Find("EffectPanel/Effect"); + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyBehavior.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyBehavior.cs.meta new file mode 100644 index 00000000..c4cf5e66 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyBehavior.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 23ea9b775833e084ca4e9e0feae0f417 +timeCreated: 1611403458 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyDocument.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyDocument.cs new file mode 100644 index 00000000..28994f9f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyDocument.cs @@ -0,0 +1,577 @@ +using System; +using System.Collections.Generic; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildWeeklyBountyDocument : XDocComponent + { + public override uint ID + { + get + { + return XGuildWeeklyBountyDocument.uuID; + } + } + + public static XGuildWeeklyBountyDocument Doc + { + get + { + return XSingleton.singleton.Doc.GetXComponent(XGuildWeeklyBountyDocument.uuID) as XGuildWeeklyBountyDocument; + } + } + + public List CurGuildWeeklyTaskList + { + get + { + return this._curGuildWeeklyTaskList; + } + } + + public List RewardedBoxList + { + get + { + return this._rewardedBoxList; + } + } + + public uint WeeklyScore + { + get + { + return this._weeklyScore; + } + } + + public uint WeeklyAskedHelpNum + { + get + { + return this._weeklyAskedHelpNum; + } + } + + public List ChestValueList + { + get + { + return this._chestValueList; + } + } + + public List TaskHelpInfoList + { + get + { + return this._taskHelpInfoList; + } + } + + public double ActivityLeftTime + { + get + { + return this._activityLeftTime; + } + set + { + this._activityLeftTime = value; + } + } + + public uint RemainedFreshTimes + { + get + { + return this._remainedFreshTimes; + } + } + + public new static readonly uint uuID = XSingleton.singleton.XHash("XGuildWeeklyBountyDocument"); + + public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader(); + + private uint _weeklyScore; + + private uint _weeklyAskedHelpNum; + + private uint _taskRoleLevel = 0u; + + private List _rewardedBoxList = new List(); + + private List _curGuildWeeklyTaskList = new List(); + + private Dictionary> _guildTaskRewardWithMap = new Dictionary>(); + + private List _chestValueList = new List(); + + private List _taskHelpInfoList = new List(); + + private double _activityLeftTime = 0.0; + + private uint _remainedFreshTimes = 0u; + + public static void Execute(OnLoadedCallback callback = null) + { + XGuildWeeklyBountyDocument.AsyncLoader.Execute(callback); + } + + public override void OnAttachToHost(XObject host) + { + base.OnAttachToHost(host); + } + + protected override void EventSubscribe() + { + base.EventSubscribe(); + } + + public override void OnDetachFromHost() + { + base.OnDetachFromHost(); + } + + protected override void OnReconnected(XReconnectedEventArgs arg) + { + } + + public override void OnEnterSceneFinally() + { + base.OnEnterSceneFinally(); + } + + public void SendGetWeeklyTaskInfo() + { + RpcC2G_GetWeeklyTaskInfo rpc = new RpcC2G_GetWeeklyTaskInfo(); + XSingleton.singleton.Send(rpc); + } + + public void OnGetWeeklyTaskInfo(GetWeeklyTaskInfoRes oRes) + { + this._weeklyScore = oRes.score; + this._weeklyAskedHelpNum = oRes.askhelp_num; + this._rewardedBoxList = oRes.rewarded_box; + this._taskHelpInfoList = oRes.helpinfo; + this._taskRoleLevel = oRes.accept_level; + this._activityLeftTime = oRes.lefttime; + this._remainedFreshTimes = oRes.remain_free_refresh_count; + this.UpdateTaskContent(oRes.task); + this.ResetRewardsMap(); + bool flag = DlgBase.singleton.IsVisible(); + if (flag) + { + DlgBase.singleton.RefreshUI(); + } + } + + public bool HasFinishWeeklyTasks() + { + return this.IsAllBoxsReward() && this.IsAllTaskFinished(); + } + + public void SendToGetWeeklyTaskReward(uint type, uint value) + { + RpcC2G_GetWeeklyTaskReward rpcC2G_GetWeeklyTaskReward = new RpcC2G_GetWeeklyTaskReward(); + rpcC2G_GetWeeklyTaskReward.oArg.type = type; + rpcC2G_GetWeeklyTaskReward.oArg.value = value; + XSingleton.singleton.Send(rpcC2G_GetWeeklyTaskReward); + } + + public void OnGetWeeklyTaskReward(GetWeeklyTaskRewardArg oArg, GetWeeklyTaskRewardRes oRes) + { + bool flag = oArg.type == 1u && (ulong)oArg.value < (ulong)((long)this._curGuildWeeklyTaskList.Count); + if (flag) + { + this._weeklyScore = oRes.score; + for (int i = 0; i < this._curGuildWeeklyTaskList.Count; i++) + { + GuildWeeklyTaskInfo guildWeeklyTaskInfo = this._curGuildWeeklyTaskList[i]; + bool flag2 = guildWeeklyTaskInfo.originIndex == oArg.value; + if (flag2) + { + guildWeeklyTaskInfo.isRewarded = true; + break; + } + } + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshTaskList(false); + DlgBase.singleton.RefreshChestList(); + DlgBase.singleton.PlayCompleteEffect(); + } + } + else + { + bool flag4 = oArg.type == 2u; + if (flag4) + { + bool flag5 = !this._rewardedBoxList.Contains(oArg.value); + if (flag5) + { + this._rewardedBoxList.Add(oArg.value); + } + bool flag6 = DlgBase.singleton.IsVisible(); + if (flag6) + { + DlgBase.singleton.RefreshChestList(); + } + } + } + } + + private bool IsAllBoxsReward() + { + List chestValueList = XGuildWeeklyBountyDocument.Doc.ChestValueList; + for (int i = 0; i < chestValueList.Count; i++) + { + bool flag = !this.RewardedBoxList.Contains(chestValueList[i]); + if (flag) + { + return false; + } + } + return true; + } + + private bool IsAllTaskFinished() + { + for (int i = 0; i < this._curGuildWeeklyTaskList.Count; i++) + { + bool flag = !this._curGuildWeeklyTaskList[i].isRewarded; + if (flag) + { + return false; + } + } + return true; + } + + private void UpdateTaskContent(List task) + { + this.CurGuildWeeklyTaskList.Clear(); + for (int i = 0; i < task.Count; i++) + { + WeeklyTaskInfo weeklyTaskInfo = task[i]; + this.CurGuildWeeklyTaskList.Add(new GuildWeeklyTaskInfo + { + taskID = weeklyTaskInfo.id, + step = weeklyTaskInfo.step, + isRewarded = weeklyTaskInfo.is_rewarded, + hasAsked = weeklyTaskInfo.ask_help, + refreshedCount = weeklyTaskInfo.refresh_count, + originIndex = weeklyTaskInfo.index, + category = WeeklyTaskCategory.None + }); + } + this._curGuildWeeklyTaskList.Sort(new Comparison(this.SortWeeklyTaskList)); + } + + private int SortWeeklyTaskList(GuildWeeklyTaskInfo x, GuildWeeklyTaskInfo y) + { + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(x.taskID); + DailyTask.RowData dailyTaskTableInfoByID2 = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(y.taskID); + bool flag = dailyTaskTableInfoByID != null && dailyTaskTableInfoByID2 != null; + if (flag) + { + bool flag2 = x.isRewarded ^ y.isRewarded; + if (flag2) + { + bool isRewarded = x.isRewarded; + if (isRewarded) + { + return 1; + } + bool isRewarded2 = y.isRewarded; + if (isRewarded2) + { + return -1; + } + } + else + { + bool flag3 = !x.isRewarded && x.step >= dailyTaskTableInfoByID.conditionNum; + bool flag4 = !y.isRewarded && y.step >= dailyTaskTableInfoByID2.conditionNum; + bool flag5 = flag3 ^ flag4; + if (flag5) + { + bool flag6 = flag3; + if (flag6) + { + return -1; + } + bool flag7 = flag4; + if (flag7) + { + return 1; + } + } + else + { + bool flag8 = dailyTaskTableInfoByID.taskquality != dailyTaskTableInfoByID2.taskquality; + if (flag8) + { + return (int)(dailyTaskTableInfoByID2.taskquality - dailyTaskTableInfoByID.taskquality); + } + } + } + } + return (int)(x.taskID - y.taskID); + } + + private void ResetRewardsMap() + { + this._guildTaskRewardWithMap.Clear(); + this._chestValueList.Clear(); + for (int i = 0; i < XGuildDailyTaskDocument.DailyTaskRewardTable.Table.Length; i++) + { + DailyTaskReward.RowData rowData = XGuildDailyTaskDocument.DailyTaskRewardTable.Table[i]; + uint num = rowData.level[0]; + uint num2 = rowData.level[1]; + bool flag = this._taskRoleLevel >= num && this._taskRoleLevel <= num2; + if (flag) + { + uint mappingValueWithQualityAndType = XGuildDailyTaskDocument.GetMappingValueWithQualityAndType((GuildTaskType)rowData.category, rowData.tasktype, rowData.taskquality); + bool flag2 = rowData.category == 2u && !this._guildTaskRewardWithMap.ContainsKey(mappingValueWithQualityAndType); + if (flag2) + { + this._guildTaskRewardWithMap.Add(mappingValueWithQualityAndType, new List()); + for (int j = 0; j < rowData.taskreward.Count; j++) + { + this._guildTaskRewardWithMap[mappingValueWithQualityAndType].Add(new GuildTaskReward + { + itemID = rowData.taskreward[j, 0], + count = rowData.taskreward[j, 1] + }); + } + } + bool flag3 = rowData.category == 2u && rowData.tasktype == 2u; + if (flag3) + { + bool flag4 = !this._chestValueList.Contains(rowData.taskquality); + if (flag4) + { + this._chestValueList.Add(rowData.taskquality); + } + } + } + } + this._chestValueList.Sort(); + } + + public List GetSingleTaskRewardInfoByID(GuildTaskType type, uint taskID) + { + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(taskID); + bool flag = dailyTaskTableInfoByID != null; + if (flag) + { + uint mappingValueWithQualityAndType = XGuildDailyTaskDocument.GetMappingValueWithQualityAndType(type, 1u, dailyTaskTableInfoByID.taskquality); + List result = new List(); + bool flag2 = this._guildTaskRewardWithMap.TryGetValue(mappingValueWithQualityAndType, out result); + if (flag2) + { + return result; + } + } + return new List(); + } + + public List GetTotalTaskRewardInfo(GuildTaskType type, uint count) + { + uint mappingValueWithQualityAndType = XGuildDailyTaskDocument.GetMappingValueWithQualityAndType(type, 2u, count); + List list = new List(); + bool flag = this._guildTaskRewardWithMap.TryGetValue(mappingValueWithQualityAndType, out list); + List result; + if (flag) + { + result = list; + } + else + { + result = new List(); + } + return result; + } + + public void SendCommitWeeklyItem(uint index, List items) + { + RpcC2G_TurnOverWeeklyTaskItem rpcC2G_TurnOverWeeklyTaskItem = new RpcC2G_TurnOverWeeklyTaskItem(); + rpcC2G_TurnOverWeeklyTaskItem.oArg.index = index; + rpcC2G_TurnOverWeeklyTaskItem.oArg.itemuid.Clear(); + rpcC2G_TurnOverWeeklyTaskItem.oArg.itemuid.AddRange(items); + XSingleton.singleton.Send(rpcC2G_TurnOverWeeklyTaskItem); + } + + public void OnTurnOverWeeklyTaskReply(TurnOverWeeklyTaskItemArg oArg, TurnOverWeeklyTaskItemRes oRes) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("weeklyCommitSuccess"), "fece00"); + bool flag = (ulong)oArg.index < (ulong)((long)this._curGuildWeeklyTaskList.Count); + if (flag) + { + for (int i = 0; i < this._curGuildWeeklyTaskList.Count; i++) + { + bool flag2 = oArg.index == this._curGuildWeeklyTaskList[i].originIndex; + if (flag2) + { + GuildWeeklyTaskInfo guildWeeklyTaskInfo = this._curGuildWeeklyTaskList[i]; + guildWeeklyTaskInfo.step += (uint)oArg.itemuid.Count; + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshTaskList(false); + } + break; + } + } + } + } + + public void SendToRefreshTaskList(uint taskIndex) + { + RpcC2G_RefreshWeeklyTask rpcC2G_RefreshWeeklyTask = new RpcC2G_RefreshWeeklyTask(); + rpcC2G_RefreshWeeklyTask.oArg.index = taskIndex; + XSingleton.singleton.Send(rpcC2G_RefreshWeeklyTask); + } + + internal void OnRefreshTaskList(RefreshWeeklyTaskArg oArg, RefreshWeeklyTaskRes oRes) + { + bool flag = this._remainedFreshTimes > 0u; + if (flag) + { + this._remainedFreshTimes -= 1u; + } + for (int i = 0; i < this._curGuildWeeklyTaskList.Count; i++) + { + bool flag2 = this._curGuildWeeklyTaskList[i].originIndex == oArg.index; + if (flag2) + { + WeeklyTaskInfo task = oRes.task; + this.CurGuildWeeklyTaskList[i] = new GuildWeeklyTaskInfo + { + taskID = task.id, + step = task.step, + isRewarded = task.is_rewarded, + hasAsked = task.ask_help, + refreshedCount = task.refresh_count, + originIndex = task.index + }; + break; + } + } + bool flag3 = DlgBase.singleton.IsVisible(); + if (flag3) + { + DlgBase.singleton.RefreshTaskList(false); + DlgBase.singleton.PlayRefreshEffect(); + } + } + + public int GetTaskOriginalIndexByID(uint curSelectTaskID) + { + for (int i = 0; i < this._curGuildWeeklyTaskList.Count; i++) + { + bool flag = this._curGuildWeeklyTaskList[i].taskID == curSelectTaskID; + if (flag) + { + return (int)this._curGuildWeeklyTaskList[i].originIndex; + } + } + return -1; + } + + public GuildWeeklyTaskInfo GetTaskInfoByTaskID(uint curSelectTaskID) + { + for (int i = 0; i < this._curGuildWeeklyTaskList.Count; i++) + { + bool flag = this._curGuildWeeklyTaskList[i].taskID == curSelectTaskID; + if (flag) + { + return this._curGuildWeeklyTaskList[i]; + } + } + return null; + } + + public GuildWeeklyTaskInfo GetTaskInfoByIndex(uint curSelectIndex) + { + for (int i = 0; i < this._curGuildWeeklyTaskList.Count; i++) + { + bool flag = this._curGuildWeeklyTaskList[i].originIndex == curSelectIndex; + if (flag) + { + return this._curGuildWeeklyTaskList[i]; + } + } + return null; + } + + public int GetRewardedTaskCount() + { + int num = 0; + for (int i = 0; i < this._curGuildWeeklyTaskList.Count; i++) + { + bool isRewarded = this._curGuildWeeklyTaskList[i].isRewarded; + if (isRewarded) + { + num++; + } + } + return num; + } + + public void OnGetWeeklyHelpReply(DailyTaskAskHelpArg oArg, DailyTaskAskHelpRes oRes) + { + bool flag = oRes.code == ErrorCode.ERR_SUCCESS; + if (flag) + { + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(oArg.task_id); + GuildWeeklyTaskInfo taskInfoByTaskID = this.GetTaskInfoByTaskID(oArg.task_id); + bool flag2 = taskInfoByTaskID != null && dailyTaskTableInfoByID != null; + if (flag2) + { + bool flag3 = dailyTaskTableInfoByID.tasktype == 4u; + if (flag3) + { + XGuildDailyTaskDocument.Doc.SendGuildDonateReq(dailyTaskTableInfoByID.conditionNum - taskInfoByTaskID.step, dailyTaskTableInfoByID.BQ[0, 0], oRes.ask_uid, NoticeType.NT_GUILD_Weekly_DONATE_REQ); + } + else + { + XGuildDailyTaskDocument.Doc.SendGuildDonateReq(dailyTaskTableInfoByID.conditionNum - taskInfoByTaskID.step, dailyTaskTableInfoByID.conditionId[0], oRes.ask_uid, NoticeType.NT_GUILD_Weekly_DONATE_REQ); + } + taskInfoByTaskID.hasAsked = true; + this._weeklyAskedHelpNum += 1u; + bool flag4 = DlgBase.singleton.IsVisible(); + if (flag4) + { + DlgBase.singleton.RefreshTaskItem(); + } + } + } + else + { + XSingleton.singleton.ShowSystemTip(oRes.code, "fece00"); + } + } + + public bool GoToTakeTask() + { + XTaskDocument specificDocument = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + XTaskRecord taskRecord = specificDocument.TaskRecord; + for (int i = 0; i < taskRecord.Tasks.Count; i++) + { + bool flag = taskRecord.Tasks[i].Status == TaskStatus.TaskStatus_CanTake && taskRecord.Tasks[i].TableData.TaskType == 7u; + if (flag) + { + return true; + } + } + return false; + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyDocument.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyDocument.cs.meta new file mode 100644 index 00000000..364de64b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyDocument.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c9a05f3cc96e5874aacdd8a331b5223a +timeCreated: 1611404539 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyView.cs b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyView.cs new file mode 100644 index 00000000..a0f16a28 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyView.cs @@ -0,0 +1,917 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XGuildWeeklyBountyView : DlgBase + { + public override string fileName + { + get + { + return "Guild/GuildWeeklyBountyView"; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override bool pushstack + { + get + { + return true; + } + } + + public override int sysid + { + get + { + return 904; + } + } + + private const int colNum = 4; + + private uint _curSelectIndex = 0u; + + private IXUICheckBox _selectCheck; + + private List _hasSendedIndex = new List(); + + private int _curSelectMailIndex = 0; + + private XFx _refreshTaskEffect; + + private XFx _completedTaskEffect; + + protected override void OnLoad() + { + base.OnLoad(); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + } + + protected override void OnUnload() + { + bool flag = this._refreshTaskEffect != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this._refreshTaskEffect, true); + } + bool flag2 = this._completedTaskEffect != null; + if (flag2) + { + XSingleton.singleton.DestroyFx(this._completedTaskEffect, true); + } + base.OnUnload(); + } + + protected override void Init() + { + base.Init(); + this.InitProperties(); + } + + protected override void OnHide() + { + this._curSelectIndex = 0u; + base.OnHide(); + } + + protected override void OnShow() + { + base.OnShow(); + bool flag = this._completedTaskEffect != null; + if (flag) + { + this._completedTaskEffect.SetActive(false); + } + bool flag2 = this._refreshTaskEffect != null; + if (flag2) + { + this._completedTaskEffect.SetActive(false); + } + base.uiBehaviour.MailRoot.gameObject.SetActive(false); + XGuildWeeklyBountyDocument.Doc.SendGetWeeklyTaskInfo(); + } + + public override void StackRefresh() + { + base.StackRefresh(); + bool flag = this._completedTaskEffect != null; + if (flag) + { + this._completedTaskEffect.SetActive(false); + } + bool flag2 = this._refreshTaskEffect != null; + if (flag2) + { + this._refreshTaskEffect.SetActive(false); + } + base.uiBehaviour.MailRoot.gameObject.SetActive(false); + XGuildWeeklyBountyDocument.Doc.SendGetWeeklyTaskInfo(); + } + + public override void OnUpdate() + { + base.OnUpdate(); + double num = XGuildWeeklyBountyDocument.Doc.ActivityLeftTime; + num -= (double)Time.deltaTime; + XGuildWeeklyBountyDocument.Doc.ActivityLeftTime = num; + bool flag = (int)num >= 1; + if (flag) + { + bool flag2 = num >= 43200.0; + string str; + if (flag2) + { + str = XSingleton.singleton.TimeDuarationFormatString((int)num, 4); + } + else + { + str = XSingleton.singleton.TimeDuarationFormatString((int)num, 5); + } + base.uiBehaviour.LeftTimeLabel.SetText(XStringDefineProxy.GetString("WeeklyTaskLeftTime") + str); + } + else + { + base.uiBehaviour.LeftTimeLabel.SetText(XStringDefineProxy.GetString("WeeklyTaskFinished")); + } + } + + public void RefreshUI() + { + this.RefreshMailInfo(); + this.RefreshTaskList(true); + this.RefreshChestList(); + } + + public void RefreshTaskItem() + { + GuildWeeklyTaskInfo taskInfoByIndex = XGuildWeeklyBountyDocument.Doc.GetTaskInfoByIndex(this._curSelectIndex); + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID((taskInfoByIndex == null) ? 0u : taskInfoByIndex.taskID); + bool flag = dailyTaskTableInfoByID == null; + if (!flag) + { + this.SetOpBtnState(taskInfoByIndex, dailyTaskTableInfoByID); + IXUISprite ixuisprite = base.uiBehaviour.RightItem.transform.Find("Quality").GetComponent("XUISprite") as IXUISprite; + IXUISprite ixuisprite2 = base.uiBehaviour.RightItem.transform.Find("Icon/Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.SetSprite(ixuisprite.spriteName.Substring(0, ixuisprite.spriteName.Length - 1) + dailyTaskTableInfoByID.taskquality); + ixuisprite2.SetSprite(dailyTaskTableInfoByID.TaskIcon, dailyTaskTableInfoByID.AtlasName, false); + bool flag2 = dailyTaskTableInfoByID.tasktype == 1u || dailyTaskTableInfoByID.tasktype == 4u; + base.uiBehaviour.GetLabel.SetText(flag2 ? XSingleton.singleton.GetString("GotoObtain") : XSingleton.singleton.GetString("PVPActivity_Go")); + base.uiBehaviour.TaskDecLabel.SetText((dailyTaskTableInfoByID == null) ? "" : dailyTaskTableInfoByID.taskdescription); + int @int = XSingleton.singleton.GetInt("WeeklyTaskAskHelpNum"); + base.uiBehaviour.WeeklyAskLabel.SetText(string.Format(XStringDefineProxy.GetString("WeeklyAsk"), XGuildWeeklyBountyDocument.Doc.WeeklyAskedHelpNum, @int)); + base.uiBehaviour.HelpBtn.SetEnable(!taskInfoByIndex.hasAsked && (ulong)XGuildWeeklyBountyDocument.Doc.WeeklyAskedHelpNum < (ulong)((long)@int) && !taskInfoByIndex.isRewarded, false); + base.uiBehaviour.HelpBtn.gameObject.SetActive(flag2); + base.uiBehaviour.WeeklyAskLabel.gameObject.SetActive(flag2); + base.uiBehaviour.HelpBtn.ID = (ulong)dailyTaskTableInfoByID.taskID; + base.uiBehaviour.HelpBtnLabel.SetText(taskInfoByIndex.hasAsked ? XStringDefineProxy.GetString("DailyTaskGetted") : XStringDefineProxy.GetString("DailyTaskGet")); + int refreshedCount = (int)taskInfoByIndex.refreshedCount; + int int2 = XSingleton.singleton.GetInt("WeeklyTaskRefreshCount"); + base.uiBehaviour.RefreshBtn.SetEnable(refreshedCount < int2 && !taskInfoByIndex.isRewarded, false); + base.uiBehaviour.RefreshBtn.ID = (ulong)dailyTaskTableInfoByID.taskID; + int num = 0; + int int3 = XSingleton.singleton.GetInt("WeekyFreeRefreshNum"); + bool flag3 = XGuildWeeklyBountyDocument.Doc.RemainedFreshTimes == 0u; + if (flag3) + { + List intList = XSingleton.singleton.GetIntList("WeeklyTaskRefreshCost"); + num = intList[Mathf.Min(new int[] + { + refreshedCount, + int2, + intList.Count - 1 + })]; + } + string @string = XStringDefineProxy.GetString("WeeklyFreeRefresh"); + IXUILabel ixuilabel = base.uiBehaviour.FreeLabelObj.GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(string.Concat(new object[] + { + @string, + XGuildWeeklyBountyDocument.Doc.RemainedFreshTimes, + "/", + int3 + })); + base.uiBehaviour.FreeLabelObj.SetActive(num == 0); + base.uiBehaviour.DragonCoinCostLabel.SetText(string.Format(XStringDefineProxy.GetString("WeelyDragonCoinCost"), num)); + base.uiBehaviour.DragonCoinCostLabel.gameObject.SetActive(num > 0); + List singleTaskRewardInfoByID = XGuildWeeklyBountyDocument.Doc.GetSingleTaskRewardInfoByID(GuildTaskType.WeeklyTask, taskInfoByIndex.taskID); + int num2 = (singleTaskRewardInfoByID == null) ? 0 : singleTaskRewardInfoByID.Count; + int num3 = Mathf.Min(num2, base.uiBehaviour.RewardsParentTrans.childCount); + int i = 0; + bool flag4 = XActivityDocument.Doc.IsInnerDropTime(904u); + while (i < num3) + { + GameObject gameObject = base.uiBehaviour.RewardsParentTrans.GetChild(i).gameObject; + gameObject.SetActive(true); + XLevelSealDocument specificDocument = XDocuments.GetSpecificDocument(XLevelSealDocument.uuID); + bool flag5 = singleTaskRewardInfoByID[i].itemID == 4u && specificDocument.IsInLevelSeal(); + int itemCount; + if (flag5) + { + itemCount = (int)(singleTaskRewardInfoByID[i].count * 0.5); + } + else + { + itemCount = (int)singleTaskRewardInfoByID[i].count; + } + XSingleton.singleton.normalItemDrawer.DrawItem(gameObject, (int)singleTaskRewardInfoByID[i].itemID, itemCount, true); + IXUISprite ixuisprite3 = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite3.ID = (ulong)singleTaskRewardInfoByID[i].itemID; + ixuisprite3.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton.singleton.OnItemClick)); + Transform transform = gameObject.transform.Find("Double"); + bool flag6 = transform != null; + if (flag6) + { + transform.gameObject.SetActive(flag4 && singleTaskRewardInfoByID[i].itemID != 4u); + } + i++; + } + while (i < base.uiBehaviour.RewardsParentTrans.childCount) + { + base.uiBehaviour.RewardsParentTrans.GetChild(i++).gameObject.SetActive(false); + } + base.uiBehaviour.ProgressLabel.SetText(taskInfoByIndex.step + "/" + dailyTaskTableInfoByID.conditionNum); + base.uiBehaviour.SingleTaskBountyLabel.SetText(XStringDefineProxy.GetString("CurrentTaskScoreText") + dailyTaskTableInfoByID.score); + } + } + + public void PlayRefreshEffect() + { + bool flag = this._refreshTaskEffect != null; + if (flag) + { + this._refreshTaskEffect.SetActive(true); + this._refreshTaskEffect.Play(base.uiBehaviour.effectRoot, Vector3.zero, Vector3.one, 1f, true, false); + } + } + + public void PlayCompleteEffect() + { + bool flag = this._completedTaskEffect != null; + if (flag) + { + this._completedTaskEffect.SetActive(true); + this._completedTaskEffect.Play(base.uiBehaviour.effectRoot, Vector3.zero, Vector3.one, 1f, true, false); + } + } + + public void RefreshTaskItemALL() + { + bool flag = this._selectCheck != null; + if (flag) + { + GuildWeeklyTaskInfo taskInfoByIndex = XGuildWeeklyBountyDocument.Doc.GetTaskInfoByIndex(this._curSelectIndex); + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID((taskInfoByIndex == null) ? 0u : taskInfoByIndex.taskID); + bool flag2 = dailyTaskTableInfoByID != null; + if (flag2) + { + IXUILabel ixuilabel = this._selectCheck.gameObject.transform.Find("Num").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(taskInfoByIndex.step + "/" + dailyTaskTableInfoByID.conditionNum); + GameObject gameObject = this._selectCheck.gameObject.transform.Find("RedPoint").gameObject; + gameObject.SetActive(taskInfoByIndex.step >= dailyTaskTableInfoByID.conditionNum && !taskInfoByIndex.isRewarded); + } + } + this.RefreshTaskItem(); + } + + public void RefreshChestList() + { + List chestValueList = XGuildWeeklyBountyDocument.Doc.ChestValueList; + uint weeklyScore = XGuildWeeklyBountyDocument.Doc.WeeklyScore; + int i = 0; + bool flag = chestValueList != null && chestValueList.Count > 0; + if (flag) + { + while (i < chestValueList.Count - 1) + { + bool flag2 = weeklyScore >= chestValueList[i] && !XGuildWeeklyBountyDocument.Doc.RewardedBoxList.Contains(chestValueList[i]); + if (flag2) + { + break; + } + bool flag3 = weeklyScore < chestValueList[i]; + if (flag3) + { + break; + } + i++; + } + } + bool flag4 = i >= chestValueList.Count; + if (flag4) + { + i = chestValueList.Count - 1; + } + this.UpdateChestItem(base.uiBehaviour.ChestX.gameObject, i); + base.uiBehaviour.CurrentValueLabel.SetText(XStringDefineProxy.GetString("WeeklyTaskTotalScore") + XGuildWeeklyBountyDocument.Doc.WeeklyScore); + } + + private void InitProperties() + { + base.uiBehaviour.RefreshBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnRefreshTasks)); + base.uiBehaviour.GetBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGetTaskItem)); + base.uiBehaviour.HelpBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnAskWeeklyHelp)); + base.uiBehaviour.CommitBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSummitTaskItem)); + base.uiBehaviour.CloseBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseView)); + base.uiBehaviour.MailRoot.gameObject.SetActive(true); + base.uiBehaviour.MailWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnMailWrapContentInit)); + base.uiBehaviour.MailWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnMailWrapContentUpdate)); + base.uiBehaviour.MailCloseSprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnCloseMailView)); + base.uiBehaviour.SendGrateFulBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickSendGrateFulBtn)); + base.uiBehaviour.AboutBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnShowCommonHelpView)); + this._refreshTaskEffect = XSingleton.singleton.CreateFx("Effects/FX_Particle/UIfx/UI_xuanshang_Clip01", null, true); + this._refreshTaskEffect.SetActive(false); + this._completedTaskEffect = XSingleton.singleton.CreateFx("Effects/FX_Particle/UIfx/UI_wanchengxuanshang_Clip01", null, true); + this._completedTaskEffect.SetActive(false); + base.uiBehaviour.GetBtn.gameObject.SetActive(false); + } + + private bool OnShowCommonHelpView(IXUIButton button) + { + DlgBase.singleton.ShowHelp(XSysDefine.XSys_GuildWeeklyBountyTask); + return true; + } + + private void OnMailWrapContentInit(Transform itemTransform, int index) + { + } + + private bool OnSelectMailInfoItem(IXUICheckBox iXUICheckBox) + { + bool bChecked = iXUICheckBox.bChecked; + if (bChecked) + { + this._curSelectMailIndex = (int)iXUICheckBox.ID; + base.uiBehaviour.SendGrateFulBtn.SetEnable(!this._hasSendedIndex.Contains(this._curSelectMailIndex), false); + } + return true; + } + + private bool OnClickSendGrateFulBtn(IXUIButton button) + { + List taskHelpInfoList = XGuildWeeklyBountyDocument.Doc.TaskHelpInfoList; + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag = !specificDocument.CheckInGuild(); + bool result; + if (flag) + { + result = false; + } + else + { + XInvitationDocument specificDocument2 = XDocuments.GetSpecificDocument(XInvitationDocument.uuID); + NoticeTable.RowData noticeData = specificDocument2.GetNoticeData(NoticeType.NT_GUILD_Weekly_Help_Thanks_REQ); + bool flag2 = noticeData == null; + if (flag2) + { + result = false; + } + else + { + List list = new List(); + ChatParam chatParam = new ChatParam(); + chatParam.link = new ChatParamLink(); + ChatParam chatParam2 = new ChatParam(); + chatParam2.role = new ChatParamRole(); + chatParam2.role.uniqueid = XSingleton.singleton.XPlayerData.RoleID; + chatParam2.role.name = XSingleton.singleton.XPlayerData.Name; + chatParam2.role.profession = XSingleton.singleton.XPlayerData.TypeID; + string text = ""; + List list2 = new List(); + for (int i = 0; i < taskHelpInfoList.Count; i++) + { + bool flag3 = !list2.Contains(taskHelpInfoList[i].rolename); + if (flag3) + { + list2.Add(taskHelpInfoList[i].rolename); + text = text + taskHelpInfoList[i].rolename + " "; + } + } + ChatParam chatParam3 = new ChatParam(); + chatParam3.role = new ChatParamRole(); + chatParam3.role.uniqueid = 0UL; + chatParam3.role.name = text; + chatParam3.role.profession = 0u; + list.Add(chatParam2); + list.Add(chatParam3); + list.Add(chatParam); + DlgBase.singleton.SendChatContent(noticeData.info, (ChatChannelType)noticeData.channel, true, list, true, 0UL, 0f, false, false); + this._hasSendedIndex.Add(this._curSelectMailIndex); + this.OnCloseMailView(null); + result = true; + } + } + return result; + } + + private void OnCloseMailView(IXUISprite uiSprite) + { + base.uiBehaviour.MailRoot.gameObject.SetActive(false); + List taskHelpInfoList = XGuildWeeklyBountyDocument.Doc.TaskHelpInfoList; + taskHelpInfoList.Clear(); + this._hasSendedIndex.Clear(); + } + + private bool OnCloseView(IXUIButton button) + { + this.SetVisible(false, true); + return true; + } + + private void SetOpBtnState(GuildWeeklyTaskInfo selectTaskinfo, DailyTask.RowData taskInfo) + { + bool flag = taskInfo.tasktype == 1u || taskInfo.tasktype == 4u; + base.uiBehaviour.CommitBtn.SetEnable(!selectTaskinfo.isRewarded, false); + bool isRewarded = selectTaskinfo.isRewarded; + string @string; + if (isRewarded) + { + @string = XStringDefineProxy.GetString("WeeklyAreadyCommitted"); + } + else + { + bool flag2 = selectTaskinfo.step >= taskInfo.conditionNum; + if (flag2) + { + @string = XStringDefineProxy.GetString("WeeklyToCommit"); + } + else + { + bool flag3 = flag; + if (flag3) + { + bool flag4 = taskInfo.tasktype == 1u; + ulong num; + if (flag4) + { + num = XBagDocument.BagDoc.GetItemCount((int)taskInfo.conditionId[0]); + } + else + { + ItemType itemType = (ItemType)(taskInfo.conditionId[0] / 100u); + ItemQuality quality = (ItemQuality)(taskInfo.conditionId[0] % 100u); + num = (ulong)((long)XBagDocument.BagDoc.GetItemsByTypeAndQuality(1UL << (int)itemType, quality).Count); + } + bool flag5 = num <= 0UL; + if (flag5) + { + @string = XSingleton.singleton.GetString("GotoObtain"); + } + else + { + @string = XStringDefineProxy.GetString("WeeklyCommitItem"); + } + } + else + { + @string = XSingleton.singleton.GetString("PVPActivity_Go"); + } + } + } + base.uiBehaviour.CommitLabel.SetText(@string); + base.uiBehaviour.CommitBtnRedpoint.SetActive(!selectTaskinfo.isRewarded && selectTaskinfo.step >= taskInfo.conditionNum); + } + + private bool OnSummitTaskItem(IXUIButton button) + { + bool flag = this._curSelectIndex >= 0u; + if (flag) + { + GuildWeeklyTaskInfo taskInfoByIndex = XGuildWeeklyBountyDocument.Doc.GetTaskInfoByIndex(this._curSelectIndex); + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID((taskInfoByIndex == null) ? 0u : taskInfoByIndex.taskID); + bool flag2 = dailyTaskTableInfoByID != null; + if (flag2) + { + bool flag3 = taskInfoByIndex.step >= dailyTaskTableInfoByID.conditionNum; + if (flag3) + { + XGuildWeeklyBountyDocument.Doc.SendToGetWeeklyTaskReward(1u, this._curSelectIndex); + } + else + { + bool flag4 = dailyTaskTableInfoByID.tasktype == 1u || dailyTaskTableInfoByID.tasktype == 4u; + bool flag5 = flag4; + if (flag5) + { + bool flag6 = dailyTaskTableInfoByID.tasktype == 1u; + ulong num; + if (flag6) + { + num = XBagDocument.BagDoc.GetItemCount((int)dailyTaskTableInfoByID.conditionId[0]); + } + else + { + ItemType itemType = (ItemType)(dailyTaskTableInfoByID.conditionId[0] / 100u); + ItemQuality quality = (ItemQuality)(dailyTaskTableInfoByID.conditionId[0] % 100u); + num = (ulong)((long)XBagDocument.BagDoc.GetItemsByTypeAndQuality(1UL << (int)itemType, quality).Count); + } + bool flag7 = num == 0UL; + if (flag7) + { + this.OnGetTaskItem(null); + } + else + { + bool flag8 = dailyTaskTableInfoByID.tasktype == 4u; + if (flag8) + { + ItemType type = (ItemType)(dailyTaskTableInfoByID.conditionId[0] / 100u); + ItemQuality quality2 = (ItemQuality)(dailyTaskTableInfoByID.conditionId[0] % 100u); + DlgBase.singleton.ShowView(new XShowSameQualityItemsView.SelectItemsHandler(this.OnSelectQualityItem), type, quality2, XStringDefineProxy.GetString("WeelyCommitTip"), (int)dailyTaskTableInfoByID.conditionNum, (int)taskInfoByIndex.step); + } + else + { + ItemList.RowData itemConf = XBagDocument.GetItemConf((int)dailyTaskTableInfoByID.conditionId[0]); + bool flag9 = itemConf != null; + if (flag9) + { + bool flag10 = itemConf.OverCnt == 1; + if (flag10) + { + List itemList; + XBagDocument.BagDoc.GetItemByItemId((int)dailyTaskTableInfoByID.conditionId[0], out itemList); + DlgBase.singleton.ShowView(new XShowSameQualityItemsView.SelectItemsHandler(this.OnSelectQualityItem), itemList, XStringDefineProxy.GetString("WeelyCommitTip"), (int)dailyTaskTableInfoByID.conditionNum, (int)taskInfoByIndex.step); + } + else + { + int num2 = (int)XBagDocument.BagDoc.GetItemCount((int)dailyTaskTableInfoByID.conditionId[0]); + XSingleton.singleton.ShowSettingNumberDialog(dailyTaskTableInfoByID.conditionId[0], XSingleton.singleton.GetString("WeeklyCommitItem"), 1u, (uint)Mathf.Min((float)num2, dailyTaskTableInfoByID.conditionNum - taskInfoByIndex.step), 1u, new ModalSettingNumberDlg.GetInputNumber(this.onSummitItemID), 50); + } + } + } + } + } + else + { + this.OnGetTaskItem(null); + } + } + } + } + return true; + } + + private void onSummitItemID(uint number) + { + bool flag = this._curSelectIndex >= 0u; + if (flag) + { + GuildWeeklyTaskInfo taskInfoByIndex = XGuildWeeklyBountyDocument.Doc.GetTaskInfoByIndex(this._curSelectIndex); + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID((taskInfoByIndex == null) ? 0u : taskInfoByIndex.taskID); + bool flag2 = dailyTaskTableInfoByID != null; + if (flag2) + { + List list = new List(); + List list2 = new List(); + bool itemByItemId = XBagDocument.BagDoc.GetItemByItemId((int)dailyTaskTableInfoByID.conditionId[0], out list2); + if (itemByItemId) + { + int num = Mathf.Min((int)number, list2.Count); + for (int i = 0; i < num; i++) + { + list.Add(list2[i].uid); + } + XGuildWeeklyBountyDocument.Doc.SendCommitWeeklyItem(this._curSelectIndex, list); + } + } + } + } + + private void OnSelectQualityItem(List itemList) + { + bool flag = itemList.Count > 0; + if (flag) + { + XGuildWeeklyBountyDocument.Doc.SendCommitWeeklyItem(this._curSelectIndex, itemList); + } + } + + private bool OnAskWeeklyHelp(IXUIButton button) + { + uint taskID = (uint)button.ID; + XGuildDailyTaskDocument.Doc.SendDailyTaskAskHelp(PeriodTaskType.PeriodTaskType_Weekly, taskID); + return true; + } + + private bool OnGetTaskItem(IXUIButton button) + { + GuildWeeklyTaskInfo taskInfoByIndex = XGuildWeeklyBountyDocument.Doc.GetTaskInfoByIndex(this._curSelectIndex); + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID((taskInfoByIndex == null) ? 0u : taskInfoByIndex.taskID); + bool flag = dailyTaskTableInfoByID == null; + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = dailyTaskTableInfoByID.tasktype == 1u; + if (flag2) + { + XSingleton.singleton.ShowItemAccess((int)dailyTaskTableInfoByID.conditionId[0], null); + } + else + { + bool flag3 = dailyTaskTableInfoByID.tasktype == 4u; + if (flag3) + { + XSingleton.singleton.ShowItemAccess((int)dailyTaskTableInfoByID.BQ[0, 0], null); + } + else + { + bool flag4 = dailyTaskTableInfoByID.tasktype == 3u; + if (flag4) + { + List list = new List(); + List list2 = new List(); + for (int i = 0; i < dailyTaskTableInfoByID.BQ.Count; i++) + { + list.Add((int)dailyTaskTableInfoByID.BQ[i, 0]); + list2.Add((int)dailyTaskTableInfoByID.BQ[i, 1]); + } + DlgBase.singleton.ShowMonsterAccess(dailyTaskTableInfoByID.NPCID, list, list2, null); + } + else + { + XSingleton.singleton.OpenSystem((int)dailyTaskTableInfoByID.BQ[0, 0]); + } + } + } + result = true; + } + return result; + } + + private bool OnRefreshTasks(IXUIButton button) + { + uint num = (uint)button.ID; + GuildWeeklyTaskInfo taskInfoByIndex = XGuildWeeklyBountyDocument.Doc.GetTaskInfoByIndex(this._curSelectIndex); + bool flag = taskInfoByIndex != null; + if (flag) + { + bool flag2 = taskInfoByIndex.step > 0u; + if (flag2) + { + XSingleton.singleton.ShowModalDialog(XStringDefineProxy.GetString("DailyTaskStepProgressing"), new ButtonClickEventHandler(this.ConfirmToRefresh)); + } + else + { + this.ToRefreshTask(); + } + } + return true; + } + + private bool ConfirmToRefresh(IXUIButton button) + { + XSingleton.singleton.CloseModalDlg(); + this.ToRefreshTask(); + return true; + } + + private void ToRefreshTask() + { + GuildWeeklyTaskInfo taskInfoByIndex = XGuildWeeklyBountyDocument.Doc.GetTaskInfoByIndex(this._curSelectIndex); + bool flag = taskInfoByIndex == null; + if (!flag) + { + int num = 0; + bool flag2 = XGuildWeeklyBountyDocument.Doc.RemainedFreshTimes == 0u; + if (flag2) + { + int refreshedCount = (int)taskInfoByIndex.refreshedCount; + List intList = XSingleton.singleton.GetIntList("WeeklyTaskRefreshCost"); + num = intList[Mathf.Min(refreshedCount, intList.Count - 1)]; + } + ulong virtualItemCount = XBagDocument.BagDoc.GetVirtualItemCount(ItemEnum.DRAGON_COIN); + bool flag3 = (ulong)num <= virtualItemCount; + if (flag3) + { + XGuildWeeklyBountyDocument.Doc.SendToRefreshTaskList(this._curSelectIndex); + } + else + { + DlgBase.singleton.ShowBorad(7); + } + } + } + + private void UpdateChestItem(GameObject chestItem, int index) + { + List chestValueList = XGuildWeeklyBountyDocument.Doc.ChestValueList; + bool flag = index >= 0 && index < chestValueList.Count; + if (flag) + { + uint num = chestValueList[index]; + IXUILabel ixuilabel = chestItem.transform.Find("Exp").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = chestItem.GetComponent("XUISprite") as IXUISprite; + ixuisprite.ID = (ulong)num; + ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickedChestBox)); + Transform transform = chestItem.transform.Find("RedPoint"); + bool flag2 = num <= XGuildWeeklyBountyDocument.Doc.WeeklyScore; + ixuisprite.SetEnabled(true); + SeqList stringSeqList = XSingleton.singleton.GetStringSeqList("RewardBoxArr"); + bool flag3 = XGuildWeeklyBountyDocument.Doc.RewardedBoxList.Contains(num); + if (flag3) + { + bool flag4 = index == chestValueList.Count - 1; + if (flag4) + { + ixuilabel.SetText(XStringDefineProxy.GetString("CompleteBounty")); + } + transform.gameObject.SetActive(false); + ixuisprite.SetSprite(stringSeqList[Mathf.Min(index, (int)(stringSeqList.Count - 1)), 1]); + } + else + { + bool flag5 = flag2; + if (flag5) + { + ixuilabel.SetText(XStringDefineProxy.GetString("ClickToGetBounty")); + } + else + { + ixuilabel.SetText(string.Format(XStringDefineProxy.GetString("BountyValueToGet"), num.ToString())); + } + string sprite = stringSeqList[Mathf.Min(index, (int)(stringSeqList.Count - 1)), 0]; + ixuisprite.SetSprite(sprite); + transform.gameObject.SetActive(flag2); + } + } + } + + private void OnClickedChestBox(IXUISprite uiSprite) + { + uint num = (uint)uiSprite.ID; + bool flag = XGuildWeeklyBountyDocument.Doc.WeeklyScore >= num && !XGuildWeeklyBountyDocument.Doc.RewardedBoxList.Contains(num); + if (flag) + { + XGuildWeeklyBountyDocument.Doc.SendToGetWeeklyTaskReward(2u, num); + } + else + { + List totalTaskRewardInfo = XGuildWeeklyBountyDocument.Doc.GetTotalTaskRewardInfo(GuildTaskType.WeeklyTask, num); + List list = new List(); + List list2 = new List(); + for (int i = 0; i < totalTaskRewardInfo.Count; i++) + { + list.Add(totalTaskRewardInfo[i].itemID); + XLevelSealDocument specificDocument = XDocuments.GetSpecificDocument(XLevelSealDocument.uuID); + bool flag2 = totalTaskRewardInfo[i].itemID == 4u && specificDocument.IsInLevelSeal(); + uint item; + if (flag2) + { + item = (uint)(totalTaskRewardInfo[i].count * 0.5); + } + else + { + item = totalTaskRewardInfo[i].count; + } + list2.Add(item); + } + DlgBase.singleton.Show(list, list2, false); + DlgBase.singleton.SetGlobalPosition(uiSprite.gameObject.transform.position); + } + } + + public void RefreshTaskList(bool init = true) + { + List curGuildWeeklyTaskList = XGuildWeeklyBountyDocument.Doc.CurGuildWeeklyTaskList; + base.uiBehaviour.BountyItemPool.ReturnAll(false); + this._selectCheck = null; + for (int i = 0; i < curGuildWeeklyTaskList.Count; i++) + { + DailyTask.RowData dailyTaskTableInfoByID = XGuildDailyTaskDocument.Doc.GetDailyTaskTableInfoByID(curGuildWeeklyTaskList[i].taskID); + bool flag = dailyTaskTableInfoByID != null; + if (flag) + { + GameObject gameObject = base.uiBehaviour.BountyItemPool.FetchGameObject(false); + int num = i; + int num2 = 0; + gameObject.transform.localPosition = base.uiBehaviour.BountyItemPool.TplPos + (float)(num * base.uiBehaviour.BountyItemPool.TplWidth) * Vector3.right + (float)(num2 * (base.uiBehaviour.BountyItemPool.TplHeight + 10)) * Vector3.down; + IXUICheckBox ixuicheckBox = gameObject.GetComponent("XUICheckBox") as IXUICheckBox; + ixuicheckBox.ID = (ulong)curGuildWeeklyTaskList[i].originIndex; + ixuicheckBox.RegisterOnCheckEventHandler(new CheckBoxOnCheckEventHandler(this.OnSelectBountyItem)); + bool flag2 = this._curSelectIndex == curGuildWeeklyTaskList[i].originIndex; + ixuicheckBox.ForceSetFlag(false); + if (init) + { + bool flag3 = i == 0; + if (flag3) + { + this._selectCheck = ixuicheckBox; + } + } + else + { + bool flag4 = flag2; + if (flag4) + { + this._selectCheck = ixuicheckBox; + } + } + IXUILabel ixuilabel = gameObject.transform.Find("Num").GetComponent("XUILabel") as IXUILabel; + string text = curGuildWeeklyTaskList[i].step + "/" + dailyTaskTableInfoByID.conditionNum; + ixuilabel.SetText(text); + IXUISprite ixuisprite = gameObject.transform.Find("Quality").GetComponent("XUISprite") as IXUISprite; + IXUISprite ixuisprite2 = gameObject.transform.Find("Icon/Icon").GetComponent("XUISprite") as IXUISprite; + ixuisprite.SetSprite(ixuisprite.spriteName.Substring(0, ixuisprite.spriteName.Length - 1) + dailyTaskTableInfoByID.taskquality); + ixuisprite2.SetSprite(dailyTaskTableInfoByID.TaskIcon, dailyTaskTableInfoByID.AtlasName, false); + GameObject gameObject2 = gameObject.transform.Find("RedPoint").gameObject; + gameObject2.SetActive(curGuildWeeklyTaskList[i].step >= dailyTaskTableInfoByID.conditionNum && !curGuildWeeklyTaskList[i].isRewarded); + Transform transform = gameObject.transform.Find("Complete"); + transform.gameObject.SetActive(curGuildWeeklyTaskList[i].isRewarded); + IXUIProgress ixuiprogress = gameObject.transform.Find("TaskProgress").GetComponent("XUIProgress") as IXUIProgress; + ixuiprogress.value = curGuildWeeklyTaskList[i].step / dailyTaskTableInfoByID.conditionNum; + } + } + bool flag5 = this._selectCheck != null; + if (flag5) + { + bool bChecked = this._selectCheck.bChecked; + if (bChecked) + { + this.OnSelectBountyItem(this._selectCheck); + } + else + { + this._selectCheck.bChecked = true; + } + } + if (init) + { + base.uiBehaviour.BountyListScrollView.ResetPosition(); + } + } + + private bool OnSelectBountyItem(IXUICheckBox iXUICheckBox) + { + bool bChecked = iXUICheckBox.bChecked; + if (bChecked) + { + uint curSelectIndex = (uint)iXUICheckBox.ID; + this._curSelectIndex = curSelectIndex; + this.RefreshTaskItem(); + } + return true; + } + + private void RefreshMailInfo() + { + List taskHelpInfoList = XGuildWeeklyBountyDocument.Doc.TaskHelpInfoList; + bool flag = taskHelpInfoList.Count > 0; + if (flag) + { + base.uiBehaviour.MailRoot.gameObject.SetActive(true); + base.uiBehaviour.MailWrapContent.SetContentCount(taskHelpInfoList.Count, false); + base.uiBehaviour.MailScrollView.ResetPosition(); + } + else + { + base.uiBehaviour.MailRoot.gameObject.SetActive(false); + } + } + + private void OnMailWrapContentUpdate(Transform itemTransform, int index) + { + List taskHelpInfoList = XGuildWeeklyBountyDocument.Doc.TaskHelpInfoList; + bool flag = index < taskHelpInfoList.Count; + if (flag) + { + TaskHelpInfo taskHelpInfo = taskHelpInfoList[index]; + IXUILabel ixuilabel = itemTransform.Find("Tip").GetComponent("XUILabel") as IXUILabel; + string rolename = taskHelpInfo.rolename; + ItemList.RowData itemConf = XBagDocument.GetItemConf((int)taskHelpInfo.itemid); + string text = " "; + bool flag2 = itemConf != null; + if (flag2) + { + text += itemConf.ItemName[0]; + } + ixuilabel.SetText(string.Format(XStringDefineProxy.GetString("weelyHelpItemTip"), rolename, taskHelpInfo.itemcount, text)); + IXUILabel ixuilabel2 = itemTransform.Find("Time").GetComponent("XUILabel") as IXUILabel; + string text2 = new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(taskHelpInfo.time).ToLocalTime().ToString("yyyy-MM-dd H:mm"); + ixuilabel2.SetText(text2); + } + } + } +} diff --git a/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyView.cs.meta b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyView.cs.meta new file mode 100644 index 00000000..ebe2c086 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Guild/XGuildWeeklyBountyView.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 360102b0702b74a488a8b46263e684cf +timeCreated: 1611403561 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: -- cgit v1.1-26-g67d0