Skip to content

Enhanced launcher UI with modern design - #23

Open
CoderA05 wants to merge 3 commits into
Open-Source-Free-Realms:mainfrom
CoderA05:main
Open

CoderA05 wants to merge 3 commits into
Open-Source-Free-Realms:mainfrom
CoderA05:main

Conversation

@CoderA05

Copy link
Copy Markdown

Changes

  • Modern 1024x576 launcher interface with custom design
  • Server list with colored icons, titles, and subtitles
  • Play/Stop button with hover effects and random backgrounds (20 images)
  • Settings panel with Display Name field (saves to config)
  • Edit server functionality with delete option
  • Discord and Reddit button integration in bottom bar
  • Compiled bindings enabled for better performance
  • FreeRealms font integration
  • Server Name field in Add/Edit dialog
  • Welcome back message with user name

UI Improvements

  • Custom server icons (9 colors)
  • Edit button on hover for each server
  • Status indicators (Online/Offline)
  • Player count display
  • Notification system
  • Popup overlay for dialogs

Technical

  • AvaloniaUseCompiledBindingsByDefault = true
  • All XAML bindings use x:DataType for compile-time validation
  • Clean codebase with no backend logic changes

- 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
@datah4zard

Copy link
Copy Markdown
Contributor

This looks much more digestible than the last PR. Thank you for cleaning this up!

@datah4zard datah4zard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}")));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +37 to +38
[ObservableProperty]
private string displayName = "User";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this property. I don't see anything binding to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants