Esempio n. 1
0
    //如果玩家点击了确认,则遍历配置表的修改列表,根据对应的类型执行订阅的事件
    public void onGameSettingsConfirm()
    {
        if (GameSettingsXmlModel.CheckSettingsAttIsDirty())
        {
            if (GameSettingsXmlModel != null)
            {
                if (GameSettingsXmlModel.intTypeAttributeDirtyList != null)
                {
                    foreach (GameSettingAttributeBase <int> intAtt in GameSettingsXmlModel.intTypeAttributeDirtyList)
                    {
                        if (IntEvent != null)
                        {
                            GameSettingIntEventArgs e = new GameSettingIntEventArgs();
                            e.GameSettingEventName = intAtt.AType;
                            e.GameSettingIntValue  = intAtt.AValue;
                            IntEvent(this, e);
                        }
                    }
                }

                if (GameSettingsXmlModel.boolTypeAttributeDirtyList != null)
                {
                    foreach (GameSettingAttributeBase <bool> boolAtt in GameSettingsXmlModel.boolTypeAttributeDirtyList)
                    {
                        if (BoolEvent != null)
                        {
                            GameSettingBoolEventArgs e = new GameSettingBoolEventArgs();
                            e.GameSettingEventName = boolAtt.AType;
                            e.GameSettingBoolValue = boolAtt.AValue;
                            BoolEvent(this, e);
                        }
                    }
                }

                if (GameSettingsXmlModel.stringTypeAttributeDirtyList != null)
                {
                    foreach (GameSettingAttributeBase <string> strAtt in GameSettingsXmlModel.stringTypeAttributeDirtyList)
                    {
                        if (StringEvent != null)
                        {
                            GameSettingStringEventArgs e = new GameSettingStringEventArgs();
                            e.GameSettingEventName   = strAtt.AType;
                            e.GameSettingStringValue = strAtt.AValue;
                            StringEvent(this, e);
                        }
                    }
                }
                GameSettingsXmlModel.SaveGameSettingsDirty();
            }
        }
        //PopupMovieManager.Instance.PopMovie(this);
        // LeaveMovie();
    }
Esempio n. 2
0
    /// <summary>
    /// 根据选项界面的修改项目名称,切换对应血量信息显示状态
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public static void ChangeBloodSetting(object sender, GameSettingBoolEventArgs e)
    {
        switch (e.GameSettingEventName)
        {
        case "bShowPlayerBlood":
            ChangePlayerBlood(e.GameSettingBoolValue);
            break;

        case "bShowBloodInfo":
            ChangeBloodInfoVisible(e.GameSettingBoolValue);
            break;

        default:
            break;
        }
    }