better generation UI (#7078)

This commit is contained in:
JniTrRny
2022-06-26 11:51:17 -04:00
committed by GitHub
parent 5b48faf13b
commit a2513493df
4 changed files with 64 additions and 46 deletions
+23 -20
View File
@@ -121,7 +121,7 @@ committingchanges = Committing Changes
done = Done done = Done
feature.unsupported = Your device does not support this feature. feature.unsupported = Your device does not support this feature.
mods.initfailed = [red]\u26a0[] The previous Mindustry instance failed to initialize. This was likely caused by misbehaving mods.\n\nTo prevent a crash loop, [red]all mods have been disabled.[] mods.initfailed = [red]\u26A0[] The previous Mindustry instance failed to initialize. This was likely caused by misbehaving mods.\n\nTo prevent a crash loop, [red]all mods have been disabled.[]
mods = Mods mods = Mods
mods.none = [lightgray]No mods found! mods.none = [lightgray]No mods found!
mods.guide = Modding Guide mods.guide = Modding Guide
@@ -450,6 +450,9 @@ editor.errorheader = This map file is either not valid or corrupt.
editor.errorname = Map has no name defined. Are you trying to load a save file? editor.errorname = Map has no name defined. Are you trying to load a save file?
editor.update = Update editor.update = Update
editor.randomize = Randomize editor.randomize = Randomize
editor.moveup = Move Up
editor.movedown = Move Down
editor.copy = Copy
editor.apply = Apply editor.apply = Apply
editor.generate = Generate editor.generate = Generate
editor.sectorgenerate = Sector Generate editor.sectorgenerate = Sector Generate
@@ -590,8 +593,8 @@ objective.destroyunits = [accent]Destroy: [][lightgray]{0}[]x Units
objective.enemiesapproaching = [accent]Enemies approaching in [lightgray]{0}[] objective.enemiesapproaching = [accent]Enemies approaching in [lightgray]{0}[]
objective.destroycore = [accent]Destroy Enemy Core objective.destroycore = [accent]Destroy Enemy Core
objective.command = [accent]Command Units objective.command = [accent]Command Units
objective.nuclearlaunch = [accent]\u26a0 Nuclear launch detected: [lightgray]{0} objective.nuclearlaunch = [accent]\u26A0 Nuclear launch detected: [lightgray]{0}
announce.nuclearstrike = [red]\u26a0 NUCLEAR STRIKE INBOUND \u26a0 announce.nuclearstrike = [red]\u26A0 NUCLEAR STRIKE INBOUND \u26A0
loadout = Loadout loadout = Loadout
resources = Resources resources = Resources
@@ -899,7 +902,7 @@ bullet.reload = [stat]{0}[lightgray]x fire rate
bullet.range = [stat]{0}[lightgray] tiles range bullet.range = [stat]{0}[lightgray] tiles range
unit.blocks = blocks unit.blocks = blocks
unit.blockssquared = blocks² unit.blockssquared = blocks\u00B2
unit.powersecond = power units/second unit.powersecond = power units/second
unit.tilessecond = tiles/second unit.tilessecond = tiles/second
unit.liquidsecond = liquid units/second unit.liquidsecond = liquid units/second
@@ -1471,39 +1474,39 @@ team.blue.name = Blue
hint.skip = Skip hint.skip = Skip
hint.desktopMove = Use [accent][[WASD][] to move. hint.desktopMove = Use [accent][[WASD][] to move.
hint.zoom = [accent]Scroll[] to zoom in or out. hint.zoom = [accent]Scroll[] to zoom in or out.
hint.mine = Move near the \uf8c4 copper ore and [accent]tap[] it to mine manually. hint.mine = Move near the \uF8C4 copper ore and [accent]tap[] it to mine manually.
hint.desktopShoot = [accent][[Left-click][] to shoot. hint.desktopShoot = [accent][[Left-click][] to shoot.
hint.depositItems = To transfer items, drag from your ship to the core. hint.depositItems = To transfer items, drag from your ship to the core.
hint.respawn = To respawn as a ship, press [accent][[V][]. hint.respawn = To respawn as a ship, press [accent][[V][].
hint.respawn.mobile = You have switched control to a unit/structure. To respawn as a ship, [accent]tap the avatar in the top left.[] hint.respawn.mobile = You have switched control to a unit/structure. To respawn as a ship, [accent]tap the avatar in the top left.[]
hint.desktopPause = Press [accent][[Space][] to pause and unpause the game. hint.desktopPause = Press [accent][[Space][] to pause and unpause the game.
hint.placeDrill = Select the \ue85e [accent]Drill[] tab in the menu at the bottom right, then select a \uf870 [accent]Drill[] and click on a copper patch to place it. hint.placeDrill = Select the \uE85E [accent]Drill[] tab in the menu at the bottom right, then select a \uF870 [accent]Drill[] and click on a copper patch to place it.
hint.placeDrill.mobile = Select the \ue85e [accent]Drill[] tab in the menu at the bottom right, then select a \uf870 [accent]Drill[] and tap on a copper patch to place it.\n\nPress the \ue800 [accent]checkmark[] at the bottom right to confirm. hint.placeDrill.mobile = Select the \uE85E [accent]Drill[] tab in the menu at the bottom right, then select a \uF870 [accent]Drill[] and tap on a copper patch to place it.\n\nPress the \uE800 [accent]checkmark[] at the bottom right to confirm.
hint.placeConveyor = Conveyors move items from drills into other blocks. Select a \uf896 [accent]Conveyor[] from the \ue814 [accent]Distribution[] tab.\n\nClick and drag to place multiple conveyors.\n[accent]Scroll[] to rotate. hint.placeConveyor = Conveyors move items from drills into other blocks. Select a \uF896 [accent]Conveyor[] from the \uE814 [accent]Distribution[] tab.\n\nClick and drag to place multiple conveyors.\n[accent]Scroll[] to rotate.
hint.placeConveyor.mobile = Conveyors move items from drills into other blocks. Select a \uf896 [accent]Conveyor[] from the \ue814 [accent]Distribution[] tab.\n\nHold down your finger for a second and drag to place multiple conveyors. hint.placeConveyor.mobile = Conveyors move items from drills into other blocks. Select a \uF896 [accent]Conveyor[] from the \uE814 [accent]Distribution[] tab.\n\nHold down your finger for a second and drag to place multiple conveyors.
hint.placeTurret = Place \uf861 [accent]Turrets[] to defend your base from enemies.\n\nTurrets require ammo - in this case, \uf838copper.\nUse conveyors and drills to supply them. hint.placeTurret = Place \uF861 [accent]Turrets[] to defend your base from enemies.\n\nTurrets require ammo - in this case, \uF838copper.\nUse conveyors and drills to supply them.
hint.breaking = [accent]Right-click[] and drag to break blocks. hint.breaking = [accent]Right-click[] and drag to break blocks.
hint.breaking.mobile = Activate the \ue817 [accent]hammer[] in the bottom right and tap to break blocks.\n\nHold down your finger for a second and drag to break in a selection. hint.breaking.mobile = Activate the \uE817 [accent]hammer[] in the bottom right and tap to break blocks.\n\nHold down your finger for a second and drag to break in a selection.
hint.blockInfo = View information of a block by selecting it in the [accent]build menu[], then selecting the [accent][[?][] button at the right. hint.blockInfo = View information of a block by selecting it in the [accent]build menu[], then selecting the [accent][[?][] button at the right.
hint.derelict = [accent]Derelict[] structures are broken remnants of old bases that no longer function.\n\nThese structures can be [accent]deconstructed[] for resources. hint.derelict = [accent]Derelict[] structures are broken remnants of old bases that no longer function.\n\nThese structures can be [accent]deconstructed[] for resources.
hint.research = Use the \ue875 [accent]Research[] button to research new technology. hint.research = Use the \uE875 [accent]Research[] button to research new technology.
hint.research.mobile = Use the \ue875 [accent]Research[] button in the \ue88c [accent]Menu[] to research new technology. hint.research.mobile = Use the \uE875 [accent]Research[] button in the \uE88C [accent]Menu[] to research new technology.
hint.unitControl = Hold [accent][[L-ctrl][] and [accent]click[] to control friendly units or turrets. hint.unitControl = Hold [accent][[L-ctrl][] and [accent]click[] to control friendly units or turrets.
hint.unitControl.mobile = [accent][[Double-tap][] to control friendly units or turrets. hint.unitControl.mobile = [accent][[Double-tap][] to control friendly units or turrets.
hint.launch = Once enough resources are collected, you can [accent]Launch[] by selecting nearby sectors from the \ue827 [accent]Map[] in the bottom right. hint.launch = Once enough resources are collected, you can [accent]Launch[] by selecting nearby sectors from the \uE827 [accent]Map[] in the bottom right.
hint.launch.mobile = Once enough resources are collected, you can [accent]Launch[] by selecting nearby sectors from the \ue827 [accent]Map[] in the \ue88c [accent]Menu[]. hint.launch.mobile = Once enough resources are collected, you can [accent]Launch[] by selecting nearby sectors from the \uE827 [accent]Map[] in the \uE88C [accent]Menu[].
hint.schematicSelect = Hold [accent][[F][] and drag to select blocks to copy and paste.\n\n[accent][[Middle Click][] to copy a single block type. hint.schematicSelect = Hold [accent][[F][] and drag to select blocks to copy and paste.\n\n[accent][[Middle Click][] to copy a single block type.
hint.conveyorPathfind = Hold [accent][[L-Ctrl][] while dragging conveyors to automatically generate a path. hint.conveyorPathfind = Hold [accent][[L-Ctrl][] while dragging conveyors to automatically generate a path.
hint.conveyorPathfind.mobile = Enable \ue844 [accent]diagonal mode[] and drag conveyors to automatically generate a path. hint.conveyorPathfind.mobile = Enable \uE844 [accent]diagonal mode[] and drag conveyors to automatically generate a path.
hint.boost = Hold [accent][[L-Shift][] to fly over obstacles with your current unit.\n\nOnly a few ground units have boosters. hint.boost = Hold [accent][[L-Shift][] to fly over obstacles with your current unit.\n\nOnly a few ground units have boosters.
hint.payloadPickup = Press [accent][[[] to pick up small blocks or units. hint.payloadPickup = Press [accent][[[] to pick up small blocks or units.
hint.payloadPickup.mobile = [accent]Tap and hold[] a small block or unit to pick it up. hint.payloadPickup.mobile = [accent]Tap and hold[] a small block or unit to pick it up.
hint.payloadDrop = Press [accent]][] to drop a payload. hint.payloadDrop = Press [accent]][] to drop a payload.
hint.payloadDrop.mobile = [accent]Tap and hold[] an empty location to drop a payload there. hint.payloadDrop.mobile = [accent]Tap and hold[] an empty location to drop a payload there.
hint.waveFire = [accent]Wave[] turrets with water as ammunition will automatically put out nearby fires. hint.waveFire = [accent]Wave[] turrets with water as ammunition will automatically put out nearby fires.
hint.generator = \uf879 [accent]Combustion Generators[] burn coal and transmit power to adjacent blocks.\n\nPower transmission range can be extended with \uf87f [accent]Power Nodes[]. hint.generator = \uF879 [accent]Combustion Generators[] burn coal and transmit power to adjacent blocks.\n\nPower transmission range can be extended with \uF87F [accent]Power Nodes[].
hint.guardian = [accent]Guardian[] units are armored. Weak ammo such as [accent]Copper[] and [accent]Lead[] is [scarlet]not effective[].\n\nUse higher tier turrets or \uf835 [accent]Graphite[] \uf861Duo/\uf859Salvo ammunition to take Guardians down. hint.guardian = [accent]Guardian[] units are armored. Weak ammo such as [accent]Copper[] and [accent]Lead[] is [scarlet]not effective[].\n\nUse higher tier turrets or \uF835 [accent]Graphite[] \uF861Duo/\uF859Salvo ammunition to take Guardians down.
hint.coreUpgrade = Cores can be upgraded by [accent]placing higher-tier cores over them[].\n\nPlace a  [accent]Foundation[] core over the  [accent]Shard[] core. Make sure it is free from nearby obstructions. hint.coreUpgrade = Cores can be upgraded by [accent]placing higher-tier cores over them[].\n\nPlace a \u00EF\u00A1\u00A8 [accent]Foundation[] core over the \u00EF\u00A1\u00A9 [accent]Shard[] core. Make sure it is free from nearby obstructions.
hint.presetLaunch = Gray [accent]landing zone sectors[], such as [accent]Frozen Forest[], can be launched to from anywhere. They do not require capture of nearby territory.\n\n[accent]Numbered sectors[], such as this one, are [accent]optional[]. hint.presetLaunch = Gray [accent]landing zone sectors[], such as [accent]Frozen Forest[], can be launched to from anywhere. They do not require capture of nearby territory.\n\n[accent]Numbered sectors[], such as this one, are [accent]optional[].
hint.presetDifficulty = This sector has a [scarlet]high enemy threat level[].\nLaunching to such sectors is [accent]not recommended[] without proper technology and preparation. hint.presetDifficulty = This sector has a [scarlet]high enemy threat level[].\nLaunching to such sectors is [accent]not recommended[] without proper technology and preparation.
hint.coreIncinerate = After the core is filled to capacity with an item, any extra items of that type it receives will be [accent]incinerated[]. hint.coreIncinerate = After the core is filled to capacity with an item, any extra items of that type it receives will be [accent]incinerated[].
@@ -1536,7 +1539,7 @@ liquid.slag.description = Refined in separators into constituent metals. Consume
liquid.oil.description = Used in advanced material production and as incendiary ammunition. liquid.oil.description = Used in advanced material production and as incendiary ammunition.
liquid.cryofluid.description = Used as coolant in reactors, turrets and factories. liquid.cryofluid.description = Used as coolant in reactors, turrets and factories.
block.derelict = \uf77e [lightgray]Derelict block.derelict = \uF77E [lightgray]Derelict
block.armored-conveyor.description = Moves items forward. Does not accept non-conveyor inputs from the sides. block.armored-conveyor.description = Moves items forward. Does not accept non-conveyor inputs from the sides.
block.illuminator.description = Emits light. block.illuminator.description = Emits light.
block.message.description = Stores a message for communication between allies. block.message.description = Stores a message for communication between allies.
@@ -268,30 +268,42 @@ public class MapGenerateDialog extends BaseDialog{
t.add().growX(); t.add().growX();
ImageButtonStyle style = Styles.geni; ImageButtonStyle style = Styles.geni;
t.defaults().size(42f); t.defaults().size(42f).padLeft(-5f);
t.button(Icon.refresh, style, () -> { t.button(Icon.refresh, style, () -> {
filter.randomize(); filter.randomize();
update(); update();
}); }).padLeft(-16f).tooltip("@editor.randomize");
t.button(Icon.upOpen, style, () -> { if(filter != filters.first()){
int idx = filters.indexOf(filter); t.button(Icon.upOpen, style, () -> {
filters.swap(idx, Math.max(0, idx - 1)); int idx = filters.indexOf(filter);
filters.swap(idx, Math.max(0, idx - 1));
rebuildFilters();
update();
}).tooltip("@editor.moveup");
}
if(filter != filters.peek()){
t.button(Icon.downOpen, style, () -> {
int idx = filters.indexOf(filter);
filters.swap(idx, Math.min(filters.size - 1, idx + 1));
rebuildFilters();
update();
}).tooltip("@editor.movedown");
}
t.button(Icon.copy, style, () -> {
filters.insert(filters.indexOf(filter), filter);
rebuildFilters(); rebuildFilters();
update(); update();
}); }).tooltip("@editor.copy");
t.button(Icon.downOpen, style, () -> {
int idx = filters.indexOf(filter);
filters.swap(idx, Math.min(filters.size - 1, idx + 1));
rebuildFilters();
update();
});
t.button(Icon.cancel, style, () -> { t.button(Icon.cancel, style, () -> {
filters.remove(filter); filters.remove(filter);
rebuildFilters(); rebuildFilters();
update(); update();
}); }).tooltip("@waves.remove");
}).growX(); }).growX();
c.row(); c.row();
+1 -1
View File
@@ -67,7 +67,7 @@ public class LogicDialog extends BaseDialog{
dialog.show(); dialog.show();
}).name("edit"); }).name("edit");
if(mobile && !Core.graphics.isPortrait()) buttons.row(); if(Core.graphics.isPortrait()) buttons.row();
buttons.button("@variables", Icon.menu, () -> { buttons.button("@variables", Icon.menu, () -> {
BaseDialog dialog = new BaseDialog("@variables"); BaseDialog dialog = new BaseDialog("@variables");
@@ -105,21 +105,24 @@ public abstract class FilterOption{
public void build(Table table){ public void build(Table table){
table.button(b -> b.image(supplier.get().uiIcon).update(i -> ((TextureRegionDrawable)i.getDrawable()) table.button(b -> b.image(supplier.get().uiIcon).update(i -> ((TextureRegionDrawable)i.getDrawable())
.setRegion(supplier.get() == Blocks.air ? Icon.none.getRegion() : supplier.get().uiIcon)).size(iconSmall), () -> { .setRegion(supplier.get() == Blocks.air ? Icon.none.getRegion() : supplier.get().uiIcon)).size(iconSmall), () -> {
BaseDialog dialog = new BaseDialog(""); BaseDialog dialog = new BaseDialog("@filter.option." + name);
dialog.setFillParent(false); dialog.setFillParent(false);
int i = 0; dialog.cont.pane(t -> {
for(Block block : Vars.content.blocks()){ int i = 0;
if(!filter.get(block)) continue; for(Block block : Vars.content.blocks()){
if(!filter.get(block)) continue;
dialog.cont.image(block == Blocks.air ? Icon.none.getRegion() : block.uiIcon).size(iconMed).pad(3).get().clicked(() -> { t.image(block == Blocks.air ? Icon.none.getRegion() : block.uiIcon).size(iconMed).pad(3).tooltip(block == Blocks.air ? "@none" : block.localizedName).get().clicked(() -> {
consumer.get(block); consumer.get(block);
dialog.hide(); dialog.hide();
changed.run(); changed.run();
}); });
if(++i % 10 == 0) dialog.cont.row(); if(++i % 10 == 0) t.row();
} }
});
dialog.closeOnBack();
dialog.addCloseButton();
dialog.show(); dialog.show();
}).pad(4).margin(12f); }).pad(4).margin(12f);