Commit b5da0029 authored by Unicorn369's avatar Unicorn369

Update

parent 096110bd
...@@ -12,7 +12,8 @@ public class LAZYsetting : MonoBehaviour { ...@@ -12,7 +12,8 @@ public class LAZYsetting : MonoBehaviour {
public UIToggle closeUp; public UIToggle closeUp;
public UIToggle showoff; public UIToggle showoff;
public UIToggle showoffWhenActived; public UIToggle showoffWhenActived;
public UIToggle cloud; public UIToggle cloud;
public UIToggle DownloadImage;
public UIToggle Vbattle; public UIToggle Vbattle;
public UIToggle Vmove; public UIToggle Vmove;
public UIToggle Vchain; public UIToggle Vchain;
......
...@@ -459,7 +459,7 @@ public class Program : MonoBehaviour ...@@ -459,7 +459,7 @@ public class Program : MonoBehaviour
WWW w = new WWW("https://api.github.com/repos/szefo09/updateYGOPro2/contents/"); WWW w = new WWW("https://api.github.com/repos/szefo09/updateYGOPro2/contents/");
while (!w.isDone) while (!w.isDone)
{ {
if (Application.internetReachability == NetworkReachability.NotReachable) if (Application.internetReachability == NetworkReachability.NotReachable || !string.IsNullOrEmpty(w.error))
{ {
throw new Exception("No Internet connection!"); throw new Exception("No Internet connection!");
} }
...@@ -514,7 +514,6 @@ public class Program : MonoBehaviour ...@@ -514,7 +514,6 @@ public class Program : MonoBehaviour
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Log(e.ToString());
File.Delete("updates/SHAs.txt"); File.Delete("updates/SHAs.txt");
} }
} }
...@@ -1125,6 +1124,7 @@ public class Program : MonoBehaviour ...@@ -1125,6 +1124,7 @@ public class Program : MonoBehaviour
public static bool Running = true; public static bool Running = true;
public static bool MonsterCloud = false; public static bool MonsterCloud = false;
public static bool DownloadImage = false;
public static float fieldSize = 1; public static float fieldSize = 1;
void OnApplicationQuit() void OnApplicationQuit()
......
...@@ -808,25 +808,17 @@ public class GameTextureManager ...@@ -808,25 +808,17 @@ public class GameTextureManager
{ {
path = "picture/cardIn8thEdition/" + pic.code.ToString() + ".jpg"; path = "picture/cardIn8thEdition/" + pic.code.ToString() + ".jpg";
} }
#if UNITY_ANDROID || UNITY_IPHONE //Android、iPhone if (!File.Exists(path) && pic.code != 0 && Program.DownloadImage)
if (!File.Exists(path) && pic.code != 0)
{ {
//YGOMobile (177x254) //YGOMobile (177x254)
df.Download("http://download.ygopro.win/ygopro/pics/" + pic.code.ToString() + ".jpg", "expansions/pics/" + pic.code.ToString() + ".jpg"); df.Download("http://download.ygopro.win/ygopro/pics/" + pic.code.ToString() + ".jpg", "expansions/pics/" + pic.code.ToString() + ".jpg");
path = "expansions/pics/" + pic.code.ToString() + ".jpg"; path = "expansions/pics/" + pic.code.ToString() + ".jpg";
} }
#endif if (!File.Exists(path) && pic.code != 0 && Program.DownloadImage)
if (!File.Exists(path) && pic.code != 0)
{ {
//YGOPro2 (421x614) //先行卡 (177x254)
df.Download("http://download.ygopro.win/ygopro2/picture/card/" + pic.code.ToString() + ".jpg", "picture/card/" + pic.code.ToString() + ".jpg"); df.Download("http://download.ygopro.win/ygopro2-data/expansions/pics/" + pic.code.ToString() + ".jpg", "picture/cardIn8thEdition/" + pic.code.ToString() + ".jpg");
path = "picture/card/" + pic.code.ToString() + ".jpg"; path = "picture/cardIn8thEdition/" + pic.code.ToString() + ".jpg";
}
if (!File.Exists(path) && pic.code != 0)
{
//YGOPro2 pre(336x490)
df.Download("http://download.ygopro.win/ygopro2/expansions/pics/" + pic.code.ToString() + ".jpg", "picture/card/" + pic.code.ToString() + ".jpg");
path = "picture/card/" + pic.code.ToString() + ".jpg";
} }
if (!File.Exists(path)) if (!File.Exists(path))
{ {
......
...@@ -24,7 +24,7 @@ public class Setting : WindowServant2D ...@@ -24,7 +24,7 @@ public class Setting : WindowServant2D
UIHelper.getByName<UIToggle>(gameObject, "handmPosition_").value = UIHelper.fromStringToBool(Config.Get("handmPosition_", "0")); UIHelper.getByName<UIToggle>(gameObject, "handmPosition_").value = UIHelper.fromStringToBool(Config.Get("handmPosition_", "0"));
UIHelper.getByName<UIToggle>(gameObject, "spyer_").value = UIHelper.fromStringToBool(Config.Get("spyer_", "1")); UIHelper.getByName<UIToggle>(gameObject, "spyer_").value = UIHelper.fromStringToBool(Config.Get("spyer_", "1"));
UIHelper.getByName<UIToggle>(gameObject, "resize_").value = UIHelper.fromStringToBool(Config.Get("resize_", "0")); UIHelper.getByName<UIToggle>(gameObject, "resize_").value = UIHelper.fromStringToBool(Config.Get("resize_", "0"));
if (QualitySettings.GetQualityLevel()<3) if (QualitySettings.GetQualityLevel() < 3)
{ {
UIHelper.getByName<UIToggle>(gameObject, "high_").value = false; UIHelper.getByName<UIToggle>(gameObject, "high_").value = false;
} }
...@@ -46,13 +46,13 @@ public class Setting : WindowServant2D ...@@ -46,13 +46,13 @@ public class Setting : WindowServant2D
sliderSize = UIHelper.getByName<UISlider>(gameObject, "size_"); sliderSize = UIHelper.getByName<UISlider>(gameObject, "size_");
sliderAlpha = UIHelper.getByName<UISlider>(gameObject, "alpha_"); sliderAlpha = UIHelper.getByName<UISlider>(gameObject, "alpha_");
sliderVsize = UIHelper.getByName<UISlider>(gameObject, "vSize_"); sliderVsize = UIHelper.getByName<UISlider>(gameObject, "vSize_");
Program.go(2000,readVales); Program.go(2000, readVales);
var collection = gameObject.GetComponentsInChildren<UIToggle>(); var collection = gameObject.GetComponentsInChildren<UIToggle>();
for (int i = 0; i < collection.Length; i++) for (int i = 0; i < collection.Length; i++)
{ {
if (collection[i].name.Length > 0 && collection[i].name[0] == '*') if (collection[i].name.Length > 0 && collection[i].name[0] == '*')
{ {
if (collection[i].name== "*mouseParticle" || collection[i].name == "*showOff" || collection[i].name == "*Efield") if (collection[i].name == "*mouseParticle" || collection[i].name == "*showOff" || collection[i].name == "*Efield")
{ {
collection[i].value = UIHelper.fromStringToBool(Config.Get(collection[i].name, "1")); collection[i].value = UIHelper.fromStringToBool(Config.Get(collection[i].name, "1"));
} }
...@@ -62,13 +62,14 @@ public class Setting : WindowServant2D ...@@ -62,13 +62,14 @@ public class Setting : WindowServant2D
} }
} }
} }
setting.showoffATK.value = Config.Get("showoffATK","1800"); setting.showoffATK.value = Config.Get("showoffATK", "1800");
setting.showoffStar.value = Config.Get("showoffStar", "5"); setting.showoffStar.value = Config.Get("showoffStar", "5");
UIHelper.registEvent(setting.showoffATK.gameObject, onchangeClose); UIHelper.registEvent(setting.showoffATK.gameObject, onchangeClose);
UIHelper.registEvent(setting.showoffStar.gameObject, onchangeClose); UIHelper.registEvent(setting.showoffStar.gameObject, onchangeClose);
UIHelper.registEvent(setting.mouseEffect.gameObject, onchangeMouse); UIHelper.registEvent(setting.mouseEffect.gameObject, onchangeMouse);
UIHelper.registEvent(setting.closeUp.gameObject, onchangeCloseUp); UIHelper.registEvent(setting.closeUp.gameObject, onchangeCloseUp);
UIHelper.registEvent(setting.cloud.gameObject, onchangeCloud); UIHelper.registEvent(setting.cloud.gameObject, onchangeCloud);
UIHelper.registEvent(setting.DownloadImage.gameObject, onchangeDownload);
UIHelper.registEvent(setting.Vpedium.gameObject, onCP); UIHelper.registEvent(setting.Vpedium.gameObject, onCP);
UIHelper.registEvent(setting.Vfield.gameObject, onCP); UIHelper.registEvent(setting.Vfield.gameObject, onCP);
UIHelper.registEvent(setting.Vlink.gameObject, onCP); UIHelper.registEvent(setting.Vlink.gameObject, onCP);
...@@ -98,6 +99,11 @@ public class Setting : WindowServant2D ...@@ -98,6 +99,11 @@ public class Setting : WindowServant2D
Program.MonsterCloud = setting.cloud.value; Program.MonsterCloud = setting.cloud.value;
} }
public void onchangeDownload()
{
Program.DownloadImage = setting.DownloadImage.value;
}
public void onchangeMouse() public void onchangeMouse()
{ {
Program.I().mouseParticle.SetActive(setting.mouseEffect.value); Program.I().mouseParticle.SetActive(setting.mouseEffect.value);
...@@ -115,7 +121,7 @@ public class Setting : WindowServant2D ...@@ -115,7 +121,7 @@ public class Setting : WindowServant2D
} }
public void onchangeCloseUp() public void onchangeCloseUp()
{ {
if (setting.closeUp.value == false) if (setting.closeUp.value == false)
{ {
...@@ -177,7 +183,7 @@ public class Setting : WindowServant2D ...@@ -177,7 +183,7 @@ public class Setting : WindowServant2D
} }
UISlider sliderSize; UISlider sliderSize;
void onChangeSize() void onChangeSize()
{ {
if (sliderSize != null) if (sliderSize != null)
{ {
...@@ -185,7 +191,7 @@ public class Setting : WindowServant2D ...@@ -185,7 +191,7 @@ public class Setting : WindowServant2D
} }
} }
public float vol() public float vol()
{ {
return UIHelper.getByName<UISlider>(gameObject, "vol_").value; return UIHelper.getByName<UISlider>(gameObject, "vol_").value;
} }
...@@ -217,7 +223,7 @@ public class Setting : WindowServant2D ...@@ -217,7 +223,7 @@ public class Setting : WindowServant2D
Config.Set("vSize_", ((int)(UIHelper.getByName<UISlider>(gameObject, "vSize_").value * 1000)).ToString()); Config.Set("vSize_", ((int)(UIHelper.getByName<UISlider>(gameObject, "vSize_").value * 1000)).ToString());
Config.Set("alpha_", ((int)(UIHelper.getByName<UISlider>(gameObject, "alpha_").value * 1000)).ToString()); Config.Set("alpha_", ((int)(UIHelper.getByName<UISlider>(gameObject, "alpha_").value * 1000)).ToString());
var collection = gameObject.GetComponentsInChildren<UIToggle>(); var collection = gameObject.GetComponentsInChildren<UIToggle>();
for (int i = 0; i < collection.Length; i++) for (int i = 0; i < collection.Length; i++)
{ {
if (collection[i].name.Length > 0 && collection[i].name[0] == '*') if (collection[i].name.Length > 0 && collection[i].name[0] == '*')
{ {
...@@ -231,7 +237,7 @@ public class Setting : WindowServant2D ...@@ -231,7 +237,7 @@ public class Setting : WindowServant2D
public void save() public void save()
{ {
Config.Set("ignoreWatcher_",UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "ignoreWatcher_").value)); Config.Set("ignoreWatcher_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "ignoreWatcher_").value));
Config.Set("ignoreOP_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "ignoreOP_").value)); Config.Set("ignoreOP_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "ignoreOP_").value));
Config.Set("smartSelect_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "smartSelect_").value)); Config.Set("smartSelect_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "smartSelect_").value));
Config.Set("autoChain_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "autoChain_").value)); Config.Set("autoChain_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "autoChain_").value));
......
This diff is collapsed.
...@@ -229,7 +229,7 @@ PlayerSettings: ...@@ -229,7 +229,7 @@ PlayerSettings:
AndroidSplashScreenScale: 0 AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0} androidSplashScreen: {fileID: 0}
AndroidKeystoreName: ygopro.jks AndroidKeystoreName: ygopro.jks
AndroidKeyaliasName: ygopro AndroidKeyaliasName:
AndroidTVCompatibility: 0 AndroidTVCompatibility: 0
AndroidIsGame: 0 AndroidIsGame: 0
androidEnableBanner: 1 androidEnableBanner: 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment