예제 #1
0
    // Use this for initialization
    void Awake()
    {
        m_isInit = true;

        pathInfo   = new XMLLoader <XMLDataPathInfo>(XMLConfigPath.PathInfo);
        cityPoints = new XMLLoader <XMLDataCityPoints>(XMLConfigPath.CityPoints);
    }
예제 #2
0
        private void populateLists(XMLLoader loader) // XMLLoader loader
        {
            // Loader alle ingredienser i en liste
            foreach (Ingredient ing in loader.Ingredients.Ingredient)
            {
                ingredients.Add(ing);
            }
            foreach (Pizza m_product in pizzas)                                        // køere gennem alle produkter
            {
                ListViewItem Item = new ListViewItem(m_product.name);                  // Laver nyt listviewitem til produkt or giver den navnet på produktet

                Item.SubItems.Add(ingredientList(m_product.ingredients, ingredients)); // Giver listviewitemet ingredienser
                Item.SubItems.Add(getPizzaPrice(m_product));                           // og pris
                pizzaMenu.Items.Add(Item);                                             // Putter data på spreadsheet
            }
            // Loader dej og sovs og putter dem i deres dropdown menuer
            foreach (Dough Dough in loader.Doughs.Dough)
            {
                pizzaDough.Items.Add(Dough.name);
            }
            foreach (Sauce Sauce in loader.Sauces.Sauce)
            {
                pizzaSauce.Items.Add(Sauce.name);
            }
        }
예제 #3
0
        private void Start()
        {
            Logger             = base.Logger;
            Util.Logger.logger = Logger;

            IsVerbose = Config.Bind("Heelz", "Heelz Verbose Mode", false,
                                    new ConfigDescription("Make Heelz Plugin print all of debug messages in console. Useless for most of users."));
            LoadDevXML = Config.Bind("Heelz", "Load Developer XML", false,
                                     new ConfigDescription("Make Heelz Plugin load heel_manifest.xml file from game root folder. Useful for developing heels. Useless for most of users."));
            CharacterApi.RegisterExtraBehaviour <HeelsController>(GUID);
            HarmonyWrapper.PatchAll(typeof(HSHeelz));

            Logger.LogInfo("[Heelz] Heels mode activated: destroy all foot");
            var loadedManifests = Sideloader.Sideloader.Manifests.Values;

            foreach (var manifest in loadedManifests)
            {
                XMLLoader.LoadXML(manifest.manifestDocument);
            }

            if (LoadDevXML.Value)
            {
                XMLLoader.StartWatchDevXML();
            }
        }
예제 #4
0
    IEnumerator FadingText(XElement convo)
    {
        TextBoxManager.player.DisablePartyMovement();
        fadeText.gameObject.SetActive(true);
        convoRunning = true;
        yield return(new WaitForSeconds(1));

        var lines = XMLLoader.GetLines(convo);

        foreach (XElement line in lines)
        {
            yield return(new WaitForSeconds(1));

            fadeText.text = XMLLoader.GetSpeakerDialog(line);
            Color textColor = fadeText.color;
            for (int i = 0; i < 20; i++)
            {
                textColor.a   += .05f;
                fadeText.color = textColor;
                yield return(null);
            }
            yield return(new WaitForSeconds(2));

            for (int i = 0; i < 20; i++)
            {
                textColor.a   -= .05f;
                fadeText.color = textColor;
                yield return(null);
            }
        }
        yield return(new WaitForSeconds(1));

        convoRunning     = false;
        fadeText.enabled = false;
    }
