Beispiel #1
0
 protected BellowEntity(Smith2DGame game, Mesh bellow, Matrix4 bellowTransform, Mesh rig, float x, float y, float z, float xSize, float ySize) : base(x, y, z, xSize, ySize)
 {
     Game                 = game;
     this.bellow          = bellow;
     this.bellowTransform = bellowTransform;
     this.rig             = rig;
 }
 public CastingTableEntity(Smith2DGame game, Mesh m, Mesh fill, float x, float y, float tableWidth, float tableHeight, float xSize, float ySize) : base(m, x, y, 0, xSize, ySize)
 {
     this.game        = game;
     this.tableWidth  = tableWidth;
     this.tableHeight = tableHeight;
     this.fill        = fill;
 }
Beispiel #3
0
 public MailboxEntity(Smith2DGame game, Mesh box, Mesh lid, Matrix4 lidOffset, float x, float y, float z, float xRot, float yRot, float zRot, float xSize, float ySize) : base(null, x, y, z, xRot, yRot, zRot, xSize, ySize)
 {
     this.game      = game;
     this.box       = box;
     this.lid       = lid;
     this.lidOffset = lidOffset;
 }
Beispiel #4
0
 public HatchEntity(Smith2DGame game, Mesh hatchHole, Mesh hatch, Vector3 hatchTranslation, float x, float y, float z, float xSize, float ySize) : base(hatchHole, x, y, z, xSize, ySize)
 {
     this.game             = game;
     this.hatchHole        = hatchHole;
     this.hatch            = hatch;
     this.hatchTranslation = Matrix4.CreateTranslation(hatchTranslation);
     Solid = false;
 }
Beispiel #5
0
 public Item CreateItem(Smith2DGame game, int metal, float purity)
 {
     if (Info.ItemCreator != null && Info.ItemCreator.CanCreateItem(metal, purity, game))
     {
         return(Info.ItemCreator.CreateItem(metal, purity));
     }
     return(null);
 }
Beispiel #6
0
 public FoundryEntity(Smith2DGame game, Mesh m, Mesh molten, Matrix4 liquidTransform, Mesh fall, Vector3 lightPos, float x, float y, Matrix4[] ingotMatrices, float xSize, float ySize) : base(m, x, y, 0, xSize, ySize)
 {
     this.game            = game;
     this.molten          = molten;
     this.liquidTransform = liquidTransform;
     this.fall            = fall;
     this.lightPos        = lightPos;
     IngotMatrices        = ingotMatrices;
 }
