Merge pull request 'master' (#107) from Alienjack/AxibugEmuOnline:master into master
Reviewed-on: #107
This commit is contained in:
commit
c09085354b
@ -585,7 +585,7 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 21300000, guid: 961aba7b7a39e4d4c832e94350f44d4c, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 0ab2653139d474e40a1ce8213f36274e, type: 3}
|
||||||
m_Type: 0
|
m_Type: 0
|
||||||
m_PreserveAspect: 0
|
m_PreserveAspect: 0
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
|
|||||||
@ -79,6 +79,13 @@ namespace AxibugEmuOnline.Client.InputDevices
|
|||||||
{
|
{
|
||||||
foreach (var device in m_devices.Values) device.Update();
|
foreach (var device in m_devices.Values) device.Update();
|
||||||
|
|
||||||
|
DebugInputSystem();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DebugInputSystem()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
#if ENABLE_INPUT_SYSTEM
|
||||||
foreach (var device in InputSystem.devices)
|
foreach (var device in InputSystem.devices)
|
||||||
{
|
{
|
||||||
if (device is Mouse)
|
if (device is Mouse)
|
||||||
@ -91,7 +98,7 @@ namespace AxibugEmuOnline.Client.InputDevices
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,8 +172,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
public unsafe void Save(uint sequence, byte[] savData, byte[] screenShotData)
|
public unsafe void Save(uint sequence, byte[] savData, byte[] screenShotData)
|
||||||
{
|
{
|
||||||
if (IsBusy) return;
|
|
||||||
|
|
||||||
var filePath = FilePath;
|
var filePath = FilePath;
|
||||||
|
|
||||||
var header = new Header
|
var header = new Header
|
||||||
|
|||||||
@ -26,8 +26,8 @@ namespace AxibugEmuOnline.Client
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_sequece = (uint)netData.Sequence;
|
m_sequece = (uint)netData.Sequence;
|
||||||
m_downloadTask = AxiHttpProxy.GetDownLoad($"{App.httpAPI.WebHost}/{netData.SavUrl}");
|
m_downloadTask = AxiHttpProxy.GetDownLoad($"{App.httpAPI.WebHost}/{netData.SavUrl}?v={m_sequece}");
|
||||||
m_downloadTaskImg = AxiHttpProxy.GetDownLoad($"{App.httpAPI.WebHost}/{netData.SavImgUrl}");
|
m_downloadTaskImg = AxiHttpProxy.GetDownLoad($"{App.httpAPI.WebHost}/{netData.SavImgUrl}?v={m_sequece}");
|
||||||
|
|
||||||
Host.SetSavingFlag();
|
Host.SetSavingFlag();
|
||||||
}
|
}
|
||||||
@ -52,15 +52,26 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
if (m_downloadTaskImg.downloadHandler.bHadErr) //下载失败
|
if (m_downloadTaskImg.downloadHandler.bHadErr) //下载失败
|
||||||
{
|
{
|
||||||
FSM.ChangeState<IdleState>();
|
FSM.GetState<SyncFailedState>().Error = m_downloadTaskImg.downloadHandler.ErrInfo;
|
||||||
|
FSM.ChangeState<SyncFailedState>();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
var savData = Host.CloudAPI.UnGzipData(m_downloadTask.downloadHandler.data);
|
var savData = Host.CloudAPI.UnGzipData(m_downloadTask.downloadHandler.data);
|
||||||
var imgData = Host.CloudAPI.UnGzipData(m_downloadTaskImg.downloadHandler.data);
|
var imgData = m_downloadTaskImg.downloadHandler.data; //图片数据已被服务器解压
|
||||||
|
|
||||||
Host.Save(m_sequece, savData, imgData);
|
Host.Save(m_sequece, savData, imgData);
|
||||||
FSM.ChangeState<SyncedState>();
|
FSM.ChangeState<SyncedState>();
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
FSM.GetState<SyncFailedState>().Error = "云存档解压失败";
|
||||||
|
FSM.ChangeState<SyncFailedState>();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,18 +92,16 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
public override void OnExcute(OptionUI optionUI, ref bool cancelHide)
|
public override void OnExcute(OptionUI optionUI, ref bool cancelHide)
|
||||||
{
|
{
|
||||||
if (m_savFile.IsBusy)
|
if (m_savFile.IsBusy) //取消同步进程
|
||||||
{
|
{
|
||||||
OverlayManager.PopTip("存档正在同步中");
|
m_savFile.FSM.ChangeState<SaveFile.IdleState>();
|
||||||
cancelHide = true;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var stateData = m_ingameUI.Core.GetStateBytes();
|
var stateData = m_ingameUI.Core.GetStateBytes();
|
||||||
var tex = m_ingameUI.Core.OutputPixel;
|
var tex = m_ingameUI.Core.OutputPixel;
|
||||||
var screenData = tex.ToJPG(m_ingameUI.Core.DrawCanvas.transform.localScale);
|
var screenData = tex.ToJPG(m_ingameUI.Core.DrawCanvas.transform.localScale);
|
||||||
|
|
||||||
m_savFile.Save(m_savFile.Sequecen, stateData, screenData);
|
m_savFile.Save(m_savFile.Sequecen + 1, stateData, screenData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +165,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
public override void OnExcute(OptionUI optionUI, ref bool cancelHide)
|
public override void OnExcute(OptionUI optionUI, ref bool cancelHide)
|
||||||
{
|
{
|
||||||
if (m_savFile.GetCurrentState() is not SaveFile.ConflictState) return;
|
if (m_savFile.GetCurrentState() is not SaveFile.ConflictState) return;
|
||||||
cancelHide = true;
|
|
||||||
m_savFile.FSM.ChangeState<SaveFile.DownloadingState>();
|
m_savFile.FSM.ChangeState<SaveFile.DownloadingState>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,7 +184,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
public override void OnExcute(OptionUI optionUI, ref bool cancelHide)
|
public override void OnExcute(OptionUI optionUI, ref bool cancelHide)
|
||||||
{
|
{
|
||||||
if (m_savFile.GetCurrentState() is not SaveFile.ConflictState) return;
|
if (m_savFile.GetCurrentState() is not SaveFile.ConflictState) return;
|
||||||
cancelHide = true;
|
|
||||||
m_savFile.FSM.ChangeState<SaveFile.UploadingState>();
|
m_savFile.FSM.ChangeState<SaveFile.UploadingState>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,28 +92,19 @@ namespace AxibugEmuOnline.Client
|
|||||||
{
|
{
|
||||||
Canvas.ForceUpdateCanvases();
|
Canvas.ForceUpdateCanvases();
|
||||||
|
|
||||||
|
var topParent = FindTopOptionUI();
|
||||||
|
var totalWidth = GetTotalWidth(topParent);
|
||||||
|
|
||||||
|
Vector2 end = new Vector2(-totalWidth, MenuRoot.anchoredPosition.y);
|
||||||
|
|
||||||
if (m_popTween != null)
|
if (m_popTween != null)
|
||||||
{
|
{
|
||||||
Vector2 end = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y);
|
|
||||||
m_popTween.ChangeEndValue(end, false);
|
m_popTween.ChangeEndValue(end, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
Vector2 end = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y);
|
|
||||||
var topParent = m_parent;
|
|
||||||
while (topParent != null && topParent.m_parent != null)
|
|
||||||
{
|
|
||||||
topParent = topParent.m_parent;
|
|
||||||
}
|
|
||||||
if (topParent != null)
|
|
||||||
{
|
{
|
||||||
topParent.MenuRoot.anchoredPosition = end;
|
topParent.MenuRoot.anchoredPosition = end;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
MenuRoot.anchoredPosition = end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RebuildSelectIndex();
|
RebuildSelectIndex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,7 +214,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
if (!m_bPoped)
|
if (!m_bPoped)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_bPoped = true;
|
m_bPoped = true;
|
||||||
Vector2 start = new Vector2(0, MenuRoot.anchoredPosition.y);
|
Vector2 start = new Vector2(0, MenuRoot.anchoredPosition.y);
|
||||||
Vector2 end = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y);
|
Vector2 end = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y);
|
||||||
@ -234,19 +224,8 @@ namespace AxibugEmuOnline.Client
|
|||||||
var moveDelta = value - start;
|
var moveDelta = value - start;
|
||||||
start = value;
|
start = value;
|
||||||
|
|
||||||
var topParent = m_parent;
|
var topParent = FindTopOptionUI();
|
||||||
while (topParent != null && topParent.m_parent != null)
|
|
||||||
{
|
|
||||||
topParent = topParent.m_parent;
|
|
||||||
}
|
|
||||||
if (topParent != null)
|
|
||||||
{
|
|
||||||
topParent.MenuRoot.anchoredPosition += moveDelta;
|
topParent.MenuRoot.anchoredPosition += moveDelta;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MenuRoot.anchoredPosition += moveDelta;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
end,
|
end,
|
||||||
0.3f
|
0.3f
|
||||||
@ -256,7 +235,30 @@ namespace AxibugEmuOnline.Client
|
|||||||
m_lastCS = CommandDispatcher.Instance.Mode;
|
m_lastCS = CommandDispatcher.Instance.Mode;
|
||||||
CommandDispatcher.Instance.Mode = CommandListener.ScheduleType.Normal;
|
CommandDispatcher.Instance.Mode = CommandListener.ScheduleType.Normal;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OptionUI FindTopOptionUI()
|
||||||
|
{
|
||||||
|
if (m_parent == null) return this;
|
||||||
|
|
||||||
|
var topParent = m_parent;
|
||||||
|
while (topParent != null && topParent.m_parent != null)
|
||||||
|
{
|
||||||
|
topParent = topParent.m_parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return topParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
static float GetTotalWidth(OptionUI root)
|
||||||
|
{
|
||||||
|
float totalWidth = root.MenuRoot.rect.width;
|
||||||
|
if (root.m_child != null)
|
||||||
|
{
|
||||||
|
totalWidth += GetTotalWidth(root.m_child);
|
||||||
|
}
|
||||||
|
|
||||||
|
return totalWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -21,8 +21,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
get => m_target;
|
get => m_target;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (m_target == value) return;
|
|
||||||
|
|
||||||
m_target = value;
|
m_target = value;
|
||||||
if (m_target == null)
|
if (m_target == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user