Beispiel #1
0
 public override void PerformCraft(IPerformCraftEvent evt)
 {
     if (OnPerformCraft is not null)
     {
         OnPerformCraft(evt);
     }
     else
     {
         base.PerformCraft(evt);
     }
 }
 public virtual void PerformCraft(IPerformCraftEvent evt)
 {
     if (evt.Item is null)
     {
         evt.Cancel();
     }
     else
     {
         evt.Complete();
     }
 }
Beispiel #3
0
    public void PerformCraft(IPerformCraftEvent evt)
    {
        var menu     = new BuildMenu(Blueprint, Blueprint.isUpgrade() ? ActionType.Upgrade : ActionType.Build, evt, Mod);
        var old_menu = Game1.activeClickableMenu;

        Game1.activeClickableMenu = menu;

        menu.exitFunction = () => {
            Game1.activeClickableMenu = old_menu;
            evt.Cancel();
        };
    }
Beispiel #4
0
    public BuildMenu(BluePrint?bp, ActionType action, IPerformCraftEvent evt, ModEntry mod) : base()
    {
        Mod       = mod;
        Action    = action;
        Blueprint = bp;
        Event     = evt;

        Location = Game1.currentLocation as BuildableGameLocation;

        Game1.displayHUD     = false;
        Game1.viewportFreeze = true;
        Game1.panScreen(0, 0);

        btnCancel = new ClickableTextureComponent(
            "OK",
            new Rectangle(
                Game1.uiViewport.Width - 128,
                Game1.uiViewport.Height - 128,
                64, 64
                ),
            null,
            null,
            Game1.mouseCursors,
            Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 47),
            1f
            );

        if (Action == ActionType.Upgrade && Blueprint != null)
        {
            Message = Game1.content.LoadString(@"Strings\UI:Carpenter_SelectBuilding_Upgrade", new BluePrint(Blueprint.nameOfBuildingToUpgrade).displayName);
        }
        else if (Action == ActionType.Demolish)
        {
            Message = Game1.content.LoadString(@"Strings\UI:Carpenter_SelectBuilding_Demolish");
        }
        else if (Action == ActionType.Paint)
        {
            Message = Game1.content.LoadString(@"Strings\UI:Carpenter_SelectBuilding_Paint");
        }
        else
        {
            Message = Game1.content.LoadString(@"Strings\UI:Carpenter_ChooseLocation");
        }
    }
Beispiel #5
0
 public void PerformCraft(IPerformCraftEvent evt)
 {
     evt.Complete();
 }