Exemple #1
0
        ActionEvent ReadActionEvent()
        {
            byte expanded      = ReadByte();
            byte enabled       = ReadByte();
            byte withDialog    = ReadByte();
            byte dialogOptions = ReadByte();

            try
            {
                string text = ReadFourByteString();
                string eventName;

                if (text == "TEXT")
                {
                    eventName = ReadString();
                }
                else if (text == "long")
                {
                    eventName = ReadFourByteString();
                }
                else
                {
                    Console.WriteLine("Unknown text: " + text);
                    return(null);
                }

                var actionEvent = _map.Lookup(eventName);
                // actionEvent.EventForDisplay = ReadString();
                string tmp = ReadString();
                actionEvent.EventForDisplay = Abbreviations.GetUppercased(eventName);

                DebugOutput.Dump("EventName: " + eventName);

                actionEvent.HasDescriptor = (ReadInt32() != 0);
                if (!actionEvent.HasDescriptor)
                {
                    DebugOutput.Dump("HasDescriptor: " + actionEvent.HasDescriptor);
                    actionEvent.IsEnabled = (enabled == 0) ? false : true;
                    return(actionEvent);
                }

                if (PreSix == false)
                {
                    string classID = ReadUnicodeString();
                    DebugOutput.Dump("ClassID: " + classID);

                    string classID2 = ReadTokenOrString();
                    DebugOutput.Dump("ClassID2: " + classID2);
                }

                actionEvent.NumberOfItems = ReadInt32();
                DebugOutput.Dump("NumberOfItems: " + actionEvent.NumberOfItems);

                actionEvent           = actionEvent.Parse(this);
                actionEvent.IsEnabled = (enabled == 0) ? false : true;

                return(actionEvent);
            }
            catch (GimpSharpException e)
            {
                Console.WriteLine("-------------> Parsing failed");
                return(null);
            }
        }