mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-10-06 04:47:14 +03:00
Misc fixes
This commit is contained in:
parent
95fa62f572
commit
198f05b112
@ -102,6 +102,10 @@ public class Planets{
|
||||
startSector = 10;
|
||||
atmosphereRadIn = -0.01f;
|
||||
atmosphereRadOut = 0.3f;
|
||||
defaultEnv = Env.underwater | Env.terrestrial;
|
||||
ruleSetter = r -> {
|
||||
|
||||
};
|
||||
}};
|
||||
|
||||
//TODO hide beryllium and others on load in rules
|
||||
|
@ -140,8 +140,10 @@ public class Weapon implements Cloneable{
|
||||
t.row();
|
||||
t.add("[lightgray]" + Stat.inaccuracy.localized() + ": [white]" + (int)inaccuracy + " " + StatUnit.degrees.localized());
|
||||
}
|
||||
t.row();
|
||||
t.add("[lightgray]" + Stat.reload.localized() + ": " + (mirror ? "2x " : "") + "[white]" + Strings.autoFixed(60f / reload * shoot.shots, 2) + " " + StatUnit.perSecond.localized());
|
||||
if(reload > 0){
|
||||
t.row();
|
||||
t.add("[lightgray]" + Stat.reload.localized() + ": " + (mirror ? "2x " : "") + "[white]" + Strings.autoFixed(60f / reload * shoot.shots, 2) + " " + StatUnit.perSecond.localized());
|
||||
}
|
||||
|
||||
StatValues.ammo(ObjectMap.of(u, bullet)).display(t);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package mindustry.type.weapons;
|
||||
|
||||
import arc.math.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
@ -22,6 +23,11 @@ public class BuildWeapon extends Weapon{
|
||||
bullet = new BulletType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStats(UnitType u, Table t){
|
||||
//no.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Unit unit, WeaponMount mount){
|
||||
//no
|
||||
|
@ -66,7 +66,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
public boolean showed = false, sectorsShown;
|
||||
public String searchText = "";
|
||||
|
||||
public Table sectorTop = new Table(), notifs = new Table();
|
||||
public Table sectorTop = new Table(), notifs = new Table(), expandTable = new Table();
|
||||
public Label hoverLabel = new Label("");
|
||||
|
||||
public PlanetDialog(){
|
||||
@ -281,6 +281,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
}
|
||||
selected = destSec;
|
||||
updateSelected();
|
||||
rebuildExpand();
|
||||
}
|
||||
|
||||
//TODO pan over to correct planet
|
||||
@ -564,7 +565,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
if(state.planet != planet){
|
||||
newPresets.clear();
|
||||
state.planet = planet;
|
||||
rebuildList();
|
||||
rebuildExpand();
|
||||
}
|
||||
settings.put("lastplanet", planet.name);
|
||||
}).width(200).height(40).growX().update(bb -> bb.setChecked(state.planet == planet));
|
||||
@ -576,31 +577,39 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
}),
|
||||
|
||||
new Table(c -> {
|
||||
c.visible(() -> !(graphics.isPortrait() && mobile));
|
||||
if(state.planet.sectors.contains(Sector::hasBase)){
|
||||
int attacked = state.planet.sectors.count(Sector::isAttacked);
|
||||
|
||||
//sector notifications & search
|
||||
c.top().right();
|
||||
c.defaults().width(290f);
|
||||
|
||||
c.button(bundle.get("sectorlist") +
|
||||
(attacked == 0 ? "" : "\n[red]⚠[lightgray] " + bundle.format("sectorlist.attacked", "[red]" + attacked + "[]")),
|
||||
Icon.downOpen, Styles.squareTogglet, () -> sectorsShown = !sectorsShown)
|
||||
.height(60f).checked(b -> {
|
||||
Image image = (Image)b.getCells().first().get();
|
||||
image.setDrawable(sectorsShown ? Icon.upOpen : Icon.downOpen);
|
||||
return sectorsShown;
|
||||
}).with(t -> t.left().margin(7f)).with(t -> t.getLabelCell().grow().left()).row();
|
||||
|
||||
c.collapser(t -> {
|
||||
t.background(Styles.black8);
|
||||
|
||||
notifs = t;
|
||||
rebuildList();
|
||||
}, false, () -> sectorsShown).padBottom(64f).row();
|
||||
}
|
||||
expandTable = c;
|
||||
})).grow();
|
||||
|
||||
rebuildExpand();
|
||||
}
|
||||
|
||||
void rebuildExpand(){
|
||||
Table c = expandTable;
|
||||
c.clear();
|
||||
c.visible(() -> !(graphics.isPortrait() && mobile));
|
||||
if(state.planet.sectors.contains(Sector::hasBase)){
|
||||
int attacked = state.planet.sectors.count(Sector::isAttacked);
|
||||
|
||||
//sector notifications & search
|
||||
c.top().right();
|
||||
c.defaults().width(290f);
|
||||
|
||||
c.button(bundle.get("sectorlist") +
|
||||
(attacked == 0 ? "" : "\n[red]⚠[lightgray] " + bundle.format("sectorlist.attacked", "[red]" + attacked + "[]")),
|
||||
Icon.downOpen, Styles.squareTogglet, () -> sectorsShown = !sectorsShown)
|
||||
.height(60f).checked(b -> {
|
||||
Image image = (Image)b.getCells().first().get();
|
||||
image.setDrawable(sectorsShown ? Icon.upOpen : Icon.downOpen);
|
||||
return sectorsShown;
|
||||
}).with(t -> t.left().margin(7f)).with(t -> t.getLabelCell().grow().left()).row();
|
||||
|
||||
c.collapser(t -> {
|
||||
t.background(Styles.black8);
|
||||
|
||||
notifs = t;
|
||||
rebuildList();
|
||||
}, false, () -> sectorsShown).padBottom(64f).row();
|
||||
}
|
||||
}
|
||||
|
||||
void rebuildList(){
|
||||
@ -1108,25 +1117,21 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
//make sure there are no under-attack sectors (other than this one)
|
||||
for(Planet planet : content.planets()){
|
||||
if(!planet.allowWaveSimulation && !debugSelect){
|
||||
int attackedCount = planet.sectors.count(s -> s.isAttacked() && s != sector);
|
||||
|
||||
//if there are two or more attacked sectors... something went wrong, don't show the dialog to prevent softlock
|
||||
if(attackedCount < 2){
|
||||
Sector attacked = planet.sectors.find(s -> s.isAttacked() && s != sector);
|
||||
if(attacked != null){
|
||||
BaseDialog dialog = new BaseDialog("@sector.noswitch.title");
|
||||
dialog.cont.add(bundle.format("sector.noswitch", attacked.name(), attacked.planet.localizedName)).maxWidth(400f).labelAlign(Align.center).center().wrap();
|
||||
dialog.addCloseButton();
|
||||
dialog.buttons.button("@sector.view", Icon.eyeSmall, () -> {
|
||||
dialog.hide();
|
||||
lookAt(attacked);
|
||||
selected = attacked;
|
||||
updateSelected();
|
||||
});
|
||||
dialog.show();
|
||||
Sector attacked = planet.sectors.find(s -> s.isAttacked() && s != sector);
|
||||
if(attacked != null && planet.sectors.count(s -> s.isAttacked()) < 2){
|
||||
BaseDialog dialog = new BaseDialog("@sector.noswitch.title");
|
||||
dialog.cont.add(bundle.format("sector.noswitch", attacked.name(), attacked.planet.localizedName)).maxWidth(400f).labelAlign(Align.center).center().wrap();
|
||||
dialog.addCloseButton();
|
||||
dialog.buttons.button("@sector.view", Icon.eyeSmall, () -> {
|
||||
dialog.hide();
|
||||
lookAt(attacked);
|
||||
selected = attacked;
|
||||
updateSelected();
|
||||
});
|
||||
dialog.show();
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public class Build{
|
||||
|
||||
if(
|
||||
check == null || //nothing there
|
||||
(state.rules.staticFog && !fogControl.isDiscovered(team, wx, wy)) ||
|
||||
(state.rules.staticFog && state.rules.fog && !fogControl.isDiscovered(team, wx, wy)) ||
|
||||
(check.floor().isDeep() && !type.floating && !type.requiresWater && !type.placeableLiquid) || //deep water
|
||||
(type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate) || //same block, same rotation
|
||||
!check.interactable(team) || //cannot interact
|
||||
|
Loading…
Reference in New Issue
Block a user