Show house owner name when house has owner
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user