public JetBoxOptionsPage(Lifetime lifetime, IUIApplication environment, ClientFactory clientFactory, JetBoxSettingsStorage jetBoxSettings, JetPopupMenus jetPopupMenus) : base(lifetime, environment, PID) { mySettingsStore = jetBoxSettings.SettingsStore.BindToContextLive(lifetime, ContextRange.ApplicationWide); myLifetimes = new SequentialLifetimes(lifetime); myClient = clientFactory.CreateClient(); myClient.UserLogin = mySettingsStore.GetValue(JetBoxSettingsAccessor.Login); // init UI myLoggedPanel = new FlowLayoutPanel { Visible = false, AutoSize = true }; myLoggedPanel.Controls.Add(myLoginLabel = new RichTextLabel(environment)); myLoggedPanel.Controls.Add(new LinkLabel("Logout", Logout, jetPopupMenus)); myNonLoggedPanel = new FlowLayoutPanel { Visible = false, AutoSize = true, FlowDirection = FlowDirection.TopDown }; myNonLoggedPanel.Controls.Add(new LinkLabel("Login", Login, jetPopupMenus) { Image = Environment.Theming.Icons[UnnamedThemedIcons.Dropbox.Id].CurrentGdipBitmapScreenDpi, ImageAlign = ContentAlignment.MiddleLeft, Padding = new Padding(20, 0, 0, 0) }); Controls.Add(myLoggedPanel); Controls.Add(myNonLoggedPanel); InitLoginState(); }
public TypeInterfaceToolWindowRegistrar(Lifetime lifetime, ToolWindowManager toolWindowManager, IShellLocks locks, ISettingsStore settingsStore, IActionManager actionManager, IActionBarManager actionBarManager, IShortcutManager shortcutManager, TypeInterfaceToolWindowDescriptor toolWindowDescriptor, ITheming theming, IThemedIconManager themedIconManager, IColorThemeManager colorThemeManager) { myLifetime = lifetime; myLocks = locks; mySettingsStore = settingsStore; myActionBarManager = actionBarManager; myTheming = theming; myThemedIconManager = themedIconManager; myColorThemeManager = colorThemeManager; myToolWindowClass = toolWindowManager.Classes[toolWindowDescriptor]; myToolWindowClass.RegisterEmptyContent( lifetime, lt => { var emptyLabel = new RichTextLabel { BackColor = SystemColors.Control, Dock = DockStyle.Fill }; emptyLabel.RichTextBlock.Add(new RichText("No hierarchies open", new TextStyle(FontStyle.Bold))); emptyLabel.RichTextBlock.Add( new RichText("Use " + actionManager.GetHowToExecuteAction(shortcutManager, typeof(BrowseTypeHierarchyAction)), TextStyle.Default)); emptyLabel.RichTextBlock.Add(new RichText("on a type to see hierarchy", TextStyle.Default)); emptyLabel.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter); return emptyLabel.BindToLifetime(lt); }); }
public ServerInfo() { _richTextLabel = new RichTextLabel { VerticalExpand = true }; AddChild(_richTextLabel); var buttons = new HBoxContainer(); AddChild(buttons); var uriOpener = IoCManager.Resolve <IUriOpener>(); var discordButton = new Button { Text = Loc.GetString("server-info-discord-button") }; discordButton.OnPressed += args => uriOpener.OpenUri(UILinks.Discord); var websiteButton = new Button { Text = Loc.GetString("server-info-website-button") }; websiteButton.OnPressed += args => uriOpener.OpenUri(UILinks.Website); var reportButton = new Button { Text = Loc.GetString("server-info-report-button") }; reportButton.OnPressed += args => uriOpener.OpenUri(UILinks.BugReport); var creditsButton = new Button { Text = Loc.GetString("server-info-credits-button") }; creditsButton.OnPressed += args => new CreditsWindow().Open(); var changelogButton = new ChangelogButton { HorizontalExpand = true, HorizontalAlignment = HAlignment.Right }; buttons.AddChild(discordButton); buttons.AddChild(websiteButton); buttons.AddChild(reportButton); buttons.AddChild(creditsButton); buttons.AddChild(changelogButton); }
protected override void Initialize() { IoCManager.InjectDependencies(this); CommandBar = GetChild <LineEdit>("CommandBar"); Contents = GetChild <RichTextLabel>("Contents"); Contents.ScrollFollowing = true; CommandBar.OnTextEntered += CommandEntered; console.AddString += (_, args) => AddLine(args.Text, args.Channel, args.Color); console.AddFormatted += (_, args) => AddFormattedLine(args.Message); console.ClearText += (_, args) => Clear(); }
public override void _Ready() { Controller = new PlayerController(this); Sprite = (AnimatedSprite)GetNode("Sprite"); RayPivot = (Node2D)GetNode("RayPivot"); Clock = (RichTextLabel)GetNode("UI/ControlUI/Clock"); Inventory = new Inventory(); Inventory.Items.Add(Tools.GetTool(0)); Inventory.Items.Add(Tools.GetTool(1)); TimeNode = (DayNight)GetNode("DayNight"); }
public override void _Ready() { animplayer = GetNode <AnimationPlayer>("AnimationPlayer"); rotateplayer = GetNode <AnimationPlayer>("RotatePlayer"); sprite = GetNode <Sprite>("Sprite"); rtx = GetNode <RichTextLabel>("Camera2D/movement"); zoomfac = GetNode <RichTextLabel>("Camera2D/zoomfactor"); isinair = GetNode <RichTextLabel>("Camera2D/isinair"); movvec = GetNode <RichTextLabel>("Camera2D/movvec"); cam = GetNode <Camera2D>("Camera2D"); nowGravity = baseGravity; zoomfactor = cam.Zoom.x; }
public override void _Ready() { LoadGame(); SetProcess(true); GenerateNewOrbTime(); GenerateNewAsteroidTime(); GenerateNewArmorTime(); SetBulletTimer(); viewSize = GetViewportRect().Size; scoreText = (RichTextLabel)GetNode("ScoreText"); scoreText.BbcodeText = "[right]" + currentScore.ToString() + "[/right]"; fpsText = (RichTextLabel)GetNode("FPSText"); }
public void Write([NotNull] string text, [NotNull] RichTextLabel label) { Ensure.Any.IsNotNull(text, nameof(text)); Ensure.Any.IsNotNull(label, nameof(label)); if (Color.HasValue) { label.PushColor(Color.Value); } if (Underline) { label.PushUnderline(); } if (Bold || Italics) { var sb = new StringBuilder(text.Length + 7 * 2); if (Bold) { sb.Append("[b]"); } if (Italics) { sb.Append("[i]"); } sb.Append(text); if (Italics) { sb.Append("[/i]"); } if (Bold) { sb.Append("[/b]"); } label.AppendBbcode(sb.ToString()); } else { label.AddText(text); } if (Color.HasValue || Underline) { label.Pop(); } }
private void AddFormattedText(string text) { if (VBox == null) { return; } var introLabel = new RichTextLabel(); var introMessage = new FormattedMessage(); introMessage.AddMarkup(text); introLabel.SetMessage(introMessage); VBox.AddChild(introLabel); }
public override void _Ready() { display = (RichTextLabel)GetNode("Panel/HSplitContainer/Panel/VSplitContainer/Display"); input = (LineEdit)GetNode("Panel/HSplitContainer/Panel/VSplitContainer/Input"); text_edit = (TextEdit)GetNode("Panel/HSplitContainer/VSplitContainer/TextEdit"); text_edit_open_file_label = (Label)GetNode("Panel/HSplitContainer/VSplitContainer/Panel/OpenFileName"); save_button = (Button)GetNode("Panel/HSplitContainer/VSplitContainer/HBoxContainer/Save"); quit_button = (Button)GetNode("Panel/HSplitContainer/VSplitContainer/HBoxContainer/Quit"); input.Connect("text_entered", this, "__TextEntered__"); shell.Connect("s_PushMsg", this, "__PushMsg__"); save_button.Connect("button_down", this, "__Save__"); quit_button.Connect("button_down", this, "__Quit__"); }
private void _on_Button_pressed() { if (Text == "" || Text.Empty()) { return; } RichTextLabel node = GetParent().GetParent().GetParent().GetNode <RichTextLabel>("CommandPanel/RichTextLabel"); node.Text += $">{GetText()}\n"; CommandInputEvent.Call(GetText()); LastCmds.Add(GetText()); currentCmd = 0; SetText(""); }
public override void _Ready() { if (_log == null) { _log = this; } else { QueueFree(); return; } Output = GetNode <RichTextLabel>("Output"); }
/// <summary>Assigns all controls.</summary> private void AssignControls() { LblError = (Label)GetNode("LblError"); LblGoldOnHand = (Label)GetNode("Gold/LblGoldOnHand"); LblGoldInBank = (Label)GetNode("Gold/LblGoldInBank"); LblLoanAvailable = (Label)GetNode("Gold/LblLoanAvailable"); LblLoanOwed = (Label)GetNode("Gold/LblLoanOwed"); BtnDeposit = (Button)GetNode("Buttons/BtnDeposit"); BtnWithdraw = (Button)GetNode("Buttons/BtnWithdraw"); BtnTakeOutLoan = (Button)GetNode("Buttons/BtnTakeOutLoan"); BtnRepayLoan = (Button)GetNode("Buttons/BtnRepayLoan"); TxtGold = (LineEdit)GetNode("TxtGold"); TxtBank = (RichTextLabel)GetNode("TxtBank"); }
public override void _Ready() { CurrencyText = (RichTextLabel)GetNode("VBoxStoreContainer/Panel/CurrencyText"); extraLivesBtn = (Button)GetNode("VBoxStoreContainer/HBoxContainer/VBoxContainer/ExtraLifeBtn"); doubleHealthBtn = (Button)GetNode("VBoxStoreContainer/HBoxContainer/VBoxContainer2/DoubleHealthBtn"); burstBulletBtn = (Button)GetNode("VBoxStoreContainer/HBoxContainer/VBoxContainer3/MissileBtn"); extraLivesBtn.Text = extraLivesCost + " Points"; doubleHealthBtn.Text = doubleHealthCost + " Points"; burstBulletBtn.Text = burstBulletCost + " Points"; LoadGame(); LoadCurrentLives(); LoadCurrentHealth(); LoadBurstBullet(); }
public void InfoLoop() { if (Menu[2].Visible) { int PassCount = 0; for (byte i = 0; i < Battle.Count; i++) { if (Battle[i].IsHovered() && !Battle[i].Disabled) { if (i == PastSelection) { break; } else { Move HMove = LPokemon[1].Moveset[i]; PastSelection = i; RichTextLabel TypeLabel = Menu[2].GetNode("INFBOX/TEXT/TYPE") as RichTextLabel; RichTextLabel CountLabel = Menu[2].GetNode("INFBOX/TEXT/COUNT") as RichTextLabel; TypeLabel.BbcodeText = string.Format("[center]{0}[/center]", Pokemon.TypeNames[HMove.Type]); CountLabel.BbcodeText = string.Format("[right]{0}/{1}[/right]", HMove.CurrentCount, HMove.Count); break; } } else { PassCount++; } } if (PassCount == Battle.Count) { Move HMove = LPokemon[1].Moveset[0]; PastSelection = 0; RichTextLabel TypeLabel = Menu[2].GetNode("INFBOX/TEXT/TYPE") as RichTextLabel; RichTextLabel CountLabel = Menu[2].GetNode("INFBOX/TEXT/COUNT") as RichTextLabel; TypeLabel.BbcodeText = string.Format("[center]{0}[/center]", Pokemon.TypeNames[HMove.Type]); CountLabel.BbcodeText = string.Format("[right]{0}/{1}[/right]", HMove.CurrentCount, HMove.Count); } } }
private BoxContainer MakeRoundEndSummaryTab(string gamemode, string roundEnd, TimeSpan roundDuration, int roundId) { var roundEndSummaryTab = new BoxContainer { Orientation = LayoutOrientation.Vertical, Name = Loc.GetString("round-end-summary-window-round-end-summary-tab-title") }; var roundEndSummaryContainerScrollbox = new ScrollContainer { VerticalExpand = true }; var roundEndSummaryContainer = new BoxContainer { Orientation = LayoutOrientation.Vertical }; //Gamemode Name var gamemodeLabel = new RichTextLabel(); var gamemodeMessage = new FormattedMessage(); gamemodeMessage.AddMarkup(Loc.GetString("round-end-summary-window-round-id-label", ("roundId", roundId))); gamemodeMessage.AddText(" "); gamemodeMessage.AddMarkup(Loc.GetString("round-end-summary-window-gamemode-name-label", ("gamemode", gamemode))); gamemodeLabel.SetMessage(gamemodeMessage); roundEndSummaryContainer.AddChild(gamemodeLabel); //Duration var roundTimeLabel = new RichTextLabel(); roundTimeLabel.SetMarkup(Loc.GetString("round-end-summary-window-duration-label", ("hours", roundDuration.Hours), ("minutes", roundDuration.Minutes), ("seconds", roundDuration.Seconds))); roundEndSummaryContainer.AddChild(roundTimeLabel); //Round end text if (!string.IsNullOrEmpty(roundEnd)) { var roundEndLabel = new RichTextLabel(); roundEndLabel.SetMarkup(roundEnd); roundEndSummaryContainer.AddChild(roundEndLabel); } roundEndSummaryContainerScrollbox.AddChild(roundEndSummaryContainer); roundEndSummaryTab.AddChild(roundEndSummaryContainerScrollbox); return(roundEndSummaryTab); }
public void Show() { ToolWindowInstance instance = toolWindowClass.RegisterInstance( lifetime, StringUtil.MakeTitle("YouTrack Explorer"), // title of your window; tip: StringUtil.MakeTitle null, // return a System.Drawing.Image to be displayed (lt, twi) => { var label = new RichTextLabel { BackColor = SystemColors.Control, Dock = DockStyle.Fill }; label.RichTextBlock.Add(new RichText("My Content", new TextStyle(FontStyle.Bold))); label.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter); return label.BindToLifetime(lt); }); instance.EnsureControlCreated().Show(); }
public Listener(MainPanel panel) { CommandOutput = panel.CommandOutputBox; LogOutput = panel.LogText; _commandListener = new CommandListener(); _commandListener.AddCommand(new Xana()); _commandListener.AddCommand(new LW()); _commandListener.AddCommand(new Aelita()); //Ensure Help command is always the last command to be added to the listener List <Command> commands = _commandListener.GetCommands(); _commandListener.AddCommand(new Help(ref commands)); }
public void Write(string text, RichTextLabel label) { Ensure.That(text, nameof(text)).IsNotNull(); Ensure.That(label, nameof(label)).IsNotNull(); Color.Iter(label.PushColor); if (Underline) { label.PushUnderline(); } if (Bold || Italics) { var sb = new StringBuilder(text.Length + 7 * 2); if (Bold) { sb.Append("[b]"); } if (Italics) { sb.Append("[i]"); } sb.Append(text); if (Italics) { sb.Append("[/i]"); } if (Bold) { sb.Append("[/b]"); } label.AppendBbcode(sb.ToString()); } else { label.AddText(text); } if (Color.IsSome || Underline) { label.Pop(); } }
public PaperWindow() { MinSize = SetSize = (300, 300); var container = new BoxContainer { Orientation = LayoutOrientation.Vertical }; _label = new RichTextLabel(); Input = new LineEdit { Visible = false }; container.AddChild(_label); container.AddChild(Input); Contents.AddChild(container); }
public override void _Ready() { PersistentDataStorage.Load(); if (this._iconScrollList == null) { this._iconScrollList = (VBoxContainer)this.GetNode("Bestiary").GetNode("Container").GetNode("MarginContainer").GetNode("ScrollListEnemyIcons").GetNode("ScrollBoxEnemyIcons"); this._bigIcon = (AnimatedSprite)this.GetNode("Bestiary").GetNode("Container2").GetNode("MarginContainer").GetNode("BestiaryLog").GetNode("EnemySprite"); this._lockIcon = (AnimatedSprite)this.GetNode("Bestiary").GetNode("Container2").GetNode("MarginContainer").GetNode("BestiaryLog").GetNode("LockIcon"); this._enemyDescription = (RichTextLabel)this.GetNode("Bestiary").GetNode("Container2").GetNode("MarginContainer").GetNode("BestiaryLog").GetNode("Container").GetNode("MarginContainer").GetNode("EnemyDescription"); this._enemyName = (RichTextLabel)this.GetNode("Bestiary").GetNode("Container2").GetNode("MarginContainer").GetNode("BestiaryLog").GetNode("Container2").GetNode("MarginContainer").GetNode("EnemyName"); this.PopulateBestiary(); this.PrepareBestiary(); ((Button)this.GetNode("Bestiary").GetNode("MarginContainer").GetNode("Container").GetNode("MarginContainer").GetNode("Button")).Connect("pressed", this, "CloseBestiary"); } }
public override void _Ready() { _creditsRichText = GetNode <RichTextLabel>("CreditsContainer/CenterContainer/VBoxContainer/Credits"); // make sure bbcode is enabled & set the credits value _creditsRichText.BbcodeEnabled = true; _creditsRichText.SetBbcode(Game.Autoload().Credits); _creditsRichText.Connect("meta_clicked", this, nameof(Clicked)); _linkSeek = _creditsRichText.GetVisibleLineCount(); _maxSeekLines = _creditsRichText.GetLineCount() - 1; // was trying to use scrolling credits, but it sucked. // _creditsTimer = GetNode<Timer>("CreditsTimer"); // _creditsTimer.Connect("timeout", this, nameof(ScrollCredits)); }
public override async void _Ready() { CurrentSceneContainer = GetNode <Control>("CurrentScene"); CodeLabel = GetNode <RichTextLabel>("Container/VBox/TopControl/CodeHBox/Code"); SummaryLabel = GetNode <RichTextLabel>("Container/VBox/TopControl/CodeHBox/Summary"); CodeBackground = GetNode <ColorRect>("Container/VBox/TopControl/CodeBackground"); ToggleCodeButton = GetNode <Button>("Container/VBox/ButtonsMargin/Buttons/LeftButtons/ToggleCodeButton"); ToggleUIButton = GetNode <Button>("Container/VBox/ButtonsMargin/Buttons/LeftButtons/ToggleUIButton"); PrevChapterButton = GetNode <Button>("Container/VBox/ButtonsMargin/Buttons/SelectionButtons/ChapterSelection/PrevChapter"); NextChapterButton = GetNode <Button>("Container/VBox/ButtonsMargin/Buttons/SelectionButtons/ChapterSelection/NextChapter"); SelectChapterButton = GetNode <OptionButton>("Container/VBox/ButtonsMargin/Buttons/SelectionButtons/ChapterSelection/SelectChapter"); PrevExampleButton = GetNode <Button>("Container/VBox/ButtonsMargin/Buttons/SelectionButtons/ExampleSelection/PrevExample"); NextExampleButton = GetNode <Button>("Container/VBox/ButtonsMargin/Buttons/SelectionButtons/ExampleSelection/NextExample"); SelectExampleButton = GetNode <OptionButton>("Container/VBox/ButtonsMargin/Buttons/SelectionButtons/ExampleSelection/SelectExample"); ReloadExampleButton = GetNode <Button>("Container/VBox/ButtonsMargin/Buttons/SelectionButtons/ExampleSelection/ReloadExample"); SelectionButtons = GetNode <VBoxContainer>("Container/VBox/ButtonsMargin/Buttons/SelectionButtons"); LoadingLabel = GetNode <Label>("Container/Loading"); PrevChapterButton.Connect("pressed", this, nameof(SelectPrevChapter)); NextChapterButton.Connect("pressed", this, nameof(SelectNextChapter)); PrevExampleButton.Connect("pressed", this, nameof(SelectPrevExample)); NextExampleButton.Connect("pressed", this, nameof(SelectNextExample)); ToggleCodeButton.Connect("pressed", this, nameof(ToggleCodeLabel)); ReloadExampleButton.Connect("pressed", this, nameof(LoadCurrentExample)); SelectChapterButton.Connect("item_selected", this, nameof(SelectChapterFromId)); SelectExampleButton.Connect("item_selected", this, nameof(SelectExampleFromId)); ToggleUIButton.Connect("pressed", this, nameof(ToggleUI)); SummaryLabel.Visible = false; CodeBackground.Visible = false; CodeLabel.Visible = false; ToggleCodeButton.Visible = false; ToggleUIButton.Visible = false; sceneLoader = new SceneLoader(); sceneLoader.Connect(nameof(SceneLoader.ScenesLoaded), this, nameof(OnScenesLoaded)); // Force min size for exercise selection var font = SelectChapterButton.GetFont("font"); SelectExampleButton.RectMinSize = font.GetCharSize('w') * new Vector2(SceneLoader.SampleNameMaxLength, 1); await ToSignal(GetTree().CreateTimer(0.1f), "timeout"); AddChild(sceneLoader); }
public YouTrackExplorerWindowRegistrar(Lifetime lifetime, ToolWindowManager toolWindowManager, YouTrackExplorerWindowDescriptor descriptor) { this.lifetime = lifetime; toolWindowClass = toolWindowManager.Classes[descriptor]; toolWindowClass.RegisterEmptyContent( lifetime, lt => { // initialize the default ('empty') content for the tool window var label = new RichTextLabel { BackColor = SystemColors.Control, Dock = DockStyle.Fill }; label.RichTextBlock.Add(new RichText("Nothing Here", new TextStyle(FontStyle.Bold))); label.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter); return label.BindToLifetime(lt); }); }
public TutorialWindow() { Title = "The Tutorial!"; var scrollContainer = new ScrollContainer(); Contents.AddChild(scrollContainer); var label = new RichTextLabel(); scrollContainer.AddChild(label); var message = new FormattedMessage(); message.AddText(TutorialContents); label.SetMessage(message); }
public override void _Ready() { leftCard = GetNode <CardVisual>(leftCardPath); middleCard = GetNode <CardVisual>(middleCardPath); rightCard = GetNode <CardVisual>(rightCardPath); foodField = GetNode <FoodVisual>(foodPath); bubbleText = GetNode <RichTextLabel>(bubblePath); buyButton = GetNode <Button>(buyButtonPath); buyButtonText = GetNode <RichTextLabel>(buyButtonPath + "/Text"); leftCard.Connect(nameof(CardVisual.OnClick), this, nameof(OpenCard), 0.InArray()); middleCard.Connect(nameof(CardVisual.OnClick), this, nameof(OpenCard), 1.InArray()); rightCard.Connect(nameof(CardVisual.OnClick), this, nameof(OpenCard), 2.InArray()); foodField.Connect(nameof(FoodVisual.OnClick), this, nameof(OpenFood)); buyButton.Connect("pressed", this, nameof(Buy)); CallDeferred(nameof(Init)); }
protected override Control BuildBubble(string text) { var label = new RichTextLabel { MaxWidth = 256, }; label.SetMessage(text); var panel = new PanelContainer { StyleClasses = { "speechBox", "sayBox" }, Children = { label }, ModulateSelfOverride = Color.White.WithAlpha(0.75f) }; return(panel); }
// Called when the node enters the scene tree for the first time. public override void _Ready() { _map = this.GetNode <Area2D>("../MainMap"); _tilemap = _map.GetNode <TileMap>("./Ground"); _upBorder = this.GetNode <Area2D>("UpBorder"); _downBorder = this.GetNode <Area2D>("DownBorder"); _debugPosition = this.GetNode <RichTextLabel>("DebugMapPosition"); _isScrollingUp = false; _isScrollingDown = false; _upBorder.Connect("mouse_entered", this, "_on_UpBorder_mouse_entered"); _downBorder.Connect("mouse_entered", this, "_on_DownBorder_mouse_entered"); _upBorder.Connect("mouse_exited", this, "_on_UpBorder_mouse_exited"); _downBorder.Connect("mouse_exited", this, "_on_DownBorder_mouse_exited"); }
public ServerInfo() { _richTextLabel = new RichTextLabel { VerticalExpand = true }; AddChild(_richTextLabel); var buttons = new HBoxContainer(); AddChild(buttons); var uriOpener = IoCManager.Resolve <IUriOpener>(); var discordButton = new Button { Text = Loc.GetString("Discord") }; discordButton.OnPressed += args => uriOpener.OpenUri(UILinks.Discord); var websiteButton = new Button { Text = Loc.GetString("Website") }; websiteButton.OnPressed += args => uriOpener.OpenUri(UILinks.Website); var reportButton = new Button { Text = Loc.GetString("Report Bugs") }; reportButton.OnPressed += args => uriOpener.OpenUri(UILinks.BugReport); var creditsButton = new Button { Text = Loc.GetString("Credits") }; creditsButton.OnPressed += args => new CreditsWindow().Open(); buttons.AddChild(discordButton); buttons.AddChild(websiteButton); buttons.AddChild(reportButton); buttons.AddChild(creditsButton); }
public override void _Ready() { SetProcess(true); SetPhysicsProcess(true); LoadCurrentLives(); LoadCurrentHealth(); LoadBurstBullet(); viewSize = GetViewportRect().Size; currentBulletCooldownTime = bulletCooldownTime; shipSprite = (Sprite)GetNode("Sprite"); healthText = (RichTextLabel)GetNode("HealthText"); livesText = (RichTextLabel)GetNode("LivesText"); healthText.Text = currentHealth + "%"; livesText.Text = currentLives.ToString(); audio = (AudioStreamPlayer)GetNode("Audio"); }
public override void _Ready() { // TODO: proper level loading..? lander = GetNode <Lander>("Lander"); groundTimer = GetNode <Timer>("GroundTimer"); fuelBar = GetNode <ProgressBar>("UI/FuelBar"); restartText = GetNode <RichTextLabel>("UI/ResetText"); restartText.Hide(); landText = GetNode <RichTextLabel>("UI/LandText"); landText.Hide(); camera = GetNode <Camera2D>("Camera"); winSound = GetNode <AudioStreamPlayer>("LevelWinSound"); resetSound = GetNode <AudioStreamPlayer>("LevelResetSound"); ll = new LevelLoader(); var lvl = ll.FirstLevel(); SetCurrentLevel(lvl); }
public void Show() { ToolWindowInstance instance = toolWindowClass.RegisterInstance( lifetime, StringUtil.MakeTitle("YouTrack Explorer"), // title of your window; tip: StringUtil.MakeTitle null, // return a System.Drawing.Image to be displayed (lt, twi) => { var label = new RichTextLabel(application) { BackColor = SystemColors.Control, Dock = DockStyle.Fill }; label.RichTextBlock.Add(new RichText("My Content", new TextStyle(FontStyle.Bold))); label.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter); return(label.BindToLifetime(lt)); }); instance.EnsureControlCreated().Show(); }
public CommunicationsConsoleMenu(CommunicationsConsoleBoundUserInterface owner) { IoCManager.InjectDependencies(this); Title = Loc.GetString("Communications Console"); Owner = owner; _countdownLabel = new RichTextLabel() { CustomMinimumSize = new Vector2(0, 200) }; _emergencyShuttleButton = new Button(); _emergencyShuttleButton.OnPressed += (e) => Owner.EmergencyShuttleButtonPressed(); var vbox = new VBoxContainer() { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand }; vbox.AddChild(_countdownLabel); vbox.AddChild(_emergencyShuttleButton); var hbox = new HBoxContainer() { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand }; hbox.AddChild(new Control() { CustomMinimumSize = new Vector2(100, 0), SizeFlagsHorizontal = SizeFlags.FillExpand }); hbox.AddChild(vbox); hbox.AddChild(new Control() { CustomMinimumSize = new Vector2(100, 0), SizeFlagsHorizontal = SizeFlags.FillExpand }); Contents.AddChild(hbox); UpdateCountdown(); Timer.SpawnRepeating(1000, UpdateCountdown, _timerCancelTokenSource.Token); }
public override void _Ready() { Controller = new PlayerController(this); Sprite = (AnimatedSprite)GetNode("Sprite"); RayPivot = (Node2D)GetNode("RayPivot"); Clock = (RichTextLabel)GetNode("UI/ControlUI/Clock"); MessageLabel = (RichTextLabel)GetNode("UI/ControlUI/Message"); MessageLabel.BbcodeText = ""; CurrencyLabel = (RichTextLabel)GetNode("UI/ControlUI/Currency"); Currency += 5; Inventory = new Inventory(); Inventory.Items.Add(Database <Item> .Get("Tools\\BasicHoe")); Inventory.Items.Add(Database <Item> .Get("Tools\\BasicWateringCan")); TimeNode = (DayNight)GetNode("DayNight"); }
public JetBoxOptionsPage(Lifetime lifetime, IUIApplication environment, ClientFactory clientFactory, JetBoxSettingsStorage jetBoxSettings, JetPopupMenus jetPopupMenus, OpensUri opensUri) : base(lifetime, environment, PID) { mySettingsStore = jetBoxSettings.SettingsStore.BindToContextLive(lifetime, ContextRange.ApplicationWide); myOpensUri = opensUri; myClient = clientFactory.CreateClient(); myClient.UserLogin = mySettingsStore.GetValue(JetBoxSettingsAccessor.Login); // init UI myLoggedPanel = new FlowLayoutPanel { Visible = false, AutoSize = true }; myLoggedPanel.Controls.Add(myLoginLabel = new RichTextLabel(environment)); myLoggedPanel.Controls.Add(new LinkLabel("Logout", Logout, jetPopupMenus)); myNonLoggedPanel = new FlowLayoutPanel { Visible = false, AutoSize = true, FlowDirection = FlowDirection.TopDown }; myNonLoggedPanel.Controls.Add(new LinkLabel("Login", Login, jetPopupMenus)); myNonLoggedPanel.Controls.Add(new LinkLabel("Get access (click after approving access on the web)", GetInfo, jetPopupMenus)); Controls.Add(myLoggedPanel); Controls.Add(myNonLoggedPanel); InitLoginState(); }