// Use this for initialization void Start() { SetUpButtons(); if (Context.Banner_url.IsNullOrEmpty() == true) { BannerImage.gameObject.SetActive(false); } else { string url = string.Format(GlobalDefine.GetScratchBoadhUrl(), Context.Banner_url); WebResource.Instance.GetSprite(url, (Sprite sprite) => { if (BannerImage != null) { BannerImage.sprite = sprite; BannerImage.color = Color.white; SetImageSize(); } }, () => { if (BannerImage != null) { BannerImage.sprite = ResourceManager.Instance.Load("dummy_scratch_banner", ResourceType.Common); BannerImage.color = Color.white; SetImageSize(); } }); } }
void OnGUI( ) { var toRemove = new List <GlobalDefine>(); foreach (var define in _globalDefines) { if (defineEditor(define)) { toRemove.Add(define); } } foreach (var define in toRemove) { _globalDefines.Remove(define); } if (GUILayout.Button("Add Define")) { var d = new GlobalDefine(); d.define = "NEW_DEFINE"; d.enabled = false; _globalDefines.Add(d); } GUILayout.Space(40); if (GUILayout.Button("Save")) { save(); Close(); } }
//[MenuItem("Tools/Edit Global Defines")] static void CreateWizardFromMenu() { var helper = ScriptableWizard.DisplayWizard<GlobalDefinesWizard>("Global Defines Manager", "SaveAndReBuild", "Cancel"); helper.minSize = new Vector2(500, 300); helper.maxSize = new Vector2(500, 300); string settingFile = Application.dataPath + SettingFile; if (File.Exists(settingFile)) { StreamReader reader = new StreamReader(settingFile); string settingData = reader.ReadToEnd(); reader.Close(); string[] sepDefines = { ";" }; string[] sepDefine = { ":" }; string[] defines = settingData.Split(sepDefines, System.StringSplitOptions.None); for (int i = 0; i < defines.Length; ++i) { string[] def = defines[i].Split(sepDefine, System.StringSplitOptions.None); GlobalDefine d = new GlobalDefine(); d.define = def[0]; d.enabled = ((string)def[1]).ToUpper() == "TRUE"; helper._globalDefines.Add(d); } } }
/// <summary> /// <para>Cuando hay un item en el toggle</para> /// </summary> /// <param name="defineItem"></param> /// <param name="eType"></param> private void OnGUIDefineItemToggle(GlobalDefine defineItem, COMPILER eType) // Cuando hay un item en el toggle { GUIStyle togStyle = EditorStyles.miniButtonMid; if (eType == COMPILER.END) { togStyle = EditorStyles.miniButtonRight; } string name = "Unity"; if (eType == COMPILER.CSHARP) { name = "C#"; } else if (eType == COMPILER.CSHARP_EDITOR) { name = "C# editor"; } bool isEnabled = defineItem.IsEnabled(eType); GUI.backgroundColor = isEnabled ? Color.cyan : Color.white; bool newValue = GUILayout.Toggle(isEnabled, name, togStyle, GUILayout.Width(BUTTON_WIDTH)); if (newValue == isEnabled) { return; } defineItem.SetEnable(eType, newValue); SetSelectedDefine(defineItem); }
void OnGUI() { var toRemove = new List<GlobalDefine>(); foreach( var define in _globalDefines ) { if( defineEditor( define ) ) toRemove.Add( define ); } foreach( var define in toRemove ) _globalDefines.Remove( define ); if( GUILayout.Button( "Add Define" ) ) { var d = new GlobalDefine(); d.define = "NEW_DEFINE"; d.enabled = false; _globalDefines.Add( d ); } GUILayout.Space( 40 ); if( GUILayout.Button( "Save" ) ) { save(); Close(); } }
/// <summary> /// <para>Carga los RSP</para> /// </summary> /// <param name="compilerType"></param> private void CargarRspFile(COMPILER compilerType) // Carga los RSP { string path = RspFilePath(compilerType); if (!File.Exists(path)) { return; } string rspOption = File.ReadAllText(path); MatchCollection defineMatchs = Regex.Matches(rspOption, PATRON); foreach (Match match in defineMatchs) { Group group = match.Groups[NOMBRE_GRUPO]; foreach (Capture cap in group.Captures) { GlobalDefine define = GetData(cap.Value); if (define != null) { define.SetEnable(compilerType, true); } } } }
/// <summary> /// <para>Iguala un global con otro</para> /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static bool IsEquals(GlobalDefine a, GlobalDefine b) // Iguala un global con otro { if (a == null && b == null) { return(true); } if (a == null || b == null) { return(false); } if (a.Nombre != b.Nombre) { return(false); } for (int i = 0; i < a.isEnableSettings.Length; ++i) { if (a.isEnableSettings[i] != b.isEnableSettings[i]) { return(false); } } return(true); }
private void LoadIconResource() { for (int i = 0; i < TabGroupList.Count; ++i) { for (int j = 0; j < TabGroupList[i].SubTabList.Count; ++j) { SubTabContext subTab = TabGroupList[i].SubTabList[j]; if (subTab.GachaMaster == null) { continue; } string url = ""; if (subTab.GachaMaster.url_img == string.Empty) { url = string.Format(GlobalDefine.GetScratchIconhUrl(), subTab.GachaMaster.fix_id); } else { url = string.Format(GlobalDefine.GetScratchIconhUrl(), subTab.GachaMaster.url_img); } WebResource.Instance.GetSprite(url, (Sprite sprite) => { subTab.IconImage = sprite; }, () => { subTab.IconImage = ResourceManager.Instance.Load("dummy_scratch_icon", ResourceType.Common); }); } } }
public void LoadBoadImage() { if (m_Master != null) { string url = ""; if (m_Master.type == MasterDataDefineLabel.GachaType.STEP_UP) { url = string.Format(GlobalDefine.GetScratchBoadhUrl(), m_StepManageMaster.url_img); } else { if (m_Master.url_img == string.Empty) { url = string.Format(GlobalDefine.GetScratchBoadhUrl(), m_Master.fix_id); } else { url = string.Format(GlobalDefine.GetScratchBoadhUrl(), m_Master.url_img); } } WebResource.Instance.GetSprite(url, (Sprite sprite) => { BoadImage = sprite; BoadAlpha = 1; }, () => { BoadImage = ResourceManager.Instance.Load("dummy_scratch_banner"); BoadAlpha = 1; }); } }
public static string GetApplicationStatus(bool isTag) { string status = ""; #if API_SELECT_DEBUG || BUILD_TYPE_DEBUG if (DebugOption.Instance.disalbeDebugMenu == true) { return(status); } string apiversion = GlobalDefine.GetApiVersion(); SQLiteClient.Instance.UpdateDbClientVersion(); //サーバタイプ string createServer = SQLiteClient.Instance.GetDbServerType().ToString(); //作成時間 double unixTime = SQLiteClient.Instance.GetDbCreateTime(); DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); DateTime date = unixStart.AddSeconds(unixTime).ToLocalTime(); string createDate = " : " + date.ToString("yyyy/MM/dd HH:mm"); string sizestart = isTag == true ? "<size=22>" : ""; if (Patcher.Instance.isNextVersion()) { sizestart = isTag == true ? "<size=26>" : ""; } string sizeend = isTag == true ? "</size>" : ""; string space = isTag == true ? "\n" : " / "; string colorstart = isTag == true ? "<color=#0000ff>" : ""; if (Patcher.Instance.isNextVersion()) { colorstart = isTag == true ? "<color=#ff0000>" : ""; } string colorend = isTag == true ? "</color>" : ""; string dbtext = createServer + createDate; if (isTag == true) { dbtext += "\n" + GetSqliteUrl(); } Uri uri = new Uri(GetResourceBasePath()); status = StrOpe.i + sizestart + Application.productName + sizeend + space + sizestart + colorstart + ServerDataUtil.GetServerName() + colorend + sizeend + "\nAPI: " + apiversion + "\nAsset: " + uri.Scheme + "://" + uri.Host + "" + uri.AbsolutePath + "\ndb: " + dbtext + "\nuuid: " + LocalSaveManager.Instance.LoadFuncUUID(); #endif return(status); }
/// <summary> /// Add a define to the list of defines. /// </summary> /// <param name="defineText"> Define text.</param> /// <param name="isActive"> True if it is active.</param> private void AddDefine(string defineText, bool isActive) { if (m_allDefines.Exists(x => x.m_defineName == defineText) == false) { GlobalDefine newDefine = new GlobalDefine(isActive, defineText); m_allDefines.Add(newDefine); } }
/// <summary> /// <para>Determina si se esta editando</para> /// </summary> /// <param name="define"></param> /// <returns></returns> private bool IsEditingDefine(GlobalDefine define) // Determina si se esta editando { if (define == null) { return(false); } return(editingDefine == define.Nombre); }
/// <summary> /// <para>Determina si esta seleccionado</para> /// </summary> /// <param name="define"></param> /// <returns></returns> private bool IsSelectedDefine(GlobalDefine define) // Determina si esta seleccionado { if (define == null) { return(false); } return(selectedDefine == define.Nombre); }
/// <summary> /// <para>Iniciando renombrado</para> /// </summary> /// <param name="define"></param> private void BeginRename(GlobalDefine define) // Iniciando renombrado { if (define == null) { return; } editingDefine = define.Nombre; editingName = define.Nombre; }
/// <summary> /// <para>Seleccionar define</para> /// </summary> /// <param name="define"></param> private void SetSelectedDefine(GlobalDefine define) // Seleccionar define { if (define == null) { selectedDefine = ""; } else { selectedDefine = define.Nombre; } isInputProcessed = true; }
public static BannerData Create(JsonDAO jdao, ListItemModel listItemModel) { BannerData d = new BannerData(listItemModel); d.banner = String.Format("{0}/{1}", GlobalDefine.GetBaseBannerUrl(), jdao.GetStr("banner")); d.priority = jdao.GetInt("priority"); d.link = jdao.GetStr("link"); #if BUILD_TYPE_DEBUG Debug.Log("CALL BatchData#Create banner:" + d.banner + " priority:" + d.priority); #endif return(d); }
private bool DefineEditor(GlobalDefine define) { EditorGUILayout.BeginHorizontal(); define.define = EditorGUILayout.TextField(define.define); define.enabled = EditorGUILayout.Toggle(define.enabled); bool remove = GUILayout.Button("Remove"); EditorGUILayout.EndHorizontal(); return remove; }
/// <summary> /// <para>Renombra una definicion</para> /// </summary> /// <param name="oldName"></param> /// <param name="newName"></param> public void Renombrar(string oldName, string newName) // Renombra una definicion { GlobalDefine defineData = null; dicDefines.TryGetValue(oldName, out defineData); if (defineData == null) { return; } dicDefines.Remove(oldName); defineData.Renombrar(newName); dicDefines[defineData.Nombre] = defineData; }
/// <summary> /// <para>Proceso input</para> /// </summary> /// <param name="rtItem"></param> /// <param name="define"></param> private void ProcessInput(Rect rtItem, GlobalDefine define) // Proceso input { if (isInputProcessed == true || define == null) { return; } if (ProcessRename(rtItem, define)) { isInputProcessed = true; } else if (ProcessMouse(rtItem, define)) { isInputProcessed = true; } }
/// <summary> /// <para>Obtener Data</para> /// </summary> /// <param name="defineName"></param> /// <returns></returns> public GlobalDefine GetData(string defineName) // Obtener Data { if (string.IsNullOrEmpty(defineName)) { return(null); } GlobalDefine defineData = null; dicDefines.TryGetValue(defineName, out defineData); if (defineData == null) { defineData = new GlobalDefine(defineName); dicDefines[defineName] = defineData; } return(defineData); }
private bool defineEditor(GlobalDefine define) { EditorGUILayout.BeginHorizontal(); define.define = EditorGUILayout.TextField(define.define); define.enabled = EditorGUILayout.Toggle(define.enabled); var remove = false; if (GUILayout.Button("Remove")) { remove = true; } EditorGUILayout.EndHorizontal(); return(remove); }
public void openBossInfo() { SoundUtil.PlaySE(SEID.SE_MENU_OK); if (m_RecvData == null || m_RecvData.guerrilla == null ) { return; } PacketStructGuerrilla _info = m_RecvData.guerrilla; Dialog _newDialog = Dialog.Create(DialogType.DialogScrollInfo); _newDialog.SetDialogText(DialogTextType.Title, GameTextUtil.GetText("gerira_dialog_title")); if (_info.image != null) { for (int i = 0; i < _info.image.Length; i++) { if (!ChkTiming(_info.image[i].timing_start, _info.image[i].timing_end)) { continue; } _newDialog.AddScrollInfoImage(String.Format("{0}/{1}", GlobalDefine.GetBaseBannerUrl(), _info.image[i].url)); break; } } if (_info.text != null) { for (int i = 0; i < _info.text.Length; i++) { if (!ChkTiming(_info.text[i].timing_start, _info.text[i].timing_end)) { continue; } _newDialog.AddScrollInfoText(_info.text[i].message); } } _newDialog.Show(); }
/// <summary> /// リソースのロード開始 /// </summary> /// <param name="finishAction"></param> public void LoadResources(Action finishAction = null) { string url = string.Format(GlobalDefine.GetMasterResourcesUrl() , UserDataAdmin.Instance.m_PeriodLoginResourceRoot , m_LoginPeriodData.resource_store_name , ""); m_LoadingCount = 0; GetResource(url + "background.png", (Sprite sprite) => { CharaImage = sprite; }, () => { CharaImage = null; }); StartCoroutine(LoopCheckLoad(finishAction)); }
private void openUnitInfo() { SoundUtil.PlaySE(SEID.SE_MENU_OK); if (m_RecvData == null || m_RecvData.new_unit == null ) { return; } PacketStructNewUnit _info = m_RecvData.new_unit; Dialog _newDialog = Dialog.Create(DialogType.DialogScrollInfo); _newDialog.SetDialogText(DialogTextType.Title, GameTextUtil.GetText("newunit_dialog_title")); if (_info.image != null) { for (int i = 0; i < _info.image.Length; i++) { if (!ChkTiming(_info.image[i].timing_start, _info.image[i].timing_end)) { continue; } _newDialog.AddScrollInfoImage(String.Format("{0}/{1}", GlobalDefine.GetBaseBannerUrl(), _info.image[i].url)); break; } } if (_info.icon != null) { for (int i = 0; i < _info.icon.Length; i++) { if (!ChkTiming(_info.icon[i].timing_start, _info.icon[i].timing_end)) { continue; } _newDialog.AddScrollInfoIconList(_info.icon[i].title, _info.icon[i].ids); } } _newDialog.Show(); }
/// <summary> /// <para>Agregar de la interfaz</para> /// </summary> private void OnGUIAddMenu() // Agregar de la interfaz { EditorGUILayout.BeginHorizontal(); newDefineName = EditorGUILayout.TextField(newDefineName, GUILayout.MinWidth(TOP_MENU_BUTTON_WIDTH)); bool isInvalid = false; if (GlobalDefine.IsValidName(newDefineName) == false) { EditorGUILayout.HelpBox(StringsUEME.NOMBRE_INVALIDO_MDEFINE, MessageType.Error); isInvalid = true; } else if (definesEditing.IsDefined(newDefineName)) { EditorGUILayout.HelpBox(StringsUEME.DEFINE_EXISTE_MDEFINE, MessageType.Error); isInvalid = true; } EditorGUI.BeginDisabledGroup(isInvalid); if (isInvalid == false) { GUI.backgroundColor = Color.cyan; } if (GUILayout.Button(StringsUEME.ADD_DEFINE_MDEFINE, GUILayout.Width(TOGGLE_WIDTH))) { GlobalDefine newDefine = definesEditing.GetData(newDefineName); if (newDefine != null) { newDefine.SetEnableAll(true); } GUI.FocusControl(""); newDefineName = CrearNuevoNombreDefine(); } GUI.backgroundColor = Color.white; EditorGUI.EndDisabledGroup(); EditorGUILayout.EndHorizontal(); }
/// <summary> /// <para>Renombrar</para> /// </summary> /// <param name="rtItem"></param> /// <param name="define"></param> /// <returns></returns> private bool ProcessRename(Rect rtItem, GlobalDefine define) // Renombrar { if (define == null || define.Nombre != editingDefine) { return(false); } bool isInvalid = false; if (GlobalDefine.IsValidName(editingName) == false) { EditorGUILayout.HelpBox(StringsUEME.NOMBRE_INVALIDO_MDEFINE, MessageType.Error); isInvalid = true; } else if (editingName != define.Nombre && definesEditing.IsDefined(editingName)) { EditorGUILayout.HelpBox(StringsUEME.DEFINE_EXISTE_MDEFINE, MessageType.Error); isInvalid = true; } if ((Event.current.type == EventType.MouseDown && !UtilEvent.IsClicked(rtItem)) || (Event.current.type == EventType.KeyUp && Event.current.keyCode == KeyCode.Return)) { if (isInvalid) { EndRename(); } else { doRename = true; } Event.current.Use(); return(true); } return(false); }
// サーバーとリソースの参照先切り替えアプリのバージョン(Platformごと) public bool isNextVersion() { #if BUILD_TYPE_DEBUG if (DebugOption.Instance.noneNextVersion) { return(false); } #endif string next = GetStr("APP_NEXT_VERSION_" + NOUtil.Platform.ToUpper()); if (next.IsNullOrEmpty()) { return(false); } if (next != GlobalDefine.StrVersion()) { return(false); } return(true); }
/// <summary> /// <para>Procesos mouse</para> /// </summary> /// <param name="rtItem"></param> /// <param name="define"></param> /// <returns></returns> private bool ProcessMouse(Rect rtItem, GlobalDefine define)// Procesos mouse { if (define == null || UtilEvent.IsClicked(rtItem) == false) { return(false); } if (string.IsNullOrEmpty(editingDefine) == false) { EndRename(); } if (IsSelectedDefine(define)) { SetSelectedDefine(null); } else { SetSelectedDefine(define); } Event.current.Use(); return(true); }
/// <summary> /// 情報ウインドウ設定 /// </summary> private void settingInfoWindow() { PacketStructPlayer _player = UserDataAdmin.Instance.m_StructPlayer; //次ランクまで経験値計算 MasterDataUserRank nextRank = MasterFinder <MasterDataUserRank> .Instance.Find((int)_player.rank + 1); if (nextRank != null) { //NextRankLabel = "次のランクまであと"; int nextExp = (int)nextRank.exp_next_total - (int)_player.exp; NextRankExp = string.Format(GameTextUtil.GetText("head_subtext3"), nextExp); } else { //NextRankLabel = "ランクは最大です"; NextRankExp = GameTextUtil.GetText("rankmax_caution"); } updateStaminaTime(); #if API_SELECT_DEBUG || BUILD_TYPE_DEBUG StatusdValue = GlobalDefine.GetApplicationStatus(false); #endif }
/// <summary> /// <para>Es igual a otra globaldefine</para> /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> public static bool IsEquals(GlobalDefineSetting a, GlobalDefineSetting b) // Es igual a otra globaldefine { if (a.dicDefines.Count != b.dicDefines.Count) { return(false); } foreach (GlobalDefine aDefine in a.dicDefines.Values) { if (aDefine == null) { continue; } GlobalDefine bDefine = null; b.dicDefines.TryGetValue(aDefine.Nombre, out bDefine); if (bDefine == null || GlobalDefine.IsEquals(aDefine, bDefine) == false) { return(false); } } return(true); }
private bool defineEditor( GlobalDefine define ) { EditorGUILayout.BeginHorizontal(); define.define = EditorGUILayout.TextField( define.define ); define.enabled = EditorGUILayout.Toggle( define.enabled ); var remove = false; if( GUILayout.Button( "Remove" ) ) remove = true; EditorGUILayout.EndHorizontal(); return remove; }
private void OnGUI() { var configs = this.GetConfigurations(); EditorGUILayout.LabelField("Custom Project Builder v.0.0.3"); GUILayout.Space(10); int oldConfigIndex = this._currentConfigurationName != null ? System.Array.IndexOf(configs, this._currentConfigurationName) : -1; int newConfigIndex = EditorGUILayout.Popup( oldConfigIndex, configs ); if (newConfigIndex != oldConfigIndex) { this._currentConfigurationName = newConfigIndex != -1 ? configs[newConfigIndex] : null; this._currentConfiguration = null; } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("New")) { this.CreateNewConfiguration(); } if (GUILayout.Button(this._currentConfiguration != null && this._currentConfigurationDirty ? "Save*" : "Save")) { this.SaveCurrentConfiguration(); } EditorGUILayout.EndHorizontal(); if (this._currentConfiguration == null && this._currentConfigurationName != null) { this._currentConfiguration = this.LoadConfiguration(this._currentConfigurationName); this._currentConfigurationDirty = false; } if (this._currentConfiguration != null) { this._currentConfigurationDirty |= this._currentConfiguration.OnGUI(); } var toRemove = new List<GlobalDefine>(); if( GUILayout.Button( "Add Define" ) ) { var d = new GlobalDefine(); d.define = "NEW_DEFINE"; d.enabled = false; _globalDefines.Add( d ); pos.y += 20; } GUILayout.Space (10); pos = EditorGUILayout.BeginScrollView(pos); foreach( var define in _globalDefines ) { if( DefineEditor( define ) ) toRemove.Add( define ); } foreach( var define in toRemove ) _globalDefines.Remove( define ); GUILayout.Space( 10 ); EditorGUILayout.HelpBox ("Это тестовый пример сборщика проектов!", MessageType.Info); EditorGUILayout.EndScrollView(); GUI.backgroundColor = Color.green; if (this._currentConfiguration != null) { if (GUILayout.Button("Build " + this._currentConfiguration.name)) { SaveDefines(); this.Build(this._currentConfiguration); this.Close(); } } }
/// <summary> /// Remove a define from the list of defines. /// </summary> /// <param name="define"> The define to remove.</param> private void RemoveDefine(GlobalDefine define) { m_allDefines.Remove(define); }
public void Initialize(bool forceReinitialization) { if (_db == null || forceReinitialization) { initalizeFlags(); //TODOリリース時はパスワードを埋め込む #if BUILD_TYPE_DEBUG dbPassword = "******"; #else dbPassword = "******"; #endif if (changeWorkingName && workingName.Trim() == "") { Debug.LogError("Sqlite3: If you want to change the database's working name, then you will need to supply a new working name in the SimpleSQLManager [" + gameObject.name + "]"); return; } Dispose(); DivRNUtil.ResetTableName(); string documentsPath = getPath(); bool fileExists = (DbFileList().Count > 0) ? true : false; bool proceed = true; if ((overwriteIfExists && fileExists) || !fileExists || (overwriteIfAppVersionUp && PlayerPrefs.GetInt(SOLITE_APPVERSION_KEY, 0) < GlobalDefine.AppVerToInt())) { try { if (fileExists) { RemoveDbFiles(); } CopyDbFile(documentsPath); PlayerPrefs.SetInt(SOLITE_APPVERSION_KEY, GlobalDefine.AppVerToInt()); PlayerPrefs.Save(); if (databaseCreated != null) { databaseCreated(documentsPath); } } catch { proceed = false; Debug.LogError("Sqlite3: Failed to open database at the working path: " + documentsPath); } } if (proceed) { CreateConnection(documentsPath); _db.Trace = debugTrace; } } }
/// <summary> /// Turn a define off or on. /// </summary> /// <param name="define"> The define to toggle.</param> /// <param name="isActive"> The state to toggle to.</param> private void ToggleDefine(GlobalDefine define, bool isActive) { define.m_isActive = isActive; }
/// <summary> /// Remove a define from the list of defines. /// </summary> /// <param name="define"> The define to remove.</param> private void RemoveDefine(GlobalDefine define) { m_allDefines.Remove(define); }
/// <summary> /// Add a define to the list of defines. /// </summary> /// <param name="defineText"> Define text.</param> /// <param name="isActive"> True if it is active.</param> private void AddDefine(string defineText, bool isActive) { if (m_allDefines.Exists(x => x.m_defineName == defineText) == false) { GlobalDefine newDefine = new GlobalDefine(isActive, defineText); m_allDefines.Add(newDefine); } }
/// <summary> /// Turn a define off or on. /// </summary> /// <param name="define"> The define to toggle.</param> /// <param name="isActive"> The state to toggle to.</param> private void ToggleDefine(GlobalDefine define, bool isActive) { define.m_isActive = isActive; }