Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,10 @@ gradle-app.setting
.DS_Store
Thumbs.db
android/libs/
andriodlib/
andriodlib/

## Unused but very interesting shit, such as analytics :3
## Yes, i did implement analytics, but I'm not risking keeping them in a public version
## + leaking a discord webhook would be a problem
/.archive/
## Why are you reading a random .gitignore file, anyways?
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# NOTICE: Currently shelved unill V7's release or ealier, when controls feels more mature
not that this mod shows in the mod browser, it doesnt for some reason

# New-Controls
A Fork of ***Mnemotechnician/New-Controls-Public*** to make an Ai do simple tasks for when your lazy and/or afk!

This mod ***is multiplayer-compatible***, meaning you can use all its features (even the unfair ones) in the multiplayer.
~~TLDR: off brand Foo's client~~
# Enabling
To enable the controls: press the 🔧 (wrench) button while in-game. You will see a panel with a status bar and a big red "DISABLED" label. Clicking on the label toggles the controls.

Expand Down
39 changes: 24 additions & 15 deletions assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
newcontrols.ai.header = Ai behaviour Panel
newcontrols.ai.header = [purple]Ai behaviour Panel
newcontrols.ai.status = Status:
newcontrols.ai.enabled-ai = [green]Enabled[]
newcontrols.ai.enabled-manual = [lime]MOBILE[]
Expand All @@ -7,34 +7,43 @@ newcontrols.ai.toggle = Pause / Resume
newcontrols.ai.manual = Joystick mode
newcontrols.ai.action = Action:

newcontrols.ai.action-AUTO-TYPE = [lime]auto
newcontrols.ai.action-AUTO = [lime]auto[]\n({0}[])
newcontrols.ai.action-AUTO-TYPE = [lime]auto
newcontrols.ai.action-AUTO = [green]auto\n[white]([lime]{0}[])
newcontrols.ai.action-NONE = [accent]manual control
newcontrols.ai.action-IDLE = [scarlet]no suitable actions
newcontrols.ai.action-ATTACK = [green]attacking
newcontrols.ai.action-MINE = [green]mining
newcontrols.ai.action-PATROL = [green]patrolling
newcontrols.ai.action-BUILD = [green]Building
newcontrols.ai.action-REPAIR = [green]Repairing
newcontrols.ai.action-RETREAT=[green]Retreating

newcontrols.ai.action-ATTACK = Attacking
newcontrols.ai.action-MINE = Mining
newcontrols.ai.action-PATROL = Patrolling
newcontrols.ai.action-BUILD = Building
newcontrols.ai.action-REBUILD= Rebuilding
newcontrols.ai.action-ASSIST= Assisting
newcontrols.ai.action-REPAIR = Repairing
newcontrols.ai.action-RETREAT= Retreating
newcontrols.ai.action-TURRET= Turret

newcontrols.ai.settings = Settings
newcontrols.ai.actions-select = Select action
newcontrols.ai.actions-preferences = Preferences
newcontrols.ai.actions-enable = Toggle auto actions
newcontrols.ai.joystick = Joystick

newcontrols.ai.indicator.retreat = - R
newcontrols.ai.indicator.respawn = - r
newcontrols.ai.joystick-autoAim = Automatic Aiming
newcontrols.ai.joystick-switch = switch move and aim sticks

newcontrols.ai.prefs.attack-radius = Attack radius
newcontrols.ai.prefs.mine-radius = Mine radius
newcontrols.ai.prefs.mine-items = Mine items
newcontrols.ai.prefs.useCorePos = Use core position
newcontrols.ai.prefs.mine-keep-minimum = Minimum amount
newcontrols.ai.prefs.mine-items = Mine config
newcontrols.ai.prefs.hp-respawn = Respawn threshold
newcontrols.ai.prefs.retreat_instead = Retreat instead
newcontrols.ai.prefs.attack_ignore_buildings = Attack ignores buildings

