Ejemplo n.º 1
0
    private bool AddOption(ref Vector3 pos, OptionConfig op)
    {
        //控制选项上部空5个像素 [3/23/2012 Ivan]
        pos.x = 30;
        //pos.y = 10;

        GameObject option = Instantiate(OptionPrefab) as GameObject;

        option.name = op.WinName;
        option.transform.position = pos;
        //GFX.GfxUtility.attachGameObject(option, childGo);
        GFX.GfxUtility.attachGameObject(option, childOptGo);
        option.layer = LayerManager.UILayer;

        UIButton button = option.GetComponent <UIButton>();

        button.Anchor                 = SpriteRoot.ANCHOR_METHOD.UPPER_LEFT;
        button.spriteText.Anchor      = SpriteText.Anchor_Pos.Upper_Left;
        button.spriteText.lineSpacing = 1;
        button.Text = op.Content;

        float buttonHeight = (button.spriteText.renderer.bounds.max.y - button.spriteText.renderer.bounds.min.y);

        pos.y -= buttonHeight;

        button.AddInputDelegate(OptionClick);

        return(true);
    }
Ejemplo n.º 2
0
    public void ReLayout()
    {
        Vector3 tempTxtPos    = orgTextPos;
        Vector3 tempOptPos    = orgOptPos;
        Vector3 tempRewardPos = orgActionPos;

        for (int i = 0; i < allWindows.Count; i++)
        {
            CmConfig item = allWindows[i];
            if (item is TxtConfig)
            {
                TxtConfig txtConfig = item as TxtConfig;
                AddTextWind(ref orgTextPos, txtConfig);
            }
            else if (item is OptionConfig)
            {
                OptionConfig op = item as OptionConfig;
                AddOption(ref tempOptPos, op);
            }
            else if (item is ActionConfig)
            {
                ActionConfig action = item as ActionConfig;
                AddAction(ref tempRewardPos, action);
            }
            else if (item is SpaceConfig)
            {
                SpaceConfig space = item as SpaceConfig;
                orgTextPos.y -= space.LineCount * space.LineHeight;
            }
        }
    }
Ejemplo n.º 3
0
 internal string GetFirstOptionName()
 {
     for (int i = 0; i < allWindows.Count; i++)
     {
         if (allWindows[i] is OptionConfig)
         {
             OptionConfig item = allWindows[i] as OptionConfig;
             return(item.WinName);
         }
     }
     return(null);
 }
Ejemplo n.º 4
0
    public bool AddOption(string winName, string opText)
    {
        OptionConfig op = new OptionConfig();
        // 加入文字转义 [2/20/2012 Ivan]
        string parseRes;

        UIString.Instance.ParserString_Runtime(opText, out parseRes);
        op.Content = parseRes;
        op.WinName = winName;
        allWindows.Add(op);
        return(true);
    }
Ejemplo n.º 5
0
 static string Init(out int sec, out bool trc, out string filepath) {
     IOptionConfig cfg = new OptionConfig(EnOptionConfigType.App);
     var conn = cfg.Get<string>("conn");
     sec = cfg.Get<int>("sec");
     trc = cfg.Get<bool>("Trace");
     filepath = cfg.Get<string>("filepath");
     if (sec <= 0) {
         cfg.Set<int>("sec", 180000);
         sec = cfg.Get<int>("sec");
     }
     if (string.IsNullOrEmpty(conn)) {
         cfg.Set<string>("conn", "conn1804c7s7.sqlserver.rds.aliyuncs.com,3433;uid=usr0804c7s7;pwd=ABcd6634539;database=erp_power");
         conn = cfg.Get<string>("conn");
     }
     return conn;
 }
Ejemplo n.º 6
0
        static Lanucher()
        {
            optcfg = new OptionConfig(EnOptionConfigType.App);
            _connstr = GetConnString();
            cahe = new Ultra.Web.Core.Cache.CacheBase();
            //OfficeSkins.Register();
            BonusSkins.Register();
            var skn = optcfg.Get<string>("SkinName");
            if (!string.IsNullOrEmpty(skn))
            {
                cahe.Put<string>(SkinKey, skn);
            }
            else
                cahe.Put<string>(SkinKey, string.Empty);

            DevExpress.Skins.SkinManager.EnableFormSkins();
        }
Ejemplo n.º 7
0
        static Lanucher()
        {
            optcfg   = new OptionConfig(EnOptionConfigType.App);
            _connstr = GetConnString();
            cahe     = new Ultra.Web.Core.Cache.CacheBase();
            //OfficeSkins.Register();
            BonusSkins.Register();
            var skn = optcfg.Get <string>("SkinName");

            if (!string.IsNullOrEmpty(skn))
            {
                cahe.Put <string>(SkinKey, skn);
            }
            else
            {
                cahe.Put <string>(SkinKey, string.Empty);
            }

            DevExpress.Skins.SkinManager.EnableFormSkins();
        }
Ejemplo n.º 8
0
        static long Clear() {
            IOptionConfig cfg = new OptionConfig(EnOptionConfigType.App);
            appkey = cfg.Get<string>("appkey");
            if (string.IsNullOrEmpty(appkey)) {
                cfg.Set<string>("appkey", "12517536");
                appkey = cfg.Get<string>("appkey");
            }
            appsecret = cfg.Get<string>("appsecret");
            if (string.IsNullOrEmpty(appsecret)) {
                cfg.Set<string>("appsecret", "d86d510e5a9dfab841e00ff7e7f63e4f");
                appsecret = cfg.Get<string>("appsecret");
            }
            //sessionkey = cfg.Get<string>("sessionkey");
            //if (string.IsNullOrEmpty(sessionkey))
            //{
            //    cfg.Set<string>("sessionkey", "610081760d1be039e230a41061de2a3bae98a9a4112df92143584903");
            //    sessionkey = cfg.Get<string>("sessionkey");
            //}

            ITopClient client = new DefaultTopClient(url, appkey, appsecret);
            TopatsJushitaJdpDatadeleteRequest req = new TopatsJushitaJdpDatadeleteRequest();
            req.SyncType = "tb_trade;tb_item;tb_refund;fx_trade;tm_refund";
            req.StartModified = DateTime.Now.AddDays(-10);
            DateTime end = DateTime.Now.AddDays(-5);
            req.EndModified = end;
            try {
                TopatsJushitaJdpDatadeleteResponse response = client.Execute(req);
                if (response.IsError) {
                    AppLog.DebugException(new Exception(string.Format("ErrCode:{0} ErrMsg:{1} SubErrCode:{2} SubErrMsg:{3}", response.ErrCode,
                        response.ErrMsg, response.SubErrCode, response.SubErrMsg)));
                    return -1L;
                } else
                    return response.Task.TaskId;
            } catch (Exception ex) {
                AppLog.DebugException(ex);
                return -1L;
            }
        }
Ejemplo n.º 9
0
 public void init()//从存档获取是否有可用的设置,没有则使用初始设定
 {
     //如果存档没有可用信息
     if (OptionConfig.ReadConfig())
     {
         战斗动画设定(OptionConfig.CONFIG_ANIMATION);
         战斗视角设定(OptionConfig.CONFIG_VIEWPORT);
         游戏速度(OptionConfig.CONFIG_GAMESPEED);
         信息速度(OptionConfig.CONFIG_INFOSPEED);
         地形窗口(OptionConfig.CONFIG_TERRAININFO);
         地图上HP槽显示(OptionConfig.CONFIG_HPBARSHOW);
         自动回合结束(OptionConfig.CONFIG_AUTOFINISHTURN);
         信息效果声音(OptionConfig.CONFIG_INFOEFFECTSOUND);
         格子浓度(OptionConfig.CONFIG_LATTICE);
         BGM(OptionConfig.CONFIG_BGMSOUNDVOLUME);
         效果音(OptionConfig.CONFIG_EFFECTSOUNDVOLUME);
         人物音(OptionConfig.CONFIG_VOICESOUNDVOLUME);
     }
     else
     {
         setDefault();
     }
 }
Ejemplo n.º 10
0
 void OnDisable()//保存设置
 {
     onExitConfig();
     OptionConfig.SaveConfig();
 }