mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-28 13:47:32 +07:00
Added unit type descriptions / Changed blast drill sprite
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 562 B |
@ -419,6 +419,9 @@ text.item.radioactivity=[LIGHT_GRAY]Radioactivity: {0}
|
||||
text.item.fluxiness=[LIGHT_GRAY]Flux Power: {0}
|
||||
text.item.hardness=[LIGHT_GRAY]Hardness: {0}
|
||||
|
||||
text.unit.health=[LIGHT_GRAY]Health: {0}
|
||||
text.unit.speed=[LIGHT_GRAY]Speed: {0}
|
||||
|
||||
text.liquid.heatcapacity=[LIGHT_GRAY]Heat Capacity: {0}
|
||||
text.liquid.viscosity=[LIGHT_GRAY]Viscosity: {0}
|
||||
text.liquid.temperature=[LIGHT_GRAY]Temperature: {0}
|
||||
@ -520,4 +523,16 @@ block.rotary-pump.name=Rotary Pump
|
||||
block.nuclear-reactor.name=Nuclear Reactor
|
||||
block.interceptor-factory.name=Interceptor Factory
|
||||
block.command-center.name=Command Center
|
||||
block.mass-driver.name=Mass Driver
|
||||
block.mass-driver.name=Mass Driver
|
||||
block.blast-drill.name=Blast Drill
|
||||
|
||||
unit.drone.name=Drone
|
||||
unit.drone.description=The starter drone unit. Spawns in the core by default. Automatically mines ores, collects items and repairs blocks.
|
||||
unit.fabricator.name=Fabricator
|
||||
unit.fabricator.description=An advanced drone unit. Automatically mines ores, collects items and repairs blocks. Significantly more effective than a drone.
|
||||
unit.scout.name=Scout
|
||||
unit.scout.description=A basic ground unit. Uses tungsten as ammo.
|
||||
unit.titan.name=Titan
|
||||
unit.titan.description=An advanced armored ground unit. Uses carbide as ammo. Attacks both ground and air targets.
|
||||
unit.monsoon.name=Monsoon
|
||||
unit.monsoon.description=A heavy carpet bomber. Uses blast compound or pyratite as ammo.
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 138 KiB |
@ -16,14 +16,19 @@ import io.anuke.ucore.function.Supplier;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Log;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
|
||||
//TODO merge unit type with mech
|
||||
public class UnitType implements UnlockableContent{
|
||||
private static byte lastid = 0;
|
||||
private static Array<UnitType> types = new Array<>();
|
||||
public final String name;
|
||||
public final byte id;
|
||||
|
||||
protected final Supplier<? extends BaseUnit> constructor;
|
||||
|
||||
public final String name;
|
||||
public final String description;
|
||||
public final byte id;
|
||||
public float health = 60;
|
||||
public float hitsize = 5f;
|
||||
public float hitsizeTile = 4f;
|
||||
@ -51,10 +56,16 @@ public class UnitType implements UnlockableContent{
|
||||
this.id = lastid++;
|
||||
this.name = name;
|
||||
this.constructor = mainConstructor;
|
||||
this.description = Bundles.getOrNull("unit." + name + ".description");
|
||||
|
||||
types.add(this);
|
||||
|
||||
TypeTrait.registerType(type, mainConstructor);
|
||||
|
||||
if(!Bundles.has("unit." + this.name + ".name")){
|
||||
Log.err("Warning: unit '" + name + "' is missing a localized name. Add the follow to bundle.properties:");
|
||||
Log.err("unit." + this.name + ".name=" + Strings.capitalize(name.replace('-', '_')));
|
||||
}
|
||||
}
|
||||
|
||||
public static UnitType getByID(byte id){
|
||||
|
@ -23,33 +23,19 @@ public class Item implements Comparable<Item>, UnlockableContent{
|
||||
public final Color color;
|
||||
public TextureRegion region;
|
||||
|
||||
/**
|
||||
* type of the item; used for tabs and core acceptance. default value is {@link ItemType#resource}.
|
||||
*/
|
||||
/**type of the item; used for tabs and core acceptance. default value is {@link ItemType#resource}.*/
|
||||
public ItemType type = ItemType.resource;
|
||||
/**
|
||||
* how explosive this item is.
|
||||
*/
|
||||
/**how explosive this item is.*/
|
||||
public float explosiveness = 0f;
|
||||
/**
|
||||
* flammability above 0.3 makes this eleigible for item burners.
|
||||
*/
|
||||
/**flammability above 0.3 makes this eleigible for item burners.*/
|
||||
public float flammability = 0f;
|
||||
/**
|
||||
* how radioactive this item is. 0=none, 1=chernobyl ground zero
|
||||
*/
|
||||
/**how radioactive this item is. 0=none, 1=chernobyl ground zero*/
|
||||
public float radioactivity;
|
||||
/**
|
||||
* how effective this item is as flux for smelting. 0 = not a flux, 0.5 = normal flux, 1 = very good
|
||||
*/
|
||||
/**how effective this item is as flux for smelting. 0 = not a flux, 0.5 = normal flux, 1 = very good*/
|
||||
public float fluxiness = 0f;
|
||||
/**
|
||||
* drill hardness of the item
|
||||
*/
|
||||
/**drill hardness of the item*/
|
||||
public int hardness = 0;
|
||||
/**
|
||||
* the burning color of this item
|
||||
*/
|
||||
/**the burning color of this item*/
|
||||
public Color flameColor = Palette.darkFlame.cpy();
|
||||
/**
|
||||
* base material cost of this item, used for calculating place times
|
||||
|
@ -17,6 +17,7 @@ import io.anuke.mindustry.world.meta.StatValue;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
|
||||
public class ContentDisplay{
|
||||
|
||||
@ -144,6 +145,31 @@ public class ContentDisplay{
|
||||
}
|
||||
|
||||
public static void displayUnit(Table table, UnitType unit){
|
||||
table.table(title -> {
|
||||
title.addImage(unit.getContentIcon()).size(8 * 6);
|
||||
title.add("[accent]" + unit.localizedName()).padLeft(5);
|
||||
});
|
||||
|
||||
table.row();
|
||||
|
||||
table.addImage("white").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||
|
||||
table.row();
|
||||
|
||||
if(unit.description != null){
|
||||
table.add(unit.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
||||
table.row();
|
||||
|
||||
table.addImage("white").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||
table.row();
|
||||
}
|
||||
|
||||
table.left().defaults().fillX();
|
||||
|
||||
table.add(Bundles.format("text.unit.health", unit.health));
|
||||
table.row();
|
||||
table.add(Bundles.format("text.unit.speed", Strings.toFixed(unit.speed, 1)));
|
||||
table.row();
|
||||
table.row();
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import io.anuke.mindustry.core.ContentLoader;
|
||||
import io.anuke.mindustry.game.Content;
|
||||
import io.anuke.mindustry.game.UnlockableContent;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.ucore.scene.event.HandCursorListener;
|
||||
import io.anuke.ucore.scene.ui.Image;
|
||||
import io.anuke.ucore.scene.ui.ScrollPane;
|
||||
import io.anuke.ucore.scene.ui.Tooltip;
|
||||
@ -56,6 +57,7 @@ public class UnlocksDialog extends FloatingDialog{
|
||||
if(unlock.isHidden()) continue;
|
||||
|
||||
Image image = control.database().isUnlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-locked");
|
||||
image.addListener(new HandCursorListener());
|
||||
list.add(image).size(size).pad(3);
|
||||
|
||||
if(control.database().isUnlocked(unlock)){
|
||||
|
Reference in New Issue
Block a user