예제 #5
0
        public Extra(List <Ingredient> ing, XMLLoader Loader, Pizza pizza, pizzaApp returnto)
        {
            ingredients = ing;      // Sætter lokal liste over ingredienser til liste a ingredienser der bliver passet
            loader      = Loader;   // Sætter lokal variable med xml fil informationen til den der er blevet passet
            returnTo    = returnto; // bruges til at returne den nye pizza

            InitializeComponent();

            populateLists();

            // Hvis en pizza bliver passed
            if (pizza != null)
            {
                // Vælger de ingredienser, krydderier, sovs, dej og størrelse der er på pizzaen der er blevet passed
                foreach (string i in pizza.ingredients.Split(','))
                {
                    toppingBox.SetItemCheckState(Convert.ToInt32(i), CheckState.Checked);
                }
                foreach (string i in pizza.spices.Split(','))
                {
                    spiceBox.SetItemCheckState(Convert.ToInt32(i), CheckState.Checked);
                }
                pizzaDough.SelectedIndex = Convert.ToInt32(pizza.dough);
                pizzaSauce.SelectedIndex = Convert.ToInt32(pizza.sauce);
                if (pizza.size != -1)
                {
                    pizzaSize.SelectedIndex = Convert.ToInt32(pizza.size);
                }
                else // Hvis ikke pizzaen har en størrelse sættes den til lille som standard
                {
                    pizzaSize.SelectedIndex = 2;
                }
            }
        }
예제 #6
0
    public static Ships loadShipsForChosenSide()
    {
        string chosenSide = LocalDataWrapper.getPlayer().getChosenSide();

        /*********************************TODO remove when testing is done!!*/
        if (chosenSide == null || chosenSide.Equals(""))
        {
            chosenSide = "Rebels";
        }
        /*********************************TODO remove when testing is done!!*/

        Ships ships = new Ships();

        switch (chosenSide)
        {
        case "Rebels":
            ships = XMLLoader.getShips("rebel_ships.xml");
            break;

        case "Empire":
            ships = XMLLoader.getShips("imperial_ships.xml");
            break;
        }

        return(ships);
    }
예제 #7
0
    static int LoadXML(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        XMLLoader <XMLDataBattle> obj = LuaScriptMgr.GetNetObject <XMLLoader <XMLDataBattle> >(L, 1);
        string arg0 = LuaScriptMgr.GetLuaString(L, 2);

        obj.LoadXML(arg0);
        return(0);
    }
예제 #8
0
파일: Button.cs 프로젝트: anthrax3/AForm
        public void OpenForm(string xmlFile)
        {
            IBlockWeb bw = XMLLoader.LoadBlockWeb(xmlFile, "a", blockWeb.Broker);

            string formId = bw.GetConnector("FormId").GetValue <string>();
            Form   frm    = bw[formId].ProcessRequest("GetUIElement") as Form;

            frm.ShowDialog();
        }
예제 #9
0
    static int ReflectionFields(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        XMLLoader <XMLDataBattle> obj = LuaScriptMgr.GetNetObject <XMLLoader <XMLDataBattle> >(L, 1);
        Type arg0 = LuaScriptMgr.GetTypeObject(L, 2);
        IDictionary <string, FieldInfo> o = obj.ReflectionFields(arg0);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
예제 #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            RuntimeBlockBroker broker = initBroker();

            IBlockWeb bw     = XMLLoader.LoadBlockWeb("blockWeb-copy.xml", "a", broker, null);
            string    formId = bw.GetConnector("FormId").GetValue <string>();

            System.Windows.Forms.Form frm = bw[formId].ProcessRequest("GetUIElement") as System.Windows.Forms.Form;
            frm.ShowDialog();
        }
