diff --git a/ReallifeGamemode.Client/Gui/house.ts b/ReallifeGamemode.Client/Gui/house.ts index 31034570..aa380097 100644 --- a/ReallifeGamemode.Client/Gui/house.ts +++ b/ReallifeGamemode.Client/Gui/house.ts @@ -20,8 +20,6 @@ export default function house(globalData: GlobalData) { mp.game.ui.addTextComponentSubstringPlayerName('Drücke ~INPUT_CONTEXT~, um das Hausmenü öffnen'); mp.game.ui.displayHelpTextFromStringLabel(0, true, true, -1); - - mp.keys.bind(0x45, false, keyPressHandler); keyBound = true; }); @@ -29,7 +27,13 @@ export default function house(globalData: GlobalData) { function keyPressHandler() { mp.gui.chat.push("open menu"); mp.game.ui.clearHelp(true); - houseMenu = new Menu("Hausverwaltung", houseData.Type, new Point(50, 50), null, null); + + var subTitle = houseData.Type; + if (houseData.OwnerName) { + subTitle += " von " + houseData.OwnerData; + } + + houseMenu = new Menu("Hausverwaltung", subTitle, new Point(50, 50), null, null); globalData.InMenu = true; mp.gui.chat.push(houseState.toString()); diff --git a/ReallifeGamemode.Server/Managers/HouseManager.cs b/ReallifeGamemode.Server/Managers/HouseManager.cs index 4c6c5507..6da5e5f9 100644 --- a/ReallifeGamemode.Server/Managers/HouseManager.cs +++ b/ReallifeGamemode.Server/Managers/HouseManager.cs @@ -83,12 +83,12 @@ namespace ReallifeGamemode.Server.Managers { using (dbContext = new DatabaseContext()) { - return dbContext.Houses.Where(h => h.Id == id).FirstOrDefault(); + return dbContext.Houses.Where(h => h.Id == id).Include(h => h.Owner).FirstOrDefault(); } } else { - return dbContext.Houses.Where(h => h.Id == id).FirstOrDefault(); + return dbContext.Houses.Where(h => h.Id == id).Include(h => h.Owner).FirstOrDefault(); } } @@ -140,6 +140,7 @@ namespace ReallifeGamemode.Server.Managers var newHouse = new { + OwnerName = house.Owner?.Name, house.RentalFee, house.Price, house.Type,