-
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.
Tried adding a MenuPlatform (it doesnt work, but it will soon)
- Loading branch information
Showing
17 changed files
with
306 additions
and
117 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
.idea/.idea.PlatformCustomizer/.idea/projectSettingsUpdater.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
using System.IO; | ||
using IPA.Utilities; | ||
using PlatformCustomizer.Miscellaneous; | ||
|
||
namespace PlatformCustomizer.CustomFeet | ||
{ | ||
public class CustomFeetDir | ||
{ | ||
private const string CustomFeetDirName = "CustomFeet"; | ||
public DirectoryInfo CustomFeetDirectory; | ||
public DirectoryInfo CustomFeet; | ||
|
||
public CustomFeetDir() | ||
{ | ||
var baseDir = new DirectoryInfo(UnityGame.InstallPath); | ||
|
||
CustomFeetDirectory = baseDir.GetDirectory(CustomFeetDirName); | ||
|
||
if (!CustomFeetDirectory.Exists) | ||
{ | ||
CustomFeetDirectory = baseDir.CreateSubdirectory(CustomFeetDirName); | ||
PathTools.RelativeExtension = null; | ||
} | ||
|
||
} | ||
} | ||
} |
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,65 @@ | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using SiraUtil.Web; | ||
using UnityEngine; | ||
using PlatformCustomizer.Miscellaneous; | ||
using PlatformCustomizer.CustomFeet; | ||
|
||
namespace PlatformCustomizer.CustomFeet | ||
{ | ||
internal class RemoteLocation : ICustomListItem | ||
{ | ||
public readonly string remoteLocation; | ||
private readonly DirectoryInfo _customFeetDir; | ||
private readonly string _fileName; | ||
|
||
private readonly IHttpService _webClient; | ||
|
||
private RemoteLocation(InitData initData, IHttpService webClient, CustomFeetDir feetDirs) | ||
{ | ||
_webClient = webClient; | ||
_customFeetDir = feetDirs.CustomFeetDirectory; | ||
|
||
remoteLocation = initData.RemoteLocation; | ||
ListName = initData.Name; | ||
_fileName = initData.Filename; | ||
} | ||
|
||
public string ListName { get; } | ||
|
||
public async Task<Tuple<bool, string>> Download(CancellationToken token) | ||
{ | ||
try | ||
{ | ||
var response = await _webClient.GetAsync(remoteLocation, null, token); | ||
if (!response.Successful) | ||
{ | ||
return default; | ||
} | ||
Plugin.Log.Critical("KSDJFOIjseoijiosejf"); | ||
var filename = GetFileName(); | ||
File.WriteAllBytes(_customFeetDir.GetFile(filename).FullName, await response.ReadAsByteArrayAsync()); | ||
return new Tuple<bool, string>(true, "CustomFeet\\" + filename); | ||
} | ||
catch (Exception) | ||
{ | ||
return default; | ||
} | ||
} | ||
|
||
private string GetFileName() | ||
{ | ||
return _fileName; | ||
} | ||
|
||
public struct InitData | ||
{ | ||
public string RemoteLocation; | ||
public string Name; | ||
public string Filename; | ||
} | ||
} | ||
} |
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,26 @@ | ||
using Zenject; | ||
using UnityEngine; | ||
using PlatformCustomizer.Configuration; | ||
|
||
namespace PlatformCustomizer.MenuItems | ||
{ | ||
public class DisableItems : IInitializable | ||
{ | ||
PluginConfig config = PluginConfig.Instance; | ||
public GameObject feet = GameObject.Find("Feet"); | ||
public GameObject jordans = GameObject.Find("shoes"); | ||
|
||
public void Initialize() | ||
{ | ||
|
||
/*if (config.EnableMod == true) | ||
{ | ||
if (config.JordanMode == true) | ||
{ | ||
feet.SetActive(false); | ||
Plugin.instantiate.SetActive(true); | ||
} | ||
}*/ | ||
} | ||
} | ||
} |
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
Oops, something went wrong.