예제 #11
0
    static int GetInfoById(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        XMLLoader <XMLDataBattle> obj = LuaScriptMgr.GetNetObject <XMLLoader <XMLDataBattle> >(L, 1);
        int           arg0            = (int)LuaScriptMgr.GetNumber(L, 2);
        XMLDataBattle o = obj.GetInfoById(arg0);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
예제 #12
0
    static int GetInfoByName(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        XMLLoader <XMLDataBattle> obj = LuaScriptMgr.GetNetObject <XMLLoader <XMLDataBattle> >(L, 1);
        string        arg0            = LuaScriptMgr.GetLuaString(L, 2);
        XMLDataBattle o = obj.GetInfoByName(arg0);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
예제 #13
0
    void Start()
    {
        Me = this;
        XMLLoader xmlLoader = new XMLLoader();

        GameModel = xmlLoader.LoadGame(Resources.Load <TextAsset>("model").text);
        Debug.Log("loaded " + GameModel.Scenes.Count + " scenes");

        AudioSources = Camera.main.GetComponents <AudioSource> ();
        PrepareNewScene("Cud mniemany");
    }
예제 #14
0
 void Start()
 {
     if (instance)
     {
         Destroy(this);
     }
     else
     {
         instance = this;
         Initiate(Application.systemLanguage);
     }
 }
예제 #15
0
        public TlBaseXML(string Filename, bool Custom) : base("xml")
        {
            XMLLoader.Load(Filename, T, Custom);

            Name = T.ToolName;
            foreach (var A in T.ControllerTypes)
            {
                Arch.Add(A);
            }
            foreach (var T in T.Tags)
            {
                Tags.Add(T);
            }
        }
예제 #16
0
    static int get_Data(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        if (o == null)
        {
            LuaDLL.luaL_error(L, "unknown member name Data");
        }

        XMLLoader <XMLDataBattle> obj = (XMLLoader <XMLDataBattle>)o;

        LuaScriptMgr.PushObject(L, obj.Data);
        return(1);
    }
예제 #17
0
    public static bool LoadXmlKeyValueStringToDict <T>(string path, string keyValue, ref Dictionary <string, T> dict) where T : class, new()
    {
        XmlElement root = null;

        if (!XMLLoader.LoadRootElement(PATH_DIR + path, out root))
        {
            Debug.LogError("Failed to load" + path + "Table!");
            return(false);
        }

        if (dict == null)
        {
            dict = new Dictionary <string, T>();
        }
        else
        {
            dict.Clear();
        }

        for (int dataIdx = 0; dataIdx < root.ChildNodes.Count; ++dataIdx)
        {
            XmlElement  node     = root.ChildNodes[dataIdx] as XmlElement;
            FieldInfo[] fieldArr = typeof(T).GetFields();
            T           data     = new T();

            string strValue = node.GetAttribute(keyValue);
            if (string.IsNullOrEmpty(strValue))
            {
                Debug.LogError("Failed to Dict Load key Name is :" + strValue);
                return(false);
            }
            else
            {
                for (int i = 0; i < fieldArr.Length; ++i)
                {
                    FieldInfo fi    = fieldArr[i];
                    string    value = node.GetAttribute(fi.Name);
                    if (!string.IsNullOrEmpty(value))
                    {
                        SetValue <T>(fi, data, value);
                    }
                }

                dict.Add(strValue, data);
            }
        }

        return(true);
    }
    void Start()
    {
        Sounds.Pain1      = Resources.Load <AudioClip>("music/sounds/bol");
        Sounds.Pain2      = Resources.Load <AudioClip>("music/sounds/bol2");
        Sounds.Step       = Resources.Load <AudioClip> ("music/sounds/krok1");
        Sounds.Shield     = Resources.Load <AudioClip> ("music/sounds/tarcza");
        Sounds.Hit        = Resources.Load <AudioClip>("music/sounds/hit");
        Sounds.Heal       = Resources.Load <AudioClip> ("music/sounds/lvlUp");
        Sounds.HitBlocked = Resources.Load <AudioClip> ("music/sounds/hit_blocked");

        XmlLoader = new XMLLoader();
        Me        = this;

        PlayerGM = XmlLoader.CreatePlayer();
    }
예제 #19
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            SimpleBlockBroker broker = new SimpleBlockBroker();
            RepositoryOptions ro     = new RepositoryOptions();

            ro.Folder = txtBlocksFolder.Text;

            broker.SetupBroker(ro);

            IBlockWeb bw     = XMLLoader.LoadBlockWeb(txtFormFile.Text, txtBWID.Text, broker, null);
            string    formId = bw.GetConnector("FormId").GetValue <string>();

            System.Windows.Forms.Form frm = bw[formId].ProcessRequest("GetUIElement") as System.Windows.Forms.Form;
            frm.ShowDialog();
        }
예제 #20
0
 public static IEnumerator loadAll()
 {
     init();
     for (int i = 0; i < _list.Count; i++)
     {
         ConfigDataVo cfgVo  = _list[i];
         XMLLoader    loader = new XMLLoader(cfgVo.loadHandler, cfgVo.url);
         yield return(Client.ins.StartCoroutine(loader.doLoadAsync(Client.ins)));
     }
     do
     {
         yield return(null);
     } while (GameConfig.ins.PetMaxLevel != 0);
     //_list.clear();
 }
예제 #21
0
        private KryptonGroupBox _WarningGroupBox; // Groupbox containing warning.

        #endregion Fields

        #region Constructors

        public Navigator(XMLLoader.ButtonHelp buttonHelp, Delegate del)
        {
            _ButtonHelp = buttonHelp;

            InitializeComponent();
            _ProcessHeaderGroupList = new List<KryptonHeaderGroup>();
            CreateWarningGroupBox();
            this.Dock = System.Windows.Forms.DockStyle.Fill;

            NavigatorControl.Button.ContextButton.Click += ContextButton_Click;
            ContextMenuStrip.ItemClicked += ContextMenuStrip_ItemClicked;
            ContextMenuStrip.Items.Add("Summary");
            switchButtonSpec.Click += switchButtonSpec_Click;

            _ClearAllPG = del;
        }
예제 #22
0
파일: Program.cs 프로젝트: jaalvarez92/SIA
        static void Main(string[] args)
        {
            ReplaceInFile("C:\\Users\\Javier\\Desktop\\hola.txt", "C:\\Users\\Javier\\Desktop\\hola3.txt", "las personas", "el mundo");
            ///////////////////////////
            //Se prueba objeto entity
            ///////////////////////////

            //Método Set (no case sensitive)
            Entity e = new Entity();

            e.Set("Nombre", "Javier");
            e.Set("Nombre", "Alonso");
            e.Set("Apellido", "Alvarez");
            e.Set("edad", 20);
            e.Set("fecha_nacimiento", new DateTime(1992, 2, 2));

            //Método Get (no case sensitive)
            Console.WriteLine("Información de Javier:");
            Console.WriteLine("Nombre: " + (string)e.Get("Nombre"));
            Console.WriteLine("Apellido: " + (string)e.Get("apellido"));
            Console.WriteLine("Edad: " + (int)e.Get("edad"));
            Console.WriteLine("Fecha de Nacimiento: " + (DateTime)e.Get("fecha_nacimiento"));

            ///////////////////////////
            ///////////////////////////

            ManejadorBaseDatos.Instancia.EjecutarScript("AYA");
            ///////////////////////////
            //Se prueba DA
            ///////////////////////////

            // Prueba Carga XML con DA
            Entities sp = new XMLLoader().loadXML("C://Users//Javier//.netbeans//7.1.2//config//GF3//domain1//tmsite//da//da.xml");

            // Prueba Ejecutar SP con objeto entity
            Entity parametros = new Entity();

            parametros.Set("pID", 1);
            parametros.Set("pCarro", "Toyota");
            parametros.Set("pNombre", "Javier");


            ///////////////////////////
            ///////////////////////////

            Console.ReadKey();
        }
예제 #23
0
        static void Main(string[] args)
        {
            XMLLoader       xml  = new XMLLoader("C:\\Users\\praktykant\\source\\repos\\FlagLibrary2\\flags.xml");
            List <FlagList> list = xml.GetFlagLists();

            foreach (FlagList fl in list)
            {
                Console.WriteLine(fl.name);
                Console.WriteLine();
                foreach (ParsedFlagData data in fl.Parse(7))
                {
                    Console.WriteLine("   " + "Wartość: " + data.value);
                    Console.WriteLine("   " + "Opis: " + data.description);
                    Console.WriteLine("   " + "Opcja: " + data.currentOption);
                    Console.WriteLine();
                }
            }
        }
예제 #24
0
    public static Pilots loadPilotsForEachShip(Ships ships)
    {
        Pilots pilots = new Pilots();

        foreach (Ship ship in ships.Ship)
        {
            if (pilots == null || pilots.Pilot == null || pilots.Pilot.Capacity == 0)
            {
                pilots = XMLLoader.getPilots(ship.ShipId.ToString() + "_pilots.xml");
            }
            else
            {
                pilots.Pilot.AddRange(XMLLoader.getPilots(ship.ShipId.ToString() + "_pilots.xml").Pilot);
            }
        }

        return(pilots);
    }
예제 #25
0
        private void Start()
        {
            Util.Log.Logger.logSource = Logger;
            ConfigUtility.Initialize(Config);
            CharacterApi.RegisterExtraBehaviour <HeelsController>(Constant.GUID);
            HarmonyWrapper.PatchAll(typeof(HeelzPlugin));
            Logger.LogInfo("[Heelz] Heels mode activated: destroy all foot");
            var loadedManifests = Sideloader.Sideloader.Manifests.Values;

            foreach (var manifest in loadedManifests)
            {
                XMLLoader.LoadXML(manifest.manifestDocument);
            }
            if (LoadDevXML.Value)
            {
                XMLLoader.StartWatchDevXML();
            }
        }
예제 #26
0
파일: Program.cs 프로젝트: jaalvarez92/SIA
        static void Main(string[] args)
        {
            ReplaceInFile("C:\\Users\\Javier\\Desktop\\hola.txt", "C:\\Users\\Javier\\Desktop\\hola3.txt", "las personas","el mundo");
            ///////////////////////////
            //Se prueba objeto entity
            ///////////////////////////

            //Método Set (no case sensitive)
            Entity e = new Entity();
            e.Set("Nombre", "Javier");
            e.Set("Nombre", "Alonso");
            e.Set("Apellido", "Alvarez");
            e.Set("edad", 20);
            e.Set("fecha_nacimiento", new DateTime(1992,2,2));

            //Método Get (no case sensitive)
            Console.WriteLine("Información de Javier:");
            Console.WriteLine("Nombre: " + (string)e.Get("Nombre"));
            Console.WriteLine("Apellido: " + (string)e.Get("apellido"));
            Console.WriteLine("Edad: " + (int)e.Get("edad"));
            Console.WriteLine("Fecha de Nacimiento: " + (DateTime)e.Get("fecha_nacimiento"));

            ///////////////////////////
            ///////////////////////////

            ManejadorBaseDatos.Instancia.EjecutarScript("AYA");
            ///////////////////////////
            //Se prueba DA
            ///////////////////////////

            // Prueba Carga XML con DA
            Entities sp = new XMLLoader().loadXML("C://Users//Javier//.netbeans//7.1.2//config//GF3//domain1//tmsite//da//da.xml");

            // Prueba Ejecutar SP con objeto entity
            Entity parametros = new Entity();
            parametros.Set("pID", 1);
            parametros.Set("pCarro","Toyota");
            parametros.Set("pNombre","Javier");

            ///////////////////////////
            ///////////////////////////

            Console.ReadKey();
        }
예제 #27
0
        void CreateAndShowMainMenu()
        {
            CameraFreeze();
            XMLLoader xmlLoader = new XMLLoader();

            xmlLoader.Load("Profiles\\profiles.xml");
            userList = new UsersList(xmlLoader.Document);

            mainMenu = new MainMenu(this.Game, ref userList);
            mainMenu.OnNewGameStartClick += new EventHandler <MainMenuEventArgs>(mainMenu_OnNewGameStartClick);
            mainMenu.OnExitClick         += new EventHandler(mainMenu_OnExitClick);
            mainMenu.OnDeleteUserClick   += new EventHandler <MainMenuEventArgs>(mainMenu_OnDeleteUSerClick);
            mainMenu.OnLoadGameClick     += new EventHandler <MainMenuEventArgs>(mainMenu_OnLoadGameClick);

            pointer           = new Sprite(this.Game, GraphicsCollection.GetPack("pointer"));
            pointer.XRelative = 0;
            pointer.YRelative = 0;
            pointer.DrawOrder = 10000;
        }
예제 #28
0
    public void DataFromXML(string iFileContent)
    {
        XMLLoader <ModuleData> _DataLoader = new XMLLoader <ModuleData>();

        _DataLoader.Initial(iFileContent, true);

        if (m_ModuleDatas != null)
        {
            m_ModuleDatas.Clear();
            m_ModuleDatas = null;
        }

        m_ModuleDatas = new List <ModuleData>();
        foreach (ModuleData _Data in _DataLoader.DataList)
        {
            m_ModuleDatas.Add(_Data);
        }

        _DataLoader = null;
    }
예제 #29
0
    void Start()
    {
        //Initialize
        keySource = gameObject.GetComponent <AudioSource>();
        xml       = gameObject.GetComponent <XMLLoader>();

        console_Panel    = log_Panel.transform.parent.gameObject;
        log_ActiveFields = new List <GameObject>();
        log_TextFields   = new TMP_Text[log_Panel.transform.childCount];

        FillTextFieldArray();

        //Turn off all text fields
        foreach (TMP_Text tmp in log_TextFields)
        {
            tmp.gameObject.SetActive(false);
        }

        SetFocus("input");
    }
예제 #30
0
    public static bool LoadXmlToList <T>(string path, ref List <T> list) where T : class, new()
    {
        XmlElement root = null;

        if (!XMLLoader.LoadRootElement(PATH_DIR + path, out root))
        {
            Debug.LogError("Failed to load" + path + "Table!");
            return(false);
        }

        if (list == null)
        {
            list = new List <T>();
        }
        else
        {
            list.Clear();
        }

        for (int dataIdx = 0; dataIdx < root.ChildNodes.Count; ++dataIdx)
        {
            XmlElement  node     = root.ChildNodes[dataIdx] as XmlElement;
            FieldInfo[] fieldArr = typeof(T).GetFields();
            T           data     = new T();
            for (int i = 0; i < fieldArr.Length; ++i)
            {
                FieldInfo fi    = fieldArr[i];
                string    value = node.GetAttribute(fi.Name);
                if (!string.IsNullOrEmpty(value))
                {
                    SetValue <T>(fi, data, value);
                }
            }

            list.Add(data);
        }

        return(true);
    }
예제 #31
0
    public static Upgrades loadUpgrades(string side, string size)
    {
        Upgrades tempUpgrades = XMLLoader.getUpgrades();
        Upgrades upgrades     = new Upgrades();

        upgrades.Upgrade = new System.Collections.Generic.List <UpgradesXMLCSharp.Upgrade>();

        foreach (UpgradesXMLCSharp.Upgrade upgrade in tempUpgrades.Upgrade)
        {
            bool available = true;

            if (upgrade.SideRestriction != null && !upgrade.SideRestriction.Equals(""))
            {
                if (!upgrade.SideRestriction.Equals(LocalDataWrapper.getPlayer().getChosenSide()))
                {
                    available = false;
                }
            }

            if (available)
            {
                if (upgrade.SizeRestriction != null && !upgrade.SizeRestriction.Equals(""))
                {
                    if (!upgrade.SizeRestriction.Equals(LocalDataWrapper.getPlayer().getChosenSize()))
                    {
                        available = false;
                    }
                }
            }

            if (available)
            {
                upgrades.Upgrade.Add(upgrade);
            }
        }

        return(upgrades);
    }
예제 #32
0
    IEnumerator PlayingConvo(XElement convo, bool yesNoChoice = false)
    {
        yesNoPicked  = false;
        convoRunning = true;
        endLine      = 0;
        var lines = XMLLoader.GetLines(convo);

        foreach (XElement line in lines)
        {
            EnableTextBox(XMLLoader.GetSpeakerDialog(line), false);
            yield return(null);

            while (isTyping)
            {
                yield return(null);
            }
            if (yesNoChoice)
            {
                yesNoOptions.SetActive(true);
                cursor.SetActive(true);
                UpdateCursor(0);
                //After the text is displayed, give the player two options: yes and no. Each triggers a different cutscene.
                while (!yesNoPicked)
                {
                    CheckInputSimple();
                    yield return(null);
                }
            }
            else
            {
                while (!Input.GetButtonDown("AButton"))
                {
                    yield return(null);
                }
            }
        }
        convoRunning = false;
    }