Example #1
0
    private void Localize(SimpleLocalizationLangs language)
    {
        LocalizationKey tempKey =
            LocalizationSystem.Instance.LocAsset.localizationKeys.Find(
                elem => elem.key == keyLocalization
                );

        if (tempKey != null)
        {
            LangText tempLangText =
                tempKey.value.Find(
                    lang => lang.key == language
                    );

            if (tempLangText != null)
            {
                textToLocalize.text = tempLangText.value;
            }
            else
            {
                Debug.LogWarning(string.Format("WRN - Could not find language {0} in the key {1}.", language, tempKey.key));
            }
        }
        else
        {
            Debug.LogWarning(string.Format("WRN - Could not find key {0} in the asset.", keyLocalization));
        }
    }
Example #2
0
        /// <summary>
        /// URL重写的分页链接
        /// </summary>
        /// <param name="totalRows">总记录数</param>
        /// <param name="pageCount">总页数</param>
        /// <param name="pagaIndex">当前页码</param>
        /// <param name="anyLink">{0} 定义页码参数</param>
        /// <param name="lang">多语言版本时,指定语言</param>
        /// <returns></returns>
        public static string RewirterPage(int totalRows, int pageCount, int pagaIndex, string anyLink, LangText lang = null)
        {
            if (lang == null)
            {
                lang = new LangText();
            }

            pagaIndex = (pagaIndex <= 0) ? pagaIndex = 1 : pagaIndex;
            pagaIndex = (pagaIndex >= pageCount) ? pagaIndex = pageCount : pagaIndex;
            var sb = new StringBuilder();

            if (pagaIndex > 5)
            {
                sb.AppendFormat("<li><a href=\"{0}\">{1}</a></li>", anyLink, lang.FirstPage);
            }
            if (pagaIndex > 1)
            {
                sb.AppendFormat("<li><a href=\"{0}\">{1}</a></li>", string.Format(anyLink, (pagaIndex - 1)), lang.LastPage);
            }
            else
            {
                sb.AppendFormat("<li class=\"disabled\"><a href=\"javascript:;\">{0}</a></li>", lang.FirstPage);
            }
            int showNum = 10;
            int index   = pagaIndex - (showNum / 2);
            int sumSetp = 1;

            index = (index < 1) ? 1 : index;
            while (sumSetp <= showNum)
            {
                if (index > pageCount)
                {
                    break;
                }
                if (pagaIndex == index)
                {
                    sb.AppendFormat("<li class=\"active\"><a href=\"javascript:;\">{0}</a></li>", index);
                }
                else
                {
                    sb.AppendFormat("<li><a href=\"{0}\">{1}</a></li>", string.Format(anyLink, index), index);
                }
                sumSetp++;
                index++;
            }
            if (pagaIndex < pageCount)
            {
                sb.AppendFormat("<li><a href=\"{0}\">{1}</a></li>", string.Format(anyLink, (pagaIndex + 1)), lang.NextPage);
            }
            else
            {
                sb.AppendFormat("<li class=\"disabled\"><a href=\"javascript:;\">{0}</a></li>", lang.NextPage);
            }
            if (pagaIndex < (pageCount - 5))
            {
                sb.AppendFormat("<li><a href=\"{0}\">{1}</a></li>", string.Format(anyLink, pageCount), lang.EndPage);
            }
            return(sb.ToString());
        }
Example #3
0
    public void Awake()
    {
        thisButton      = this.GetComponent <Button>();
        backgroundImage = this.GetComponentInChildren <Image>();
        subtitles       = this.GetComponentInChildren <LangText>();

        thisButton.onClick.AddListener(() => {
            selectComicRoutine();
        });
    }
Example #4
0
 public ItemWrapper()
 {
     WrappedItem = new ItemRecord();
     m_name      = new LangText();
     m_name.SetText(Languages.All, "New item");
     m_description = new LangText();
     m_description.SetText(Languages.All, "Item description");
     m_effects                    = new ObservableCollection <EffectWrapper>();
     WrappedItem.recipeIds        = new List <uint>();
     WrappedItem.favoriteSubAreas = new List <uint>();
     WrappedItem.possibleEffects  = new List <EffectInstance>();
     WrappedItem.criteria         = "";
     WrappedItem.criteriaTarget   = "";
     WrappedItem.itemSetId        = -1;
     New = true;
 }
    void Start()
    {
        PlayerController.StopTutorial += StopTextDisplay;
        PlayerController.StopTutorial += StopImageDisplay;


        if (_player != null)
        {
            _playerController = _player.GetComponent <PlayerController>();
            _playerController.DisableAllInput();
            _playerController.EnableTouchInput();
        }

        if (_tutorialCommand != null)
        {
            _tutorialCommandLang = _tutorialCommand.GetComponent <LangText>();
        }

        if (_tutorialVisual != null)
        {
            _tutorialVisualImage = _tutorialVisual.GetComponent <Image>();
        }
    }
    /**
     * Update Screen information
     */
    void Update()
    {
        int p_discount = 0;

        // Applying discount code
        string discount_auth_yn = GameObject.Find("v_discount_auth_yn").GetComponent <Text>().text;

        if (discount_auth_yn.Equals("Y"))
        {
            p_discount = GlobalEnv.ReturnDiscountPrice(lang);
            // v_discount.color = Color.red;
        }

        // Update counting
        GameObject.Find("v_scanned_item_cnt").GetComponent <Text>().text = scanned_list.Count.ToString();
        string v_current_canvas = GameObject.Find("v_current_canvas").GetComponent <Text>().text;

        // Update item info
        if (update_tf == true && (v_current_canvas.Equals("screen1") || v_current_canvas.Equals("screen2")))
        {
            // 1. Reset all information on the self-checkout screen
            ClearAllInformation();

            // 3. Update items list
            int i       = 1;
            int p_total = 0;
            foreach (KeyValuePair <string, string> kv in scanned_list)
            {
                string o_item_name  = kv.Key;
                string o_item_qty   = kv.Value;
                string o_item_price = GlobalEnv.ReturnItemPrice(o_item_name, lang);

                // Notify the first calling
                if (firstItem_tf == false && i == 1)
                {
                    v_firstItem_yn.text = "Y";
                    firstItem_tf        = true;
                }

                // GameObject.Find("checkbox"+i).GetComponent<Toggle>().interactable = true;
                GameObject.Find("checkbox" + i).GetComponent <Toggle>().isOn = true;
                GameObject.Find("item_name" + i.ToString()).GetComponent <TextMeshProUGUI>().text  = LangText.ReturnItemName(o_item_name, lang);
                GameObject.Find("item_qty" + i.ToString()).GetComponent <TextMeshProUGUI>().text   = o_item_qty;
                GameObject.Find("item_price" + i.ToString()).GetComponent <TextMeshProUGUI>().text = o_item_price;
                p_total += Int32.Parse(o_item_qty) * Int32.Parse(o_item_price);
                i++;
            }
            v_total.text = p_total.ToString();

            // 4. Update total price Info
            int total_price = (p_total - p_discount);
            if (total_price < 0)
            {
                total_price = 0;
            }
            total_amount.text = total_price.ToString();

            M_EventLogger.EventLogging(GlobalEnv.ACTOR_SYSTEM, GlobalEnv.EVENT_CATE_SCREEN, GlobalEnv.EVENT_TYPE_SCREEN_UPDATE, "UPDATE", "Screen information Updated");
        }

        // Update
        update_tf = false;
    }
    /**
     * @Function: Item Scanner Function
     *
     * @Author: Minjung KIM
     * @Date: 2020.Mar.17
     * @History:
     *  - 2020.03.17 Minjung KIM: 최초 작성 (1개 타입의 종류만 되도록 개발)
     *  - 2020.03.18 Minjung KIM: 여러 개의 오브젝트가 스캔되도록 개발
     *  - 2020.04.19 Minjung KIM: Block scan interaction when the canvas = screen2 and discount_auth_yn = Y
     *  - 2020.05.03 Minjugn KIM: Allow scan interaction when the user touched cancel buttton
     *  - 2020.05.23 Minjung KIM: Add Event Log
     *  - 2020.06.01 Minjung KIM: Bugfix qty Counting Error
     *  - 2020.07.01 Minjung KIM: Allow the scan anytime
     *  - 2020.07.08 Minjung KIM: Add scanned item name to result_message
     */
    void OnTriggerEnter(Collider collision)
    {
        string o_item_code = collision.gameObject.name;  // unique item code: ex) A1
        string o_item_name = collision.gameObject.tag;   // item name: ex) Apple

        string current_canvas = GameObject.Find("v_current_canvas").GetComponent <Text>().text;
        string trying_to_pay  = GameObject.Find("v_trying_to_pay_yn").GetComponent <Text>().text;

        // ----------------------------------
        // 1. Scan to Add items
        // ----------------------------------
        if (!o_item_name.Equals("Untagged") && !o_item_name.Equals("card") && !o_item_name.Equals("left_cellphone") && current_canvas.Equals("screen1") && !trying_to_pay.Equals("Y"))
        {
            //Debug.Log("Add ScannerEvent() o_item_code:" + o_item_code);
            //Debug.Log("Add ScannerEvent() o_item_name:" + o_item_name);

            // 1-1 Allow only unscanned item!
            // This means that firstly we check the item unique code from duplicate_scanned_list for block the duplicate scan.
            if (dupcheck_scanned_list.ContainsKey(o_item_code) == false)
            {
                // 1. Update scanned_list quantity then Add item code in duplicate_scanned_list (for blocking the duplicate scans)
                int qty = 1;
                if (scanned_list.ContainsKey(o_item_name))
                {
                    qty = Int32.Parse(scanned_list[o_item_name]) + 1;
                }
                scanned_list[o_item_name] = qty.ToString();
                dupcheck_scanned_list.Add(o_item_code, o_item_name);
                canceled_list.Remove(o_item_code);
                SoundManager.instance.PlaySound(GlobalEnv.SOUND_SCANNED, 99);

                // 2. Add Event log
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_USER, GlobalEnv.EVENT_CATE_ACT, GlobalEnv.EVENT_TYPE_SCAN_ADD, o_item_name, o_item_code);
                update_tf = true;

                // 3. Update user message
                screen1_result_message.text  = LangText.ReturnItemName(o_item_name, lang) + LangText.scan_added[lang];
                screen1_result_message.color = Color.blue;
                result_background.color      = Color.white;
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_SYSTEM, GlobalEnv.EVENT_CATE_SYS_MSG, GlobalEnv.EVENT_TYPE_SCAN_ADD, "screen1_result_message", LangText.ReturnItemName(o_item_name, lang) + LangText.scan_added[lang]);
            }
            else
            {
                // Todo : 이미있는 아이템을 또 태그하려고했을 때
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_USER, GlobalEnv.EVENT_CATE_ACT, GlobalEnv.EVENT_TYPE_SCAN_DUP_ADD, o_item_name, o_item_code);
                // screen1_result_message.text = LangText.ReturnItemName(o_item_name, lang) + "는 이미 스캔된 아이템입니다.";
                // screen1_result_message.color = Color.red;
                // result_background.color = Color.white;
                // SOUND
                // ADMIN LOG
            }

            // ----------------------------------
            // 2. Scan to remove items
            // ----------------------------------
        }
        else if (!o_item_name.Equals("Untagged") && !o_item_name.Equals("card") && !o_item_name.Equals("left_cellphone") && current_canvas.Equals("screen2"))
        {
            //Debug.Log("Remove ScannerEvent() o_item_code:" + o_item_code);
            //Debug.Log("Remove ScannerEvent() o_item_name:" + o_item_name);

            screen2_result_message.text = "-"; //initializing

            // 2-1. Allow only scanned items & Block that already canceled items
            Debug.Log("CHECK scanned list:" + scanned_list.ContainsKey(o_item_name));
            Debug.Log("CHECK canceled list:" + !canceled_list.ContainsKey(o_item_code));
            if (scanned_list.ContainsKey(o_item_name) == true && canceled_list.ContainsKey(o_item_code) == false)
            {
                // 1. initializing the result message
                screen1_result_message.text  = "-";
                screen1_result_message.color = Color.black;

                // 2. Update scanned_list quantity then Remove item code in duplicate_scanned_list (for allow the scans again)
                int o_qty = Int32.Parse(scanned_list[o_item_name]) - 1;
                if (o_qty <= 0)
                {
                    scanned_list.Remove(o_item_name);
                }
                else
                {
                    scanned_list[o_item_name] = o_qty.ToString();
                }
                dupcheck_scanned_list.Remove(o_item_code);
                canceled_list.Add(o_item_code, o_item_name);
                SoundManager.instance.PlaySound(GlobalEnv.SOUND_SCANNED, 99);

                // 3. Add Event log
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_USER, GlobalEnv.EVENT_CATE_ACT, GlobalEnv.EVENT_TYPE_SCAN_REMOVE, o_item_name, o_item_code);

                // 4. Update removed item information with item name and price.
                screen2_result_message.text  = LangText.ReturnItemName(o_item_name, lang) + " ( " + GlobalEnv.ReturnItemPrice(o_item_name, lang) + " " + LangText.returnCurrency[lang] + " )" + LangText.scan_removed[lang];
                screen2_result_message.color = Color.blue;
                result_background.color      = Color.white;
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_SYSTEM, GlobalEnv.EVENT_CATE_SYS_MSG, GlobalEnv.EVENT_TYPE_SCAN_REMOVE, "screen2_result_message", LangText.ReturnItemName(o_item_name, lang) + " ( " + GlobalEnv.ReturnItemPrice(o_item_name, lang) + " " + LangText.returnCurrency[lang] + " )" + LangText.scan_removed[lang]);

                // 6. Automatically change the screen
                screen2_btn_home.GetComponent <Button>().interactable = false;
                screen2_btn_home.GetComponent <BoxCollider>().enabled = false;
                Invoke("ChangeScreen2toScreen1After3s", 3f);
            }
            else
            {
                // Todo - 이미 제거하거나 없는 아이템을 제거하려고 했을 때
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_USER, GlobalEnv.EVENT_CATE_ACT, GlobalEnv.EVENT_TYPE_SCAN_DUP_REMOVE, o_item_name, o_item_code);
                SoundManager.instance.PlaySound(GlobalEnv.SOUND_ERROR, lang);
                screen2_result_message.text  = LangText.ReturnItemName(o_item_name, lang) + "는 없는 아이템입니다.";
                screen2_result_message.color = Color.red;
                result_background.color      = Color.white;
                M_EventLogger.EventLogging(GlobalEnv.ACTOR_ADMIN, GlobalEnv.EVENT_CATE_SYS_MSG, GlobalEnv.EVENT_TYPE_SCAN_DUP_REMOVE, "screen2_result_message", LangText.ReturnItemName(o_item_name, lang) + "는 없는 아이템입니다.");
            }
        }
    }
