Skip to content

Commit

Permalink
Merge branch 'master' into yzh
Browse files Browse the repository at this point in the history
  • Loading branch information
YaeSakuraQvQ committed Jan 23, 2024
2 parents 84a1666 + 8f1dcc8 commit 2ab40b9
Show file tree
Hide file tree
Showing 25 changed files with 1,371 additions and 576 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- name: Set up PATH
run: |
echo "${ANDROID_HOME}/build-tools/30.0.1" >> $GITHUB_PATH
echo "${ANDROID_HOME}/build-tools/34.0.0" >> $GITHUB_PATH
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
- name: Set up PATH
run: |
echo "${ANDROID_HOME}/build-tools/30.0.1" >> $GITHUB_PATH
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 16
java-version: 17
- name: Build mod jar
run: ./gradlew deploy
- name: Upload built jar file
Expand Down
42 changes: 33 additions & 9 deletions assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,29 @@ coreInfo.selectButton.playerteam = (Player Team)

mapInfo.buttons.allAttrs = Map Attrs
mapInfo.buttons.allWaves = Waves
mapInfo.buttons.preview = Preview
mapInfo.buttons.setWave = Go
mapInfo.buttons.setWave = Set Wave
mapInfo.buttons.adminFunctions = Admin
mapInfo.buttons.forceRunWave = Force Next
mapInfo.buttons.bannedBlocks = Banned Blocks
mapInfo.buttons.bannedUnits = Banned Units
mapInfo.buttons.hiddenBuildItems = Hidden Build Items
mapInfo.buttons.revealedBlocks = Revealed Blocks
mapInfo.buttons.objectiveFlags = Objective Flags
mapInfo.buttons.mapTags = Map Tags
mapInfo.buttons.expand = Expand
mapInfo.buttons.fold = Fold

mapInfo.buildingHpMutil = BHp
mapInfo.buildingDamageMutil = BDmg
mapInfo.view = View
mapInfo.buildingHpMulti = BHp
mapInfo.buildingDamageMulti = BDmg
mapInfo.unitHealthMultiplier = UHp
mapInfo.unitDamageMutil = UDmg
mapInfo.unitDamageMulti = UDmg
mapInfo.unitCrashDamageMultiplier = UCrash
mapInfo.buildCostMutil = BCost
mapInfo.buildSpeedMutil = BSpd
mapInfo.buildRefundMutil = BRe
mapInfo.unitConstructSpeedMutil = USpd
mapInfo.buildCostMulti = BCost
mapInfo.buildSpeedMulti = BSpd
mapInfo.buildRefundMulti = BRe
mapInfo.unitConstructSpeedMulti = USpd
mapInfo.unitCostMulti = UCost
mapInfo.wave = Wave {0}
mapInfo.team = Team
mapInfo.infAmmo = Inf Ammo
Expand Down Expand Up @@ -67,6 +71,7 @@ ai.config.autorebuild = Auto Rebuild
ai.config.attack = Attack
ai.config.heal = Heal
ai.config.oneTime = One-Time Pick
ai.config.logic.ui = Custom UI

main.MI2U = MI2U
logicHelper.MI2U = Logic Helper
Expand Down Expand Up @@ -148,8 +153,11 @@ settings.mindowMap.drawSpawn = Spawn Tile
settings.mindowMap.drawFog = Fog
settings.mindowMap.drawIndicator = Attack Indicator
settings.mindowMap.drawObjective = Map Objective
settings.mindowMap.drawUnitColorDiff = Unit Color Difference
settings.mindowMap.drawUnitOutline = Unit Outline
settings.mindowMap.size = Minimap Size(Def=140)
settings.mindowMap.worldDataUpdate.tiles = Space-Scan World Tiles Update Per Tick
settings.logicHelper.autocomplete = Autocomplete

