private void AddUserAllianceButtons() { if (Id != ConfederationAlliId) { AddButton(ButtonsView.LeaveFromAlliance(Id)); } }
public override void TaskButtons() { HasButtons = true; Buttons = new List <IButtonsView> { ButtonsView.ConstructorSizeBtn(2, true, "Cancel", "GameServices.journalHelper.cancelMotherJump"), ButtonsView.ConstructorSizeBtn(2, true, "InstJump (" + JumpMotherPrice + " sg)", "GameServices.journalHelper.instMotherJump", new { PriceCc = JumpMotherPrice }) }; var m = new { DataTimer = new ItemProgress { IsProgress = true, Duration = FlyDuration, StartTime = StartTime }, SourceSystemName, TargetSystemName }; SetComplexButtonView(ComplexBtn(m, true)); }
void SetPreviousButtonHidden(bool hide) { if (hide) { NSLayoutConstraint nextBtnLeadingConstraint = null; foreach (NSLayoutConstraint constraint in ButtonsView.Constraints) { if (constraint.SecondItem == NextBtn && constraint.SecondAttribute == NSLayoutAttribute.Leading) { nextBtnLeadingConstraint = constraint; break; } } if (nextBtnLeadingConstraint == null) { ButtonsView.LeadingAnchor.ConstraintEqualTo(NextBtn.LeadingAnchor, 0).Active = true; } } else { foreach (NSLayoutConstraint constraint in ButtonsView.Constraints) { if (constraint.SecondItem == NextBtn && constraint.SecondAttribute == NSLayoutAttribute.Leading) { ButtonsView.RemoveConstraint(constraint); break; } } } }
public IHttpActionResult Convert(string name) { var alliance = new AllianceRatingOut { AllianceDescription = "descr", ComplexButtonView = new ComplexButtonView(), Id = 1, Name = "allianceName", Label = Label.DefaultUrls(), HasButtons = true, Buttons = new List <ButtonsView> { ButtonsView.HangarToggle() }, PvpPoint = 1000, LeaderImg = Avatar.DefaultUrls(), ControlledPlanet = 10, Pilots = 5, LeaderName = "LeaderName" }; var myAlliance = new TabMyAllianceOut(); alliance.ShallowConvert(myAlliance); var result = new { parent = alliance, result = myAlliance }; return(Json(result)); }
protected void ReportInfoBtns() { var isNpc = (string.Equals(TargetUserName, Npc.SkagyName, StringComparison.CurrentCultureIgnoreCase)); var fromReport = IsReport; var btnPref = (fromReport) ? "report_" + Id + "_" : "spy_" + Id + "_"; if (!isNpc) { var mes = ButtonsView.ConstructorSizeBtn(2, true, "tr_send message"); mes.ButtonId = btnPref + "mes"; Buttons.Add(mes); var smSpay = ButtonsView.Spy(2, TargetPlanetId, TargetPlanetName, true); smSpay.ButtonId = btnPref + "spy"; Buttons.Add(smSpay); } else { if (IsLose || !fromReport) { var spyBtn = ButtonsView.Spy(1, TargetPlanetId, TargetPlanetName, true); spyBtn.ButtonId = btnPref + "spy"; Buttons.Add(spyBtn); } } }
private void AddSerchButtons(int userAllianceId) { if (Id == ConfederationAlliId) { return; } AddButton(userAllianceId == Id ? ButtonsView.LeaveFromAlliance(Id) : ButtonsView.JoinToAlliacne(Id, Name)); }
private void DropButtons() { HasButtons = true; Buttons = new List <IButtonsView> { ButtonsView.ConstructorSizeBtn(2, true, Resource.Jump), ButtonsView.ConstructorSizeBtn(2, true, Resource.ReturnFleet) }; }
protected void SetButtons(bool containSubmit) { HasButtons = true; Buttons = new Dictionary <string, IButtonsView>(); if (containSubmit) { Buttons.Add("Submit", ButtonsView.ConstructorSizeBtn(1, true, Resource.Submit)); } }
private void DropButtons() { HasButtons = true; Buttons = new List <IButtonsView> { ButtonsView.ReportDelete(Id) }; ReportInfoBtns(); }
void ReleaseDesignerOutlets() { if (ButtonsView != null) { ButtonsView.Dispose(); ButtonsView = null; } if (DateLabel != null) { DateLabel.Dispose(); DateLabel = null; } if (DeleteButton != null) { DeleteButton.Dispose(); DeleteButton = null; } if (EditButton != null) { EditButton.Dispose(); EditButton = null; } if (ProductDetailsView != null) { ProductDetailsView.Dispose(); ProductDetailsView = null; } if (ProductImageView != null) { ProductImageView.Dispose(); ProductImageView = null; } if (ProductTitleLabel != null) { ProductTitleLabel.Dispose(); ProductTitleLabel = null; } if (ScoreContainerView != null) { ScoreContainerView.Dispose(); ScoreContainerView = null; } if (TextLabel != null) { TextLabel.Dispose(); TextLabel = null; } }
protected void _setBtnSend() { BtnSendMessage = ButtonsView.ConstructorSizeBtn(4); BtnSendMessage.Params = new { ChannelId, ChannelType, MessageMaxLength }; BtnSendMessage.ShowName = true; BtnSendMessage.TranslateName = Server.Modules.Localize.Game.Common.Resource.Send; }
public void SectorInfoButtons() { HasButtons = IsBookmark; if (IsBookmark) { Buttons = new List <IButtonsView> { ButtonsView.DeleteBookmark(1, BookmarkId, TypeNativeName, Id, 2) }; } }
public static IReadOnlyList <IButtonsView> MapControllButtons(ILocalizerService localizer) { var list = new List <IButtonsView>(); var cb = MapControlsActionsTranslate(localizer); for (byte i = 0; i < cb.Count; i++) { list.Add(ButtonsView.MapControlBtns(i, cb[i])); } return(list); }
public override void TaskButtons() { HasButtons = true; Buttons = new List <IButtonsView> { ButtonsView.NewTaskAttack(), ButtonsView.NewTaskTransfer(), ButtonsView.ConstructorSizeBtn(3, true, Resource.Reset, "GameServices.journalHelper.resetTaskUnits"), ButtonsView.ConstructorSizeBtn(3, true, Resource.LoadAll, "GameServices.journalHelper.setAllUnits"), ButtonsView.ConstructorSizeBtn(3, true, null, "GameServices.journalHelper.submitTaskForm") }; }
public void SetButtons() { if (IsCurrentUser) { Buttons = new Dictionary <string, IButtonsView> { { "edit", ButtonsView.ConstructorSizeBtn(1, true, Resource.Edit) }, { "cancel", ButtonsView.ConstructorSizeBtn(2, true, Resource.Cancel) }, { "send", ButtonsView.ConstructorSizeBtn(2, true, Resource.Send) } }; } }
private void SpyButtons() { HasButtons = true; var atkBtn = ButtonsView.Attack(true, 2, TargetPlanetName, TargetPlanetId); atkBtn.ButtonId = "spy_" + Id + "_attack"; Buttons = new List <IButtonsView> { atkBtn, ButtonsView.SpyDelete(Id) }; ReportInfoBtns(); }
public IPlanshetViewData InitialPlanshet(IDbConnection connection, int currentUserId, List <int> userPlanetIds = null) { if (userPlanetIds == null) { var up = _gDetailPlanetService.GetUserPlanets(connection, currentUserId); userPlanetIds = up.Select(i => i.Id).ToList(); } #region Task var taskTab = new TabTaskOut { MotherJump = _motherJumpService.GetJumpTaskModel(connection, currentUserId), Collection = _uTaskService.GetActiveTask(connection, currentUserId, SetTaskItem, userPlanetIds) }; taskTab.TaskButtons(); TabTaskOut.InitComplexBtnCollection(taskTab.Collection); #endregion #region Report var reportTab = new TabReportOut { Collection = _getReportItemsList(connection, currentUserId), TotalItems = _uReportService.GetTotalUserReports(connection, currentUserId), }; TabReportOut.InitComplexBtnCollection(reportTab.Collection); #endregion #region Spy var spyCollection = _getSpyItemsList(connection, currentUserId); var spyTab = new TabSpyOut { Collection = spyCollection, TotalItems = _uSpyService.GetTotalUserSpyReports(connection, currentUserId), Buttons = new List <IButtonsView> { ButtonsView.NewSpyItemFromSerch() } }; TabSpyOut.InitComplexBtnCollection(spyTab.Collection); #endregion return(JournalOut.InitialTabs(taskTab, reportTab, spyTab, _localizer)); }
public void PlanetInfoButtons() { if (HasButtons) { return; } HasButtons = true; if (PlanetReferToCurrentUser) { if (IsBookmark) { Buttons = new List <IButtonsView> { ButtonsView.DeleteBookmark(1, BookmarkId, TypeNativeName, Id, 0) }; } else { Buttons = new List <IButtonsView> { ButtonsView.ConstructorSizeBtn(1, true, "Go To Planet", "GameServices.mapControlHelper.jumpToUserPlanet", new { OwnId = Id, UpdateSelect = true }) }; } } else if (IsBookmark) { Buttons = new List <IButtonsView> { ButtonsView.Spy(3, Id, NativeName, false), ButtonsView.Attack(false, 3, NativeName, Id), ButtonsView.DeleteBookmark(3, BookmarkId, TypeNativeName, Id, 0) }; } else { Buttons = new List <IButtonsView> { ButtonsView.Spy(2, Id, NativeName, false), ButtonsView.Attack(false, 2, NativeName, Id) }; } }
void ReleaseDesignerOutlets() { if (ActivityIndicator != null) { ActivityIndicator.Dispose(); ActivityIndicator = null; } if (ButtonsView != null) { ButtonsView.Dispose(); ButtonsView = null; } if (ContainerView != null) { ContainerView.Dispose(); ContainerView = null; } if (NextBtn != null) { NextBtn.Dispose(); NextBtn = null; } if (PageControl != null) { PageControl.Dispose(); PageControl = null; } if (PreviousBtn != null) { PreviousBtn.Dispose(); PreviousBtn = null; } }
public Dictionary <string, object> InitUser(IDbConnection connection, ClaimsPrincipal pricipalUser, IServiceProvider resolver) { if (pricipalUser == null) { throw new NullReferenceException(nameof(pricipalUser)); } var allianceService = resolver.GetService <IAllianceService>(); var sectorService = resolver.GetService <IGSectorsService>(); var estateListService = resolver.GetService <IEstateListService>(); var systemService = resolver.GetService <ISystemService>(); var localizer = resolver.GetService <ILocalizerService>(); var tmpUser = _gameUserService.GetCurrentGameUser(connection, pricipalUser); if (tmpUser == null) { throw new NullReferenceException(nameof(tmpUser)); } var gameUser = _gameUserService.UpdateUserOnlineStatus(connection, tmpUser, true); var userChest = _storeService.GetChestUser(connection, gameUser.Id); var balanceData = (UchBalanceCcData)userChest.ActivatedItemsView[ProductTypeIds.Cc].Data; var up = (UchPremiumData)userChest.ActivatedItemsView[ProductTypeIds.Premium].Data; var userPremiumWm = new UserPremiumWorkModel(up.Premium); var motherData = _mothershipService.GetMother(connection, gameUser.Id); var mother = _synchronizer.UserMothership(connection, motherData, userPremiumWm, _mothershipService, _motherJumpService); var planetsData = _detailPlanetService.GetUserPlanets(connection, gameUser.Id); if (planetsData != null && planetsData.Any()) { planetsData = _synchronizer.UserPlanets(connection, planetsData, userPremiumWm, _detailPlanetService); } _synchronizer.RunUserTasks(connection, gameUser.Id); var sectors = sectorService.GetInitSectors(connection); var allianceUser = allianceService.GetAllianceUserByUserId(connection, gameUser.Id); var alliance = allianceService.Initial(connection, allianceUser, _gameUserService); var personalInfo = _gameUserService.GetUserPlanshetProfile(connection, allianceUser.UserId, allianceUser.AllianceId, alliance, true); // обновляет пользователя в дб обект юзер обновляет по ссылке var myAlliance = (TabMyAllianceOut)alliance.Bodys[1].TemplateData; var connectionUser = _gameUserService.SetConnectionUser(connection, gameUser, allianceUser, myAlliance.Name); //btns var units = HangarUnitsOut.EmptyHangar(); var keys = units.Keys.ToList(); var systemGeometry = systemService.GetSystemGeometryViewData(connection, mother.StartSystemId); var motherEstates = GetMotherEstate(connection, gameUser, userPremiumWm, mother, false); var toggleBtns = new List <IButtonsView> { ButtonsView.HangarToggle() }; var leftNavBtns = new List <IButtonsView> { ButtonsView.LefMenuNavAlliance(), ButtonsView.LefMenuNavConfederation(), ButtonsView.LefMenuNavJournal(), ButtonsView.LefMenuNavChannels() }; var mapControllBtns = MapInfoService.MapControllButtons(_localizer); var hangarBtns = keys.Select(key => units[key]).Select(ButtonsView.HangarListBtns).ToList(); //var storageModel = new StorageResources(); //storageModel.InitializeField(); var btns = new Dictionary <string, IReadOnlyList <IButtonsView> > { { "toggleBtns", toggleBtns }, { "leftNavBtns", leftNavBtns }, { "mapControllBtns", mapControllBtns }, { "hangarBtns", hangarBtns } }; var alianceNames = allianceService.GetAllianceNames(connection, false); var result = new Dictionary <string, object> { { localizer.TranslationKey, localizer.GetGameTranslate() }, { ResourcesView.ViewKey, ResourcesView.GetInitList(balanceData.BalanceCc.Quantity) }, { MapTypes.Sector.ToString(), sectors }, { ButtonsView.BaseBtnsKey, btns }, //todo data incorrect { UchView.ViewKey, userChest }, { EstateItemOut.ViewKey, estateListService.GetList(connection, gameUser.Id) }, { ConnectionUser.ViewKey, connectionUser }, { alliance.UniqueId, alliance }, { UserProfileInfo.AvatarViewKey, personalInfo }, { EstateViewKey, motherEstates }, { AllianceOut.AllianceNamesKey, alianceNames }, { Planetoids.ViewKey, systemGeometry } }; return(result); }
void ReleaseDesignerOutlets() { if (btnInvoice != null) { btnInvoice.Dispose(); btnInvoice = null; } if (ButtonsHeightConstraint != null) { ButtonsHeightConstraint.Dispose(); ButtonsHeightConstraint = null; } if (ButtonsView != null) { ButtonsView.Dispose(); ButtonsView = null; } if (ImpuestoLabel != null) { ImpuestoLabel.Dispose(); ImpuestoLabel = null; } if (KeyOneLabel != null) { KeyOneLabel.Dispose(); KeyOneLabel = null; } if (KeyThreeLabel != null) { KeyThreeLabel.Dispose(); KeyThreeLabel = null; } if (KeyTwoLabel != null) { KeyTwoLabel.Dispose(); KeyTwoLabel = null; } if (OptionsSegment != null) { OptionsSegment.Dispose(); OptionsSegment = null; } if (OrderDetailCollectionView != null) { OrderDetailCollectionView.Dispose(); OrderDetailCollectionView = null; } if (PdfButton != null) { PdfButton.Dispose(); PdfButton = null; } if (SubtotalLabel != null) { SubtotalLabel.Dispose(); SubtotalLabel = null; } if (TotalLabel != null) { TotalLabel.Dispose(); TotalLabel = null; } if (ValueOneLabel != null) { ValueOneLabel.Dispose(); ValueOneLabel = null; } if (ValueThreeLabel != null) { ValueThreeLabel.Dispose(); ValueThreeLabel = null; } if (ValueTwoLabel != null) { ValueTwoLabel.Dispose(); ValueTwoLabel = null; } }
private void SetRequiredButtons(BuildItemUnitView model) { model.SetComplexButtonView(); model.Action.SetButtons(); model.Action.Buttons.Add(SendAllBtnKey, ButtonsView.StorageActionSendAll()); }
void ReleaseDesignerOutlets() { if (BatteryLevel1 != null) { BatteryLevel1.Dispose(); BatteryLevel1 = null; } if (BatteryLevel2 != null) { BatteryLevel2.Dispose(); BatteryLevel2 = null; } if (BluetoothButton != null) { BluetoothButton.Dispose(); BluetoothButton = null; } if (BluetoothViewObj != null) { BluetoothViewObj.Dispose(); BluetoothViewObj = null; } if (ButtonsView != null) { ButtonsView.Dispose(); ButtonsView = null; } if (DashboardButton != null) { DashboardButton.Dispose(); DashboardButton = null; } if (DownloadButton != null) { DownloadButton.Dispose(); DownloadButton = null; } if (DownloadViewObj != null) { DownloadViewObj.Dispose(); DownloadViewObj = null; } if (EventButton1 != null) { EventButton1.Dispose(); EventButton1 = null; } if (EventButton2 != null) { EventButton2.Dispose(); EventButton2 = null; } if (EventButton3 != null) { EventButton3.Dispose(); EventButton3 = null; } if (EventButton4 != null) { EventButton4.Dispose(); EventButton4 = null; } if (EventButton5 != null) { EventButton5.Dispose(); EventButton5 = null; } if (EventButton6 != null) { EventButton6.Dispose(); EventButton6 = null; } if (EventButton7 != null) { EventButton7.Dispose(); EventButton7 = null; } if (EventButton8 != null) { EventButton8.Dispose(); EventButton8 = null; } if (GraphViewObj1 != null) { GraphViewObj1.Dispose(); GraphViewObj1 = null; } if (GraphViewObj3 != null) { GraphViewObj3.Dispose(); GraphViewObj3 = null; } if (SessionStatus1 != null) { SessionStatus1.Dispose(); SessionStatus1 = null; } if (SessionStatus2 != null) { SessionStatus2.Dispose(); SessionStatus2 = null; } if (StartSessionButton != null) { StartSessionButton.Dispose(); StartSessionButton = null; } if (StopSessionButton != null) { StopSessionButton.Dispose(); StopSessionButton = null; } }