static bool Prefix(NewsFeedPanel __instance) { LogCalled(); if (!Settings.ConfigUtil.Config.TurnOffSteamPanels) { return(true); } GameObject.DestroyImmediate(__instance.gameObject); return(false); }
// so, the whole page reloads, and then a modal pops up..... // that is a terrible UX. so TO JAVASCRIPT WE GOOOOOO public void loadComments(object sender, EventArgs evt) { int postId = Int32.Parse((sender as LinkButton).Attributes["postid"]); List <Post> comments = getComments(postId); // find a post with the matching postID in the DOM...... !!!!!!!!!!! FML! WHY C#! WHY!!!! Control Post = NewsFeedPanel.FindControl("post" + postId); int i = NewsFeedPanel.Controls.IndexOf(Post) + 1; // then find that element in the list of controls, so we can add stuff after it. foreach (Post post in comments) { NewsFeedPanel.Controls.AddAt(i, post.control); i++; } }