Example #8
0
    public void Start()
    {
        text_before.text = LangText.martText_self_before[lang];
        text_after.text  = LangText.martText_self_after[lang];
        text_scan.text   = LangText.martText_self_scan[lang];
        text_card.text   = LangText.martText_self_card[lang];

        // level
        string level         = GameObject.Find("v_level").GetComponent <Text>().text;
        string discount_code = GlobalEnv.ReturnDiscountCode(level);

        text_subtitle.text = LangText.martNoti_msg2(lang, gameMode, discount_code);

        // screen1
        if (GlobalEnv.KR.Equals(lang.ToString()))
        {
            text_screen1_currency1.text = "W";
            text_screen1_currency2.text = "W";
            text_screen1_currency3.text = "W";
        }
        text_screen1_result.text   = LangText.screen1_scanning[lang];
        text_screen1_name.text     = LangText.screen1_text_itemName[lang];
        text_screen1_qty.text      = LangText.screen1_text_itemQty[lang];
        text_screen1_price.text    = LangText.screen1_text_itemPrice[lang];
        text_screen1_total.text    = LangText.screen1_text_total[lang];
        text_screen1_discount.text = LangText.screen1_text_discount[lang];
        text_screen1_cancel.text   = LangText.screen1_button_cancel[lang];
        text_screen1_pay.text      = LangText.screen1_button_pay[lang];

        // screen2
        text_screen2_instruction.text = LangText.screen2_instruction[lang];
        text_screen2_home.text        = LangText.screen2_btn_home[lang];

        // screen3
        text_screen3_result.text = LangText.screen3_asking_discount_code[lang];
        text_screen3_yes.text    = LangText.screen3_btn_yes[lang];
        text_screen3_no.text     = LangText.screen3_btn_no[lang];

        // screen4
        text_screen4_e_result.text    = LangText.screen4_enter_the_dc[lang];
        text_screen4_e_apply.text     = LangText.screen4_button_apply[lang];
        text_screen4_e_backspace.text = LangText.screen4_button_backspace[lang];
        text_screen4_n_result.text    = LangText.screen4_enter_the_dc[lang];
        text_screen4_n_apply.text     = LangText.screen4_button_apply[lang];
        text_screen4_n_backspace.text = LangText.screen4_button_backspace[lang];
        text_screen4_h_result.text    = LangText.screen4_enter_the_dc[lang];
        text_screen4_h_apply.text     = LangText.screen4_button_apply[lang];
        text_screen4_h_backspace.text = LangText.screen4_button_backspace[lang];

        // screen5
        text_screen5_btn_back.text          = LangText.screen2_btn_home[lang];
        text_screen5_tyring_to_pay_msg.text = LangText.alert_tryingToPay[lang];

        // screen6
        text_screen6_result.text = LangText.screen5_result[lang];

        // Material rollbacks
        screen.SetTexture("_EmissionMap", basic.texture);

        // Set Home button
        if (gameMode.Equals(GlobalEnv.GAMEMODE_START))
        {
            btn_home.SetActive(false);
        }
    }
 private void OnEnable()
 {
     targetObject = (LangText)target;
     targetObject.UpdateText();
 }
Example #10
0
 public LangTextRow(LangText record)
 {
     m_record = record;
 }
Example #11
0
 public void DeleteText(LangText text)
 {
     m_langs.Remove(text.Id);
     DatabaseManager.Instance.Database.Delete(text);
 }
Example #12
0
 public void CreateText(LangText text)
 {
     m_langs.Add(text.Id, text);
     DatabaseManager.Instance.Database.Insert(text);
 }
Example #13
0
 public void SaveText(LangText text)
 {
     m_langs[text.Id] = text;
     DatabaseManager.Instance.Database.Update(text);
 }