Skip to content
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
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Time Control",
"author": "[royal]sk7725[]",
"description": "Speeds up or slows down Mindustry.\n[accent]Press on 'x#' to fold the slider.[]\nPress and hold to unfold.\n\n[scarlet]Disclaimer: not intended for multiplayer use![]",
"version": "0.2",
"version": "0.3",
"hidden": true,
"minGameVersion": 136
}
8 changes: 8 additions & 0 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ function speedText(speed){
}

function visibility(){
if (Vars.net.active()) {
let speed = 1;
Time.setDeltaProvider(() => Math.min(Core.graphics.getDeltaTime() * 60 * speed, 3 * speed));
foldedButton.setText(speedText(0));
timeSlider.setValue(0);

return false;
};
if(!Vars.ui.hudfrag.shown || Vars.ui.minimapfrag.shown()) return false;
if(!Vars.mobile) return true;

Expand Down