Fix spectate und Movement im Creator geht jez nich mehr

This commit is contained in:
VegaZ
2021-05-04 23:29:21 +02:00
parent 6cf20abb7b
commit 62d283600e
3 changed files with 75 additions and 10 deletions

View File

@@ -237,10 +237,13 @@ export default function charCreator(globalData: IGlobalData) {
saveItem.HighlightedBackColor = new Color(25, 118, 210);
creatorMainMenu.AddItem(saveItem);
//let cancelItem = new UIMenuItem("Abbrechen", "Setzt alle \u00c4nderungen zur\u00fcck.");
//cancelItem.BackColor = new Color(213, 0, 0);
//cancelItem.HighlightedBackColor = new Color(229, 57, 53);
//creatorMainMenu.AddItem(cancelItem);
if (isSurgery) {
let cancelItem = new UIMenuItem("Abbrechen", "Bricht die Operation ab");
cancelItem.BackColor = new Color(213, 0, 0);
cancelItem.HighlightedBackColor = new Color(229, 57, 53);
creatorMainMenu.AddItem(cancelItem);
}
creatorMainMenu.ListChange.on((item, listIndex) => {
if (item === genderItem) {
@@ -571,7 +574,7 @@ export default function charCreator(globalData: IGlobalData) {
creatorCamera.pointAtCoord(creatorCoords.cameraLookAt.x, creatorCoords.cameraLookAt.y, creatorCoords.cameraLookAt.z);
creatorCamera.setActive(true);
}
resetAppearanceMenu();
resetFeaturesMenu();
resetHairAndColorsMenu();
@@ -588,6 +591,7 @@ export default function charCreator(globalData: IGlobalData) {
localPlayer.freezePosition(true);
mp.game.cam.renderScriptCams(true, false, 0, true, false);
applyCreatorOutfit();
mp.events.callRemote("creator_GenderChange", 0);
}
});
@@ -611,5 +615,42 @@ export default function charCreator(globalData: IGlobalData) {
globalData.InMenu = false;
globalData.InMenu = false;
if (isSurgery) isSurgery = false;
}
mp.events.add("render", () => {
if (mp.cameras.exists(creatorCamera)) disableInput();
});
function disableInput() {
//WASD
mp.game.controls.disableControlAction(0, 30, true);
mp.game.controls.disableControlAction(0, 31, true);
mp.game.controls.disableControlAction(0, 32, true);
mp.game.controls.disableControlAction(0, 33, true);
mp.game.controls.disableControlAction(0, 34, true);
mp.game.controls.disableControlAction(0, 35, true);
mp.game.controls.disableControlAction(0, 266, true);
mp.game.controls.disableControlAction(0, 267, true);
mp.game.controls.disableControlAction(0, 268, true);
mp.game.controls.disableControlAction(0, 269, true);
//SPACE
mp.game.controls.disableControlAction(0, 22, true);
//R
mp.game.controls.disableControlAction(0, 140, true);
mp.game.controls.disableControlAction(0, 263, true);
//LMB
mp.game.controls.disableControlAction(0, 24, true);
mp.game.controls.disableControlAction(0, 257, true);
//LEFT CTRL
mp.game.controls.disableControlAction(0, 36, true);
//Q
mp.game.controls.disableControlAction(0, 44, true);
}
}