mindow2.helpInfoTitle = Help
mindow2.uiHelp = Mindow2 is a lite window developed by MI2U.\
Expand Down Expand Up @@ -201,4 +209,20 @@ fullAI.help = Logic Custom AI can control player unit with processor code. After
\n\nPlayer actions are divided into two parts: move, attack, and two timers are independent. 10s without control or using [accent]idle|stop[] will release the control to other AIs.\
\n\nLogic is based on world processor and can use world-sense instructions, but world-modifying and unsimulable instructions only work in single-player sandbox, such as [accent]SetProp, Write, SetBlock, etc.[] \
\n\nAlternative implementations by simulating player for some instructions, such as [accent]Control-config[].\
\n\nSome logic functions are implemented by simulating players, such as [accent]Control-config[].\
\n\nMultiple custom logics can be stored, but only one can be run at a time.\
\n\nOn first load, a default logic with sandbox map editor will be loaded.\
\n\nYou can customize the UI using Print statements. The statements for creating controls are as follows:\
\n[accent]UI.row()[]\
\nStarts a new row in the UI pane.\
\n[accent]UI.button(variable name)[]\
\nGenerates a button that sets boolean variable.\
\n[accent]UI.field(variable name)[]\
\nGenerates a text box that sets numeric variable.\
\n[accent]UI.choose(variable name)[]\
\nGenerates a selection box that sets variable to an item, unit, building, or other type. The variable needs to be initialized to a quantity of that type.\
\n[accent]UI.info(variable name)[]\
\nGenerates a label and monitors the variable.\
\nSimply write the statement (in double quotes) in the Print statement. \
\nEach time the statement is executed, a new control is generated, so please place it in the initialization statement.\
\n\nThe Developer shall not be liable for any consequences arising from the improper use of this feature.
41 changes: 32 additions & 9 deletions assets/bundles/bundle_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,29 @@ coreInfo.selectButton.playerteam = (玩家队伍)

mapInfo.buttons.allAttrs = 地图属性
mapInfo.buttons.allWaves = 波次
mapInfo.buttons.preview = 预览出怪
mapInfo.buttons.setWave = 跳转
mapInfo.buttons.setWave = 设置波次
mapInfo.buttons.adminFunctions = 管理波次
mapInfo.buttons.forceRunWave = 强制下一波
mapInfo.buttons.bannedBlocks = 禁用的建筑
mapInfo.buttons.bannedUnits = 禁用的单位
mapInfo.buttons.hiddenBuildItems = 隐藏的建材
mapInfo.buttons.revealedBlocks = 显示的建筑
mapInfo.buttons.objectiveFlags = 地图目标Flag
mapInfo.buttons.mapTags = 地图Tag
mapInfo.buttons.expand = 展开
mapInfo.buttons.fold = 折叠

mapInfo.buildingHpMutil = 建筑血量
mapInfo.buildingDamageMutil = 建筑伤害
mapInfo.view = 显示
mapInfo.buildingHpMulti = 建筑血量
mapInfo.buildingDamageMulti = 建筑伤害
mapInfo.unitHealthMultiplier = 单位血量
mapInfo.unitDamageMutil = 单位伤害
mapInfo.unitDamageMulti = 单位伤害
mapInfo.unitCrashDamageMultiplier = 单位坠毁伤害
mapInfo.buildCostMutil = 建造耗材
mapInfo.buildSpeedMutil = 建造速度
mapInfo.buildRefundMutil = 拆除返还
mapInfo.unitConstructSpeedMutil = 单位构造速度
mapInfo.buildCostMulti = 建造耗材
mapInfo.buildSpeedMulti = 建造速度
mapInfo.buildRefundMulti = 拆除返还
mapInfo.unitConstructSpeedMulti = 单位构造速度
mapInfo.unitCostMulti = 单位构造耗材
mapInfo.wave = 波次 {0}
mapInfo.team = 队伍
mapInfo.infAmmo = 无限弹药
Expand Down Expand Up @@ -67,6 +71,7 @@ ai.config.autorebuild = 自动重建
ai.config.attack = 攻击敌人
ai.config.heal = 修理建筑
ai.config.oneTime = 一次性抓取
ai.config.logic.ui = 自定义UI

main.MI2U = 
logicHelper.MI2U = 
Expand Down Expand Up @@ -148,8 +153,11 @@ settings.mindowMap.drawSpawn = 显示刷怪点
settings.mindowMap.drawFog = 显示迷雾
settings.mindowMap.drawIndicator = 显示攻击警告
settings.mindowMap.drawObjective = 显示地图目标
settings.mindowMap.drawUnitColorDiff = 单位图标色差
settings.mindowMap.drawUnitOutline = 单位描边
settings.mindowMap.size = 小地图尺寸(原版=140)
settings.mindowMap.worldDataUpdate.tiles = 天眼查世界数据每帧更新格数
settings.logicHelper.autocomplete = 自动补全