Beispiel #7
0
        public void Render(Smith2DGame game)
        {
            var cW = OrthoRenderEngine.GetCanvasWidth();
            var cH = OrthoRenderEngine.GetCanvasHeight();

            uint l = 0;

            for (int i = 0; i < GetItemAmount(); i++)
            {
                Item item = GetItem(i);

                Vector4 boxColor = i == selectedItem ? selected : Util.White;

                OrthoRenderEngine.DrawColoredTexturedBox(boxColor, TextureCollection.Button, cW - iconSize - overscan, cH - iconSize * (l + 0.5f) - overscan, iconSize, iconSize / 2, 0, 0, 1, 0.5f);
                OrthoRenderEngine.DrawColoredTexturedBox(boxColor, TextureCollection.Numbers, cW - iconSize - overscan + 2, cH - iconSize * l - overscan - 12, 10, 10, l / 4f, 0, 0.25f, 1);
                uint oldL = l;
                for (l++; l < oldL + item.GetSize(); l++)
                {
                    OrthoRenderEngine.DrawColoredTexturedBox(boxColor, TextureCollection.Button, cW - iconSize - overscan, cH - iconSize * l - overscan, iconSize, iconSize / 2, 0, 0.25f, 1, 0.5f);
                    OrthoRenderEngine.DrawColoredTexturedBox(boxColor, TextureCollection.Button, cW - iconSize - overscan, cH - iconSize * (l + 0.5f) - overscan, iconSize, iconSize / 2, 0, 0.25f, 1, 0.5f);
                }
                OrthoRenderEngine.DrawColoredTexturedBox(boxColor, TextureCollection.Button, cW - iconSize - overscan, cH - iconSize * l - overscan, iconSize, iconSize / 2, 0, 0.5f, 1, 0.5f);
                float bob = i == selectedItem ? (float)Math.Sin(Time.CurrentTime() * 5) * 4 + 2 : 0;
                item.RenderItem(cW - iconSize - overscan - bob, cH - iconSize * l - overscan - bob, iconSize + bob * 2, iconSize * item.GetSize() + bob * 2);
            }

            for (uint i = l; i < Inventory.SIZE; i++)
            {
                OrthoRenderEngine.DrawTexturedBox(TextureCollection.Button, cW - iconSize - 20, cH - iconSize * (i + 1) - 20, iconSize, iconSize, 0, 0, 1, 1);
                OrthoRenderEngine.DrawTexturedBox(TextureCollection.Numbers, cW - iconSize - 20 + 2, cH - iconSize * i - 20 - 12, 10, 10, i / 4f, 0, 0.25f, 1);
            }

            if (hoveredItem > -1 & hoveredItem < items.Count && items [hoveredItem] != null)
            {
                game.TooltipHelper.ClaimIfPossible(this);
                if (game.TooltipHelper.GetOwner() == this)
                {
                    game.TooltipHelper.RenderItemTooltip(items [hoveredItem], OrthoRenderEngine.GetCanvasWidth() - overscan - iconSize - 32, Input.OrthoMouseY);
                }
            }
            else if (game.TooltipHelper.GetOwner() == this)
            {
                game.TooltipHelper.UnClaim();
            }

            if (tooFull)
            {
                game.ErrortipHelper.ShowError(Localization.GetLocalization("ui.error.inventoryfull"), OrthoRenderEngine.GetCanvasWidth() - overscan, OrthoRenderEngine.GetCanvasHeight() - overscan - iconSize * SIZE - 32 - 30, 1.5f, true);
                tooFull = false;
            }
        }
Beispiel #8
0
 public CoalStripTable(Smith2DGame game, Mesh table, Mesh coal, float x, float y, float z, float xSize, float ySize, float height) : base(table, x, y, z, xSize, ySize)
 {
     this.game   = game;
     Coal        = coal;
     this.height = height;
 }
Beispiel #9
0
 public MainMenuView(Smith2DGame game) : base(options)
 {
     this.game = game;
 }
Beispiel #10
0
 public SmithGameWindow(Smith2DGame game) : base(1600, 900, new GraphicsMode(32, 24, 0, 8), "Smith")
 {
     this.game = game;
 }
Beispiel #11
0
 public bool CanCreateItem(int metal, float purity, Smith2DGame game)
 {
     return(true);
 }
Beispiel #12
0
 public BigBellowEntity(Smith2DGame game, Mesh bellow, Matrix4 bellowTransform, Mesh rig, float x, float y, float z, float xSize, float ySize) : base(game, bellow, bellowTransform, rig, x, y, z, xSize, ySize)
 {
 }
Beispiel #13
0
 public AnvilEntity(Smith2DGame game, Mesh m, Mesh hammer, float x, float y, float z, float xSize, float ySize, float height) : base(m, x, y, z, xSize, ySize)
 {
     this.game   = game;
     this.hammer = hammer;
     this.height = height;
 }
Beispiel #14
0
 public DoorEntity(Smith2DGame game, Mesh doorFrame, Mesh door, Matrix4 doorTranslation, float x, float y, float z, float xRot, float yRot, float zRot, float xSize, float ySize) : base(doorFrame, x, y, z, xRot, yRot, zRot, xSize, ySize)
 {
     this.game            = game;
     this.door            = door;
     this.doorTranslation = doorTranslation;
 }
Beispiel #15
0
 public SmithingView(Smith2DGame game)
 {
     this.game  = game;
     transition = new Transition();
 }