Commit 587ea0fa authored by Unicorn369's avatar Unicorn369

Merge branch 'Test' of https://github.com/Unicorn369/YGOPro2_Droid into Android

parents 1febaa84 7b18346f
......@@ -792,7 +792,7 @@ public static class UIHelper
{
if (fileInfos[i].Name.Length > 4)
{
if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".png")
if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".png" || fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".jpg")
{
string name = fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4);
if (!faces.ContainsKey(name))
......
......@@ -320,8 +320,8 @@ public class Program : MonoBehaviour
byte[] bytes = www.bytes;
ExtractZipFile(bytes, ANDROID_GAME_PATH);
}
/* //选择性更新
if (!File.Exists(ANDROID_GAME_PATH + "updates/image_version1.3.txt"))
/* //选择性更新(用于额外打补丁)
if (!File.Exists(ANDROID_GAME_PATH + "updates/version2.3.1.txt"))
{
string filePath = Application.streamingAssetsPath + "/update.zip";
var www = new WWW(filePath);
......@@ -1019,7 +1019,7 @@ public class Program : MonoBehaviour
_padScroll = 0;
}
GUI.Label(new Rect(10, 5, 200, 200), "[Ver 2.3.0] " + "FPS: " + m_FPS);
GUI.Label(new Rect(10, 5, 200, 200), "[Ver 2.3.1] " + "FPS: " + m_FPS);
}
void Update()
......
......@@ -54,6 +54,10 @@ public class HttpDldFile
}
catch (Exception)
{
if (File.Exists(filename + ".tmp"))
{
File.Delete(filename + ".tmp");
}
flag = false;
}
return flag;
......
using UnityEngine;
using System;
using System.Collections.Generic;
using System.IO;
using YGOSharp.OCGWrapper.Enums;
public class Servant
......@@ -391,8 +392,12 @@ public class Servant
public string currentMShash;
public string nameFace;
private GameObject currentMSwindow = null;
private GameObject currentMSwindow_Face = null;
public class messageSystemValue
{
public string value = "";
......@@ -779,10 +784,32 @@ public class Servant
true,
new Vector3(((float)Screen.height) / 700f, ((float)Screen.height) / 700f, ((float)Screen.height) / 700f)
);
nameFace = name;
currentMSwindow_Face = currentMSwindow;
UIHelper.InterGameObject(currentMSwindow);
UIHelper.getByName<UITexture>(currentMSwindow, "face_").mainTexture = UIHelper.getFace(name);
UIHelper.registEvent(currentMSwindow, "yes_", ES_RMSpremono, new messageSystemValue());
UIHelper.registEvent(currentMSwindow, "exit_", ES_RMSpremono, new messageSystemValue());
UIHelper.registEvent(currentMSwindow, "yes_", DownloadFace);
}
public void DownloadFace()
{
//获取QQ号
UIInput inputHttp = UIHelper.getByName<UIInput>(currentMSwindow_Face, "input_");
//如果使用自定义url,而不是QQ头像,请修改url,改为:string url = inputHttp.value;
string url = "http://q1.qlogo.cn/headimg_dl?dst_uin=" + inputHttp.value + "&spec=100";
string face = "texture/face/" + nameFace + ".jpg";
//开始下载
HttpDldFile df = new HttpDldFile();
df.Download(url, face);
//刷新头像
if (File.Exists(face))
{
Texture2D Face = UIHelper.getTexture2D(face);
UIHelper.faces.Remove(nameFace);//防止bug,先删除再添加
UIHelper.faces.Add(nameFace, Face);
UIHelper.getByName<UITexture>(currentMSwindow_Face, "face_").mainTexture = Face;
}
}
#endregion
}
......@@ -23,6 +23,7 @@ public class SelectServer : WindowServantSP
UIHelper.registEvent(gameObject, "exit_", onClickExit);
UIHelper.registEvent(gameObject, "face_", onClickFace);
UIHelper.registEvent(gameObject, "join_", onClickJoin);
UIHelper.registEvent(gameObject, "clearPsw_", onClearPsw);
serversList = UIHelper.getByName<UIPopupList>(gameObject, "server");
//serversList.fontSize = 30;
if (Application.systemLanguage == SystemLanguage.Chinese || Application.systemLanguage == SystemLanguage.ChineseSimplified || Application.systemLanguage == SystemLanguage.ChineseTraditional)
......@@ -199,6 +200,20 @@ public class SelectServer : WindowServantSP
//inputVersion.value = version;
}
void onClearPsw()
{
string PswString = File.ReadAllText("config/passwords.conf");
string[] lines = PswString.Replace("\r", "").Split("\n");
for (int i = 0; i < lines.Length; i++)
{
list.RemoveItem(lines[i]);//清空list
}
FileStream stream = new FileStream("config/passwords.conf", FileMode.Truncate, FileAccess.ReadWrite);//清空文件内容
stream.Close();
inputPsw.value = "";
Program.PrintToChat(InterString.Get("房间密码已清空"));
}
public override void show()
{
base.show();
......
This diff is collapsed.
......@@ -123,7 +123,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 2.3.0 (1.034.9)
bundleVersion: 2.3.1 (1.034.9)
preloadedAssets: []
metroInputSource: 0
m_HolographicPauseOnTrackingLoss: 1
......@@ -148,7 +148,7 @@ PlayerSettings:
tvOS: cn.ygopro2.ygopro2android
buildNumber:
iOS:
AndroidBundleVersionCode: 15
AndroidBundleVersionCode: 16
AndroidMinSdkVersion: 16
AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 0
......
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