void LoginAsync(int mouseX, int mouseY) { if (String.IsNullOrEmpty(Get(0))) { SetStatus("&ePlease enter a username"); return; } if (String.IsNullOrEmpty(Get(1))) { SetStatus("&ePlease enter a password"); return; } if (signingIn) { return; } UpdateSignInInfo(Get(0), Get(1)); CheckboxWidget skip = widgets[view.sslIndex] as CheckboxWidget; if (skip != null && skip.Value) { ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); }; Options.Set("skip-ssl-check", true); } else { ServicePointManager.ServerCertificateValidationCallback = null; } game.Session.LoginAsync(Get(0), Get(1)); game.RedrawBackground(); Resize(); SetStatus("&eSigning in.."); signingIn = true; }
void UseClassicubeSkinsClick(int mouseX, int mouseY) { CheckboxWidget widget = (CheckboxWidget)widgets[view.ccSkinsIndex]; widget.Value = !widget.Value; RedrawWidget(widget); }
void SetBool(bool value) { CheckboxWidget widget = (CheckboxWidget)widgets[view.sslIndex]; widget.Value = value; widget.Redraw(game.Drawer); game.Dirty = true; }
void SSLSkipValidationClick(int mouseX, int mouseY) { using (drawer) { drawer.SetBitmap(game.Framebuffer); CheckboxWidget widget = (CheckboxWidget)widgets[view.sslIndex]; SetBool(!widget.Value); } }
protected CheckboxWidget(CheckboxWidget other) : base(other) { CheckType = other.CheckType; GetCheckType = other.GetCheckType; IsChecked = other.IsChecked; CheckOffset = other.CheckOffset; HasPressedState = other.HasPressedState; }
public EditWorldDialog(CreatorAPI creatorAPI) { this.creatorAPI = creatorAPI; this.player = creatorAPI.componentMiner.ComponentPlayer; XElement node = ContentManager.Get <XElement>("NewWidgets/Dialog/编辑世界"); WidgetsManager.LoadWidgetContents(this, this, node); this.worldSettings = player.Project.FindSubsystem <SubsystemGameInfo>(true).WorldSettings; this.OKButton = Children.Find <ButtonWidget>("确定"); this.UpdataWorldButton = Children.Find <ButtonWidget>("重载"); this.UpdataButton = Children.Find <ButtonWidget>("刷新"); this.paletteButton = this.Children.Find <ButtonWidget>("Palette", true); this.blocksTextureIcon = this.Children.Find <RectangleWidget>("BlocksTextureIcon", true); this.blocksTextureLabel = this.Children.Find <LabelWidget>("BlocksTextureLabel", true); this.blocksTextureDetails = this.Children.Find <LabelWidget>("BlocksTextureDetails", true); this.blocksTextureButton = this.Children.Find <ButtonWidget>("BlocksTextureButton", true); this.supernaturalCreaturesButton = this.Children.Find <ButtonWidget>("SupernaturalCreatures", true); this.environmentBehaviorButton = this.Children.Find <ButtonWidget>("EnvironmentBehavior", true); this.timeOfDayButton = this.Children.Find <ButtonWidget>("TimeOfDay", true); this.weatherEffectsButton = this.Children.Find <ButtonWidget>("WeatherEffects", true); this.adventureRespawnButton = this.Children.Find <ButtonWidget>("AdventureRespawn", true); this.adventureSurvivalMechanicsButton = this.Children.Find <ButtonWidget>("AdventureSurvivalMechanics", true); this.terrainGenerationLabel = this.Children.Find <LabelWidget>("TerrainGenerationLabel", true); this.terrainGenerationButton = this.Children.Find <ButtonWidget>("TerrainGeneration", true); this.seaLevelOffsetSlider = this.Children.Find <SliderWidget>("SeaLevelOffset", true); this.temperatureOffsetSlider = this.Children.Find <SliderWidget>("TemperatureOffset", true); this.humidityOffsetSlider = this.Children.Find <SliderWidget>("HumidityOffset", true); this.biomeSizeSlider = this.Children.Find <SliderWidget>("BiomeSize", true); this.islandTerrainPanel = this.Children.Find <Widget>("IslandTerrainPanel", true); this.islandSizeNS = this.Children.Find <SliderWidget>("IslandSizeNS", true); this.islandSizeEW = this.Children.Find <SliderWidget>("IslandSizeEW", true); this.flatTerrainPanel = this.Children.Find <Widget>("FlatTerrainPanel", true); this.continentTerrainPanel = this.Children.Find <Widget>("ContinentTerrainPanel", true); this.flatTerrainLevelSlider = this.Children.Find <SliderWidget>("FlatTerrainLevel", true); this.flatTerrainBlock = this.Children.Find <BlockIconWidget>("FlatTerrainBlock", true); this.flatTerrainBlockLabel = this.Children.Find <LabelWidget>("FlatTerrainBlockLabel", true); this.flatTerrainBlockButton = this.Children.Find <ButtonWidget>("FlatTerrainBlockButton", true); this.flatTerrainMagmaOceanCheckbox = this.Children.Find <CheckboxWidget>("MagmaOcean", true); this.islandSizeEW.MinValue = 0f; this.islandSizeEW.MaxValue = (float)(this.islandSizes.Length - 1); this.islandSizeEW.Granularity = 1f; this.islandSizeNS.MinValue = 0f; this.islandSizeNS.MaxValue = (float)(this.islandSizes.Length - 1); this.islandSizeNS.Granularity = 1f; this.biomeSizeSlider.MinValue = 0f; this.biomeSizeSlider.MaxValue = (float)(this.biomeSizes.Length - 1); this.biomeSizeSlider.Granularity = 1f; }
void UseCClientClick(int mouseX, int mouseY) { CheckboxWidget widget = (CheckboxWidget)widgets[view.clientIndex]; widget.Value = !widget.Value; RedrawWidget(widget); Options.Set(OptionsKey.CClient, widget.Value); Client.CClient = widget.Value; if (Client.CClient && !Platform.FileExists(Client.GetExeName())) { if (warned) { return; } warned = true; ErrorHandler.ShowDialog("Note", "You will need to update again to get it"); } }
void LoginAsync(int mouseX, int mouseY) { if (String.IsNullOrEmpty(Get(0))) { SetStatus("&eUsername required"); return; } if (String.IsNullOrEmpty(Get(1))) { SetStatus("&ePassword required"); return; } if (getTask != null) { return; } game.Username = Get(0); UpdateSignInInfo(Get(0), Get(1)); CheckboxWidget skip = widgets[view.sslIndex] as CheckboxWidget; if (skip != null && skip.Value) { ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); }; Options.Set("skip-ssl-check", true); } else { ServicePointManager.ServerCertificateValidationCallback = null; } getTask = new GetCSRFTokenTask(); getTask.RunAsync(game); game.RedrawBackground(); Resize(); SetStatus("&eSigning in.."); signingIn = true; }
public Img(ComponentPlayer player, string path, TerrainRaycastResult?Point1, SubsystemTerrain subsystemTerrain) { path_img = path; Point = new Point3(Point1.Value.CellFace.Point.X, Point1.Value.CellFace.Point.Y, Point1.Value.CellFace.Point.Z); m_subsystemTerrain = subsystemTerrain; this.player = player; WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("WE/DialogsWE/ImgDialog")); // WidgetsManager.LoadWidgetContents(this, this, XElement.Load(@"D:\Games\WSC\Content\WE\DialogsWE\ImgDialog.xml")); m_okButton = this.Children.Find <ButtonWidget>("Img_Dialog.OK", true); m_cancelButton = this.Children.Find <ButtonWidget>("Img_Dialog.Cancel", true); m_type_creatingButton = this.Children.Find <ButtonWidget>("Img_Dialog.type_cr_btn", true); m_type_creatingLabel = this.Children.Find <LabelWidget>("Img_Dialog.type_cr_text", true); m_resizeSlider = this.Children.Find <SliderWidget>("Img_Dialog.resize_sl", true); m_furniture_resolutionSlider = this.Children.Find <SliderWidget>("Img_Dialog.furn_res_sl", true); m_deep_colorSlider = this.Children.Find <SliderWidget>("Img_Dialog.Slider_deep", true); m_color_ofsetSlider = this.Children.Find <SliderWidget>("Img_Dialog.ofst_sl", true); m_posButton = this.Children.Find <ButtonWidget>("Img_Dialog.pos_sel", true); m_rotButton = this.Children.Find <ButtonWidget>("Img_Dialog.rot_sel", true); m_posLabel = this.Children.Find <LabelWidget>("Img_Dialog.pos_txt", true); m_rotLabel = this.Children.Find <LabelWidget>("Img_Dialog.rot_txt", true); m_colors_useBox = this.Children.Find <CheckboxWidget>("Img_Dialog.Line0", true); m_color_saveBox = this.Children.Find <CheckboxWidget>("Img_Dialog.Line1", true); m_mirrorBox = this.Children.Find <CheckboxWidget>("Img_Dialog.mirror", true); m_resizeSlider.MinValue = 1f; m_resizeSlider.MaxValue = 8f; m_furniture_resolutionSlider.MinValue = 2f; m_furniture_resolutionSlider.MaxValue = 16f; m_color_ofsetSlider.MinValue = 0f; m_color_ofsetSlider.MaxValue = 8f; m_deep_colorSlider.MinValue = 2f; m_deep_colorSlider.MaxValue = 16f; t_c_txt = "Furniture"; m_colors_useBox.IsChecked = false; m_color_saveBox.IsChecked = false; m_resizeSlider.Value = 2; m_furniture_resolutionSlider.Value = 16; m_deep_colorSlider.Value = 16; pos_txt = "Horizontally"; rot_txt = "Front"; }