psv中文输入,PSV暂时屏蔽滤镜,httpapi搜索处理部分
This commit is contained in:
parent
fca038e67d
commit
62fbb6e11b
@ -20,6 +20,13 @@ namespace AxibugEmuOnline.Client
|
||||
|
||||
public FilterManager(CanvasGroup filterPreview, CanvasGroup mainBg)
|
||||
{
|
||||
#if UNITY_PSP2
|
||||
m_filters = new List<Filter>();
|
||||
m_filterRomSetting = new FilterRomSetting();
|
||||
m_previewFilterWraper = new AlphaWraper(mainBg, filterPreview, false);
|
||||
return;
|
||||
#endif
|
||||
|
||||
m_filters = new List<Filter>
|
||||
{
|
||||
new Filter(new FixingPixelArtGrille()),
|
||||
@ -38,13 +45,19 @@ namespace AxibugEmuOnline.Client
|
||||
public Texture ExecuteFilterRender(Texture src)
|
||||
{
|
||||
if (result == null)
|
||||
result = RenderTexture.GetTemporary(Screen.width, Screen.height);
|
||||
{
|
||||
//result = RenderTexture.GetTemporary(Screen.width, Screen.height);
|
||||
result = Initer.instance.renderTest;
|
||||
}
|
||||
else if (result.width != Screen.width || result.height != Screen.height)
|
||||
{
|
||||
RenderTexture.ReleaseTemporary(result);
|
||||
result = RenderTexture.GetTemporary(Screen.width, Screen.height);
|
||||
//RenderTexture.ReleaseTemporary(result);
|
||||
//result = RenderTexture.GetTemporary(Screen.width, Screen.height);
|
||||
result = Initer.instance.renderTest;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool anyFilterEnable = false;
|
||||
foreach (var filter in Filters)
|
||||
{
|
||||
|
@ -2,6 +2,7 @@ using AxibugEmuOnline.Client.ClientCore;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
@ -14,7 +15,27 @@ namespace AxibugEmuOnline.Client
|
||||
|
||||
public delegate void GetRomListAPI(Action<Resp_GameList> callback, int page, int pageSize = 10);
|
||||
public delegate void SearchRomListAPI(Action<Resp_GameList> callback, string searchKey, int page, int pageSize = 10);
|
||||
public static string UrlEncode(string str)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (char c in str)
|
||||
{
|
||||
if ((c >= '0' && c <= '9') ||
|
||||
(c >= 'a' && c <= 'z') ||
|
||||
(c >= 'A' && c <= 'Z') ||
|
||||
c == '-' || c == '_' || c == '.' || c == '!' || c == '~' || c == '*' || c == '\'' || c == '(' || c == ')')
|
||||
{
|
||||
sb.Append(c);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append('%').Append(((int)c).ToString("X2"));
|
||||
}
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
public void GetNesRomList(Action<Resp_GameList> callback, int page, int pageSize = 10)
|
||||
{
|
||||
App.StartCoroutine(GetNesRomListFlow(page, pageSize, callback));
|
||||
@ -26,6 +47,13 @@ namespace AxibugEmuOnline.Client
|
||||
}
|
||||
private IEnumerator SearchNesRomListFlow(string searchKey, int page, int pageSize, Action<Resp_GameList> callback)
|
||||
{
|
||||
//避免特殊字符和个别文字编码问题
|
||||
byte[] gb2312Bytes = Encoding.Default.GetBytes(searchKey);
|
||||
byte[] utf8Bytes = Encoding.Convert(Encoding.Default, Encoding.UTF8, gb2312Bytes);
|
||||
// 将UTF-8编码的字节数组转换回字符串(此时是UTF-8编码的字符串)
|
||||
string utf8String = Encoding.UTF8.GetString(utf8Bytes);
|
||||
searchKey = UrlEncode(utf8String);
|
||||
App.log.Info($"search->{utf8String} ->{searchKey}");
|
||||
|
||||
AxiHttpProxy.SendWebRequestProxy request = AxiHttpProxy.Get($"{WebSiteApi}/NesRomList?Page={page}&PageSize={pageSize}&SearchKey={searchKey}");
|
||||
yield return request.SendWebRequest;
|
||||
|
@ -18,9 +18,11 @@ public class SonyVitaCommonDialog : MonoBehaviour
|
||||
Sony.Vita.Dialog.Ime.ImeDialogParams info = new Sony.Vita.Dialog.Ime.ImeDialogParams();
|
||||
|
||||
// Set supported languages, 'or' flags together or set to 0 to support all languages.
|
||||
info.supportedLanguages = Sony.Vita.Dialog.Ime.FlagsSupportedLanguages.LANGUAGE_JAPANESE |
|
||||
info.supportedLanguages = Sony.Vita.Dialog.Ime.FlagsSupportedLanguages.LANGUAGE_SIMPLIFIED_CHINESE |
|
||||
Sony.Vita.Dialog.Ime.FlagsSupportedLanguages.LANGUAGE_JAPANESE |
|
||||
Sony.Vita.Dialog.Ime.FlagsSupportedLanguages.LANGUAGE_ENGLISH_GB |
|
||||
Sony.Vita.Dialog.Ime.FlagsSupportedLanguages.LANGUAGE_DANISH;
|
||||
Sony.Vita.Dialog.Ime.FlagsSupportedLanguages.LANGUAGE_TRADITIONAL_CHINESE;
|
||||
|
||||
info.languagesForced = true;
|
||||
|
||||
info.type = Sony.Vita.Dialog.Ime.EnumImeDialogType.TYPE_DEFAULT;
|
||||
|
@ -23,7 +23,7 @@ namespace AxibugEmuOnline.Client
|
||||
|
||||
public static void Input(Action<string> callback, string placeHolder, string defaultText)
|
||||
{
|
||||
#if UNITY_PSP2
|
||||
#if UNITY_PSP2 && !UNITY_EDITOR
|
||||
App.sonyVitaCommonDialog.ShowPSVitaIME(callback, placeHolder, defaultText);
|
||||
#else
|
||||
s_ins.m_InputUI.Show(new ValueTuple<Action<string>, string, string>(callback, placeHolder, defaultText));
|
||||
|
Loading…
Reference in New Issue
Block a user