better generation UI (#7078)

This commit is contained in:
JniTrRny
2022-06-26 22:51:17 +07:00
committed by GitHub
parent 5b48faf13b
commit a2513493df
4 changed files with 64 additions and 46 deletions

View File

@@ -121,7 +121,7 @@ committingchanges = Committing Changes
done = Done
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.none = [lightgray]No mods found!
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.update = Update
editor.randomize = Randomize
editor.moveup = Move Up
editor.movedown = Move Down
editor.copy = Copy
editor.apply = Apply
editor.generate = 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.destroycore = [accent]Destroy Enemy Core
objective.command = [accent]Command Units
objective.nuclearlaunch = [accent]\u26a0 Nuclear launch detected: [lightgray]{0}
announce.nuclearstrike = [red]\u26a0 NUCLEAR STRIKE INBOUND \u26a0
objective.nuclearlaunch = [accent]\u26A0 Nuclear launch detected: [lightgray]{0}
announce.nuclearstrike = [red]\u26A0 NUCLEAR STRIKE INBOUND \u26A0
loadout = Loadout
resources = Resources
@@ -899,7 +902,7 @@ bullet.reload = [stat]{0}[lightgray]x fire rate
bullet.range = [stat]{0}[lightgray] tiles range
unit.blocks = blocks
unit.blockssquared = blocks²
unit.blockssquared = blocks\u00B2
unit.powersecond = power units/second
unit.tilessecond = tiles/second
unit.liquidsecond = liquid units/second
@@ -1471,39 +1474,39 @@ team.blue.name = Blue
hint.skip = Skip
hint.desktopMove = Use [accent][[WASD][] to move.
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.depositItems = To transfer items, drag from your ship to the core.
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.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.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.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.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.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.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.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.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.mobile = Use the \ue875 [accent]Research[] button in the \ue88c [accent]Menu[] 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.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.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 = 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.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.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.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.payloadDrop = Press [accent]][] to drop a payload.
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.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.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.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.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.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[].
@@ -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.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.illuminator.description = Emits light.
block.message.description = Stores a message for communication between allies.

View File

@@ -268,30 +268,42 @@ public class MapGenerateDialog extends BaseDialog{
t.add().growX();
ImageButtonStyle style = Styles.geni;
t.defaults().size(42f);
t.defaults().size(42f).padLeft(-5f);
t.button(Icon.refresh, style, () -> {
filter.randomize();
update();
});
}).padLeft(-16f).tooltip("@editor.randomize");
t.button(Icon.upOpen, style, () -> {
int idx = filters.indexOf(filter);
filters.swap(idx, Math.max(0, idx - 1));
if(filter != filters.first()){
t.button(Icon.upOpen, style, () -> {
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();
update();
});
t.button(Icon.downOpen, style, () -> {
int idx = filters.indexOf(filter);
filters.swap(idx, Math.min(filters.size - 1, idx + 1));
rebuildFilters();
update();
});
}).tooltip("@editor.copy");
t.button(Icon.cancel, style, () -> {
filters.remove(filter);
rebuildFilters();
update();
});
}).tooltip("@waves.remove");
}).growX();
c.row();

View File

@@ -67,7 +67,7 @@ public class LogicDialog extends BaseDialog{
dialog.show();
}).name("edit");
if(mobile && !Core.graphics.isPortrait()) buttons.row();
if(Core.graphics.isPortrait()) buttons.row();
buttons.button("@variables", Icon.menu, () -> {
BaseDialog dialog = new BaseDialog("@variables");

View File

@@ -105,21 +105,24 @@ public abstract class FilterOption{
public void build(Table table){
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), () -> {
BaseDialog dialog = new BaseDialog("");
BaseDialog dialog = new BaseDialog("@filter.option." + name);
dialog.setFillParent(false);
int i = 0;
for(Block block : Vars.content.blocks()){
if(!filter.get(block)) continue;
dialog.cont.pane(t -> {
int i = 0;
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(() -> {
consumer.get(block);
dialog.hide();
changed.run();
});
if(++i % 10 == 0) dialog.cont.row();
}
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);
dialog.hide();
changed.run();
});
if(++i % 10 == 0) t.row();
}
});
dialog.closeOnBack();
dialog.addCloseButton();
dialog.show();
}).pad(4).margin(12f);