added webpack, begin migration from js to ts
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -332,3 +332,7 @@ ASALocalRun/
|
|||||||
|
|
||||||
# Local History for Visual Studio
|
# Local History for Visual Studio
|
||||||
.localhistory/
|
.localhistory/
|
||||||
|
|
||||||
|
|
||||||
|
tmp/
|
||||||
|
index.js
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
const NativeUI = require('nativeui');
|
const NativeUI = require('../nativeui');
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
const UIMenuItem = NativeUI.UIMenuItem;
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||||
@@ -10,7 +10,7 @@ const ItemsCollection = NativeUI.ItemsCollection;
|
|||||||
const Color = NativeUI.Color;
|
const Color = NativeUI.Color;
|
||||||
const ListItem = NativeUI.ListItem;
|
const ListItem = NativeUI.ListItem;
|
||||||
|
|
||||||
const moneyFormat = require("moneyformat");
|
const moneyFormat = require("../moneyformat");
|
||||||
|
|
||||||
var shopMenu;
|
var shopMenu;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ var businessMoney;
|
|||||||
var mainMenu;
|
var mainMenu;
|
||||||
var bankMenu;
|
var bankMenu;
|
||||||
|
|
||||||
const NativeUI = require("nativeui");
|
const NativeUI = require("../nativeui");
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
const UIMenuItem = NativeUI.UIMenuItem;
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||||
@@ -19,7 +19,7 @@ const ItemsCollection = NativeUI.ItemsCollection;
|
|||||||
const Color = NativeUI.Color;
|
const Color = NativeUI.Color;
|
||||||
const ListItem = NativeUI.ListItem;
|
const ListItem = NativeUI.ListItem;
|
||||||
|
|
||||||
const InputHelper = require("inputhelper");
|
const InputHelper = require("../inputhelper");
|
||||||
|
|
||||||
mp.events.add('business_showHelp', (bizName, bizMoney) => {
|
mp.events.add('business_showHelp', (bizName, bizMoney) => {
|
||||||
mp.game.ui.setTextComponentFormat('STRING');
|
mp.game.ui.setTextComponentFormat('STRING');
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
var creatorHairMenu;
|
var creatorHairMenu;
|
||||||
|
|
||||||
const NativeUI = require("nativeui");
|
const NativeUI = require("../nativeui");
|
||||||
const Data = require("CharCreator/data");
|
const Data = require("./data");
|
||||||
|
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
const UIMenuItem = NativeUI.UIMenuItem;
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const InputHelper = require("inputhelper");
|
const InputHelper = require("../../inputhelper");
|
||||||
|
|
||||||
var show = false;
|
var show = false;
|
||||||
var showAdmin = false;
|
var showAdmin = false;
|
||||||
|
|||||||
@@ -1,208 +0,0 @@
|
|||||||
/**
|
|
||||||
* @overview Life of German Reallife - Gui Infobox infobox.js
|
|
||||||
* @author VegaZ
|
|
||||||
* @copyright (c) 2008 - 2018 Life of German
|
|
||||||
*/
|
|
||||||
|
|
||||||
var currentdate;
|
|
||||||
var dateString;
|
|
||||||
var timeString;
|
|
||||||
|
|
||||||
var draw = false;
|
|
||||||
var editMode = false;
|
|
||||||
|
|
||||||
let posX = 0.92;
|
|
||||||
let posY = 0.45;
|
|
||||||
let width = 0.1;
|
|
||||||
let height = 0.2;
|
|
||||||
let colorR = 0;
|
|
||||||
let colorG = 0;
|
|
||||||
let colorB = 0;
|
|
||||||
let colorA = 72;
|
|
||||||
|
|
||||||
var day;
|
|
||||||
var month;
|
|
||||||
var year;
|
|
||||||
var hour;
|
|
||||||
var minute;
|
|
||||||
var second;
|
|
||||||
|
|
||||||
var nDay;
|
|
||||||
var nMonth;
|
|
||||||
var nHour;
|
|
||||||
var nMinute;
|
|
||||||
var nSecond;
|
|
||||||
|
|
||||||
var playerName;
|
|
||||||
var playerId;
|
|
||||||
var playerMoney;
|
|
||||||
|
|
||||||
mp.events.add("draw", (pName, pId) => {
|
|
||||||
playerName = pName;
|
|
||||||
playerId = pId;
|
|
||||||
draw = true;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add("toggleEditMode", (toggle) => {
|
|
||||||
editMode = toggle;
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add("toggleUi", (show) => {
|
|
||||||
if (show === false) {
|
|
||||||
draw = false;
|
|
||||||
mp.game.ui.displayRadar(false);
|
|
||||||
mp.game.ui.displayHud(false);
|
|
||||||
mp.gui.chat.show(false);
|
|
||||||
globalData.HideGui = true;
|
|
||||||
} else {
|
|
||||||
draw = true;
|
|
||||||
mp.game.ui.displayRadar(true);
|
|
||||||
mp.game.ui.displayHud(true);
|
|
||||||
mp.gui.chat.show(true);
|
|
||||||
globalData.HideGui = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
//function currencyFormatDE(num) {
|
|
||||||
// return ('$' + num.toFixed(2).replace('.', ',').replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1.'));
|
|
||||||
//}
|
|
||||||
|
|
||||||
const moneyFormat = require("moneyformat");
|
|
||||||
|
|
||||||
mp.events.add("updateMoney", (money) => {
|
|
||||||
playerMoney = moneyFormat(money);
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add("render", () => {
|
|
||||||
|
|
||||||
if (draw === true) {
|
|
||||||
currentdate = new Date();
|
|
||||||
|
|
||||||
day = currentdate.getDate();
|
|
||||||
month = currentdate.getMonth();
|
|
||||||
year = currentdate.getFullYear();
|
|
||||||
|
|
||||||
hour = currentdate.getHours();
|
|
||||||
minute = currentdate.getMinutes();
|
|
||||||
second = currentdate.getSeconds();
|
|
||||||
|
|
||||||
if (day < 10) {
|
|
||||||
nDay = "0" + day;
|
|
||||||
} else nDay = day;
|
|
||||||
|
|
||||||
if (hour < 10) {
|
|
||||||
nHour = "0" + hour;
|
|
||||||
} else nHour = hour;
|
|
||||||
|
|
||||||
if (minute < 10) {
|
|
||||||
nMinute = "0" + minute;
|
|
||||||
} else nMinute = minute;
|
|
||||||
|
|
||||||
if (second < 10) {
|
|
||||||
nSecond = "0" + second;
|
|
||||||
} else nSecond = second;
|
|
||||||
|
|
||||||
switch (month) {
|
|
||||||
case 0:
|
|
||||||
nMonth = "Jan.";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
nMonth = "Feb.";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
nMonth = "Mär.";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
nMonth = "Apr.";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
nMonth = "Mai";
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
nMonth = "Jun.";
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
nMonth = "Jul.";
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
nMonth = "Aug.";
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
nMonth = "Sep.";
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
nMonth = "Okt.";
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
nMonth = "Nov.";
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
nMonth = "Dez.";
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dateString = nDay + ". " + nMonth + " " + year;
|
|
||||||
timeString = nHour + ":" + nMinute + ":" + nSecond + " Uhr";
|
|
||||||
|
|
||||||
mp.game.graphics.requestStreamedTextureDict("digitaloverlay", true);
|
|
||||||
//static
|
|
||||||
mp.game.graphics.drawSprite("digitaloverlay", "static1", posX, posY, width, height, 0, 0, 255, 0, 88);
|
|
||||||
//mp.game.graphics.drawRect(posX, posY, width, height, colorR, colorG, colorB, colorA);
|
|
||||||
mp.game.graphics.drawText(playerName + " (" + playerId + ")", [0.92, 0.351],
|
|
||||||
{
|
|
||||||
font: 4,
|
|
||||||
color: [255, 255, 255, 255],
|
|
||||||
scale: [0.5, 0.5],
|
|
||||||
outline: true
|
|
||||||
})
|
|
||||||
|
|
||||||
mp.game.graphics.drawText(dateString + "\n" + timeString, [0.938, 0.381],
|
|
||||||
{
|
|
||||||
font: 4,
|
|
||||||
color: [255, 255, 255, 255],
|
|
||||||
scale: [0.5, 0.5],
|
|
||||||
outline: true
|
|
||||||
})
|
|
||||||
|
|
||||||
mp.game.graphics.drawText("~g~$~s~" + playerMoney, [0.938, 0.441],
|
|
||||||
{
|
|
||||||
font: 4,
|
|
||||||
color: [255, 255, 255, 255],
|
|
||||||
scale: [0.5, 0.5],
|
|
||||||
outline: true
|
|
||||||
})
|
|
||||||
mp.game.graphics.drawText("~r~Datum: ", [0.89, 0.381],
|
|
||||||
{
|
|
||||||
font: 4,
|
|
||||||
color: [255, 255, 255, 255],
|
|
||||||
scale: [0.5, 0.5],
|
|
||||||
outline: true
|
|
||||||
})
|
|
||||||
mp.game.graphics.drawText("~r~Uhrzeit: ", [0.891, 0.411],
|
|
||||||
{
|
|
||||||
font: 4,
|
|
||||||
color: [255, 255, 255, 255],
|
|
||||||
scale: [0.5, 0.5],
|
|
||||||
outline: true
|
|
||||||
})
|
|
||||||
mp.game.graphics.drawText("~y~Bank: ", [0.887, 0.441],
|
|
||||||
{
|
|
||||||
font: 4,
|
|
||||||
color: [255, 255, 255, 255],
|
|
||||||
scale: [0.5, 0.5],
|
|
||||||
outline: true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (editMode === true) {
|
|
||||||
mp.game.graphics.drawText("~r~EDIT-MODE AKTIV", [0.5, 0],
|
|
||||||
{
|
|
||||||
font: 4,
|
|
||||||
color: [255, 255, 255, 255],
|
|
||||||
scale: [0.7, 0.7],
|
|
||||||
outline: true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
|
||||||
213
ReallifeGamemode.Client/Gui/infobox.ts
Normal file
213
ReallifeGamemode.Client/Gui/infobox.ts
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
/**
|
||||||
|
* @overview Life of German Reallife - Gui Infobox infobox.js
|
||||||
|
* @author VegaZ
|
||||||
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
|
*/
|
||||||
|
|
||||||
|
import moneyFormat from "../moneyformat";
|
||||||
|
|
||||||
|
export default function (globalData: GlobalData): void {
|
||||||
|
var currentdate;
|
||||||
|
var dateString;
|
||||||
|
var timeString;
|
||||||
|
|
||||||
|
var draw = false;
|
||||||
|
var editMode = false;
|
||||||
|
|
||||||
|
let posX = 0.92;
|
||||||
|
let posY = 0.45;
|
||||||
|
let width = 0.1;
|
||||||
|
let height = 0.2;
|
||||||
|
let colorR = 0;
|
||||||
|
let colorG = 0;
|
||||||
|
let colorB = 0;
|
||||||
|
let colorA = 72;
|
||||||
|
|
||||||
|
var day;
|
||||||
|
var month;
|
||||||
|
var year;
|
||||||
|
var hour;
|
||||||
|
var minute;
|
||||||
|
var second;
|
||||||
|
|
||||||
|
var nDay;
|
||||||
|
var nMonth;
|
||||||
|
var nHour;
|
||||||
|
var nMinute;
|
||||||
|
var nSecond;
|
||||||
|
|
||||||
|
var playerName;
|
||||||
|
var playerId;
|
||||||
|
var playerMoney;
|
||||||
|
|
||||||
|
mp.events.add("draw", (pName, pId) => {
|
||||||
|
playerName = pName;
|
||||||
|
playerId = pId;
|
||||||
|
draw = true;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add("toggleEditMode", (toggle) => {
|
||||||
|
editMode = toggle;
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add("toggleUi", (show) => {
|
||||||
|
if (show === false) {
|
||||||
|
draw = false;
|
||||||
|
mp.game.ui.displayRadar(false);
|
||||||
|
mp.game.ui.displayHud(false);
|
||||||
|
mp.gui.chat.show(false);
|
||||||
|
globalData.HideGui = true;
|
||||||
|
} else {
|
||||||
|
draw = true;
|
||||||
|
mp.game.ui.displayRadar(true);
|
||||||
|
mp.game.ui.displayHud(true);
|
||||||
|
mp.gui.chat.show(true);
|
||||||
|
globalData.HideGui = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add("updateMoney", (money) => {
|
||||||
|
playerMoney = moneyFormat(money);
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add("render", () => {
|
||||||
|
|
||||||
|
if (draw === true) {
|
||||||
|
currentdate = new Date();
|
||||||
|
|
||||||
|
day = currentdate.getDate();
|
||||||
|
month = currentdate.getMonth();
|
||||||
|
year = currentdate.getFullYear();
|
||||||
|
|
||||||
|
hour = currentdate.getHours();
|
||||||
|
minute = currentdate.getMinutes();
|
||||||
|
second = currentdate.getSeconds();
|
||||||
|
|
||||||
|
if (day < 10) {
|
||||||
|
nDay = "0" + day;
|
||||||
|
} else nDay = day;
|
||||||
|
|
||||||
|
if (hour < 10) {
|
||||||
|
nHour = "0" + hour;
|
||||||
|
} else nHour = hour;
|
||||||
|
|
||||||
|
if (minute < 10) {
|
||||||
|
nMinute = "0" + minute;
|
||||||
|
} else nMinute = minute;
|
||||||
|
|
||||||
|
if (second < 10) {
|
||||||
|
nSecond = "0" + second;
|
||||||
|
} else nSecond = second;
|
||||||
|
|
||||||
|
switch (month) {
|
||||||
|
case 0:
|
||||||
|
nMonth = "Jan.";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
nMonth = "Feb.";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
nMonth = "Mär.";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
nMonth = "Apr.";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
nMonth = "Mai";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
nMonth = "Jun.";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
nMonth = "Jul.";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
nMonth = "Aug.";
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
nMonth = "Sep.";
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
nMonth = "Okt.";
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
nMonth = "Nov.";
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
nMonth = "Dez.";
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dateString = nDay + ". " + nMonth + " " + year;
|
||||||
|
timeString = nHour + ":" + nMinute + ":" + nSecond + " Uhr";
|
||||||
|
|
||||||
|
mp.game.graphics.requestStreamedTextureDict("digitaloverlay", true);
|
||||||
|
//static
|
||||||
|
mp.game.graphics.drawSprite("digitaloverlay", "static1", posX, posY, width, height, 0, 0, 255, 0, 88);
|
||||||
|
//mp.game.graphics.drawRect(posX, posY, width, height, colorR, colorG, colorB, colorA);
|
||||||
|
mp.game.graphics.drawText(playerName + " (" + playerId + ")", [0.92, 0.351],
|
||||||
|
{
|
||||||
|
font: 4,
|
||||||
|
color: [255, 255, 255, 255],
|
||||||
|
scale: [0.5, 0.5],
|
||||||
|
outline: true,
|
||||||
|
centre: false
|
||||||
|
})
|
||||||
|
|
||||||
|
mp.game.graphics.drawText(dateString + "\n" + timeString, [0.938, 0.381],
|
||||||
|
{
|
||||||
|
font: 4,
|
||||||
|
color: [255, 255, 255, 255],
|
||||||
|
scale: [0.5, 0.5],
|
||||||
|
outline: true,
|
||||||
|
centre: false
|
||||||
|
})
|
||||||
|
|
||||||
|
mp.game.graphics.drawText("~g~$~s~" + playerMoney, [0.938, 0.441],
|
||||||
|
{
|
||||||
|
font: 4,
|
||||||
|
color: [255, 255, 255, 255],
|
||||||
|
scale: [0.5, 0.5],
|
||||||
|
outline: true,
|
||||||
|
centre: false
|
||||||
|
})
|
||||||
|
mp.game.graphics.drawText("~r~Datum: ", [0.89, 0.381],
|
||||||
|
{
|
||||||
|
font: 4,
|
||||||
|
color: [255, 255, 255, 255],
|
||||||
|
scale: [0.5, 0.5],
|
||||||
|
outline: true,
|
||||||
|
centre: false
|
||||||
|
})
|
||||||
|
mp.game.graphics.drawText("~r~Uhrzeit: ", [0.891, 0.411],
|
||||||
|
{
|
||||||
|
font: 4,
|
||||||
|
color: [255, 255, 255, 255],
|
||||||
|
scale: [0.5, 0.5],
|
||||||
|
outline: true,
|
||||||
|
centre: false
|
||||||
|
})
|
||||||
|
mp.game.graphics.drawText("~y~Bank: ", [0.887, 0.441],
|
||||||
|
{
|
||||||
|
font: 4,
|
||||||
|
color: [255, 255, 255, 255],
|
||||||
|
scale: [0.5, 0.5],
|
||||||
|
outline: true,
|
||||||
|
centre: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (editMode === true) {
|
||||||
|
mp.game.graphics.drawText("~r~EDIT-MODE AKTIV", [0.5, 0],
|
||||||
|
{
|
||||||
|
font: 4,
|
||||||
|
color: [255, 255, 255, 255],
|
||||||
|
scale: [0.7, 0.7],
|
||||||
|
outline: true,
|
||||||
|
centre: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
let menuBrowser = null;
|
let menuBrowser = null;
|
||||||
|
|
||||||
const NativeUI = require('nativeui');
|
const NativeUI = require('../../nativeui');
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
const UIMenuItem = NativeUI.UIMenuItem;
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ var ambulanceImagePos;
|
|||||||
var rangeLeft;
|
var rangeLeft;
|
||||||
var sortText;
|
var sortText;
|
||||||
|
|
||||||
const NativeUI = require("nativeui");
|
const NativeUI = require("../nativeui");
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
const UIMenuItem = NativeUI.UIMenuItem;
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ receivedTradeGrid[2] = [0.5015, 0.5]
|
|||||||
receivedTradeGrid[3] = [0.5835, 0.5]
|
receivedTradeGrid[3] = [0.5835, 0.5]
|
||||||
receivedTradeGrid[4] = [0.6655, 0.5]
|
receivedTradeGrid[4] = [0.6655, 0.5]
|
||||||
|
|
||||||
const NativeUI = require("nativeui");
|
const NativeUI = require("../nativeui");
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
const UIMenuItem = NativeUI.UIMenuItem;
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
/**
|
|
||||||
* @overview Life of German Reallife - Login Main main.js
|
|
||||||
* @author VegaZ, hydrant
|
|
||||||
* @copyright (c) 2008 - 2018 Life of German
|
|
||||||
*/
|
|
||||||
var loginBrowser;
|
|
||||||
var loginCam = mp.cameras.new('login', new mp.Vector3(-1883.736, -781.4911, 78.27616), new mp.Vector3(3.185999, 0, -79.59519), 40);
|
|
||||||
|
|
||||||
var localPlayer = mp.players.local;
|
|
||||||
|
|
||||||
mp.events.add('SERVER:Login_ShowBrowser', _ => {
|
|
||||||
mp.gui.cursor.show(true, true);
|
|
||||||
mp.gui.chat.show(false);
|
|
||||||
mp.game.ui.displayHud(false);
|
|
||||||
mp.game.ui.displayRadar(false);
|
|
||||||
|
|
||||||
loginBrowser = mp.browsers.new("package://assets/html/login/index.html");
|
|
||||||
|
|
||||||
loginCam.setActive(true);
|
|
||||||
mp.game.cam.renderScriptCams(true, false, 0, true, false);
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add('SERVER:Login_Error', (error, deactivate = false) => {
|
|
||||||
if (loginBrowser) {
|
|
||||||
loginBrowser.execute(`showError("${error}");`);
|
|
||||||
if (deactivate) {
|
|
||||||
loginBrowser.destroy();
|
|
||||||
|
|
||||||
mp.gui.cursor.show(false, false);
|
|
||||||
mp.gui.chat.show(true);
|
|
||||||
mp.game.ui.displayHud(true);
|
|
||||||
mp.game.ui.displayRadar(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add('CEF:Login_RequestPlayerName', _ => {
|
|
||||||
if (loginBrowser) {
|
|
||||||
loginBrowser.execute(`setPlayerName("${localPlayer.name}");`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add('CEF:Login_LoginRequest', (username, password) => {
|
|
||||||
mp.events.callRemote('CLIENT:Login_LoginRequest', username, password);
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add('CEF:Login_RegisterRequest', (username, password, passwordRepeat) => {
|
|
||||||
mp.events.callRemote('CLIENT:Login_RegisterRequest', username, password, passwordRepeat);
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add('SERVER:Login_Success', _ => {
|
|
||||||
if (loginBrowser) {
|
|
||||||
loginBrowser.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
mp.gui.cursor.show(false, false);
|
|
||||||
mp.gui.chat.show(true);
|
|
||||||
mp.game.ui.displayHud(true);
|
|
||||||
mp.game.ui.displayRadar(true);
|
|
||||||
|
|
||||||
loginCam.setActive(false);
|
|
||||||
mp.game.cam.renderScriptCams(false, false, 0, true, false);
|
|
||||||
});
|
|
||||||
58
ReallifeGamemode.Client/Login/main.ts
Normal file
58
ReallifeGamemode.Client/Login/main.ts
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/**
|
||||||
|
* @overview Life of German Reallife - Login Main main.js
|
||||||
|
* @author VegaZ, hydrant
|
||||||
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default function(): void {
|
||||||
|
var loginBrowser: BrowserMp;
|
||||||
|
var loginCam: CameraMp = mp.cameras.new('login', new mp.Vector3(-1883.736, -781.4911, 78.27616), new mp.Vector3(3.185999, 0, -79.59519), 40);
|
||||||
|
|
||||||
|
var localPlayer: PlayerMp = mp.players.local;
|
||||||
|
|
||||||
|
mp.events.add('SERVER:Login_ShowBrowser', () => {
|
||||||
|
mp.gui.cursor.show(true, true);
|
||||||
|
mp.gui.chat.show(false);
|
||||||
|
mp.game.ui.displayHud(false);
|
||||||
|
mp.game.ui.displayRadar(false);
|
||||||
|
|
||||||
|
loginBrowser = mp.browsers.new("package://assets/html/login/index.html");
|
||||||
|
|
||||||
|
loginCam.setActive(true);
|
||||||
|
mp.game.cam.renderScriptCams(true, false, 0, true, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add('SERVER:Login_Error', (error: string) => {
|
||||||
|
if (loginBrowser) {
|
||||||
|
loginBrowser.execute(`showError("${error}");`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add('CEF:Login_RequestPlayerName', () => {
|
||||||
|
if (loginBrowser) {
|
||||||
|
loginBrowser.execute(`setPlayerName("${localPlayer.name}");`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add('CEF:Login_LoginRequest', (username: string, password: string) => {
|
||||||
|
mp.events.callRemote('CLIENT:Login_LoginRequest', username, password);
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add('CEF:Login_RegisterRequest', (username: string, password: string, passwordRepeat: string) => {
|
||||||
|
mp.events.callRemote('CLIENT:Login_RegisterRequest', username, password, passwordRepeat);
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add('SERVER:Login_Success', () => {
|
||||||
|
if (loginBrowser) {
|
||||||
|
loginBrowser.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
mp.gui.cursor.show(false, false);
|
||||||
|
mp.gui.chat.show(true);
|
||||||
|
mp.game.ui.displayHud(true);
|
||||||
|
mp.game.ui.displayRadar(true);
|
||||||
|
|
||||||
|
loginCam.setActive(false);
|
||||||
|
mp.game.cam.renderScriptCams(false, false, 0, true, false);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
* @copyright (c) 2008 - 2018 Life of German
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NativeUI = require("nativeui");
|
const NativeUI = require("../nativeui");
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
const UIMenuItem = NativeUI.UIMenuItem;
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||||
|
|||||||
@@ -12,10 +12,15 @@
|
|||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="tmp\**" />
|
||||||
|
<EmbeddedResource Remove="tmp\**" />
|
||||||
|
<None Remove="tmp\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="assets\css\atm\" />
|
<Folder Include="assets\css\atm\" />
|
||||||
<Folder Include="assets\img\atm\" />
|
<Folder Include="assets\img\atm\" />
|
||||||
<Folder Include="cs_packages\" />
|
|
||||||
<Folder Include="Gui\vehiclemenu\web\css\" />
|
<Folder Include="Gui\vehiclemenu\web\css\" />
|
||||||
<Folder Include="Gui\vehiclemenu\web\font\" />
|
<Folder Include="Gui\vehiclemenu\web\font\" />
|
||||||
<Folder Include="Gui\vehiclemenu\web\img\" />
|
<Folder Include="Gui\vehiclemenu\web\img\" />
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
$rootPath = "$PSScriptRoot\.."
|
|
||||||
|
|
||||||
$tsConfig = "$rootPath\tsconfig.json"
|
|
||||||
|
|
||||||
$outputPath = "$rootPath\js_output"
|
|
||||||
|
|
||||||
if(Test-Path $outputPath)
|
|
||||||
{
|
|
||||||
Remove-Item -Path $outputPath -Recurse -Force | Out-Null
|
|
||||||
}
|
|
||||||
|
|
||||||
tsc -p $tsConfig
|
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
$rootPath = "$PSScriptRoot\.."
|
#$rootPath = "$PSScriptRoot\.."
|
||||||
|
|
||||||
$assetPath = "$rootPath\assets"
|
#$assetPath = "$rootPath\assets"
|
||||||
$csPackagesPath = "$rootPath\cs_packages"
|
#$csPackagesPath = "$rootPath\cs_packages"
|
||||||
$dlcPacksPath = "$rootPath\dlcpacks"
|
#$dlcPacksPath = "$rootPath\dlcpacks"
|
||||||
|
|
||||||
$clientResourcesPath = "$rootPath\..\..\client_packages"
|
#$clientResourcesPath = "$rootPath\..\..\client_packages"
|
||||||
$sourceDlcPacksPath = "$rootPath\..\..\source_dlcpacks"
|
#$sourceDlcPacksPath = "$rootPath\..\..\source_dlcpacks"
|
||||||
|
|
||||||
Remove-Item -Path "$clientResourcesPath\*" -Recurse -Force
|
#Remove-Item -Path "$clientResourcesPath\*" -Recurse -Force
|
||||||
|
|
||||||
$exclude = @('*.ts', 'package.json', 'package-lock.json', 'tsconfig.json', '*.csproj', 'Scripts', 'node_modules', 'bin', 'obj', 'dlcpacks')
|
#$exclude = @('*.ts', 'package.json', 'package-lock.json', 'tsconfig.json', '*.csproj', 'Scripts', 'node_modules', 'bin', 'obj', 'dlcpacks')
|
||||||
|
|
||||||
if(!(Test-Path $sourceDlcPacksPath))
|
#if(!(Test-Path $sourceDlcPacksPath))
|
||||||
{
|
#{
|
||||||
New-Item -Type Directory $sourceDlcPacksPath
|
# New-Item -Type Directory $sourceDlcPacksPath
|
||||||
}
|
#}
|
||||||
|
|
||||||
Remove-Item -Path "$sourceDlcPacksPath\*" -Recurse -Force
|
#Remove-Item -Path "$sourceDlcPacksPath\*" -Recurse -Force
|
||||||
|
|
||||||
Copy-Item "$rootPath\*" $clientResourcesPath -Recurse -Exclude $exclude
|
#Copy-Item "$rootPath\*" $clientResourcesPath -Recurse -Exclude $exclude
|
||||||
Copy-Item "$dlcPacksPath\*" $sourceDlcPacksPath -Recurse -Force
|
#Copy-Item "$dlcPacksPath\*" $sourceDlcPacksPath -Recurse -Force
|
||||||
@@ -100,7 +100,7 @@ var doorOpeners = [
|
|||||||
|
|
||||||
var bikeModTypes = [];
|
var bikeModTypes = [];
|
||||||
|
|
||||||
const NativeUI = require("nativeui");
|
const NativeUI = require("../nativeui");
|
||||||
const Menu = NativeUI.Menu;
|
const Menu = NativeUI.Menu;
|
||||||
const UIMenuItem = NativeUI.UIMenuItem;
|
const UIMenuItem = NativeUI.UIMenuItem;
|
||||||
const BadgeStyle = NativeUI.BadgeStyle;
|
const BadgeStyle = NativeUI.BadgeStyle;
|
||||||
|
|||||||
6
ReallifeGamemode.Client/global.d.ts
vendored
Normal file
6
ReallifeGamemode.Client/global.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
declare interface GlobalData {
|
||||||
|
InTuning: boolean,
|
||||||
|
HideGui: boolean,
|
||||||
|
Interaction: boolean,
|
||||||
|
InChat: boolean
|
||||||
|
}
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
/**
|
|
||||||
* @overview Life of German Reallife - Login index.js
|
|
||||||
* @author VegaZ, hydrant
|
|
||||||
* @copyright (c) 2008 - 2018 Life of German
|
|
||||||
**/
|
|
||||||
|
|
||||||
let globalData = {
|
|
||||||
InTuning: false,
|
|
||||||
HideGui: false,
|
|
||||||
Interaction: false,
|
|
||||||
InChat: false
|
|
||||||
};
|
|
||||||
|
|
||||||
mp.game.gameplay.enableMpDlcMaps(true);
|
|
||||||
mp.game.vehicle.defaultEngineBehaviour = false;
|
|
||||||
|
|
||||||
//ALPHABETISCH SORTIERT UND ZUSAMMENGEFÜGT
|
|
||||||
|
|
||||||
require('./Business/main.js');
|
|
||||||
require('./Business/cardealer.js');
|
|
||||||
|
|
||||||
require('./CharCreator/index.js');
|
|
||||||
require('./coloredhlights');
|
|
||||||
|
|
||||||
require('./DoorManager/doormanager.js');
|
|
||||||
|
|
||||||
require('./FactionManagement/main.js');
|
|
||||||
|
|
||||||
require('./Gui/deathscreen.js');
|
|
||||||
require('./Gui/infobox.js');
|
|
||||||
require('./Gui/nametags.js');
|
|
||||||
require('./Gui/playerlist.js');
|
|
||||||
require('./Gui/Inventory/inventory.js');
|
|
||||||
require('./Gui/vehiclemenu/main.js');
|
|
||||||
require('./Gui/interiors.js');
|
|
||||||
|
|
||||||
require('./Interaction/factioninteraction.js');
|
|
||||||
require('./Interaction/playerinteraction.js');
|
|
||||||
|
|
||||||
require('./Login/main.js');
|
|
||||||
|
|
||||||
require('./Player/dutycloth.js');
|
|
||||||
require('./Player/keys.js');
|
|
||||||
require('./Player/quit.js');
|
|
||||||
require('./Player/freecam.js');
|
|
||||||
|
|
||||||
require('./Save/main.js');
|
|
||||||
|
|
||||||
require('./Speedometer/index.js');
|
|
||||||
|
|
||||||
require('./Tuning/main.js');
|
|
||||||
require('./Tuning/sync.js');
|
|
||||||
require('./Tuning/sirensilence.js');
|
|
||||||
|
|
||||||
require('./util/waypoint.js');
|
|
||||||
|
|
||||||
require('./vehiclesync/vehiclesync.js');
|
|
||||||
require('./vehiclesync/smoothtrottle.js');
|
|
||||||
require('./vehiclesync/vehicleindicators.js');
|
|
||||||
61
ReallifeGamemode.Client/index.ts
Normal file
61
ReallifeGamemode.Client/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/**
|
||||||
|
* @overview Life of German Reallife - Login index.js
|
||||||
|
* @author VegaZ, hydrant
|
||||||
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
|
**/
|
||||||
|
|
||||||
|
let globalData: GlobalData = {
|
||||||
|
InTuning: false,
|
||||||
|
HideGui: false,
|
||||||
|
Interaction: false,
|
||||||
|
InChat: false
|
||||||
|
};
|
||||||
|
|
||||||
|
//ALPHABETISCH SORTIERT UND ZUSAMMENGEFÜGT
|
||||||
|
|
||||||
|
//require('./Business/main.js');
|
||||||
|
//require('./Business/cardealer.js');
|
||||||
|
|
||||||
|
//require('./CharCreator/index.js');
|
||||||
|
|
||||||
|
//require('./coloredhlights');
|
||||||
|
|
||||||
|
//require('./DoorManager/doormanager.js');
|
||||||
|
|
||||||
|
//require('./FactionManagement/main.js');
|
||||||
|
|
||||||
|
//require('./Gui/deathscreen.js');
|
||||||
|
|
||||||
|
import Infobox from './Gui/infobox';
|
||||||
|
Infobox(globalData);
|
||||||
|
|
||||||
|
//require('./Gui/nametags.js');
|
||||||
|
//require('./Gui/playerlist.js');
|
||||||
|
//require('./Gui/Inventory/inventory.js');
|
||||||
|
//require('./Gui/vehiclemenu/main.js');
|
||||||
|
//require('./Gui/interiors.js');
|
||||||
|
|
||||||
|
//require('./Interaction/factioninteraction.js');
|
||||||
|
//require('./Interaction/playerinteraction.js');
|
||||||
|
|
||||||
|
import Login from './Login/main';
|
||||||
|
Login();
|
||||||
|
|
||||||
|
//require('./Player/dutycloth.js');
|
||||||
|
//require('./Player/keys.js');
|
||||||
|
//require('./Player/quit.js');
|
||||||
|
//require('./Player/freecam.js');
|
||||||
|
|
||||||
|
//require('./Save/main.js');
|
||||||
|
|
||||||
|
//require('./Speedometer/index.js');
|
||||||
|
|
||||||
|
//require('./Tuning/main.js');
|
||||||
|
//require('./Tuning/sync.js');
|
||||||
|
//require('./Tuning/sirensilence.js');
|
||||||
|
|
||||||
|
//require('./util/waypoint.js');
|
||||||
|
|
||||||
|
//require('./vehiclesync/vehiclesync.js');
|
||||||
|
//require('./vehiclesync/smoothtrottle.js');
|
||||||
|
//require('./vehiclesync/vehicleindicators.js');
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
exports = function (money, digits = 0) {
|
export default function (money, digits = 0) {
|
||||||
return money.toLocaleString("de-DE", { minimumFractionDigits: digits });
|
return money.toLocaleString("de-DE", { minimumFractionDigits: digits });
|
||||||
};
|
};
|
||||||
3990
ReallifeGamemode.Client/package-lock.json
generated
3990
ReallifeGamemode.Client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -2,9 +2,16 @@
|
|||||||
"name": "reallifegamemode.client",
|
"name": "reallifegamemode.client",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/ragemp-c": "github:CocaColaBear/types-ragemp-c#master"
|
"@types/ragemp-c": "github:CocaColaBear/types-ragemp-c#master",
|
||||||
|
"uglifyjs-webpack-plugin": "^2.1.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "^11.9.5"
|
"@babel/core": "^7.3.4",
|
||||||
|
"@types/node": "^11.9.5",
|
||||||
|
"babel-loader": "^8.0.5",
|
||||||
|
"ts-loader": "^5.3.3",
|
||||||
|
"typescript": "^3.3.3333",
|
||||||
|
"webpack": "^4.29.6",
|
||||||
|
"webpack-cli": "^3.2.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,10 @@
|
|||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"alwaysStrict": true,
|
"alwaysStrict": true,
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"rootDir": "./"
|
"rootDir": "./",
|
||||||
|
"outDir": "./tmp",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"moduleResolution": "node"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*"
|
"**/*"
|
||||||
|
|||||||
25
ReallifeGamemode.Client/webpack.config.js
Normal file
25
ReallifeGamemode.Client/webpack.config.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
mode: 'production',
|
||||||
|
entry: './index.ts',
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname),
|
||||||
|
filename: 'index.js'
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
use: { loader: 'babel-loader' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.ts$/,
|
||||||
|
use: { loader: 'ts-loader' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.ts', '.js', '.json']
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -40,6 +40,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
|
|
||||||
if (IsPlayerBanned(player)) return;
|
if (IsPlayerBanned(player)) return;
|
||||||
player.TriggerEvent("SERVER:Login_ShowBrowser");
|
player.TriggerEvent("SERVER:Login_ShowBrowser");
|
||||||
|
player.SendChatMessage("show login");
|
||||||
string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID:" + player.Handle.Value + "] (" + player.Address + ")";
|
string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID:" + player.Handle.Value + "] (" + player.Address + ")";
|
||||||
ChatService.BroadcastAdmin(msg, AdminLevel.ADMIN);
|
ChatService.BroadcastAdmin(msg, AdminLevel.ADMIN);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user