private void OnDataGridClick(DataGrid args) { var breakdown = args.CurrentItem as IDelegateBreakdown; var detailed = new DetailedView(breakdown, _combatControl); detailed.Show(); }
public AddComponentWindow(Sidebar sidebar, Control under, Link link, DetailedView view, bool addToGroup = true) : this(sidebar, under, view, addToGroup) { this.link = link; addCompView = new AddComponentView(sidebar, neoSidebar, LeftPadding, 80, sidebar.tbcViews.TabPages[0].Height - 260); addCompView.InitLink(link); }
private AddComponentWindow(Sidebar sidebar, Control under, DetailedView view, bool addToGroup = true) { this.under = under; under.Visible = false; sidebar.master.Visible = false; this.addToGroup = addToGroup; Control par = sidebar.tbcViews.TabPages[0]; UserInterface.GameInputDisabled = true; this.view = view; this.manager = sidebar.manager; this.sidebar = sidebar; neoSidebar = new NeoSidebar(manager); neoSidebar.Init(); neoSidebar.Left = sidebar.master.Left; neoSidebar.Width = par.Width; neoSidebar.Top = 5; neoSidebar.Height = par.Height + 15; neoSidebar.BevelBorder = BevelBorder.All; neoSidebar.BevelColor = Color.Black; neoSidebar.Left = LeftPadding; neoSidebar.Text = "Add Component"; neoSidebar.BackColor = new Color(30, 60, 30); manager.Add(neoSidebar); TitlePanel titlePanelAddComponent = new TitlePanel(sidebar, neoSidebar, "Add Component", true); titlePanelAddComponent.btnBack.Click += Close; HeightCounter += titlePanelAddComponent.Height; NewLabel("Add", 15, false); NewLabel("Name", 50, false); int left = 145; NewLabel("AO", left, false); NewLabel("AS", left + 20, false); NewLabel("DR", left + 40, false); btnAdd = new Button(manager); btnAdd.Init(); btnAdd.Parent = neoSidebar; btnAdd.Width = 150; btnAdd.Top = neoSidebar.Height - btnAdd.Height * 2; btnAdd.Left = neoSidebar.Width / 2 - btnAdd.Width / 2; btnAdd.Text = "Add Components"; btnAdd.Click += AddComponents; }
public Satellite(string name, Vector3 position, float radius, Material material, float spinSpeed, Planet planet) : base(name) { this.radius = radius; this.sphere = new Sphere(name, position, radius, Constants.satelliteLongitudeSegments, Constants.satelliteLatitudeSegments, material); this.sphere.gameObject.AddComponent <Spin>().speed = spinSpeed; Orbit orbit = this.sphere.gameObject.AddComponent <Orbit>(); orbit.center = planet.sphere.gameObject; float distance = Vector3.Distance(sphere.gameObject.transform.position, planet.sphere.gameObject.transform.position); orbit.speed = Constants.satelliteOrbitConstant / distance; sphere.gameObject.transform.SetParent(planet.sphere.gameObject.transform); SimpleHoverInfo simpleHoverInfo = this.sphere.gameObject.AddComponent <SimpleHoverInfo>(); simpleHoverInfo.bodyRadius = radius; DetailedView detailedView = this.sphere.gameObject.AddComponent <DetailedView>(); detailedView.bodyRadius = radius; }
public Star(string name, Vector3 position, float radius, Material material) : base(name) { this.radius = radius; this.sphere = new Sphere(name, position, radius, Constants.starLongitudeSegments, Constants.starLatitudeSegments, material); GameObject light = new GameObject(name + "Light"); light.transform.position = sphere.gameObject.transform.position; Light l = light.AddComponent <Light>(); l.type = LightType.Point; //TODO: set range and intensity based on size and strength l.range = 1000; l.intensity = 1; SimpleHoverInfo simpleHoverInfo = this.sphere.gameObject.AddComponent <SimpleHoverInfo>(); simpleHoverInfo.bodyRadius = radius; DetailedView detailedView = this.sphere.gameObject.AddComponent <DetailedView>(); detailedView.bodyRadius = radius; }
internal IEnumerable <GroupedDetailView> GetGroupedDetailViews(SearchQuery searchQuery, int userSearchTypeId, out int totalHits, out bool more) { var searchResults = SearchController.Instance.SiteSearch(searchQuery); totalHits = searchResults.TotalHits; more = searchResults.Results.Count == searchQuery.PageSize; var groups = new List <GroupedDetailView>(); var tabGroups = new Dictionary <string, IList <SearchResult> >(); foreach (var result in searchResults.Results) { //var key = result.TabId + result.Url; var key = result.Url; if (!tabGroups.ContainsKey(key)) { tabGroups.Add(key, new List <SearchResult> { result }); } else { //when the result is a user search type, we should only show one result // and if duplicate, we should also reduce the totalHit number. if (result.SearchTypeId != userSearchTypeId || tabGroups[key].All(r => r.Url != result.Url)) { tabGroups[key].Add(result); } else { totalHits--; } } } foreach (var results in tabGroups.Values) { var group = new GroupedDetailView(); //first entry var first = results[0]; group.Title = first.Title; group.DocumentUrl = first.Url; //Find a different title for multiple entries with same url if (results.Count > 1) { if (first.TabId > 0) { var tab = TabController.Instance.GetTab(first.TabId, first.PortalId, false); if (tab != null) { group.Title = tab.TabName; } } else if (first.ModuleId > 0) { var tabTitle = GetTabTitleFromModuleId(first.ModuleId); if (!string.IsNullOrEmpty(tabTitle)) { group.Title = tabTitle; } } } else if (first.ModuleDefId > 0 && first.ModuleDefId == HtmlModuleDefitionId) //special handling for Html module { var tabTitle = GetTabTitleFromModuleId(first.ModuleId); if (!string.IsNullOrEmpty(tabTitle)) { group.Title = tabTitle; if (first.Title != "Enter Title" && first.Title != "Text/HTML") { group.Title += " > " + first.Title; } first.Title = group.Title; } } foreach (var result in results) { var detail = new DetailedView { Title = result.Title, DocumentTypeName = InternalSearchController.Instance.GetSearchDocumentTypeDisplayName(result), DocumentUrl = result.Url, Snippet = result.Snippet, DisplayModifiedTime = result.DisplayModifiedTime, Tags = result.Tags.ToList(), AuthorProfileUrl = result.AuthorUserId > 0 ? Globals.UserProfileURL(result.AuthorUserId) : string.Empty, AuthorName = result.AuthorName }; group.Results.Add(detail); } groups.Add(group); } return(groups); }
internal static IEnumerable <GroupedDetailView> GetGroupedDetailViews(SearchQuery searchQuery, int userSearchTypeId, out int totalHits, out bool more) { SearchResults searchResults = SearchController.Instance.SiteSearch(searchQuery); totalHits = searchResults.TotalHits; more = totalHits > searchQuery.PageSize * searchQuery.PageIndex; List <GroupedDetailView> groups = new List <GroupedDetailView>(); Dictionary <string, IList <DotNetNukeSearch.SearchResult> > tabGroups = new Dictionary <string, IList <DotNetNukeSearch.SearchResult> >(); foreach (DotNetNukeSearch.SearchResult result in searchResults.Results) { //var key = result.TabId + result.Url; string key = result.Url; if (!tabGroups.ContainsKey(key)) { tabGroups.Add(key, new List <DotNetNukeSearch.SearchResult> { result }); } else { //when the result is a user search type, we should only show one result // and if duplicate, we should also reduce the totalHit number. if (result.SearchTypeId != userSearchTypeId || tabGroups[key].All(r => r.Url != result.Url)) { tabGroups[key].Add(result); } else { totalHits--; } } } bool showFriendlyTitle = false; //ActiveModule == null // || !ActiveModule.ModuleSettings.ContainsKey("ShowFriendlyTitle") // || Convert.ToBoolean(ActiveModule.ModuleSettings["ShowFriendlyTitle"]); foreach (IList <DotNetNukeSearch.SearchResult> results in tabGroups.Values) { GroupedDetailView group = new GroupedDetailView(); //first entry DotNetNukeSearch.SearchResult first = results[0]; group.Title = showFriendlyTitle ? GetFriendlyTitle(first) : first.Title; group.DocumentUrl = first.Url; //Find a different title for multiple entries with same url if (results.Count > 1) { if (first.TabId > 0) { TabInfo tab = TabController.Instance.GetTab(first.TabId, first.PortalId, false); if (tab != null) { group.Title = showFriendlyTitle && !string.IsNullOrEmpty(tab.Title) ? tab.Title : tab.TabName; } } else if (first.ModuleId > 0) { string tabTitle = GetTabTitleFromModuleId(first.ModuleId); if (!string.IsNullOrEmpty(tabTitle)) { group.Title = tabTitle; } } } else if (first.ModuleDefId > 0 && first.ModuleDefId == HtmlModuleDefitionId) //special handling for Html module { string tabTitle = GetTabTitleFromModuleId(first.ModuleId); if (!string.IsNullOrEmpty(tabTitle)) { group.Title = tabTitle; if (first.Title != "Enter Title" && first.Title != "Text/HTML") { group.Title += " > " + first.Title; } first.Title = group.Title; } } foreach (DotNetNukeSearch.SearchResult result in results) { string title = showFriendlyTitle ? GetFriendlyTitle(result) : result.Title; DetailedView detail = new DetailedView { Title = title != null && title.Contains("<") ? HttpUtility.HtmlEncode(title) : title, DocumentTypeName = InternalSearchController.Instance.GetSearchDocumentTypeDisplayName(result), DocumentUrl = result.Url, Snippet = result.Snippet, Description = result.Description, DisplayModifiedTime = result.DisplayModifiedTime, Tags = result.Tags.ToList(), AuthorProfileUrl = result.AuthorUserId > 0 ? Globals.UserProfileURL(result.AuthorUserId) : string.Empty, AuthorName = result.AuthorName }; group.Results.Add(detail); } groups.Add(group); } return(groups); }