newcontrols.ai.prefs.tooltip.useCorePos = Use the core in instead of the unit for AI's Actions
newcontrols.ai.prefs.tooltip.mine-keep-minimum = Amount to mine to before switch to other actions

newcontrols.unit.nolimit = [grey]Unlimited
newcontrols.unit.noautorespawn = [grey]Off
newcontrols.unit.nolimit = [grey]Unlimited[]
newcontrols.unit.off = [grey]Off[]
newcontrols.unit.percent = [accent]%[]

newcontrols.manual.command = Command
Expand Down
33 changes: 33 additions & 0 deletions assets/bundles/bundle_uk_UA.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
newcontrols.ai.header = Панель поведінки
newcontrols.ai.status = Статус:
newcontrols.ai.enabled-ai = [green]ENABLED + AI[]
newcontrols.ai.enabled-manual = [green]ENABLED[]
newcontrols.ai.disabled = [red]DISABLED[]
newcontrols.ai.toggle = Зупинити / Продовжити
newcontrols.ai.manual = Режим джойстика
newcontrols.ai.action = Режим:

newcontrols.ai.action-AUTO-TYPE = [lime]автоматич. вибір
newcontrols.ai.action-AUTO = [lime]автоматич. []({0}[])
newcontrols.ai.action-NONE = [accent]ручне керування
newcontrols.ai.action-IDLE = [scarlet]Немає підходящих дій
newcontrols.ai.action-ATTACK = [green]атака
newcontrols.ai.action-MINE = [green]видобуток
newcontrols.ai.action-PATROL = [green]патрулювання

newcontrols.ai.settings = Налаштування
newcontrols.ai.actions-select = Виберіть дію
newcontrols.ai.actions-preferences = Уподобання
newcontrols.ai.actions-enable = Увімк./Вимкн. автоматичні дії

newcontrols.ai.prefs.attack-radius = Радіус атаки
newcontrols.ai.prefs.mine-radius = Радіус видобутку
newcontrols.ai.prefs.mine-items = Видобувати ресурси

newcontrols.unit.nolimit = [grey]Необмежений

newcontrols.manual.command = Командувати
newcontrols.manual.pickup-unit = Підібрати одиницю
newcontrols.manual.pickup-block = Підібрати блок
newcontrols.manual.drop = Скинути вантаж
newcontrols.manual.pay-enter = Керувати блоком
2 changes: 1 addition & 1 deletion assets/bundles/bundle_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ newcontrols.manual.command = 命令
newcontrols.manual.pickup-unit = 装载单位
newcontrols.manual.pickup-block = 装载方块
newcontrols.manual.drop = 放下荷载
newcontrols.manual.pay-enter = 进入方块
newcontrols.manual.pay-enter = 进入方块
101 changes: 48 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,81 @@ version '1.0'

group = "newcontrols"

//compile java 16 code, targeting java 8
targetCompatibility = 8
sourceCompatibility = JavaVersion.VERSION_17

sourceSets.main.java.srcDirs = ["src"]

repositories{
mavenCentral()
maven{ url 'https://www.jitpack.io' }
mavenCentral()
maven {
url 'https://www.jitpack.io'
}
}

ext{
//the build number that this mod is made for
mindustryVersion = 'v135' //h..
jabelVersion = "0.7.0"
sdkRoot = System.getenv("ANDROID_HOME") ?: System.getenv("ANDROID_SDK_ROOT")
//the build number that this mod is made for
sdkRoot = System.getenv("ANDROID_HOME") ?: System.getenv("ANDROID_SDK_ROOT")
}

//java 8 backwards compatibility flag
allprojects{
tasks.withType(JavaCompile){
options.compilerArgs.addAll(['--release', '8'])
}
tasks.withType(JavaCompile){
options.compilerArgs.addAll(['--release', '8'])
}
}

