Skip to content

Commit

Permalink
加入卖宝物功能
Browse files Browse the repository at this point in the history
  • Loading branch information
k2lizheng authored and luiges90 committed Oct 19, 2023
1 parent 223a2a3 commit f8409fb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions Content/Data/Plugins/ContextMenuData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
<MenuItem ID="8" Name="Treasure" DisplayName="宝物">
<MenuItem ID="1" Name="Confiscate" DisplayName="没收" DisplayIfTrue="HasTreasureToConfiscate" />
<MenuItem ID="2" Name="Award" DisplayName="授予" DisplayIfTrue="HasTreasureToAward" />
<MenuItem ID="3" Name="Sell" DisplayName="" DisplayIfTrue="HasTreasureToAward" />
</MenuItem>
</MenuItem>
<MenuItem ID="8" Name="Section" DisplayName="军区">
Expand Down
1 change: 1 addition & 0 deletions WorldOfTheThreeKingdoms/GameGlobal/ContextMenuResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public enum ContextMenuResult
Monarch_Refuse,
Monarch_Treasure_Confiscate,
Monarch_Treasure_Award,
Monarch_Treasure_Sell,
Section_New,
Section_Regroup,
Section_Disband,
Expand Down
1 change: 1 addition & 0 deletions WorldOfTheThreeKingdoms/GameGlobal/FrameFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public enum FrameFunction
GetConfiscateTreasure,
GetAwardTreasure,
GetAwardTreasurePerson,
GetSellTreasure,
xuanzemeinv,
chongxingmeinv,
MoveFeizi,
Expand Down
3 changes: 3 additions & 0 deletions WorldOfTheThreeKingdoms/GameScreens/MGSContextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ private void HandleContextMenuResult(ContextMenuResult result)
case ContextMenuResult.Monarch_Treasure_Award:
this.ShowTabListInFrame(UndoneWorkKind.Frame, FrameKind.Treasure, FrameFunction.GetAwardTreasure, false, true, true, false, this.CurrentArchitecture.GetTreasureListOfLeader(), null, "", "");
break;
case ContextMenuResult.Monarch_Treasure_Sell:
this.ShowTabListInFrame(UndoneWorkKind.Frame, FrameKind.Treasure, FrameFunction.GetSellTreasure, false, true, true, false, this.CurrentArchitecture.GetTreasureListOfLeader(), null, "卖宝", "");
break;
case ContextMenuResult.Monarch_officePosition_SelfBecomeEmperor:
this.CurrentArchitecture.BelongedFaction.SelfBecomeEmperor();
break;
Expand Down
15 changes: 14 additions & 1 deletion WorldOfTheThreeKingdoms/GameScreens/ScreenManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ private void FrameFunction_Architecture_AfterGetAwardTreasurePerson() // 赏赐
}
}
}

private void FrameFunction_Architecture_AfterGetSellTreasure() // 卖宝
{
this.CurrentGameObject = Session.MainGame.mainGameScreen.Plugins.TabListPlugin.SelectedItem as GameObject;
if (this.CurrentGameObject != null)
{
Treasure currentGameObject = this.CurrentGameObject as Treasure;
this.CurrentArchitecture.BelongedFaction.Leader.LoseTreasure(currentGameObject);
Session.Current.Scenario.Treasures.Remove(currentGameObject);
this.CurrentArchitecture.IncreaseFund(10000);
}
}
private void FrameFunction_Architecture_Afterxuanzemeinv() // 纳妃
{
this.CurrentPerson = Session.MainGame.mainGameScreen.Plugins.TabListPlugin.SelectedItem as Person;
Expand Down Expand Up @@ -1423,6 +1433,9 @@ public void HandleFrameFunction(FrameFunction function)
case FrameFunction.GetAwardTreasurePerson:
this.FrameFunction_Architecture_AfterGetAwardTreasurePerson();
break;
case FrameFunction.GetSellTreasure:
this.FrameFunction_Architecture_AfterGetSellTreasure();
break;
case FrameFunction.xuanzemeinv :
this.FrameFunction_Architecture_Afterxuanzemeinv();
break;
Expand Down

0 comments on commit f8409fb

Please sign in to comment.