-
Notifications
You must be signed in to change notification settings - Fork 0
[UI] Implement the base interface for servers list UI #7
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
base: master
Are you sure you want to change the base?
Conversation
9986977 to
37958b5
Compare
37958b5 to
c9d1602
Compare
e711757 to
156e7a6
Compare
…f untracked files
…s value Sanity check if the Settings UI has been successfully initialized. And if not, rollback the initialization process and unload the mod!
| string AbsolutePath; | ||
|
|
||
| /* Sanity check -- Make sure the Assets folder of the mod exists */ | ||
| SceneBundleLocation = GetUiScenePathLocation(Scene); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unnecessary: all scenes can be packed into the same assetbundle and then identified by the scene name alone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So a single UI asset bundle? Alright, gotcha
| * This parameter is optional and ignored for every other scene name. | ||
| * | ||
| */ | ||
| public static void ShowScene(string SceneName, Action ActionToTakeCallback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the point of this method, it calls a different method for one scene and just uses SceneManager.LoadScene for the rest. Wouldn't having a dedicated method just for the main menu and calling LoadScene in all other cases be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having an extra method just to switch back to the main menu scene feels too redundant so the point of ShowScene is to exactly encapsulate two ways of loading scenes.
| public static void DisplayUi() | ||
| { | ||
| /* Load the server list UI scene, the asset bundle should be already loaded */ | ||
| COTLMP.Api.Scenes.ShowScene("ServerListUI", null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SceneManager.LoadScene can be used directly here instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of COTLMP.Api.Scenes is to have a API wrapper of Scenes methods for the mod so that we may wanna implement whatever code we wanna implement, whatever that makes sense to you
| * be loaded in memory after the scene has been loaded. | ||
| */ | ||
| COTLMP.Debug.PrintLogger.PrintVerbose(DebugLevel.MESSAGE_LEVEL, DebugComponent.UI_COMPONENT, "BindUiElements() called"); | ||
| yield return new WaitForSeconds(0.5f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read about it and SceneManager.LoadScene loads the scene completely next frame. Instead of waiting 500ms, you can use yield return null; to make it run the next frame.
| { | ||
| AssetBundle Bundle; | ||
|
|
||
| Bundle = COTLMP.Api.Scenes.LoadSceneBundle(SCENE_TYPE.SceneServerList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can have a single call to load an assetbundle containing all scenes here instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't include: build artifact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add AssetBundles folder, TextMesh Pro "Examples & Extras" (if not depending on it) and Documentation, and Temp folders here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not gonna through the entire Examples folder, but if nothing here is in use, remove it from git
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll remove the Examples folder
As the title says.
Demonstration
2025-09-16_23-39-57.mp4
TODO
[ ] Make the UI fit the COTL-style a little bit(it'll be postponed at a later time)