dependencies{
compileOnly "com.github.Anuken.Arc:arc-core:$mindustryVersion"
compileOnly "com.github.Anuken.Mindustry:core:$mindustryVersion"
annotationProcessor "com.github.Anuken:jabel:$jabelVersion"
implementation files("lib/Autoupdate-lib.jar")
annotationProcessor 'com.github.Anuken:jabel:0.8.0'
compileOnly "com.github.Anuken.Mindustry:core:v140"
compileOnly "com.github.Anuken.Arc:arc-core:dfcb21ce56"

implementation "com.github.mnemotechnician:autoupdate-lib:-SNAPSHOT"
}

task jarAndroid{
dependsOn "jar"
dependsOn "jar"

doLast{
if(!sdkRoot || !new File(sdkRoot).exists()) throw new GradleException("No valid Android SDK found. Ensure that ANDROID_HOME is set to your Android SDK directory.");
doLast{
if(!sdkRoot || !new File(sdkRoot).exists()) throw new GradleException("No valid Android SDK found. Ensure that ANDROID_HOME is set to your Android SDK directory.")

def platformRoot = new File("$sdkRoot/platforms/").listFiles().sort().reverse().find{ f -> new File(f, "android.jar").exists()}
def platformRoot = new File("$sdkRoot/platforms/").listFiles().sort().reverse().find{ f -> new File(f, "android.jar").exists()}

if(!platformRoot) throw new GradleException("No android.jar found. Ensure that you have an Android platform installed.")
if(!platformRoot) throw new GradleException("No android.jar found. Ensure that you have an Android platform installed.")

//collect dependencies needed for desugaring
def dependencies = (configurations.compileClasspath.asList() + configurations.runtimeClasspath.asList() + [new File(platformRoot, "android.jar")]).collect{ "--classpath $it.path" }.join(" ")
//collect dependencies needed for desugaring
def dependencies = (configurations.compileClasspath.asList() + configurations.runtimeClasspath.asList() + [new File(platformRoot, "android.jar")]).collect{ "--classpath $it.path" }.join(" ")

//dex and desugar files - this requires d8 in your PATH
"d8 $dependencies --min-api 14 --output ${project.archivesBaseName}Android.jar ${project.archivesBaseName}Desktop.jar"
.execute(null, new File("$buildDir/libs")).waitForProcessOutput(System.out, System.err)
}
//dex and desugar files - this requires d8 in your PATH
"d8 $dependencies --min-api 14 --output ${project.archivesBaseName}Android.jar ${project.archivesBaseName}Desktop.jar"
.execute(null, new File("$buildDir/libs")).waitForProcessOutput(System.out, System.err)
}
}

jar{
archiveFileName = "${project.archivesBaseName}Desktop.jar"
archiveFileName = "${project.archivesBaseName}Desktop.jar"

from{
configurations.runtimeClasspath.collect{ it.isDirectory() ? it : zipTree(it) }
}
from{
configurations.runtimeClasspath.collect{ it.isDirectory() ? it : zipTree(it) }
}

from(rootDir){
include "mod.hjson"
//include "icon.png" //Will make new icon
}
from(rootDir){
include "mod.hjson"
include "icon.png"
}

from("assets/"){
include "**"
}
from("assets/"){
include "**"
}
}

task deploy(type: Jar){
dependsOn jarAndroid
dependsOn jar
archiveFileName = "Newcontrols In A Jar.jar"

from{ [zipTree("$buildDir/libs/${project.archivesBaseName}Desktop.jar"), zipTree("$buildDir/libs/${project.archivesBaseName}Android.jar")] }

doLast{
delete{
delete "$buildDir/libs/${project.archivesBaseName}Desktop.jar"
delete "$buildDir/libs/${project.archivesBaseName}Android.jar"
}
}
dependsOn jarAndroid
dependsOn jar
archiveFileName = "Newcontrols In A Jar.jar"

from{ [zipTree("$buildDir/libs/${project.archivesBaseName}Desktop.jar"), zipTree("$buildDir/libs/${project.archivesBaseName}Android.jar")] }

doLast{
delete{
delete "$buildDir/libs/${project.archivesBaseName}Desktop.jar"
delete "$buildDir/libs/${project.archivesBaseName}Android.jar"
}
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon May 02 19:45:58 CST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading