public MapMakerScreen(IApplicationService appService) { var sharedContainer = new MapMakerDataContainer(); mapEditorWorldScreen = appService.Kernel.Get <MapMakerWorldScreen>( new ConstructorArgument("sharedContainer", sharedContainer)); mapEditorHudScreen = appService.Kernel.Get <MapMakerHudScreen>( new ConstructorArgument("sharedContainer", sharedContainer)); AddScreen(mapEditorWorldScreen); AddScreen(mapEditorHudScreen); }
public MapMakerHudScreen( IApplicationManager appManager, IEventService eventService, INotificationService notificationService, MapMakerDataContainer sharedContainer) { this.appManager = appManager; this.notificationService = notificationService; this.sharedContainer = sharedContainer; this.buttons = new List <Button>(); eventService.RegisterMouseClickCallback( this.Id, new MouseClickCallbackEventArgs(Mouse.Button.Left), OnMousePress); buttons.Add(new Button("Draw", new Vector2f(20, 20), () => { SetState(MapEditState.DrawingLines); notificationService.ShowToast( ToastType.Info, "Drawing Lines Enabled"); }, HorizontalAlignment.Left)); buttons.Add(new Button("Move", new Vector2f(20, 70), () => { SetState(MapEditState.MovingPoints); notificationService.ShowToast( ToastType.Info, "Moving Points Enabled"); }, HorizontalAlignment.Left)); buttons.Add(new Button("Delete", new Vector2f(20, 120), () => { SetState(MapEditState.Deletion); notificationService.ShowToast( ToastType.Warning, "Deletion Enabled"); }, HorizontalAlignment.Left)); buttons.Add(new Button("Checkpoints", new Vector2f(20, 170), () => { SetState(MapEditState.Checkpoint); notificationService.ShowToast( ToastType.Info, "Checkpoint Mode Enabled"); }, HorizontalAlignment.Left)); buttons.Add(new Button("Start", new Vector2f(20, 225), () => { SetState(MapEditState.StartPosition); notificationService.ShowToast( ToastType.Info, "Set Start Position"); }, HorizontalAlignment.Left)); var exportTextPosition = new Vector2f(20, appManager.GetWindowSize().Y - 60); buttons.Add(new Button("Export", exportTextPosition, () => ExportTrack(), HorizontalAlignment.Left)); }