mindow2.helpInfoTitle = 帮助信息
mindow2.uiHelp = Mindow2是MI2U开发的简易窗体。\
Expand Down Expand Up @@ -201,4 +209,19 @@ fullAI.help = 逻辑自定义AI可以用逻辑代码控制玩家单位行动.
\n\n玩家动作分为两部分: 移动, 攻击, 2个计时器相互独立. 10s不进行控制或者使用[accent]idle, stop[], 就会释放控制权给其他AI.\
\n\n逻辑基于世界处理器, 可以使用世处的感知世界的指令, 但不能模拟的, 修改世界的指令只能在单人沙盒生效, 例如[accent]SetProp, Write, SetBlock[]等. \
\n\n部分逻辑功能通过模拟玩家实现, 例如[accent]Control-config[].\
\n\n可以存储多个自定义逻辑, 但同时只能运行其中一个.\
\n\n首次使用时, 会加载一个沙盒地形编辑器的默认逻辑.\
\n\n利用Print语句可以自定义UI. 创建控件的语句如下:\
\n[accent]UI.row()[]\
\n给UI窗格换行\
\n[accent]UI.button(变量名)[]\
\n生成按钮, 设置1,0\
\n[accent]UI.field(变量名)[]\
\n生成文本框, 设置数字变量\
\n[accent]UI.choose(变量名)[]\
\n生成选择框, 设置物品, 单位, 建筑等类型. 需要初始化变量为一个类型量.\
\n[accent]UI.info(变量名)[]\
\n生成信息栏, 监控变量\
\n在Print语句中编写语句(需要双引号)即可. \
\n语句每次执行都会生成新控件, 因此请放在初始化语句中.\
\n\n开发者对不当使用本功能产生的后果无需承担任何责任. Never Mind the Scandal and Liber.
Binary file added assets/sprites/ui-customai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ sourceSets.main.java.srcDirs = ["src"]

repositories{
mavenCentral()
maven{ url 'https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository' }
maven{ url 'https://www.jitpack.io' }
}

Expand Down
2 changes: 1 addition & 1 deletion mod.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ displayName: "MI2-Utilities Java"
name: "mi2-utilities-java"

#the mod version
version: 1.5.0
version: 1.5.4

#the minimum game build required to run this mod
minGameVersion: 146
Expand Down
12 changes: 10 additions & 2 deletions src/mi2u/MI2Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class MI2Utilities extends Mod{
public MI2Utilities(){
Events.on(ClientLoadEvent.class, e -> {
MOD = mods.getMod(MI2Utilities.class);
MOD.meta.subtitle = MOD.meta.version;
titleButtonSize = 32f;

Pixmap fade = new Pixmap(128, 128);
Expand All @@ -46,11 +47,18 @@ public MI2Utilities(){
Core.atlas.addRegion("fadeBackground", new TextureRegion(new Texture(fade)));
fadeBackground = new TextureRegionDrawable(Core.atlas.find("fadeBackground"));

Mindow2.initMindowStyles();
var whiteui = (TextureRegionDrawable)Tex.whiteui;
Mindow2.titleBarbgNormal = whiteui.tint(1f, 0.1f, 0.2f, 0.3f);
Mindow2.titleBarbgSnapped = whiteui.tint(1f, 0.1f, 0.2f, 0.2f);
Mindow2.white = whiteui.tint(1f, 1f, 1f, 1f);
Mindow2.gray2 = whiteui.tint(0.2f, 0.2f, 0.2f, 1f);
MI2USettings.init();
InputUtils.init();

maxSchematicSize = MI2USettings.getInt("maxSchematicSize", 64);
//anyone need max size < vanilla size, open an issue on Github
maxSchematicSize = Math.max(maxSchematicSize, MI2USettings.getInt("maxSchematicSize", 64));
MI2USettings.putInt("maxSchematicSize", maxSchematicSize);

renderer.maxZoom = Strings.parseFloat(MI2USettings.getStr("maxZoom", "6"));
renderer.minZoom = Strings.parseFloat(MI2USettings.getStr("minZoom", "1.5"));

Expand Down
2 changes: 1 addition & 1 deletion src/mi2u/ModifyFuncs.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static void betterTopTable(){
if(MI2USettings.getBool("modifyBlockSelectTable", false)){
Table blockCatTable = MI2Utils.getValue(ui.hudfrag.blockfrag, "blockCatTable");

((Table)blockCatTable.getCells().first().get()).getCells().first().maxHeight(Mathf.clamp(MI2USettings.getInt("blockSelectTableHeight", 194), 50, 1000));
((Table)blockCatTable.getCells().first().get()).getCells().first().height(Mathf.clamp(MI2USettings.getInt("blockSelectTableHeight", 194), 50, 1000));
blockCatTable.getCells().get(1).height(Mathf.clamp(MI2USettings.getInt("blockSelectTableHeight", 194) + 52, 50, 1000));
}
}
Expand Down
Loading

0 comments on commit 2ab40b9

Please sign in to comment.