Repository navigation
Conversation
- Modern 1024x576 launcher interface with custom design - Server list with colored icons, titles, and subtitles - Play/Stop button with hover effects and random backgrounds - Settings panel with Display Name field - Edit server functionality with delete option - Discord and Reddit button integration - Compiled bindings enabled for performance - FreeRealms font integration - Server Name field in Add/Edit dialog
|
This looks much more digestible than the last PR. Thank you for cleaning this up! |
datah4zard
left a comment
There was a problem hiding this comment.
Contrary to the PR description, there are a few backend changes here. Nothing major, but some stuff definitely should be cleaned up.
| var name = isHovered ? "Play_Button_Hover.png" : "Play_Button.png"; | ||
|
|
||
| PlayButtonImage.Source = new Bitmap(AssetLoader.Open( | ||
| new Uri($"avares://Launcher/Assets/Frame/{name}"))); |
There was a problem hiding this comment.
You're creating a new bitmap here every time the function is called, and that happens every time the hover state changes. You should load the button textures once, cache them, and then just change the reference.
There was a problem hiding this comment.
Same goes for LoadAltButton(); and honestly all the loads for reusable textures
| [DllImport("user32.dll")] | ||
| private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, | ||
| int x, int y, int cx, int cy, uint uFlags); | ||
|
|
There was a problem hiding this comment.
You shouldn't need all this code to disable the maximize button. The maximize button is already disabled on the main branch due to CanResize="False" in Main.axaml.
There was a problem hiding this comment.
The diff here is huge, and does not contain comments about the tags and what they represent (notice the deleted comments in the diff). Please consider annotating.
| [ObservableProperty] | ||
| private string displayName = "User"; |
There was a problem hiding this comment.
I think we should get rid of the display name entirely. I know it was in the design spec, but it's confusing-- people may think they are logged in to an account globally, when in reality they are not-- and honestly adds config overhead for something that doesn't serve any real purpose.
| private static readonly IImage IconRed = new Bitmap(AssetLoader.Open(new Uri("avares://Launcher/Assets/ServerIcons/Server_Icon_Red.png"))); | ||
|
|
||
| public IImage ServerIconSource => IsOnline ? IconGreen : IconRed; | ||
|
|
There was a problem hiding this comment.
This is exactly how you should be caching the hover/non-hover button images
| try | ||
| { | ||
| var window = App.GetWindow(); | ||
| await window.Launcher.LaunchUriAsync(new Uri("https://discord.gg/x7Xfz99Ydv")); |
There was a problem hiding this comment.
Just want to double-check that this link is permanent and won't expire?
|
|
||
| public string DisplayName => Settings.Instance.DisplayName; | ||
|
|
||
| public bool IsGameRunning => Servers.Any(x => x.Process is not null); |
There was a problem hiding this comment.
I don't think we need this property. I don't see anything binding to it.
Changes
UI Improvements
Technical