bigmap jetzt togglebar
This commit is contained in:
@@ -1,35 +1,17 @@
|
||||
import { GlobalData } from "..";
|
||||
|
||||
export default function bigmap() {
|
||||
var bigmap = { enabled: false, timer: null };
|
||||
var bigMapActive = false;
|
||||
|
||||
mp.game.ui.setRadarZoom(0.0);
|
||||
mp.game.ui.setRadarBigmapEnabled(false, false);
|
||||
|
||||
mp.events.add("render", () => {
|
||||
mp.game.controls.disableControlAction(0, 48, true);
|
||||
|
||||
if (mp.game.controls.isDisabledControlJustPressed(0, 48) && !GlobalData.InChat) {
|
||||
if (bigmap.timer != null) {
|
||||
clearTimeout(bigmap.timer);
|
||||
bigmap.timer = null;
|
||||
}
|
||||
|
||||
if (!bigmap.enabled) {
|
||||
mp.game.ui.setRadarBigmapEnabled(true, false);
|
||||
mp.game.ui.setRadarZoom(1.0);
|
||||
bigmap.enabled = true;
|
||||
|
||||
bigmap.timer = setTimeout(() => {
|
||||
mp.game.ui.setRadarBigmapEnabled(false, false);
|
||||
mp.game.ui.setRadarZoom(0.0);
|
||||
bigmap.enabled = false;
|
||||
bigmap.timer = null;
|
||||
}, 7500);
|
||||
} else {
|
||||
mp.game.ui.setRadarBigmapEnabled(false, false);
|
||||
mp.game.ui.setRadarZoom(0.0);
|
||||
bigmap.enabled = false;
|
||||
}
|
||||
bigMapActive = !bigMapActive;
|
||||
mp.game.ui.setRadarBigmapEnabled(bigMapActive, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user