Display incompatible mods in browser / Shoot alternate mirror fix
This commit is contained in:
@@ -38,7 +38,7 @@ allprojects{
|
|||||||
|
|
||||||
ext{
|
ext{
|
||||||
versionNumber = '8'
|
versionNumber = '8'
|
||||||
if(!project.hasProperty("versionModifier")) versionModifier = 'release'
|
if(!project.hasProperty("versionModifier")) versionModifier = 'beta'
|
||||||
if(!project.hasProperty("versionType")) versionType = 'official'
|
if(!project.hasProperty("versionType")) versionType = 'official'
|
||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
steamworksVersion = '0b86023401880bb5e586bc404bedbaae9b1f1c94'
|
steamworksVersion = '0b86023401880bb5e586bc404bedbaae9b1f1c94'
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.entities.pattern;
|
package mindustry.entities.pattern;
|
||||||
|
|
||||||
|
import arc.math.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
|
||||||
public class ShootAlternate extends ShootPattern{
|
public class ShootAlternate extends ShootPattern{
|
||||||
@@ -9,6 +10,8 @@ public class ShootAlternate extends ShootPattern{
|
|||||||
public float spread = 5f;
|
public float spread = 5f;
|
||||||
/** offset of barrel to start on */
|
/** offset of barrel to start on */
|
||||||
public int barrelOffset = 0;
|
public int barrelOffset = 0;
|
||||||
|
/** If true, the shoot order is flipped. */
|
||||||
|
public boolean mirror = false;
|
||||||
|
|
||||||
public ShootAlternate(float spread){
|
public ShootAlternate(float spread){
|
||||||
this.spread = spread;
|
this.spread = spread;
|
||||||
@@ -17,11 +20,16 @@ public class ShootAlternate extends ShootPattern{
|
|||||||
public ShootAlternate(){
|
public ShootAlternate(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void flip(){
|
||||||
|
mirror = !mirror;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shoot(int totalShots, BulletHandler handler, @Nullable Runnable barrelIncrementer){
|
public void shoot(int totalShots, BulletHandler handler, @Nullable Runnable barrelIncrementer){
|
||||||
for(int i = 0; i < shots; i++){
|
for(int i = 0; i < shots; i++){
|
||||||
float index = ((totalShots + i + barrelOffset) % barrels) - (barrels-1)/2f;
|
float index = ((totalShots + i + barrelOffset) % barrels) - (barrels-1)/2f;
|
||||||
handler.shoot(index * spread, 0, 0f, firstShotDelay + shotDelay * i);
|
handler.shoot(index * spread * -Mathf.sign(mirror), 0, 0f, firstShotDelay + shotDelay * i);
|
||||||
if(barrelIncrementer != null) barrelIncrementer.run();
|
if(barrelIncrementer != null) barrelIncrementer.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -488,8 +488,6 @@ public class ModsDialog extends BaseDialog{
|
|||||||
for(ModListing mod : listings){
|
for(ModListing mod : listings){
|
||||||
if(((mod.hasJava || mod.hasScripts) && Vars.ios) ||
|
if(((mod.hasJava || mod.hasScripts) && Vars.ios) ||
|
||||||
(!Strings.matches(searchtxt, mod.name) && !Strings.matches(searchtxt, mod.repo))
|
(!Strings.matches(searchtxt, mod.name) && !Strings.matches(searchtxt, mod.repo))
|
||||||
//hack, I'm basically testing if 135.10 >= modVersion, which is equivalent to modVersion >= 136
|
|
||||||
|| (Version.isAtLeast(135, 10, mod.minGameVersion))
|
|
||||||
) continue;
|
) continue;
|
||||||
|
|
||||||
float s = 64f;
|
float s = 64f;
|
||||||
@@ -538,13 +536,16 @@ public class ModsDialog extends BaseDialog{
|
|||||||
}
|
}
|
||||||
}).size(s).pad(4f * 2f);
|
}).size(s).pad(4f * 2f);
|
||||||
|
|
||||||
con.add(
|
String infoText =
|
||||||
"[accent]" + mod.name.replace("\n", "") +
|
"[accent]" + mod.name.replace("\n", "") +
|
||||||
|
|
||||||
(installed.contains(mod.repo) ? "\n[lightgray]" + Core.bundle.get("mod.installed") : "") +
|
(installed.contains(mod.repo) ? "\n[lightgray]" + Core.bundle.get("mod.installed") : "") +
|
||||||
"\n[lightgray]\uE809 " + mod.stars +
|
"\n[lightgray]\uE809 " + mod.stars +
|
||||||
(Version.isAtLeast(mod.minGameVersion) ? "" :
|
|
||||||
"\n" + Core.bundle.format("mod.requiresversion", mod.minGameVersion)))
|
(!Version.isAtLeast(mod.minGameVersion) ? "\n" + Core.bundle.format("mod.requiresversion", mod.minGameVersion) :
|
||||||
.width(358f).wrap().grow().pad(4f, 2f, 4f, 6f).top().left().labelAlign(Align.topLeft);
|
((mod.hasJava && Strings.parseDouble(mod.minGameVersion, 0) < minJavaModGameVersion) ? "\n" + Core.bundle.get("mod.incompatiblemod") : ""));
|
||||||
|
|
||||||
|
con.add(infoText).width(358f).wrap().grow().pad(4f, 2f, 4f, 6f).top().left().labelAlign(Align.topLeft);
|
||||||
|
|
||||||
}, Styles.flatBordert, () -> {
|
}, Styles.flatBordert, () -> {
|
||||||
var sel = new BaseDialog(mod.name);
|
var sel = new BaseDialog(mod.name);
|
||||||
@@ -569,6 +570,7 @@ public class ModsDialog extends BaseDialog{
|
|||||||
sel.buttons.button("@mods.github.open", Icon.link, () -> {
|
sel.buttons.button("@mods.github.open", Icon.link, () -> {
|
||||||
Core.app.openURI("https://github.com/" + mod.repo);
|
Core.app.openURI("https://github.com/" + mod.repo);
|
||||||
});
|
});
|
||||||
|
|
||||||
sel.buttons.button("@mods.browser.view-releases", Icon.zoom, () -> {
|
sel.buttons.button("@mods.browser.view-releases", Icon.zoom, () -> {
|
||||||
BaseDialog load = new BaseDialog("");
|
BaseDialog load = new BaseDialog("");
|
||||||
load.cont.add("[accent]Fetching Releases...");
|
load.cont.add("[accent]Fetching Releases...");
|
||||||
|
|||||||
Reference in New Issue
Block a user