Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some moves towards UI isolation #175

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

sorsarre
Copy link
Contributor

@sorsarre sorsarre commented Sep 1, 2021

Trying to jumpstart decoupling the Razor's functional guts from WinForms specifically and UI side of things in general.

Why bother?

  • In order to enable changing the frontend
    Running headless, making an alternative UI in case MS kicks WF to the curb; @markdwags mentioned ditching it all in favour of gump-based UI, which would be absolutely wicked.
  • Enable unit/auto tests for core stuff
    Mixing UI code with engine guts in a global static object managing a pile of its own instances effectively kills any prospect of unit/automated testing, aside from causing a literal headache if meditated upon for long enough.

What's in?

Not much compared to the whole workload necessary to run headless, but I hope it's a start.

Dragged some UI code from obviously domain stuff:

  • Filters
  • TextFilterManager
  • WaypointManager
  • OverheadManager
  • TargetFilterManager
  • SoundMusicManager

On WinForms front:

  • Fencing off some of the MessageBox calls behind a separate class — far from complete, but it's mostly straightforward, will do a more extensive overhaul in a separate PR;
  • Same for most clipboard calls except ones that deal with images — will have to take a better look af them.

What's next?

Specific plans are part 1, parts 2 & 3 are more in the vague far-off milestones department for now.

  1. Continue UI split
    • Remaining object managers (friends, counters, etc)
    • Agents
    • Macros
    • Hotkeys
    • Scripts
    • Deal with MessageBox infestation
    • Direct WinForms Clipboard calls
  2. Move core stuff into a separate assembly
  3. Fence core-to-UI interactions behind a set of interfaces

@markdwags markdwags self-assigned this Sep 9, 2021
@markdwags markdwags added the improvement Code cleanup/refactor label Sep 9, 2021
Copy link

@jaedan jaedan left a comment

Choose a reason for hiding this comment

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

This looks great. Separating this will allow us to use Razor in many more places.

Razor/Core/OverheadManager.cs Outdated Show resolved Hide resolved
@mythril
Copy link

mythril commented Feb 23, 2022

I have written a RunUO gump script that fairly well emulates a tabbed interface. It's a bit huge and knobby because of the constraints of gumps, but I would happily share the code and some screenshots if it will help.

@mythril
Copy link

mythril commented Feb 23, 2022

If I can get Razor building on my system I might also port the idea to Razor just to contribute.

Looking for detailed build instructions on Linux if anyone has them.

Or command line (I don't have Visual Studio) instructions for Windows 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Code cleanup/refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants