forked from AMacro/dv-multiplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
169 additions
and
111 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
Multiplayer/Components/MainMenu/IServerBrowserGameDetails.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Runtime.CompilerServices; | ||
using Newtonsoft.Json.Linq; | ||
using UnityEngine; | ||
|
||
namespace Multiplayer.Components.MainMenu | ||
{ | ||
// | ||
public interface IServerBrowserGameDetails : IDisposable | ||
{ | ||
// | ||
// | ||
int ServerID { get; } | ||
|
||
// | ||
// | ||
// | ||
string Name { get; set; } | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using DV.Common; | ||
using DV.Localization; | ||
using DV.UIFramework; | ||
using Multiplayer.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using TMPro; | ||
using UnityEngine; | ||
|
||
namespace Multiplayer.Components.MainMenu; | ||
|
||
|
||
// | ||
public class ServerBrowserElement : AViewElement<IServerBrowserGameDetails> | ||
{ | ||
private TextMeshProUGUI networkName; | ||
private TextMeshProUGUI playerCount; | ||
private TextMeshProUGUI ping; | ||
private IServerBrowserGameDetails data; | ||
|
||
private void Awake() | ||
{ | ||
//Find existing fields to duplicate | ||
networkName = this.FindChildByName("name [noloc]").GetComponent<TextMeshProUGUI>(); | ||
playerCount = this.FindChildByName("date [noloc]").GetComponent<TextMeshProUGUI>(); | ||
ping = this.FindChildByName("time [noloc]").GetComponent<TextMeshProUGUI>(); | ||
|
||
networkName.text = "Test Network"; | ||
playerCount.text = "1/4"; | ||
ping.text = "102"; | ||
} | ||
|
||
public override void SetData(IServerBrowserGameDetails data, AGridView<IServerBrowserGameDetails> _) | ||
{ | ||
if (this.data != null) | ||
{ | ||
this.data = null; | ||
} | ||
if (data != null) | ||
{ | ||
this.data = data; | ||
} | ||
UpdateView(null, null); | ||
} | ||
|
||
// | ||
private void UpdateView(object sender = null, PropertyChangedEventArgs e = null) | ||
{ | ||
networkName.text = data.Name; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using DV.Common; | ||
using DV.UI; | ||
using DV.UIFramework; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace Multiplayer.Components.MainMenu | ||
{ | ||
[RequireComponent(typeof(ContentSizeFitter))] | ||
[RequireComponent(typeof(VerticalLayoutGroup))] | ||
// | ||
public class ServerBrowserGridView : AGridView<IServerBrowserGameDetails> | ||
{ | ||
|
||
private void Awake() | ||
{ | ||
Debug.Log("serverBrowserGridview Awake"); | ||
this.dummyElementPrefab.SetActive(false); | ||
GameObject.Destroy(this.dummyElementPrefab.GetComponent<SaveLoadViewElement>()); | ||
this.dummyElementPrefab.AddComponent<ServerBrowserElement>(); | ||
|
||
this.dummyElementPrefab.SetActive(true); | ||
// GameObject defaultPrefab = GameObject.Find("SaveLoadViewElement"); | ||
// this.dummyElementPrefab = Instantiate(defaultPrefab); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
using System; | ||
using System.IO; | ||
using HarmonyLib; | ||
using JetBrains.Annotations; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.