private void PopulateListBox <T>(ContentManager contentManager, ListBox <T> listBox, IEnumerable <T> purchasableItems, string fontPath, Texture textureListItemHighlight) where T : IPurchasable { foreach (var purchasableItem in purchasableItems) { ListItem <T> listItem = new ListItem <T>(purchasableItem, textureListItemHighlight); Icon iconItem = ControlFactory.CreateIcon(contentManager, purchasableItem.IconTextureKey); Label labelPurchasableItemName = ControlFactory.CreateLabel(contentManager, fontPath, 13, Styles.Colors.White, purchasableItem.Name); Label labelPurchasableItemPrice = ControlFactory.CreateLabel(contentManager, fontPath, 13, Styles.Colors.White, "$" + purchasableItem.Price); Label labelPurchasableItemHealth = ControlFactory.CreateLabel(contentManager, fontPath, 13, Styles.Colors.White, purchasableItem.NecessityEffect.HealthEffectivenessToString()); Label labelPurchasableItemHunger = ControlFactory.CreateLabel(contentManager, fontPath, 13, Styles.Colors.White, purchasableItem.NecessityEffect.HungerEffectivenessToString()); Label labelPurchasableItemThirst = ControlFactory.CreateLabel(contentManager, fontPath, 13, Styles.Colors.White, purchasableItem.NecessityEffect.ThirstEffectivenessToString()); Label labelPurchasableItemHygiene = ControlFactory.CreateLabel(contentManager, fontPath, 13, Styles.Colors.White, purchasableItem.NecessityEffect.HygieneEffectivenessToString()); Label labelPurchasableItemSleep = ControlFactory.CreateLabel(contentManager, fontPath, 13, Styles.Colors.White, purchasableItem.NecessityEffect.SleepEffectivenessToString()); listItem.AddColumn(iconItem); listItem.AddColumn(labelPurchasableItemName); listItem.AddColumn(labelPurchasableItemPrice); listItem.AddColumn(labelPurchasableItemHealth); listItem.AddColumn(labelPurchasableItemHunger); listItem.AddColumn(labelPurchasableItemThirst); listItem.AddColumn(labelPurchasableItemSleep); listBox.AddItem(listItem); } }
public ScenarioItem(ContentManager content, string iconThumbnailKey, string iconThumbnailSelectedKey, string iconOverviewKey, string textItemName, string textOverview, string mapPathToLoad) { MapPathToLoad = mapPathToLoad; string fontPath = content.GetContentPath("Arcade"); Color fontColorWhite = Styles.Colors.White; Color fontColorPaleYellow = Styles.Colors.PaleYellow; int fontSizeName = 14; labelName = ControlFactory.CreateLabel(content, fontPath, fontSizeName, fontColorWhite, textItemName, 225); labelName.EnableShadow(content, 2, 2); labelNameSelected = ControlFactory.CreateLabel(content, fontPath, fontSizeName, fontColorPaleYellow, textItemName, 225); labelNameSelected.EnableShadow(content, 2, 2); labelOverview = ControlFactory.CreateLabel(content, fontPath, fontSizeName, fontColorWhite, textOverview, 445); labelOverview.EnableShadow(content, 2, 2); iconThumbnail = new Icon(content.GetTexture(iconThumbnailKey)); iconThumbnailSelected = new Icon(content.GetTexture(iconThumbnailSelectedKey)); iconActive = iconThumbnail; iconOverview = new Icon(content.GetTexture(iconOverviewKey)); Width = iconThumbnail.Width + labelName.Width; Height = iconThumbnail.Height; base.Clicked += OnClicked; }
public TopToolboxTray(ContentManager content, int money) { iconFrame = ControlFactory.CreateIcon(content, "TopBar"); Width = iconFrame.Width; Height = iconFrame.Height; string fontPath = content.GetContentPath("DroidSans Bold"); Color fontColor = Styles.Colors.White; int fontSizeContent = 14; buttonPause = ControlFactory.CreateButton(content, "ButtonTopBar", "ButtonTopBarHover"); buttonPause.Icon = ControlFactory.CreateIcon(content, "IconPause"); buttonPause.ButtonType = ButtonType.IconOnly; buttonPlay = ControlFactory.CreateButton(content, "ButtonTopBar", "ButtonTopBarHover"); buttonPlay.Icon = ControlFactory.CreateIcon(content, "IconPlay"); buttonPlay.ButtonType = ButtonType.IconOnly; buttonFastForward = ControlFactory.CreateButton(content, "ButtonTopBar", "ButtonTopBarHover"); buttonFastForward.Icon = ControlFactory.CreateIcon(content, "IconFastForward"); buttonFastForward.ButtonType = ButtonType.IconOnly; buttonAlerts = ControlFactory.CreateButton(content, "ButtonTopBar", "ButtonTopBarHover"); buttonAlerts.Icon = ControlFactory.CreateIcon(content, "IconAlertNotification"); buttonAlerts.ButtonType = ButtonType.IconOnly; buttonEmails = ControlFactory.CreateButton(content, "ButtonTopBar", "ButtonTopBarHover"); buttonEmails.Icon = ControlFactory.CreateIcon(content, "IconMailNotification"); buttonEmails.ButtonType = ButtonType.IconOnly; buttonMenu = ControlFactory.CreateButton(content, "ButtonTopBar", "ButtonTopBarHover"); buttonMenu.Icon = ControlFactory.CreateIcon(content, "IconGameMenu"); buttonMenu.ButtonType = ButtonType.IconOnly; labelMoney = ControlFactory.CreateLabel(content, fontPath, fontSizeContent, fontColor, String.Format("${0}", money)); labelDate = ControlFactory.CreateLabel(content, fontPath, fontSizeContent, fontColor, "."); labelTime = ControlFactory.CreateLabel(content, fontPath, fontSizeContent, fontColor, "."); labelAlerts = ControlFactory.CreateLabel(content, fontPath, fontSizeContent, fontColor, "0"); labelEmails = ControlFactory.CreateLabel(content, fontPath, fontSizeContent, fontColor, "0"); Controls.Add(iconFrame); Controls.Add(buttonPause); Controls.Add(buttonPlay); Controls.Add(buttonFastForward); Controls.Add(buttonAlerts); Controls.Add(buttonEmails); Controls.Add(buttonMenu); Controls.Add(labelMoney); Controls.Add(labelDate); Controls.Add(labelTime); Controls.Add(labelAlerts); Controls.Add(labelEmails); buttonPause.Clicked += ButtonPauseOnClicked; buttonPlay.Clicked += ButtonPlayOnClicked; buttonFastForward.Clicked += ButtonFastForwardOnClick; buttonAlerts.Clicked += ButtonAlertsOnClicked; buttonEmails.Clicked += ButtonEmailsOnClicked; buttonMenu.Clicked += ButtonMenuOnClicked; }
public ToolboxTray(ContentManager content) { iconFrame = ControlFactory.CreateIcon(content, "BottomBar"); Width = iconFrame.Width; Height = iconFrame.Height; string fontPathDroid = content.GetContentPath("DroidSans Bold"); Color fontColorWhite = Styles.Colors.White; int fontSizeContent = 16; //int fontSizeTooltipText = 8; buttonSelectEquipment = ControlFactory.CreateButton(content, "ButtonBottomBar", "ButtonBottomBarHover"); buttonSelectEquipment.Icon = ControlFactory.CreateIcon(content, "IconHandTruck"); buttonSelectEquipment.Label = ControlFactory.CreateLabel(content, fontPathDroid, fontSizeContent, fontColorWhite, "Equipment"); buttonSelectEquipment.ButtonType = ButtonType.IconAndText; buttonSelectRoom = ControlFactory.CreateButton(content, "ButtonBottomBar", "ButtonBottomBarHover"); buttonSelectRoom.Icon = ControlFactory.CreateIcon(content, "IconForklift"); buttonSelectRoom.Label = ControlFactory.CreateLabel(content, fontPathDroid, fontSizeContent, fontColorWhite, "Rooms"); buttonSelectRoom.ButtonType = ButtonType.IconAndText; buttonFinances = ControlFactory.CreateButton(content, "ButtonBottomBar", "ButtonBottomBarHover"); buttonFinances.Icon = ControlFactory.CreateIcon(content, "IconMoney"); buttonFinances.Label = ControlFactory.CreateLabel(content, fontPathDroid, fontSizeContent, fontColorWhite, "Finances"); buttonFinances.ButtonType = ButtonType.IconAndText; buttonCompany = ControlFactory.CreateButton(content, "ButtonBottomBar", "ButtonBottomBarHover"); buttonCompany.Icon = ControlFactory.CreateIcon(content, "IconBarChartUp"); buttonCompany.Label = ControlFactory.CreateLabel(content, fontPathDroid, fontSizeContent, fontColorWhite, "Company"); buttonCompany.ButtonType = ButtonType.IconAndText; buttonEmployees = ControlFactory.CreateButton(content, "ButtonBottomBar", "ButtonBottomBarHover"); buttonEmployees.Icon = ControlFactory.CreateIcon(content, "IconNametag"); buttonEmployees.Label = ControlFactory.CreateLabel(content, fontPathDroid, fontSizeContent, fontColorWhite, "Employees"); buttonEmployees.ButtonType = ButtonType.IconAndText; buttonProducts = ControlFactory.CreateButton(content, "ButtonBottomBar", "ButtonBottomBarHover"); buttonProducts.Icon = ControlFactory.CreateIcon(content, "IconOpenBox"); buttonProducts.Label = ControlFactory.CreateLabel(content, fontPathDroid, fontSizeContent, fontColorWhite, "Products"); buttonProducts.ButtonType = ButtonType.IconAndText; Controls.Add(iconFrame); Controls.Add(buttonSelectEquipment); Controls.Add(buttonSelectRoom); Controls.Add(buttonFinances); Controls.Add(buttonCompany); Controls.Add(buttonEmployees); Controls.Add(buttonProducts); buttonSelectEquipment.Clicked += ButtonSelectEquipment_Clicked; buttonSelectRoom.Clicked += ButtonSelectRoom_Clicked; buttonFinances.Clicked += ButtonFinances_Clicked; buttonCompany.Clicked += ButtonCompany_Clicked; buttonEmployees.Clicked += ButtonEmployees_Clicked; buttonProducts.Clicked += ButtonProducts_Clicked; }
public MenuCompany(ContentManager contentManager, string companyName, int numberOfEmployees, int numberOfCompetitors, int numberOfProducts, int yearlyGrossIncome) { iconFrame = new Icon(contentManager.GetTexture("MenuCompanyFrame")); Width = iconFrame.Width; Height = iconFrame.Height; string fontPath = contentManager.GetContentPath(Styles.Fonts.DroidSansBold); Color fontColorWhite = Styles.Colors.White; Color fontColorPaleYellow = Styles.Colors.PaleYellow; int fontSizeTitle = Styles.FontSizes.Title; int fontSizeContent = Styles.FontSizes.Content; int fontSizeContent2 = 12; int fontSizeTooltip = Styles.FontSizes.Tooltip; iconMainHeader = ControlFactory.CreateIcon(contentManager, "IconPenPaper"); labelMainHeader = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorPaleYellow, "Company Statistics"); labelMainHeader.EnableShadow(contentManager, 2, 2); labelCompanyName = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorWhite, "Name:"); labelNumberOfEmployees = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent2, fontColorWhite, "Employees:"); labelNumberOfCompetitors = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent2, fontColorWhite, "Competitors:"); labelNumberOfProducts = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent2, fontColorWhite, "Products:"); labelGrossIncome = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent2, fontColorWhite, "Income:"); labelCompanyNameValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorPaleYellow, companyName); labelNumberOfEmployeesValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent2, fontColorPaleYellow, numberOfEmployees.ToString()); labelNumberOfCompetitorsValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent2, fontColorPaleYellow, numberOfCompetitors.ToString()); labelNumberOfProductsValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent2, fontColorPaleYellow, numberOfProducts.ToString()); labelGrossIncomeValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent2, fontColorPaleYellow, "$" + yearlyGrossIncome.ToString()); buttonCloseWindow = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonCloseWindow.Icon = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.IconHovered = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.ButtonType = ButtonType.IconOnly; Controls.Add(iconFrame); Controls.Add(iconMainHeader); Controls.Add(labelMainHeader); Controls.Add(labelCompanyName); Controls.Add(labelNumberOfEmployees); Controls.Add(labelNumberOfCompetitors); Controls.Add(labelNumberOfProducts); Controls.Add(labelGrossIncome); Controls.Add(labelCompanyNameValue); Controls.Add(labelNumberOfEmployeesValue); Controls.Add(labelNumberOfCompetitorsValue); Controls.Add(labelNumberOfProductsValue); Controls.Add(labelGrossIncomeValue); Controls.Add(buttonCloseWindow); buttonCloseWindow.Clicked += buttonCloseWindow_Clicked; Visible = false; }
public void AddButtonMailItems(ContentManager contentManager, IEnumerable <MailItem> inbox, IEnumerable <MailItem> outbox, IEnumerable <MailItem> archive) { string fontPath = contentManager.GetContentPath(Styles.Fonts.Arcade); Color fontColorTitle = Styles.Colors.PaleGreen; int fontSizeTitle = Styles.FontSizes.Title; int fontSizeContent = Styles.FontSizes.Content; foreach (MailItem mailItem in inbox) { ButtonMailItem buttonMailItem = new ButtonMailItem(mailItem); buttonMailItem.TextureFrame = contentManager.GetTexture("ButtonMailItem"); //buttonMailItem.TextureFrameHovered = contentManager.GetTexture("ButtonMailItemHover"); //buttonMailItem.TextureFrameSelected = contentManager.GetTexture("ButtonMailItemSelected"); buttonMailItem.IconMailUnread = ControlFactory.CreateIcon(contentManager, "IconMailUnread"); buttonMailItem.IconMailRead = ControlFactory.CreateIcon(contentManager, "IconMailRead"); buttonMailItem.LabelFrom = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorTitle, mailItem.From); buttonMailItem.LabelSubject = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorTitle, mailItem.Subject); Icon iconSeparator = ControlFactory.CreateIcon(contentManager, "IconSeparator"); AddButtonMailItemInbox(buttonMailItem, iconSeparator); } foreach (MailItem mailItem in outbox) { ButtonMailItem buttonMailItem = new ButtonMailItem(mailItem); buttonMailItem.TextureFrame = contentManager.GetTexture("ButtonMailItem"); //buttonMailItem.TextureFrameHovered = contentManager.GetTexture("ButtonMailItemHover"); //buttonMailItem.TextureFrameSelected = contentManager.GetTexture("ButtonMailItemSelected"); buttonMailItem.IconMailUnread = ControlFactory.CreateIcon(contentManager, "IconMailUnread"); buttonMailItem.IconMailRead = ControlFactory.CreateIcon(contentManager, "IconMailRead"); buttonMailItem.LabelFrom = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorTitle, mailItem.From); buttonMailItem.LabelSubject = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorTitle, mailItem.Subject); Icon iconSeparator = ControlFactory.CreateIcon(contentManager, "IconSeparator"); AddButtonMailItemOutbox(buttonMailItem, iconSeparator); } foreach (MailItem mailItem in archive) { ButtonMailItem buttonMailItem = new ButtonMailItem(mailItem); buttonMailItem.TextureFrame = contentManager.GetTexture("ButtonMailItem"); //buttonMailItem.TextureFrameHovered = contentManager.GetTexture("ButtonMailItemHover"); //buttonMailItem.TextureFrameSelected = contentManager.GetTexture("ButtonMailItemSelected"); buttonMailItem.IconMailUnread = ControlFactory.CreateIcon(contentManager, "IconMailUnread"); buttonMailItem.IconMailRead = ControlFactory.CreateIcon(contentManager, "IconMailRead"); buttonMailItem.LabelFrom = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorTitle, mailItem.From); buttonMailItem.LabelSubject = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorTitle, mailItem.Subject); Icon iconSeparator = ControlFactory.CreateIcon(contentManager, "IconSeparator"); AddButtonMailItemArchive(buttonMailItem, iconSeparator); } buttonMailOpen.Visible = false; buttonMailArchive.Visible = false; }
public Textbox(ContentManager content) { string fontPath = content.GetContentPath("Arcade"); Color fontColor = Styles.Colors.PaleGreen; const int fontSizeContent = 12; IconFrame = ControlFactory.CreateIcon(content, "TextboxLongFrame"); IconInputBar = ControlFactory.CreateIcon(content, "IconInputBar"); LabelText = ControlFactory.CreateLabel(content, fontPath, fontSizeContent, fontColor, "."); Clicked += OnClicked; Blur(); }
public MenuEmail(ContentManager contentManager) { Texture textureFrame = contentManager.GetTexture("MenuEmailFrame"); iconFrame = new Icon(textureFrame); Width = iconFrame.Width; Height = iconFrame.Height; string fontPath = contentManager.GetContentPath("Arcade"); Color fontColorWhite = Styles.Colors.White; int fontSizeTitle = Styles.FontSizes.Title; int fontSizeTooltip = Styles.FontSizes.Tooltip; buttonCloseWindow = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonCloseWindow.Icon = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.IconHovered = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.ButtonType = ButtonType.IconOnly; buttonCloseWindow.Clicked += ButtonCloseOnClicked; buttonCloseWindow.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColorWhite, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_CLOSE_WINDOW)); buttonOpenAttachment = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonOpenAttachment.Icon = ControlFactory.CreateIcon(contentManager, "IconAttachment"); buttonOpenAttachment.IconHovered = ControlFactory.CreateIcon(contentManager, "IconAttachment"); buttonOpenAttachment.ButtonType = ButtonType.IconOnly; buttonOpenAttachment.Clicked += ButtonAttachmentOnClicked; buttonOpenAttachment.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColorWhite, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_OPEN_ATTACHMENT)); iconMainMenu = ControlFactory.CreateIcon(contentManager, "IconMailUnread"); labelMainMenu = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, "Read Email"); labelMainMenu.EnableShadow(contentManager, 2, 2); labelFrom = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, defaultText); labelSubject = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, defaultText); labelContent = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, defaultText, 550); Controls.Add(iconFrame); Controls.Add(iconMainMenu); Controls.Add(labelContent); Controls.Add(labelMainMenu); Controls.Add(labelFrom); Controls.Add(labelSubject); Controls.Add(buttonCloseWindow); Controls.Add(buttonOpenAttachment); Visible = false; }
public MessageBox(ContentManager contentManager, MessageBoxType type, string title, string content) { if (String.IsNullOrEmpty(title)) { title = StringReferenceKeys.DEFAULT_TEXT; } if (String.IsNullOrEmpty(content)) { content = StringReferenceKeys.DEFAULT_TEXT; } iconFrame = ControlFactory.CreateIcon(contentManager, "MessageBoxFrame"); Width = iconFrame.Width; Height = iconFrame.Height; string fontPath = contentManager.GetContentPath(Styles.Fonts.Arcade); Color fontColorTitle = Styles.Colors.White; Color fontColorLabelValue = Styles.Colors.PaleYellow; int fontSizeTitle = Styles.FontSizes.Title; int fontSizeContent = Styles.FontSizes.Content; labelTextTitle = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorTitle, title); labelTextTitle.EnableShadow(contentManager, 2, 2); labelTextContent = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorLabelValue, content, 325); if (type == MessageBoxType.Information) { iconMain = ControlFactory.CreateIcon(contentManager, "IconInfo"); } controls.Add(iconFrame); controls.Add(iconMain); controls.Add(labelTextTitle); controls.Add(labelTextContent); Hide(); }
public MenuResume(ContentManager contentManager, Resume resume) { Texture textureFrame = contentManager.GetTexture("MenuResumeFrame"); iconFrame = new Icon(textureFrame); Width = iconFrame.Width; Height = iconFrame.Height; string fontPath = contentManager.GetContentPath("Arcade"); Color fontColorWhite = Styles.Colors.White; Color fontColorYellow = Styles.Colors.PaleYellow; int fontSizeTitle = Styles.FontSizes.Title; int fontSizeContent = Styles.FontSizes.Content; int fontSizeTooltip = Styles.FontSizes.Tooltip; buttonRejectResume = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonRejectResume.Icon = ControlFactory.CreateIcon(contentManager, "IconReject"); buttonRejectResume.IconHovered = ControlFactory.CreateIcon(contentManager, "IconReject"); buttonRejectResume.ButtonType = ButtonType.IconOnly; buttonRejectResume.Clicked += ButtonRejectOnClicked; buttonRejectResume.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColorWhite, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_REJECT_RESUME)); buttonAcceptResume = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonAcceptResume.Icon = ControlFactory.CreateIcon(contentManager, "IconAccept"); buttonAcceptResume.IconHovered = ControlFactory.CreateIcon(contentManager, "IconAccept"); buttonAcceptResume.ButtonType = ButtonType.IconOnly; buttonAcceptResume.Clicked += ButtonAcceptOnClicked; buttonAcceptResume.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColorWhite, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_ACCEPT_RESUME)); iconMainMenu = ControlFactory.CreateIcon(contentManager, "IconNametag"); iconSkillsMenu = ControlFactory.CreateIcon(contentManager, "IconPenPaper"); labelMainMenu = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, "Review Resume"); labelMainMenu.EnableShadow(contentManager, 2, 2); labelSkillsMenu = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, "Skills"); labelSkillsMenu.EnableShadow(contentManager, 2, 2); iconCommunication = ControlFactory.CreateIcon(contentManager, "IconCommunication"); iconLeadership = ControlFactory.CreateIcon(contentManager, "IconLeadership"); iconCreativity = ControlFactory.CreateIcon(contentManager, "IconCreativity"); iconIntelligence = ControlFactory.CreateIcon(contentManager, "IconIntelligence"); labelCommunicationValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelLeadershipValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelCreativityValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelIntelligenceValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelName = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, resume.Employee.FullName); labelContent = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, resume.Content, 550); labelJob = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, resume.Employee.Job.Title); labelSalary = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, String.Format("${0} / yr", resume.Employee.Job.CurrentLevel.Salary)); Controls.Add(iconFrame); Controls.Add(iconMainMenu); Controls.Add(iconSkillsMenu); Controls.Add(labelName); Controls.Add(labelCommunicationValue); Controls.Add(labelContent); Controls.Add(labelCreativityValue); Controls.Add(labelIntelligenceValue); Controls.Add(labelJob); Controls.Add(labelLeadershipValue); Controls.Add(labelMainMenu); Controls.Add(labelSalary); Controls.Add(labelSkillsMenu); Controls.Add(iconCommunication); Controls.Add(iconCreativity); Controls.Add(iconIntelligence); Controls.Add(iconLeadership); Controls.Add(buttonAcceptResume); Controls.Add(buttonRejectResume); this.resume = resume; }
public MenuInspectEquipment(ContentManager contentManager) { Texture textureFrame = contentManager.GetTexture("MenuInspectEmployeeFrame"); iconFrame = new Icon(textureFrame); Width = iconFrame.Width; Height = iconFrame.Height; string fontPath = contentManager.GetContentPath(Styles.Fonts.Arcade); Color fontColor = Styles.Colors.White; Color fontColorValue = Styles.Colors.PaleYellow; int fontSizeTitle = Styles.FontSizes.Title; int fontSizeContent = Styles.FontSizes.Content; int fontSizeTooltip = Styles.FontSizes.Tooltip; buttonCloseWindow = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonCloseWindow.Icon = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.IconHovered = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.ButtonType = ButtonType.IconOnly; buttonCloseWindow.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColor, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_CLOSE_WINDOW)); buttonCloseWindow.Clicked += HandleButtonCloseWindowClicked; buttonSellEquipment = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonSellEquipment.Icon = ControlFactory.CreateIcon(contentManager, "IconSellEquipment"); buttonSellEquipment.IconHovered = ControlFactory.CreateIcon(contentManager, "IconSellEquipment"); buttonSellEquipment.ButtonType = ButtonType.IconOnly; buttonSellEquipment.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColor, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_SELL_EQUIPMENT)); buttonSellEquipment.Clicked += HandleButtonSellEquipmentClicked; buttonRepairEquipment = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonRepairEquipment.Icon = ControlFactory.CreateIcon(contentManager, "IconRepairEquipment"); buttonRepairEquipment.IconHovered = ControlFactory.CreateIcon(contentManager, "IconRepairEquipment"); buttonRepairEquipment.ButtonType = ButtonType.IconOnly; buttonRepairEquipment.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColor, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_REPAIR_EQUIPMENT)); buttonRepairEquipment.Clicked += HandleButtonRepairEquipmentClicked; iconMainMenu = ControlFactory.CreateIcon(contentManager, "IconPersonPlain"); iconNeedsMenu = ControlFactory.CreateIcon(contentManager, "IconStatistics"); iconSkillsMenu = ControlFactory.CreateIcon(contentManager, "IconPenPaper"); labelMainMenu = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColor, "Inspect Equipment"); labelMainMenu.EnableShadow(contentManager, 2, 2); labelNeedsMenu = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColor, "Needs"); labelNeedsMenu.EnableShadow(contentManager, 2, 2); labelSkillsMenu = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColor, "Skills"); labelSkillsMenu.EnableShadow(contentManager, 2, 2); iconHealth = ControlFactory.CreateIcon(contentManager, "IconMedkit"); iconHygiene = ControlFactory.CreateIcon(contentManager, "IconToothbrush"); iconSleep = ControlFactory.CreateIcon(contentManager, "IconPersonTired"); iconThirst = ControlFactory.CreateIcon(contentManager, "IconSoda"); iconHunger = ControlFactory.CreateIcon(contentManager, "IconChicken"); labelHealthValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelHygieneValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelSleepValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelThirstValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelHungerValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); iconCommunication = ControlFactory.CreateIcon(contentManager, "IconCommunication"); iconLeadership = ControlFactory.CreateIcon(contentManager, "IconLeadership"); iconCreativity = ControlFactory.CreateIcon(contentManager, "IconCreativity"); iconIntelligence = ControlFactory.CreateIcon(contentManager, "IconIntelligence"); labelCommunicationValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelLeadershipValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelCreativityValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelIntelligenceValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelName = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Name:"); labelAge = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Age:"); labelCondition = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Condition:"); labelNameValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelAgeValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelConditionValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); Controls.Add(iconFrame); Controls.Add(buttonCloseWindow); Controls.Add(iconMainMenu); Controls.Add(iconNeedsMenu); Controls.Add(iconSkillsMenu); Controls.Add(labelMainMenu); Controls.Add(labelNeedsMenu); Controls.Add(labelSkillsMenu); Controls.Add(iconHealth); Controls.Add(iconHygiene); Controls.Add(iconSleep); Controls.Add(iconThirst); Controls.Add(iconHunger); Controls.Add(labelHealthValue); Controls.Add(labelHygieneValue); Controls.Add(labelSleepValue); Controls.Add(labelThirstValue); Controls.Add(labelHungerValue); Controls.Add(iconCommunication); Controls.Add(iconLeadership); Controls.Add(iconCreativity); Controls.Add(iconIntelligence); Controls.Add(labelCommunicationValue); Controls.Add(labelLeadershipValue); Controls.Add(labelCreativityValue); Controls.Add(labelIntelligenceValue); Controls.Add(labelName); Controls.Add(labelAge); Controls.Add(labelCondition); Controls.Add(labelNameValue); Controls.Add(labelAgeValue); Controls.Add(labelConditionValue); Controls.Add(buttonSellEquipment); Controls.Add(buttonRepairEquipment); Visible = false; }
public MenuMailbox(ContentManager contentManager, IEnumerable <MailItem> inbox, IEnumerable <MailItem> outbox, IEnumerable <MailItem> archive) { Texture texture = contentManager.GetTexture("MenuMailboxFrame"); iconFrame = new Icon(texture); Width = iconFrame.Width; Height = iconFrame.Height; string fontPath = contentManager.GetContentPath("Arcade"); Color fontColorWhite = Styles.Colors.White; Color fontColorPaleYellow = Styles.Colors.PaleYellow; int fontSizeTitle = Styles.FontSizes.Title; int fontSizeContent = Styles.FontSizes.Content; int fontSizeTooltip = Styles.FontSizes.Tooltip; iconFolderHeader = ControlFactory.CreateIcon(contentManager, "IconFolderOpen"); labelFolderHeader = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, "Folder"); labelFolderHeader.EnableShadow(contentManager, 2, 2); labelPageNumber = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorPaleYellow, "N/A"); labelFrom = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorWhite, "From"); labelSubject = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorWhite, "Subject"); buttonInboxFolder = ControlFactory.CreateButton(contentManager, "ButtonMailFolder", "ButtonMailFolderHover"); buttonInboxFolder.Icon = ControlFactory.CreateIcon(contentManager, "IconFolderInbox"); buttonInboxFolder.Label = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorPaleYellow, "Inbox"); buttonInboxFolder.ButtonType = ButtonType.IconAndText; buttonOutboxFolder = ControlFactory.CreateButton(contentManager, "ButtonMailFolder", "ButtonMailFolderHover"); buttonOutboxFolder.Icon = ControlFactory.CreateIcon(contentManager, "IconFolderOutbox"); buttonOutboxFolder.Label = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorPaleYellow, "Outbox"); buttonOutboxFolder.ButtonType = ButtonType.IconAndText; buttonArchiveFolder = ControlFactory.CreateButton(contentManager, "ButtonMailFolder", "ButtonMailFolderHover"); buttonArchiveFolder.Icon = ControlFactory.CreateIcon(contentManager, "IconFolderArchive"); buttonArchiveFolder.Label = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorPaleYellow, "Archive"); buttonArchiveFolder.ButtonType = ButtonType.IconAndText; buttonArrowLeft = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonArrowLeft.Icon = ControlFactory.CreateIcon(contentManager, "IconArrowCircleLeft"); buttonArrowLeft.IconHovered = ControlFactory.CreateIcon(contentManager, "IconArrowCircleLeft"); buttonArrowLeft.ButtonType = ButtonType.IconOnly; buttonArrowRight = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonArrowRight.Icon = ControlFactory.CreateIcon(contentManager, "IconArrowCircleRight"); buttonArrowRight.IconHovered = ControlFactory.CreateIcon(contentManager, "IconArrowCircleRight"); buttonArrowRight.ButtonType = ButtonType.IconOnly; labelInboxFolder = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, "Inbox"); labelInboxFolder.EnableShadow(contentManager, 2, 2); labelOutboxFolder = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, "Outbox"); labelOutboxFolder.EnableShadow(contentManager, 2, 2); labelArchiveFolder = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorWhite, "Archive"); labelArchiveFolder.EnableShadow(contentManager, 2, 2); iconInboxFolder = ControlFactory.CreateIcon(contentManager, "IconFolderInbox"); iconOutboxFolder = ControlFactory.CreateIcon(contentManager, "IconFolderOutbox"); iconArchiveFolder = ControlFactory.CreateIcon(contentManager, "IconFolderArchive"); buttonMailOpen = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonMailOpen.Icon = ControlFactory.CreateIcon(contentManager, "IconMailOpen"); buttonMailOpen.ButtonType = ButtonType.IconOnly; buttonMailOpen.Visible = false; buttonMailOpen.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColorWhite, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_OPEN_MAIL)); buttonMailArchive = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonMailArchive.Icon = ControlFactory.CreateIcon(contentManager, "IconMailArchive"); buttonMailArchive.ButtonType = ButtonType.IconOnly; buttonMailArchive.Visible = true; buttonMailArchive.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColorWhite, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_ARCHIVE_MAIL)); iconTopSeparator = ControlFactory.CreateIcon(contentManager, "IconSeparator"); buttonCloseWindow = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonCloseWindow.Icon = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.IconHovered = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.ButtonType = ButtonType.IconOnly; buttonCloseWindow.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColorWhite, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_CLOSE_WINDOW)); menuEmail = new MenuEmail(contentManager); menuEmail.Closed += MenuEmailOnClosed; AddButtonMailItems(contentManager, inbox, outbox, archive); Controls.Add(iconFrame); Controls.Add(iconFolderHeader); Controls.Add(labelFolderHeader); Controls.Add(labelPageNumber); Controls.Add(labelFrom); Controls.Add(labelSubject); Controls.Add(buttonInboxFolder); Controls.Add(buttonOutboxFolder); Controls.Add(buttonArchiveFolder); Controls.Add(buttonArrowLeft); Controls.Add(buttonArrowRight); Controls.Add(buttonMailOpen); Controls.Add(buttonMailArchive); Controls.Add(iconTopSeparator); Controls.Add(buttonCloseWindow); buttonInboxFolder.Clicked += buttonInboxFolder_Clicked; buttonOutboxFolder.Clicked += buttonOutboxFolder_Clicked; buttonArchiveFolder.Clicked += buttonArchiveFolder_Clicked; buttonArrowLeft.Clicked += buttonArrowLeft_Clicked; buttonArrowRight.Clicked += buttonArrowRight_Clicked; buttonMailOpen.Clicked += buttonView_Clicked; buttonMailArchive.Clicked += buttonArchive_Clicked; buttonCloseWindow.Clicked += buttonCloseWindow_Clicked; currentDisplayedPageInbox = 1; SetActiveTab(ActiveTab.Inbox); Visible = false; }
public MenuPurchase(ContentManager contentManager, IEnumerable <IPurchasable> purchasableEquipment, IEnumerable <IPurchasable> purchasableRooms) { iconFrame = new Icon(contentManager.GetTexture("MenuPurchaseFrame")); Width = iconFrame.Width; Height = iconFrame.Height; string fontPath = contentManager.GetContentPath(Styles.Fonts.DroidSansBold); Color fontColorWhite = Styles.Colors.White; Color fontColorYellow = Styles.Colors.PaleYellow; int fontSizeTitle = Styles.FontSizes.Title; int fontSizeContent = Styles.FontSizes.Content; int fontSizeTooltip = Styles.FontSizes.Tooltip; iconMainMenuHeader = ControlFactory.CreateIcon(contentManager, "IconShoppingCart"); iconInfoMenuHeader = ControlFactory.CreateIcon(contentManager, "IconStatistics"); iconSkillsMenuHeader = ControlFactory.CreateIcon(contentManager, "IconPenPaper"); labelMainMenuHeader = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorYellow, "Shopping"); labelMainMenuHeader.EnableShadow(contentManager, 2, 2); labelInfoMenuHeader = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorYellow, "Needs"); labelInfoMenuHeader.EnableShadow(contentManager, 2, 2); labelSkillsMenuHeader = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColorYellow, "Skills"); labelSkillsMenuHeader.EnableShadow(contentManager, 2, 2); iconMoney = ControlFactory.CreateIcon(contentManager, "IconMoney"); iconHealth = ControlFactory.CreateIcon(contentManager, "IconMedkit"); iconHygiene = ControlFactory.CreateIcon(contentManager, "IconToothbrush"); iconSleep = ControlFactory.CreateIcon(contentManager, "IconPersonTired"); iconThirst = ControlFactory.CreateIcon(contentManager, "IconSoda"); iconHunger = ControlFactory.CreateIcon(contentManager, "IconChicken"); labelMoney = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelHealth = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelHygiene = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelSleep = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelThirst = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelHunger = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); iconCommunication = ControlFactory.CreateIcon(contentManager, "IconCommunication"); iconLeadership = ControlFactory.CreateIcon(contentManager, "IconLeadership"); iconCreativity = ControlFactory.CreateIcon(contentManager, "IconCreativity"); iconIntelligence = ControlFactory.CreateIcon(contentManager, "IconIntelligence"); labelCommunication = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelLeadership = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelCreativity = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); labelIntelligence = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorYellow, defaultText); buttonCloseWindow = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover", "ButtonSquareSelected"); buttonCloseWindow.Icon = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.IconHovered = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.ButtonType = ButtonType.IconOnly; buttonCloseWindow.Released += buttonCloseWindow_Clicked; labelDescription = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorWhite, contentManager.GetString(StringReferenceKeys.DEFAULT_TEXT), 570); Texture textureListBoxTargetFrame = contentManager.GetTexture("MenuPurchaseListBoxTarget"); Texture textureListItemHighlight = contentManager.GetTexture("ListItemHighlight"); Icon iconScrollbar = ControlFactory.CreateIcon(contentManager, "IconScrollbarMenuPurchase"); Icon iconScroller = ControlFactory.CreateIcon(contentManager, "IconScroller"); listBoxEquipment = CreateListBox <IPurchasable>(contentManager, textureListBoxTargetFrame, iconScrollbar, iconScroller); listBoxEquipment.ItemHovered += listBoxEquipment_ItemHovered; listBoxEquipment.ItemSelected += listBoxEquipment_ItemSelected; listBoxRooms = CreateListBox <IPurchasable>(contentManager, textureListBoxTargetFrame, iconScrollbar, iconScroller); listBoxRooms.ItemHovered += listBoxRooms_ItemHovered; listBoxRooms.ItemSelected += listBoxRooms_ItemSelected; CreateTabContainer(contentManager); PopulateListBox(contentManager, listBoxEquipment, purchasableEquipment, fontPath, textureListItemHighlight); PopulateListBox(contentManager, listBoxRooms, purchasableRooms, fontPath, textureListItemHighlight); Controls.Add(iconFrame); Controls.Add(iconMainMenuHeader); Controls.Add(iconInfoMenuHeader); Controls.Add(iconSkillsMenuHeader); Controls.Add(labelMainMenuHeader); Controls.Add(labelInfoMenuHeader); Controls.Add(labelSkillsMenuHeader); Controls.Add(buttonCloseWindow); Controls.Add(tabContainer); Controls.Add(labelDescription); Visible = false; }
public MenuInspectEmployee(ContentManager contentManager) { Texture textureFrame = contentManager.GetTexture("MenuInspectEmployeeFrame"); iconFrame = new Icon(textureFrame); Width = iconFrame.Width; Height = iconFrame.Height; string fontPath = contentManager.GetContentPath(Styles.Fonts.Arcade); Color fontColor = Styles.Colors.White; Color fontColorValue = Styles.Colors.PaleYellow; int fontSizeTitle = Styles.FontSizes.Title; int fontSizeContent = Styles.FontSizes.Content; int fontSizeTooltip = Styles.FontSizes.Tooltip; buttonCloseWindow = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonCloseWindow.Icon = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.IconHovered = ControlFactory.CreateIcon(contentManager, "IconWindowClose"); buttonCloseWindow.ButtonType = ButtonType.IconOnly; buttonCloseWindow.Clicked += OnButtonCloseWindowOnClicked; buttonFireEmployee = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonFireEmployee.Icon = ControlFactory.CreateIcon(contentManager, "IconFireEmployee"); buttonFireEmployee.IconHovered = ControlFactory.CreateIcon(contentManager, "IconFireEmployee"); buttonFireEmployee.ButtonType = ButtonType.IconOnly; buttonFireEmployee.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColor, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_FIRE_EMPLOYEE)); buttonFireEmployee.Clicked += ButtonFireEmployeeOnClicked; buttonDisciplineEmployee = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonDisciplineEmployee.Icon = ControlFactory.CreateIcon(contentManager, "IconDisciplineEmployee"); buttonDisciplineEmployee.IconHovered = ControlFactory.CreateIcon(contentManager, "IconDisciplineEmployee"); buttonDisciplineEmployee.ButtonType = ButtonType.IconOnly; buttonDisciplineEmployee.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColor, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_DISCIPLINE_EMPLOYEE)); buttonDisciplineEmployee.Clicked += ButtonDisciplineEmployeeOnClicked; buttonPromoteEmployee = ControlFactory.CreateButton(contentManager, "ButtonSquare", "ButtonSquareHover"); buttonPromoteEmployee.Icon = ControlFactory.CreateIcon(contentManager, "IconPromoteEmployee"); buttonPromoteEmployee.IconHovered = ControlFactory.CreateIcon(contentManager, "IconPromoteEmployee"); buttonPromoteEmployee.ButtonType = ButtonType.IconOnly; buttonPromoteEmployee.Tooltip = ControlFactory.CreateTooltip(contentManager, "TooltipFrame", fontPath, fontSizeTooltip, fontColor, contentManager.GetString(StringReferenceKeys.TOOLTIP_BUTTON_PROMOTE_EMPLOYEE)); buttonPromoteEmployee.Clicked += ButtonPromoteEmployeeOnClicked; iconMainMenu = ControlFactory.CreateIcon(contentManager, "IconPersonPlain"); iconNeedsMenu = ControlFactory.CreateIcon(contentManager, "IconStatistics"); iconSkillsMenu = ControlFactory.CreateIcon(contentManager, "IconPenPaper"); labelMainMenu = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColor, "Inspect Employee"); labelMainMenu.EnableShadow(contentManager, 2, 2); labelNeedsMenu = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColor, "Needs"); labelNeedsMenu.EnableShadow(contentManager, 2, 2); labelSkillsMenu = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeTitle, fontColor, "Skills"); labelSkillsMenu.EnableShadow(contentManager, 2, 2); iconHealth = ControlFactory.CreateIcon(contentManager, "IconMedkit"); iconHygiene = ControlFactory.CreateIcon(contentManager, "IconToothbrush"); iconSleep = ControlFactory.CreateIcon(contentManager, "IconPersonTired"); iconThirst = ControlFactory.CreateIcon(contentManager, "IconSoda"); iconHunger = ControlFactory.CreateIcon(contentManager, "IconChicken"); labelHealthValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelHygieneValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelSleepValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelThirstValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelHungerValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); iconCommunication = ControlFactory.CreateIcon(contentManager, "IconCommunication"); iconLeadership = ControlFactory.CreateIcon(contentManager, "IconLeadership"); iconCreativity = ControlFactory.CreateIcon(contentManager, "IconCreativity"); iconIntelligence = ControlFactory.CreateIcon(contentManager, "IconIntelligence"); labelCommunicationValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelLeadershipValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelCreativityValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelIntelligenceValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelName = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Name:"); labelAge = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Age:"); labelJob = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Job:"); labelSalary = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Salary:"); labelStatus = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Status:"); labelBirth = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Birth:"); labelMood = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "Mood:"); labelNameValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelAgeValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelJobValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelSalaryValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelStatusValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); labelBirthValue = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColorValue, defaultText); iconMoodHappy = ControlFactory.CreateIcon(contentManager, "IconPersonHappy"); iconMoodAngry = ControlFactory.CreateIcon(contentManager, "IconPersonAngry"); Controls.Add(iconFrame); Controls.Add(buttonCloseWindow); Controls.Add(iconMainMenu); Controls.Add(iconNeedsMenu); Controls.Add(iconSkillsMenu); Controls.Add(labelMainMenu); Controls.Add(labelNeedsMenu); Controls.Add(labelSkillsMenu); Controls.Add(iconHealth); Controls.Add(iconHygiene); Controls.Add(iconSleep); Controls.Add(iconThirst); Controls.Add(iconHunger); Controls.Add(labelHealthValue); Controls.Add(labelHygieneValue); Controls.Add(labelSleepValue); Controls.Add(labelThirstValue); Controls.Add(labelHungerValue); Controls.Add(iconCommunication); Controls.Add(iconLeadership); Controls.Add(iconCreativity); Controls.Add(iconIntelligence); Controls.Add(labelCommunicationValue); Controls.Add(labelLeadershipValue); Controls.Add(labelCreativityValue); Controls.Add(labelIntelligenceValue); Controls.Add(labelName); Controls.Add(labelAge); Controls.Add(labelJob); Controls.Add(labelSalary); Controls.Add(labelStatus); Controls.Add(labelBirth); Controls.Add(labelMood); Controls.Add(labelNameValue); Controls.Add(labelAgeValue); Controls.Add(labelJobValue); Controls.Add(labelSalaryValue); Controls.Add(labelStatusValue); Controls.Add(labelBirthValue); Controls.Add(buttonFireEmployee); Controls.Add(buttonDisciplineEmployee); Controls.Add(buttonPromoteEmployee); Visible = false; }
/// <summary> /// Initializes a new instance of the <see cref="LimitedLiability.UserInterface.UserInterfaceManager"/> class. /// </summary> /// <param name="contentManager">contentManager manager.</param> /// <param name="bottomRightPointOfWindow">Bottom right point of window.</param> /// <param name="purchasableEquipment">Purchasable items.</param> /// <param name="purchasableRooms"></param> /// <param name="inbox"></param> /// <param name="outbox"></param> /// <param name="archive"></param> /// <param name="unreadMailCount"></param> /// <param name="money"></param> /// <param name="employeeCount"></param> public UserInterfaceManager(ContentManager contentManager, Point bottomRightPointOfWindow, IEnumerable <IPurchasable> purchasableEquipment, IEnumerable <IPurchasable> purchasableRooms, IEnumerable <MailItem> inbox, IEnumerable <MailItem> outbox, IEnumerable <MailItem> archive, int unreadMailCount, int money, int employeeCount) { if (purchasableEquipment == null) { throw new ArgumentNullException("purchasableEquipment"); } if (purchasableRooms == null) { throw new ArgumentNullException("purchasableRooms"); } if (inbox == null) { throw new ArgumentNullException("inbox"); } if (outbox == null) { throw new ArgumentNullException("outbox"); } if (archive == null) { throw new ArgumentNullException("archive"); } this.bottomRightPointOfWindow = bottomRightPointOfWindow; this.contentManager = contentManager; this.purchasableEquipment = purchasableEquipment; this.purchasableRooms = purchasableRooms; toolboxTray = new ToolboxTray(contentManager); toolboxTray.Position = new Vector(bottomRightPointOfWindow.X / 2 - toolboxTray.Width / 2, bottomRightPointOfWindow.Y - toolboxTray.Height); toolboxTray.ButtonSelectGeneralClicked += ToolboxTray_ButtonSelectGeneralClicked; toolboxTray.ButtonSelectEquipmentClicked += ToolboxTray_ButtonSelectEquipmentClicked; toolboxTray.ButtonFinancesClicked += ToolboxTray_ButtonFinancesClicked; toolboxTray.ButtonCompanyClicked += ToolboxTray_ButtonCompanyClicked; toolboxTray.ButtonEmployeesClicked += ToolboxTray_ButtonEmployeesClicked; toolboxTray.ButtonProductsClicked += ToolboxTray_ButtonProductsClicked; topToolboxTray = new TopToolboxTray(contentManager, money); topToolboxTray.Position = Vector.Zero; topToolboxTray.ButtonMainMenuClicked += ButtonMainMenuOnClicked; topToolboxTray.ButtonMailMenuClicked += ButtonMailMenuOnClicked; Color fontColor; int fontSizeContent; string fontPath = GetLabelFontDetails(out fontColor, out fontSizeContent); labelMousePositionAbsolute = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "."); labelMousePositionAbsolute.Position = Vector.Zero; labelMousePositionIsometric = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "."); labelMousePositionIsometric.Position = Vector.Zero; labelSimulationTime = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "."); labelSimulationTime.Position = Vector.Zero; labelState = ControlFactory.CreateLabel(contentManager, fontPath, fontSizeContent, fontColor, "."); labelState.Position = Vector.Zero; labels.Add(labelMousePositionAbsolute); labels.Add(labelMousePositionIsometric); labels.Add(labelSimulationTime); labels.Add(labelState); CreateMenuEquipment(); CreateMenuInspectEmployee(); CreateMenuMailbox(inbox, outbox, archive); CreateMenuCompany(employeeCount); CreateMenuInspectEquipment(); menus.Add(menuPurchaseEquipment); menus.Add(menuInspectEmployee); menus.Add(menuMailbox); menus.Add(menuCompany); menus.Add(menuInspectEquipment); ChangeState(UserInterfaceState.Default); }