diff --git a/assets/mods/basegame/crafting/wires.json b/assets/mods/basegame/crafting/wires.json index d85017691..47ade4c8a 100644 --- a/assets/mods/basegame/crafting/wires.json +++ b/assets/mods/basegame/crafting/wires.json @@ -35,6 +35,13 @@ ] }, + "item@basegame:50": { /* soldering wire */ + "workbench": "wirerollingmill", + "ingredients": [ + [10, 1, "item@basegame:181"] /* 1 solder bar */ + ] + }, + "item@basegame:35": { /* copper bulb */ "workbench": "basiccrafting", "ingredients": [ diff --git a/assets/mods/basegame/items/itemid.csv b/assets/mods/basegame/items/itemid.csv index 21c0fd6b5..e4103f144 100644 --- a/assets/mods/basegame/items/itemid.csv +++ b/assets/mods/basegame/items/itemid.csv @@ -48,6 +48,7 @@ id;classname;tags 47;net.torvald.terrarum.modulebasegame.gameitems.ItemWrench;TOOL,WRENCH 48;net.torvald.terrarum.modulebasegame.gameitems.ItemAlloyingFurnace;FIXTURE,STATION 49;net.torvald.terrarum.modulebasegame.gameitems.ItemLogicSignalAdder;FIXTURE,SIGNAL +50;net.torvald.terrarum.modulebasegame.gameitems.ItemSolderingWire; # ingots 112;net.torvald.terrarum.modulebasegame.gameitems.IngotCopper;INGOT diff --git a/assets/mods/basegame/items/items.tga b/assets/mods/basegame/items/items.tga index 23b232b9c..4f51eabdd 100644 --- a/assets/mods/basegame/items/items.tga +++ b/assets/mods/basegame/items/items.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bcd48b139db6534db0794f2172275001be7a4702902aa59834ddef556be2774c +oid sha256:3160f604c594927f9aedfc1562c323f14481b137f88d084d86b1ab7a0575a02d size 2408466 diff --git a/assets/mods/basegame/locales/en/itemdesc.json b/assets/mods/basegame/locales/en/itemdesc.json index 9f8691b6b..7a4fa86bf 100644 --- a/assets/mods/basegame/locales/en/itemdesc.json +++ b/assets/mods/basegame/locales/en/itemdesc.json @@ -44,6 +44,7 @@ "TOOLTIP_item@basegame:36": "Creates wires from metal ingots", "TOOLTIP_item@basegame:47": "Reorients gadgets", "TOOLTIP_item@basegame:48": "Melts two metal ingots to make a bar of alloy", + "TOOLTIP_item@basegame:50": "Put it on the Electronics Workbench", "TOOLTIP_item@basegame:114": "A precious fuel for the steel production", diff --git a/assets/mods/basegame/locales/en/items.json b/assets/mods/basegame/locales/en/items.json index d23cbeb92..a44d37eb5 100644 --- a/assets/mods/basegame/locales/en/items.json +++ b/assets/mods/basegame/locales/en/items.json @@ -70,6 +70,7 @@ "ITEM_SLEDGEHAMMER_COPPER": "Copper Sledgehammer", "ITEM_SLEDGEHAMMER_IRON": "Iron Sledgehammer", "ITEM_SLEDGEHAMMER_STEEL": "Steel Sledgehammer", + "ITEM_SOLDERING_WIRE": "Soldering Wire", "ITEM_SMELTER_SMALL": "Small Smelter", "ITEM_STORAGE_CHEST": "Storage Chest", "ITEM_TABLE_OAK": "Oak Table", diff --git a/assets/mods/basegame/locales/koKR/itemdesc.json b/assets/mods/basegame/locales/koKR/itemdesc.json index ae6d95bda..9944ba82e 100644 --- a/assets/mods/basegame/locales/koKR/itemdesc.json +++ b/assets/mods/basegame/locales/koKR/itemdesc.json @@ -43,6 +43,7 @@ "TOOLTIP_item@basegame:36": "금속 주괴를 사용해 철사를 뽑아냅니다", "TOOLTIP_item@basegame:47": "기기의 방향을 바꿉니다", "TOOLTIP_item@basegame:48": "두 금속 괴를 녹여 합금을 만듭니다", + "TOOLTIP_item@basegame:50": "전자 작업대에 갖다놓으세요", "TOOLTIP_item@basegame:114": "강철 생산의 소중한 연료입니다", diff --git a/assets/mods/basegame/locales/koKR/items.json b/assets/mods/basegame/locales/koKR/items.json index 9edd53306..35283b89f 100644 --- a/assets/mods/basegame/locales/koKR/items.json +++ b/assets/mods/basegame/locales/koKR/items.json @@ -33,7 +33,7 @@ "ITEM_INGOT_ROSEGOLD": "분홍금괴", "ITEM_INGOT_SILVER": "은괴", "ITEM_INGOT_SILVER_BILLON": "은동괴", - "ITEM_INGOT_SOLDER": "땜납", + "ITEM_INGOT_SOLDER": "막대납", "ITEM_INGOT_STEEL": "강철괴", "ITEM_INGOT_TIN": "주석괴", "ITEM_INGOT_ZINC": "아연괴", @@ -70,6 +70,7 @@ "ITEM_SLEDGEHAMMER_COPPER": "구리 해머", "ITEM_SLEDGEHAMMER_IRON": "철 해머", "ITEM_SLEDGEHAMMER_STEEL": "강철 해머", + "ITEM_SOLDERING_WIRE": "실납", "ITEM_SMELTER_SMALL": "소형 고로", "ITEM_STORAGE_CHEST": "보관상자", "ITEM_TABLE_OAK": "나무 탁자", diff --git a/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt b/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt index e0bbc21e3..fb8eab08d 100644 --- a/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt +++ b/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt @@ -716,63 +716,50 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) { //////////////////////////////// - // #1. Consume an consumables - // don't want to open the UI and use the item at the same time, would ya? - if (itemOnGrip?.isConsumable == true) { - // click filtering (latch stuff) is handled by IngameController (see inventoryCategoryAllowClickAndDrag) - // To disable click dragging for tool/block/etc., put `override val disallowToolDragging = true` to the item's code - val consumptionSuccessful = itemOnGrip.startPrimaryUse(actor, delta) - if (consumptionSuccessful > -1) - (actor as Pocketed).inventory.consumeItem(itemOnGrip, consumptionSuccessful) + mouseInInteractableRange(actor) { mwx, mwy, mtx, mty -> + // #1. interact with the fixture if NOT FixtureInteractionBlocked + // scan for the one with non-null UI. + // what if there's multiple of such fixtures? whatever, you are supposed to DISALLOW such situation. + if (fixtureUnderMouse != null && itemOnGrip !is FixtureInteractionBlocked) { + if (!worldPrimaryClickLatch) { + worldPrimaryClickLatch = true + fixtureUnderMouse.let { fixture -> + fixture.mainUI?.let { ui -> + uiOpened = true - worldPrimaryClickLatch = true - } - else { // held item is not consumable or holding no items - mouseInInteractableRange(actor) { mwx, mwy, mtx, mty -> - // #2. interact with the fixture - // scan for the one with non-null UI. - // what if there's multiple of such fixtures? whatever, you are supposed to DISALLOW such situation. - if (fixtureUnderMouse != null && itemOnGrip !is FixtureInteractionBlocked) { - if (!worldPrimaryClickLatch) { - worldPrimaryClickLatch = true - fixtureUnderMouse.let { fixture -> - fixture.mainUI?.let { ui -> - uiOpened = true + // property 'uiFixture' is a dedicated property that the TerrarumIngame recognises. + // when it's not null, the UI will be updated and rendered + // when the UI is closed, it'll be replaced with a null value + uiFixture = ui + ui.setPosition( + (Toolkit.drawWidth - ui.width) / 4, + (App.scr.height - ui.height) / 4 // what the fuck? + ) + ui.setAsOpen() + } - // property 'uiFixture' is a dedicated property that the TerrarumIngame recognises. - // when it's not null, the UI will be updated and rendered - // when the UI is closed, it'll be replaced with a null value - uiFixture = ui - ui.setPosition( - (Toolkit.drawWidth - ui.width) / 4, - (App.scr.height - ui.height) / 4 // what the fuck? - ) - ui.setAsOpen() - } - - if (!uiOpened) { - fireFixtureInteractEvent(fixture, mwx, mwy) - } + if (!uiOpened) { + fireFixtureInteractEvent(fixture, mwx, mwy) } } } - // #3. If no fixture under mouse or FixtureInteractionBlocked, use the item - else if (itemOnGrip != null) { - // click filtering (latch stuff) is handled by IngameController (see inventoryCategoryAllowClickAndDrag) - // To disable click dragging for tool/block/etc., put `override val disallowToolDragging = true` to the item's code - val consumptionSuccessful = itemOnGrip.startPrimaryUse(actor, delta) - if (consumptionSuccessful > -1) - (actor as Pocketed).inventory.consumeItem(itemOnGrip, consumptionSuccessful) - - worldPrimaryClickLatch = true - } - // #4. If not holding any item and can do barehandaction (size big enough that barehandactionminheight check passes), do it - else { - performBarehandAction(actor, delta, mwx, mwy, mtx, mty) - } - - 0L } + // #2. If no fixture under mouse or FixtureInteractionBlocked, use the item + else if (itemOnGrip != null) { + // click filtering (latch stuff) is handled by IngameController (see inventoryCategoryAllowClickAndDrag) + // To disable click dragging for tool/block/etc., put `override val disallowToolDragging = true` to the item's code + val consumptionSuccessful = itemOnGrip.startPrimaryUse(actor, delta) + if (consumptionSuccessful > -1) + (actor as Pocketed).inventory.consumeItem(itemOnGrip, consumptionSuccessful) + + worldPrimaryClickLatch = true + } + // #3. If not holding any item and can do barehandaction (size big enough that barehandactionminheight check passes), do it + else { + performBarehandAction(actor, delta, mwx, mwy, mtx, mty) + } + + 0L } } diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemMisc.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemMisc.kt index ba8598f87..b68c1f9e8 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemMisc.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemMisc.kt @@ -88,4 +88,13 @@ class ItemTorch(originalID: ItemID) : LightIngredientBase(originalID) { override fun effectWhileEquipped(actor: ActorWithBody, delta: Float) { BlockBase.blockEffectWhenEquipped(actor, delta) } +} + +/** + * Created by minjaesong on 2024-03-11. + */ +class ItemSolderingWire(originalID: ItemID) : LightIngredientBase(originalID) { + override var originalName = "ITEM_SOLDERING_WIRE" + override val itemImage: TextureRegion + get() = CommonResourcePool.getAsItemSheet("basegame.items").get(6,2) } \ No newline at end of file diff --git a/work_files/graphics/items/basegame_items.kra b/work_files/graphics/items/basegame_items.kra index 963412709..90aeaf8b2 100644 --- a/work_files/graphics/items/basegame_items.kra +++ b/work_files/graphics/items/basegame_items.kra @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7f2a20d3916aea109b502811f800de5767a5d3be5cbdd97741a6be4072120820 -size 1538298 +oid sha256:b6dea6698e2ac5c95f807c1358a596a528ce1697924cad9ca8eb22075be5c25a +size 1586477 diff --git a/work_files/graphics/wires/four_signal_wires.kra b/work_files/graphics/wires/four_signal_wires.kra new file mode 100644 index 000000000..ddc6f0654 --- /dev/null +++ b/work_files/graphics/wires/four_signal_wires.kra @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:030e34af2cf77dc3e23fab37f9a36fb999a481ba32986523eef1584b7c31096a +size 61485