public override void CustomUpdate(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Escape)) { this.SwitchSceneTo(new WorldMapScene()); } int buttonStartY = (int)(120.0f * GetRDMultiplier()); int buttonPadY = (int)(80.0f * GetRDMultiplier()); employeeButton.Position = employeeButton.Position.FromPercentageWithOffset(0.05f, 0.05f) + new Vector2(0, buttonStartY); employeeButton.Update(this, gameTime); schedulesButton.Size = employeeButton.Size; schedulesButton.Position = employeeButton.Position + new Vector2(0, buttonPadY * 1); schedulesButton.Update(this, gameTime); offersButton.Size = employeeButton.Size; offersButton.Position = employeeButton.Position + new Vector2(0, buttonPadY * 2); offersButton.Update(this, gameTime); garageButton.Size = employeeButton.Size; garageButton.Position = employeeButton.Position + new Vector2(0, buttonPadY * 3); garageButton.Update(this, gameTime); employeeBanners.Size = new Vector2().FromPercentage(0.32f, 0.8f); employeeBanners.Position = new Vector2().FromPercentageWithOffset(0.565f, 0.1f); jobBanners.Size = employeeBanners.Size; jobBanners.Position = employeeBanners.Position; truckBanners.Size = employeeBanners.Size; truckBanners.Position = employeeBanners.Position; switch (currentView) { case SelectedDetailView.Employees: employeeBanners.Update(this, gameTime); break; case SelectedDetailView.Jobs: jobBanners.Update(this, gameTime); break; case SelectedDetailView.Garage: truckBanners.Update(this, gameTime); break; } }
private void createEmployeeBanners() { var employeeBannerList = new List <BannerWidget>(); bool headerAdded = false; foreach (var employee in WorldState.InternalEmployeesFromPlace(state.Place)) { if (!headerAdded) { employeeBannerList.Add(new SplitterBannerWidget("Internal")); headerAdded = true; } if (employee.OriginalLocation == state.Place) { var employeeBanner = new EmployeeBannerWidget(this, employee); employeeBannerList.Add(employeeBanner); employeeBanner.OnClick += EmployeeBanner_OnClick; } } headerAdded = false; foreach (var employee in WorldState.ExternalEmployeesCurrentlyAt(state.Place)) { if (!headerAdded) { employeeBannerList.Add(new SplitterBannerWidget("External")); headerAdded = true; } var employeeBanner = new EmployeeBannerWidget(this, employee); employeeBannerList.Add(employeeBanner); employeeBanner.OnClick += EmployeeBanner_OnClick; } employeeBanners = new BannerListWidget(this, employeeBannerList); employeeBanners.Update(this, null); }