private InfoMenuViewModel prepareMenu() { Menu = new InfoMenuViewModel(); Menu.AddItem(InfoExpandableViewModel.CreateExchange(ID)); var info = new InfoExpandableViewModel("Info", "fa-question"); info.AddChild(new InfoActionViewModel("Rooms", "Hotel", "Rooms", "fa-bed", new { HotelID = ID })); info.AddChild(new InfoActionViewModel("Managers", "Hotel", "Managers", "fa-users", new { HotelID = ID })); Menu.AddItem(info); if (HotelRights.AnyRights) { var manage = new InfoExpandableViewModel("Manage", "fa-cogs"); if (HotelRights.CanBuildRooms) { manage.AddChild(new InfoActionViewModel("CreateRoom", "Hotel", "Build room", "fa-bed", new { HotelID = ID })); } if (HotelRights.CanMakeDeliveries) { manage.AddChild(new InfoActionViewModel("MakeDelivery", "Hotel", "Create delivery", "fa-truck", new { HotelID = ID })); } if (HotelRights.CanSetPrices) { manage.AddChild(new InfoActionViewModel("SetPrices", "Hotel", "Pricing", "fa-usd", new { HotelID = ID })); } if (HotelRights.CanUseWallet) { manage.AddChild(new InfoActionViewModel("Wallet", "Hotel", "Wallet", "fa-money", new { HotelID = ID })); } if (HotelRights.CanManageManagers) { manage.AddChild(new InfoActionViewModel("Managers", "Hotel", "Managers", "fa-users", new { HotelID = ID })); } if (HotelRights.CanManageEquipment) { manage.AddChild(new InfoActionViewModel("Inventory", "Hotel", "Inventory", "fa-cubes", new { HotelID = ID })); } if (HotelRights.CanSwitchInto) { manage.AddChild(InfoActionViewModel.CreateEntitySwitch(ID)); } Menu.AddItem(manage); } return(Menu); }
private void prepareMenu() { Menu = new InfoMenuViewModel(); if (HouseRights.CanModifyHouse) { Menu.AddItem(new InfoActionViewModel("BuyCM", "House", "Buy House Supplies", "fa-shopping-cart", new { houseID = HouseID })) .AddItem(new InfoActionViewModel("Chest", "House", "Chest", "fa-cubes", new { houseID = HouseID })); } Menu.AddItem(new InfoActionViewModel("Furniture", "House", "Furniture", "fa-bed", new { houseID = HouseID })); if (HouseRights.CanModifyHouse && SellPrice.HasValue == false) { Menu.AddItem(new InfoActionViewModel("SellHouse", "House", "Sell House", "fa-usd", new { houseID = HouseID })); } if (HouseRights.CanModifyHouse == false && SellPrice.HasValue) { Menu.AddItem(new InfoActionViewModel("BuyHouse", "House", "Buy House", "fa-usd", System.Web.Mvc.FormMethod.Post, new { houseID = HouseID })); } }
private void createMenu() { if (CanInitiateBattle || CanInitiateSurrender) { Menu = new InfoMenuViewModel(); if (CanInitiateBattle) { Menu.AddItem(new InfoActionViewModel("StartBattle", "War", "Start Battle", "fa-fighter-jet", new { warID = Info.WarID })); } if (CanInitiateSurrender) { Menu.AddItem(new InfoActionViewModel("SurrenderWar", "War", "Surrender war", "fa-flag-o", FormMethod.Post, new { warID = Info.WarID })); } if (CanCancelSurrender) { Menu.AddItem(new InfoActionViewModel("CancelSurrender", "War", "Surrender war", "fa-times", FormMethod.Post, new { warID = Info.WarID })); } } }
private void createMenu() { Menu = new InfoMenuViewModel(); if (CanSwitch) { Menu.AddItem(InfoActionViewModel.CreateEntitySwitch(EntityID)) .AddItem(new InfoActionViewModel("ChangeOwnership", "Newspaper", "Change ownership", "fa-pencil", new { newspaperID = EntityID })); } if (NewspaperRights > 0) { var exp = new InfoExpandableViewModel("Actions", "fa-ellipsis-h"); Menu.AddItem(exp); if (NewspaperRights.HasFlag(NewspaperRightsEnum.CanWriteArticles)) { exp.AddChild(new InfoActionViewModel("WriteArticle", "Newspaper", "Create article", "fa-pencil-square-o", FormMethod.Get, new { newspaperID = EntityID })); } if (NewspaperRights.HasFlag(NewspaperRightsEnum.CanManageArticles)) { exp.AddChild(new InfoActionViewModel("ManageArticles", "Newspaper", "Manage articles", "fa-newspaper-o", FormMethod.Get, new { newspaperID = EntityID })); } if (NewspaperRights.HasFlag(NewspaperRightsEnum.CanManageJournalists)) { exp.AddChild(new InfoActionViewModel("ManageJournalists", "Newspaper", "Manage journalists", "fa-users", FormMethod.Get, new { newspaperID = EntityID })); } } if (SessionHelper.CurrentEntity.EntityID != EntityID) { Menu.AddItem(InfoExpandableViewModel.CreateExchange(EntityID)); } }
private void createMenu() { Menu = new InfoMenuViewModel(); if (AreFriends) { Menu.AddItem(new InfoExpandableViewModel("Friend", "fa-user-circle-o") .AddChild(new InfoActionViewModel("RemoveFriend", "Friend", "Remove", "fa-user-times", FormMethod.Post, new { citizenID = CitizenID }))); } if (HasReceivedFriendRequest) { Menu.AddItem(new InfoExpandableViewModel("Friend Request", "fa-user-circle-o") .AddChild(new InfoActionViewModel("AcceptFriendRequest", "Friend", "Accept", "fa-check", FormMethod.Post, new { requestID = friendRequestID })) .AddChild(new InfoActionViewModel("DeclineFriendRequest", "Friend", "Decline", "fa-times", FormMethod.Post, new { requestID = friendRequestID }))); } if (HasSentFriendRequest) { Menu.AddItem(new InfoExpandableViewModel("Friend request sent", "fa-envelope") .AddChild(new InfoActionViewModel("CancelFriendRequestByCitizen", "Friend", "Cancel", "fa-user-times", FormMethod.Post))); } if (CanAddFriend) { Menu.AddItem(new InfoActionViewModel("SendFriendRequest", "Friend", "Add friend", "fa-user-plus", FormMethod.Post, new { citizenID = CitizenID })); } if (IsUnderControl) { Menu.AddItem(new InfoActionViewModel("Wallet", "Citizen", "Wallet", "fa-dollar")) .AddItem(new InfoActionViewModel("Travel", "Citizen", "Travel", "fa-plane")); } if (SessionHelper.CurrentEntity.EntityID != CitizenID) { Menu.AddItem(InfoExpandableViewModel.CreateExchange(CitizenID)); } }