Erweiterung Surgeon
This commit is contained in:
@@ -21,8 +21,8 @@ const localPlayer = mp.players.local;
|
|||||||
|
|
||||||
export default function charSurgery(globalData: IGlobalData) {
|
export default function charSurgery(globalData: IGlobalData) {
|
||||||
|
|
||||||
var creatorHairMenu;
|
var creatorHairMenu: NativeUI.Menu;
|
||||||
|
var characterData: PlayerCharacterData;
|
||||||
function getRandomInt(min, max) {
|
function getRandomInt(min, max) {
|
||||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ export default function charSurgery(globalData: IGlobalData) {
|
|||||||
//creatorHairMenu.AddItem(hairHighlightItem);
|
//creatorHairMenu.AddItem(hairHighlightItem);
|
||||||
|
|
||||||
eyebrowColorItem = new UIMenuListItem("Augenbrauen Farbe", "Farbe deiner Augenbrauen", new ItemsCollection(hairColors));
|
eyebrowColorItem = new UIMenuListItem("Augenbrauen Farbe", "Farbe deiner Augenbrauen", new ItemsCollection(hairColors));
|
||||||
creatorHairMenu.AddItem(eyebrowColorItem)
|
creatorHairMenu.AddItem(eyebrowColorItem);
|
||||||
|
|
||||||
beardColorItem = new UIMenuListItem("Farbe der Gesichtsbehaarung", "Farbe deiner Gesichtsbehaarung", new ItemsCollection(hairColors));
|
beardColorItem = new UIMenuListItem("Farbe der Gesichtsbehaarung", "Farbe deiner Gesichtsbehaarung", new ItemsCollection(hairColors));
|
||||||
creatorHairMenu.AddItem(beardColorItem);
|
creatorHairMenu.AddItem(beardColorItem);
|
||||||
@@ -151,28 +151,85 @@ export default function charSurgery(globalData: IGlobalData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetParentsMenu(refresh = false) {
|
function resetParentsMenu(refresh = false) {
|
||||||
fatherItem.Index = 0;
|
fatherItem.Index = characterData.Father;
|
||||||
motherItem.Index = 0;
|
motherItem.Index = characterData.Mother;
|
||||||
similarityItem.Index = (currentGender === 0) ? 100 : 0;
|
similarityItem.Index = characterData.Similarity;//(currentGender === 0) ? 100 : 0;
|
||||||
skinSimilarityItem.Index = (currentGender === 0) ? 100 : 0;
|
skinSimilarityItem.Index = characterData.SkinSimilarity;//(currentGender === 0) ? 100 : 0;
|
||||||
|
|
||||||
updateParents();
|
updateParents();
|
||||||
if (refresh) creatorParentsMenu.RefreshIndex();
|
if (refresh) creatorParentsMenu.RefreshIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function resetFeaturesMenu(refresh = false) {
|
function resetFeaturesMenu(refresh = false) {
|
||||||
for (let i = 0; i < Data.featureNames.length; i++) {
|
for (let i = 0; i < Data.featureNames.length; i++) {
|
||||||
featureItems[i].Index = 100;
|
featureItems[i].Index = loadedFeatures[i];
|
||||||
updateFaceFeature(i);
|
updateFaceFeature(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (refresh) creatorFeaturesMenu.RefreshIndex();
|
if (refresh) creatorFeaturesMenu.RefreshIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var loadedFeatures;
|
||||||
|
var loadedAppearence;
|
||||||
|
var loadedAppearenceOpacity;
|
||||||
|
|
||||||
|
function loadCharacterData() {
|
||||||
|
loadedFeatures = [
|
||||||
|
characterData.NoseWidth,
|
||||||
|
characterData.NoseBottomHeight,
|
||||||
|
characterData.NoseTipLength,
|
||||||
|
characterData.NoseBridgeDepth,
|
||||||
|
characterData.NoseTipHeight,
|
||||||
|
characterData.NoseBroken,
|
||||||
|
characterData.BrowHeight,
|
||||||
|
characterData.BrowDepth,
|
||||||
|
characterData.CheekboneHeight,
|
||||||
|
characterData.CheekboneWidth,
|
||||||
|
characterData.CheekDepth,
|
||||||
|
characterData.EyeSize,
|
||||||
|
characterData.LipThickness,
|
||||||
|
characterData.JawWidth,
|
||||||
|
characterData.JawShape,
|
||||||
|
characterData.ChinHeight,
|
||||||
|
characterData.ChinDepth,
|
||||||
|
characterData.ChinWidth,
|
||||||
|
characterData.ChinIndent,
|
||||||
|
characterData.NeckWidth
|
||||||
|
];
|
||||||
|
loadedAppearence = [
|
||||||
|
characterData.Blemishes,
|
||||||
|
characterData.FacialHair,
|
||||||
|
characterData.Eyebrows,
|
||||||
|
characterData.Ageing,
|
||||||
|
characterData.Makeup,
|
||||||
|
characterData.Blush,
|
||||||
|
characterData.Complexion,
|
||||||
|
characterData.SunDamage,
|
||||||
|
characterData.Lipstick,
|
||||||
|
characterData.Freckles,
|
||||||
|
characterData.ChestHair
|
||||||
|
];
|
||||||
|
loadedAppearenceOpacity = [
|
||||||
|
characterData.BlemishesOpacity,
|
||||||
|
characterData.FacialHairOpacity,
|
||||||
|
characterData.EyebrowsOpacity,
|
||||||
|
characterData.AgeingOpacity,
|
||||||
|
characterData.MakeupOpacity,
|
||||||
|
characterData.BlushOpacity,
|
||||||
|
characterData.ComplexionOpacity,
|
||||||
|
characterData.SunDamageOpacity,
|
||||||
|
characterData.LipstickOpacity,
|
||||||
|
characterData.FrecklesOpacity,
|
||||||
|
characterData.ChestHairOpacity
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function resetAppearanceMenu(refresh = false) {
|
function resetAppearanceMenu(refresh = false) {
|
||||||
for (let i = 0; i < Data.appearanceNames.length; i++) {
|
for (let i = 0; i < Data.appearanceNames.length; i++) {
|
||||||
appearanceItems[i].Index = 0;
|
appearanceItems[i].Index = loadedAppearence[i];
|
||||||
appearanceOpacityItems[i].Index = 100;
|
appearanceOpacityItems[i].Index = loadedAppearenceOpacity[i];
|
||||||
updateAppearance(i);
|
updateAppearance(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,12 +240,12 @@ export default function charSurgery(globalData: IGlobalData) {
|
|||||||
//hairItem.Index = 0;
|
//hairItem.Index = 0;
|
||||||
//hairColorItem.Index = 0;
|
//hairColorItem.Index = 0;
|
||||||
//hairHighlightItem.Index = 0;
|
//hairHighlightItem.Index = 0;
|
||||||
eyebrowColorItem.Index = 0;
|
eyebrowColorItem.Index = characterData.EyebrowColor;
|
||||||
beardColorItem.Index = 0;
|
beardColorItem.Index = characterData.BeardColor;
|
||||||
eyeColorItem.Index = 0;
|
eyeColorItem.Index = characterData.EyeColor;
|
||||||
blushColorItem.Index = 0;
|
blushColorItem.Index = characterData.BlushColor;
|
||||||
lipstickColorItem.Index = 0;
|
lipstickColorItem.Index = characterData.LipstickColor;
|
||||||
chestHairColorItem.Index = 0;
|
chestHairColorItem.Index = characterData.ChestHairColor;
|
||||||
updateHairAndColors();
|
updateHairAndColors();
|
||||||
|
|
||||||
if (refresh) creatorHairMenu.RefreshIndex();
|
if (refresh) creatorHairMenu.RefreshIndex();
|
||||||
@@ -292,17 +349,17 @@ export default function charSurgery(globalData: IGlobalData) {
|
|||||||
let appearanceData = [];
|
let appearanceData = [];
|
||||||
for (let i = 0; i < appearanceItems.length; i++) appearanceData.push({ Value: ((appearanceItems[i].Index === 0) ? 255 : appearanceItems[i].Index - 1), Opacity: appearanceOpacityItems[i].Index * 0.01 });
|
for (let i = 0; i < appearanceItems.length; i++) appearanceData.push({ Value: ((appearanceItems[i].Index === 0) ? 255 : appearanceItems[i].Index - 1), Opacity: appearanceOpacityItems[i].Index * 0.01 });
|
||||||
|
|
||||||
/*let hairAndColors = [
|
let hairAndColors = [
|
||||||
Data.hairList[currentGender][hairItem.Index].ID,
|
//Data.hairList[currentGender][hairItem.Index].ID,
|
||||||
hairColorItem.Index,
|
//hairColorItem.Index,
|
||||||
hairHighlightItem.Index,
|
//hairHighlightItem.Index,
|
||||||
eyebrowColorItem.Index,
|
eyebrowColorItem.Index,
|
||||||
beardColorItem.Index,
|
beardColorItem.Index,
|
||||||
eyeColorItem.Index,
|
eyeColorItem.Index,
|
||||||
blushColorItem.Index,
|
blushColorItem.Index,
|
||||||
lipstickColorItem.Index,
|
lipstickColorItem.Index,
|
||||||
chestHairColorItem.Index
|
chestHairColorItem.Index
|
||||||
];*/
|
];
|
||||||
for (let i = 0; i < creatorMenus.length; i++) creatorMenus[i].Visible = false;
|
for (let i = 0; i < creatorMenus.length; i++) creatorMenus[i].Visible = false;
|
||||||
mp.gui.chat.show(true);
|
mp.gui.chat.show(true);
|
||||||
mp.game.ui.displayRadar(true);
|
mp.game.ui.displayRadar(true);
|
||||||
@@ -312,7 +369,7 @@ export default function charSurgery(globalData: IGlobalData) {
|
|||||||
localPlayer.setComponentVariation(2, Data.hairList[currentGender][hairItem.Index].ID, 0, 2);
|
localPlayer.setComponentVariation(2, Data.hairList[currentGender][hairItem.Index].ID, 0, 2);
|
||||||
mp.game.cam.renderScriptCams(false, false, 0, true, false);
|
mp.game.cam.renderScriptCams(false, false, 0, true, false);
|
||||||
creatorCamera.destroy(true);
|
creatorCamera.destroy(true);
|
||||||
mp.events.callRemote("SaveSurgery", currentGender, JSON.stringify(parentData), JSON.stringify(featureData), JSON.stringify(appearanceData));
|
mp.events.callRemote("SaveSurgery", currentGender, JSON.stringify(parentData), JSON.stringify(featureData), JSON.stringify(appearanceData), JSON.stringify(hairAndColors));
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
break;
|
break;
|
||||||
@@ -328,6 +385,12 @@ export default function charSurgery(globalData: IGlobalData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function leaveCreator() {
|
function leaveCreator() {
|
||||||
|
|
||||||
|
//resetParentsMenu();
|
||||||
|
//resetFeaturesMenu();
|
||||||
|
//resetAppearanceMenu();
|
||||||
|
//resetHairAndColorsMenu();
|
||||||
|
|
||||||
mp.gui.chat.show(true);
|
mp.gui.chat.show(true);
|
||||||
mp.game.ui.displayRadar(true);
|
mp.game.ui.displayRadar(true);
|
||||||
mp.game.ui.displayHud(true);
|
mp.game.ui.displayHud(true);
|
||||||
@@ -480,12 +543,12 @@ export default function charSurgery(globalData: IGlobalData) {
|
|||||||
let hairItem;
|
let hairItem;
|
||||||
let hairColorItem;
|
let hairColorItem;
|
||||||
let hairHighlightItem;
|
let hairHighlightItem;
|
||||||
let eyebrowColorItem;
|
let eyebrowColorItem: NativeUI.UIMenuListItem;
|
||||||
let beardColorItem;
|
let beardColorItem: NativeUI.UIMenuListItem;
|
||||||
let eyeColorItem;
|
let eyeColorItem: NativeUI.UIMenuListItem;
|
||||||
let blushColorItem;
|
let blushColorItem: NativeUI.UIMenuListItem;
|
||||||
let lipstickColorItem;
|
let lipstickColorItem: NativeUI.UIMenuListItem;
|
||||||
let chestHairColorItem;
|
let chestHairColorItem: NativeUI.UIMenuListItem;
|
||||||
|
|
||||||
creatorHairMenu = new Menu("Haar & Farben", "", new Point(0, screenRes.y / 3), null, null);
|
creatorHairMenu = new Menu("Haar & Farben", "", new Point(0, screenRes.y / 3), null, null);
|
||||||
fillHairMenu();
|
fillHairMenu();
|
||||||
@@ -558,9 +621,13 @@ export default function charSurgery(globalData: IGlobalData) {
|
|||||||
creatorMenus.push(creatorHairMenu);
|
creatorMenus.push(creatorHairMenu);
|
||||||
// CREATOR HAIR & COLORS END
|
// CREATOR HAIR & COLORS END
|
||||||
|
|
||||||
|
var character;
|
||||||
// EVENTS
|
// EVENTS
|
||||||
mp.events.add("toggleSurgery", () => {
|
mp.events.add("toggleSurgery", (jsonCharacterData: string) => {
|
||||||
if (!mp.cameras.exists(creatorCamera)) {
|
if (!mp.cameras.exists(creatorCamera)) {
|
||||||
|
|
||||||
|
characterData = JSON.parse(jsonCharacterData);
|
||||||
|
loadCharacterData();
|
||||||
creatorCamera = mp.cameras.new("creatorCamera", creatorCoords.camera, new mp.Vector3(0, 0, 0), 45);
|
creatorCamera = mp.cameras.new("creatorCamera", creatorCoords.camera, new mp.Vector3(0, 0, 0), 45);
|
||||||
creatorCamera.pointAtCoord(creatorCoords.cameraLookAt.x, creatorCoords.cameraLookAt.y, creatorCoords.cameraLookAt.z);
|
creatorCamera.pointAtCoord(creatorCoords.cameraLookAt.x, creatorCoords.cameraLookAt.y, creatorCoords.cameraLookAt.z);
|
||||||
creatorCamera.setActive(true);
|
creatorCamera.setActive(true);
|
||||||
|
|||||||
62
ReallifeGamemode.Client/global.d.ts
vendored
62
ReallifeGamemode.Client/global.d.ts
vendored
@@ -90,3 +90,65 @@ declare type WeaponCategory = {
|
|||||||
Category: number;
|
Category: number;
|
||||||
Weapons: Weapon[];
|
Weapons: Weapon[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare type PlayerCharacterData = {
|
||||||
|
Gender: boolean;
|
||||||
|
Father: number;
|
||||||
|
Mother: number;
|
||||||
|
Similarity: number;
|
||||||
|
SkinSimilarity: number;
|
||||||
|
|
||||||
|
NoseWidth: number;
|
||||||
|
NoseBottomHeight: number;
|
||||||
|
NoseTipLength: number;
|
||||||
|
NoseBridgeDepth: number;
|
||||||
|
NoseTipHeight: number;
|
||||||
|
NoseBroken: number;
|
||||||
|
BrowHeight: number;
|
||||||
|
BrowDepth: number;
|
||||||
|
CheekboneHeight: number;
|
||||||
|
CheekboneWidth: number;
|
||||||
|
CheekDepth: number;
|
||||||
|
EyeSize: number;
|
||||||
|
LipThickness: number;
|
||||||
|
JawWidth: number;
|
||||||
|
JawShape: number;
|
||||||
|
ChinHeight: number;
|
||||||
|
ChinDepth: number;
|
||||||
|
ChinWidth: number;
|
||||||
|
ChinIndent: number;
|
||||||
|
NeckWidth: number;
|
||||||
|
|
||||||
|
Blemishes: number;
|
||||||
|
BlemishesOpacity: number;
|
||||||
|
FacialHair: number;
|
||||||
|
FacialHairOpacity: number;
|
||||||
|
Eyebrows: number;
|
||||||
|
EyebrowsOpacity: number;
|
||||||
|
Ageing: number;
|
||||||
|
AgeingOpacity: number;
|
||||||
|
Makeup: number;
|
||||||
|
MakeupOpacity: number;
|
||||||
|
Blush: number;
|
||||||
|
BlushOpacity: number;
|
||||||
|
Complexion: number;
|
||||||
|
ComplexionOpacity: number;
|
||||||
|
SunDamage: number;
|
||||||
|
SunDamageOpacity: number;
|
||||||
|
Lipstick: number;
|
||||||
|
LipstickOpacity: number;
|
||||||
|
Freckles: number;
|
||||||
|
FrecklesOpacity: number;
|
||||||
|
ChestHair: number;
|
||||||
|
ChestHairOpacity: number;
|
||||||
|
|
||||||
|
Hair: number;
|
||||||
|
HairColor: number;
|
||||||
|
HairHighlightColor: number;
|
||||||
|
EyebrowColor: number;
|
||||||
|
BeardColor: number;
|
||||||
|
EyeColor: number;
|
||||||
|
BlushColor: number;
|
||||||
|
LipstickColor: number;
|
||||||
|
ChestHairColor: number;
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using ReallifeGamemode.Database.Entities;
|
using ReallifeGamemode.Database.Entities;
|
||||||
using ReallifeGamemode.Database.Models;
|
using ReallifeGamemode.Database.Models;
|
||||||
@@ -423,34 +424,78 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
public static void StartSurgery(Player player)
|
public static void StartSurgery(Player player)
|
||||||
{
|
{
|
||||||
/*
|
Character c = player.GetUser().GetCharacter();
|
||||||
var gender;
|
|
||||||
var featureData;
|
|
||||||
var parentData;
|
|
||||||
var appearanceData;
|
|
||||||
|
|
||||||
using (var dbContext = new DatabaseContext())
|
var PlayerCharacterData = new
|
||||||
{
|
{
|
||||||
User user = player.GetUser();
|
Gender = c.Gender,
|
||||||
|
Father = c.Father,
|
||||||
|
Mother = c.Mother,
|
||||||
|
Similarity = c.Similarity,
|
||||||
|
SkinSimilarity = c.SkinSimilarity,
|
||||||
|
|
||||||
var character = dbContext.Characters.SingleOrDefault(c => c.Id == user.CharacterId);
|
NoseWidth = c.NoseWidth,
|
||||||
|
NoseBottomHeight = c.NoseBottomHeight,
|
||||||
|
NoseTipLength = c.NoseTipLength,
|
||||||
|
NoseBridgeDepth = c.NoseBridgeDepth,
|
||||||
|
NoseTipHeight = c.NoseTipHeight,
|
||||||
|
NoseBroken = c.NoseBroken,
|
||||||
|
BrowHeight = c.BrowHeight,
|
||||||
|
BrowDepth = c.BrowDepth,
|
||||||
|
CheekboneHeight = c.CheekboneHeight,
|
||||||
|
CheekboneWidth = c.CheekboneWidth,
|
||||||
|
CheekDepth = c.CheekDepth,
|
||||||
|
EyeSize = c.EyeSize,
|
||||||
|
LipThickness = c.LipThickness,
|
||||||
|
JawWidth = c.JawWidth,
|
||||||
|
JawShape = c.JawShape,
|
||||||
|
ChinHeight = c.ChinHeight,
|
||||||
|
ChinDepth = c.ChinDepth,
|
||||||
|
ChinWidth = c.ChinWidth,
|
||||||
|
ChinIndent = c.ChinIndent,
|
||||||
|
NeckWidth = c.NeckWidth,
|
||||||
|
|
||||||
if (character == null) return;
|
Blemishes = c.Blemishes,
|
||||||
|
BlemishesOpacity = c.BlemishesOpacity,
|
||||||
|
FacialHair = c.FacialHair,
|
||||||
|
FacialHairOpacity = c.FacialHairOpacity,
|
||||||
|
Eyebrows = c.Eyebrows,
|
||||||
|
EyebrowsOpacity = c.EyebrowsOpacity,
|
||||||
|
Ageing = c.Ageing,
|
||||||
|
AgeingOpacity = c.AgeingOpacity,
|
||||||
|
Makeup = c.Makeup,
|
||||||
|
MakeupOpacity = c.MakeupOpacity,
|
||||||
|
Blush = c.Blush,
|
||||||
|
BlushOpacity = c.BlushOpacity,
|
||||||
|
Complexion = c.Complexion,
|
||||||
|
ComplexionOpacity = c.ComplexionOpacity,
|
||||||
|
SunDamage = c.SunDamage,
|
||||||
|
SunDamageOpacity = c.SunDamageOpacity,
|
||||||
|
Lipstick = c.Lipstick,
|
||||||
|
LipstickOpacity = c.LipstickOpacity,
|
||||||
|
Freckles = c.Freckles,
|
||||||
|
FrecklesOpacity = c.FrecklesOpacity,
|
||||||
|
ChestHair = c.ChestHair,
|
||||||
|
ChestHairOpacity = c.ChestHairOpacity,
|
||||||
|
|
||||||
|
Hair = c.Hair,
|
||||||
|
HairColor = c.HairColor,
|
||||||
|
HairHighlightColor = c.HairHighlightColor,
|
||||||
|
EyebrowColor = c.EyebrowColor,
|
||||||
|
BeardColor = c.BeardColor,
|
||||||
|
EyeColor = c.EyeColor,
|
||||||
|
BlushColor = c.BlushColor,
|
||||||
|
LipstickColor = c.LipstickColor,
|
||||||
|
ChestHairColor = c.ChestHairColor
|
||||||
|
};
|
||||||
|
|
||||||
float[] faceFeatures = new float[] { character.NoseWidth, character.NoseBottomHeight, character.NoseTipLength, character.NoseBridgeDepth, character.NoseTipHeight,
|
|
||||||
character.NoseBroken, character.BrowHeight, character.BrowDepth, character.CheekboneHeight, character.CheekboneWidth,
|
|
||||||
character.CheekboneWidth, character.CheekDepth, character.EyeSize, character.LipThickness, character.JawWidth,
|
|
||||||
character.JawShape, character.ChinHeight, character.ChinDepth, character.ChinWidth, character.ChinIndent, character.NeckWidth };
|
|
||||||
}*/
|
|
||||||
var currentPlayerCreatorDimension = (uint)NAPI.Data.GetWorldData("playerCreatorDimension");
|
var currentPlayerCreatorDimension = (uint)NAPI.Data.GetWorldData("playerCreatorDimension");
|
||||||
currentPlayerCreatorDimension++;
|
currentPlayerCreatorDimension++;
|
||||||
NAPI.Data.SetWorldData("playerCreatorDimension", currentPlayerCreatorDimension);
|
NAPI.Data.SetWorldData("playerCreatorDimension", currentPlayerCreatorDimension);
|
||||||
player.Dimension = NAPI.Data.GetWorldData("playerCreatorDimension");
|
player.Dimension = NAPI.Data.GetWorldData("playerCreatorDimension");
|
||||||
player.SafeTeleport(new Vector3(266.472, -1339.1357, 24.5378));
|
player.SafeTeleport(new Vector3(266.472, -1339.1357, 24.5378));
|
||||||
player.Heading = 146.35101f;
|
player.Heading = 146.35101f;
|
||||||
player.TriggerEvent("toggleSurgery");
|
player.TriggerEvent("toggleSurgery", JsonConvert.SerializeObject(PlayerCharacterData));
|
||||||
|
|
||||||
//player.TriggerEvent("toggleSurgery", bool gender, string parentData, string featureData, string appearanceData)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("surgeryLeave")]
|
[RemoteEvent("surgeryLeave")]
|
||||||
@@ -467,6 +512,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
var jParentData = JObject.Parse(parentData);
|
var jParentData = JObject.Parse(parentData);
|
||||||
var jFeatureData = JArray.Parse(featureData);
|
var jFeatureData = JArray.Parse(featureData);
|
||||||
var jAppearanceData = JArray.Parse(appearanceData);
|
var jAppearanceData = JArray.Parse(appearanceData);
|
||||||
|
var jHairAndColorData = JArray.Parse(hairAndColorData);
|
||||||
|
|
||||||
byte father = jParentData.Value<byte>("Father");
|
byte father = jParentData.Value<byte>("Father");
|
||||||
byte mother = jParentData.Value<byte>("Mother");
|
byte mother = jParentData.Value<byte>("Mother");
|
||||||
@@ -517,7 +563,79 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
byte chestHair = jAppearanceData[10].Value<byte>("Value");
|
byte chestHair = jAppearanceData[10].Value<byte>("Value");
|
||||||
float chestHairOpacity = jAppearanceData[10].Value<byte>("Opacity");
|
float chestHairOpacity = jAppearanceData[10].Value<byte>("Opacity");
|
||||||
|
|
||||||
|
//byte hair = jHairAndColorData.Value<byte>(0);
|
||||||
|
//byte hairColor = jHairAndColorData.Value<byte>(1);
|
||||||
|
//byte hairHighlightColor = jHairAndColorData.Value<byte>(2);
|
||||||
|
byte eyebrowColor = jHairAndColorData.Value<byte>(0);
|
||||||
|
byte beardColor = jHairAndColorData.Value<byte>(1);
|
||||||
|
byte eyeColor = jHairAndColorData.Value<byte>(2);
|
||||||
|
byte blushColor = jHairAndColorData.Value<byte>(3);
|
||||||
|
byte lipstickColor = jHairAndColorData.Value<byte>(4);
|
||||||
|
byte chestHairColor = jHairAndColorData.Value<byte>(5);
|
||||||
|
|
||||||
|
using (var saveCharacter = new DatabaseContext())
|
||||||
|
{
|
||||||
|
var character = new Database.Entities.Character
|
||||||
|
{
|
||||||
|
UserId = player.GetUser().Id,
|
||||||
|
Gender = gender,
|
||||||
|
Father = father,
|
||||||
|
Mother = mother,
|
||||||
|
Similarity = similarity,
|
||||||
|
SkinSimilarity = skinSimilarity,
|
||||||
|
|
||||||
|
NoseWidth = noseWidth,
|
||||||
|
NoseBottomHeight = noseBottomHeight,
|
||||||
|
NoseTipLength = noseTipLength,
|
||||||
|
NoseBridgeDepth = noseBridgeDepth,
|
||||||
|
NoseTipHeight = noseTipHeight,
|
||||||
|
NoseBroken = noseBroken,
|
||||||
|
BrowHeight = browHeight,
|
||||||
|
BrowDepth = browDepth,
|
||||||
|
CheekboneHeight = cheekboneHeight,
|
||||||
|
CheekboneWidth = cheekboneWidth,
|
||||||
|
CheekDepth = cheekDepth,
|
||||||
|
EyeSize = eyeSize,
|
||||||
|
LipThickness = lipThickness,
|
||||||
|
JawWidth = jawWidth,
|
||||||
|
JawShape = jawShape,
|
||||||
|
ChinHeight = chinHeight,
|
||||||
|
ChinDepth = chinDepth,
|
||||||
|
ChinWidth = chinWidth,
|
||||||
|
ChinIndent = chinIndent,
|
||||||
|
NeckWidth = neckWidth,
|
||||||
|
|
||||||
|
Blemishes = blemishes,
|
||||||
|
BlemishesOpacity = blemishesOpacity,
|
||||||
|
FacialHair = facialHair,
|
||||||
|
FacialHairOpacity = facialHairOpacity,
|
||||||
|
Eyebrows = eyebrows,
|
||||||
|
EyebrowsOpacity = eyebrowsOpacity,
|
||||||
|
Ageing = ageing,
|
||||||
|
AgeingOpacity = ageingOpacity,
|
||||||
|
Makeup = makeup,
|
||||||
|
MakeupOpacity = makeupOpacity,
|
||||||
|
Blush = blush,
|
||||||
|
BlushOpacity = blushOpacity,
|
||||||
|
Complexion = complexion,
|
||||||
|
ComplexionOpacity = complexionOpacity,
|
||||||
|
SunDamage = sunDamage,
|
||||||
|
SunDamageOpacity = sunDamageOpacity,
|
||||||
|
Lipstick = lipstick,
|
||||||
|
LipstickOpacity = lipstickOpacity,
|
||||||
|
Freckles = freckles,
|
||||||
|
FrecklesOpacity = frecklesOpacity,
|
||||||
|
ChestHair = chestHair,
|
||||||
|
ChestHairOpacity = chestHairOpacity,
|
||||||
|
|
||||||
|
EyebrowColor = eyebrowColor,
|
||||||
|
BeardColor = beardColor,
|
||||||
|
EyeColor = eyeColor,
|
||||||
|
BlushColor = blushColor,
|
||||||
|
LipstickColor = lipstickColor,
|
||||||
|
ChestHairColor = chestHairColor
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
ApplyCharacter(player);
|
ApplyCharacter(player);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user