Example #1
0
        public Message(EndianBinaryReader reader)
        {
            m_textDataOffset = reader.ReadInt32();
            m_messageId      = reader.ReadInt16();
            m_itemPrice      = reader.ReadInt16();
            m_nextMessageID  = reader.ReadInt16();

            m_unknownField3 = reader.ReadInt16();

            m_textBoxType     = (BoxTypes)reader.ReadByte();
            m_initialDrawType = (DrawTypes)reader.ReadByte();
            m_textBoxPosition = (BoxPositions)reader.ReadByte();
            m_displayItemId   = (ItemID)reader.ReadByte();

            m_unknownBool1 = reader.ReadBoolean();

            m_initialSound          = reader.ReadByte();
            m_initialCameraBehavior = reader.ReadByte();
            m_initialSpeakerAnim    = reader.ReadByte();

            reader.SkipByte();

            m_numLinesPerBox = reader.ReadInt16();

            reader.SkipByte();

            m_textData = "";
        }
Example #2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #3
0
        public static string TypeToString(BoxTypes type)
        {
            switch (type)
            {
            case BoxTypes.General:
                return("Received");

            case BoxTypes.Preorder:
                return("Preorder");
            }
            return("-");
        }
Example #4
0
        public Box(BoxTypes boxType, DataHandler dataHandler, int actualSizing)
        {
            switch (boxType)
            {
            case BoxTypes.HeaderHorizontal:
                InitializeBox(boxType, dataHandler, actualSizing, Constants.HEADER_SIZING);
                break;

            case BoxTypes.HeaderVertical:
                InitializeBox(boxType, dataHandler, Constants.HEADER_SIZING, actualSizing);
                break;
            }
        }
Example #5
0
        public int CreateBoxType(string boxType, string ImageUrl, string ImageUrlHeader, string description)
        {
            BoxTypes box = new BoxTypes
            {
                BoxType        = boxType,
                BoxImage       = ImageUrl,
                BoxImageHeader = ImageUrlHeader,
                BoxDescription = description
            };

            context.BoxTypes.Add(box);
            context.SaveChanges();
            return(box.Id);
        }
Example #6
0
        private void InitializeBox(BoxTypes type, DataHandler dataHandler, int width, int height)
        {
            this.type        = type;
            this.dataHandler = dataHandler;

            Click     += Box_Click;
            MouseDown += Box_MouseDown;
            MouseUp   += Box_MouseUp;
            MouseMove += Box_MouseMove;
            dataHandler.DataUpdated += dataHandler_DataUpdated;

            dataHandler.Manager.ResultPublished += Manager_ResultPublished;

            Width  = width;
            Height = height;
        }
Example #7
0
        public static string ToString(this BoxTypes boxType)
        {
            switch (boxType)
            {
            case BoxTypes.GatheringCell: return("Быстрый набор");

            case BoxTypes.StorageCell: return("Хранение");

            case BoxTypes.DynamicGathering: return("Динамическая ячейка (подбор)");

            case BoxTypes.DynamicPlacing: return("Динамическая ячейка");

            case BoxTypes.ClientGatheringCell: return("Динамическая ячейка предварительный подбор");
            }

            return("");
        }
Example #8
0
        //TODO might be unnessecary now...?
        /// <summary>
        /// Fixes the box at index's variables
        /// </summary>
        /// <param name="list"></param>
        /// <param name="index"></param>
        private void FixBoxAt(IList <FileFragment> list, int index)
        {
            //TODO rework to be actually be accurate, probably by searching backwards until normality
            BoxTypes box = BoxTypes.Unknown;

            switch ((index % 3) + 1) //This assumes this is a file that has no extended lengths n stuff.
            {
            case (1):
                box = BoxTypes.Length;
                break;

            case (2):
                box = BoxTypes.Type;
                break;

            case (3):
                box = BoxTypes.Data;
                break;
            }
            (list[index] as ISOFileFragment).BoxType   = box;
            (list[index] as ISOFileFragment).BoxNumber = (index / 3) + 1;
        }
    private void SetBoxType(BoxTypes type)
    {
        boxType = type;
        switch (type)
        {
        case BoxTypes.BOXTYPE_NORMAL:
            worth = normalBoxWorth;
            break;

        case BoxTypes.BOXTYPE_TIMED:
            worth = timeBoxWorth;
            break;

        case BoxTypes.BOXTYPE_SLOW:
            worth = slowBoxWorth;
            break;

        default:
            type  = BoxTypes.BOXTYPE_NORMAL;
            worth = normalBoxWorth;
            break;
        }
    }
Example #10
0
 public Box(BoxTypes type, DataHandler dataHandler, int width, int height)
 {
     InitializeBox(type, dataHandler, width, height);
 }
Example #11
0
 public ISOFileFragment(ulong offset, ulong length, string[] filename, Validity validity, string description, int boxNumber, BoxTypes boxType)
     : base(offset, length, filename, validity, description)
 {
     BoxNumber = boxNumber;
     BoxType   = boxType;
 }
Example #12
0
 public ISOFileFragment(long offset, long length, string[] filename, Validity validity, string description, int boxNumber, BoxTypes boxType)
     : this((ulong)offset, (ulong)length, filename, validity, description, boxNumber, boxType)
 {
 }
Example #13
0
        public bool UpdateVariables(IList <FileFragment> list, ref int index, ref List <int> changed)
        {
            //Default start
            if (index == 0)
            {
                (list[index] as ISOFileFragment).BoxType   = BoxTypes.Length;
                (list[index] as ISOFileFragment).BoxNumber = 1;
                return(false);
            }
            else
            {
                //Shared between both cases
                BoxTypes current   = BoxTypes.Unknown;
                BoxTypes prev      = (list[index - 1] as ISOFileFragment).BoxType;
                int      boxNumber = (list[index - 1] as ISOFileFragment).BoxNumber;

                //HACK abandon all (some) hope ye who enter here
                //HACK it might be faster to just not have this first case, since it's only used once (if a file is created while enabled)
                //If in the middle of list
                if (index + 1 < list.Count)
                {
                    BoxTypes next = (list[index + 1] as ISOFileFragment).BoxType;
                    //TODO maybe move to C# 7 and use "when"?
                    switch (prev)
                    {
                    case (BoxTypes.Length):
                        current = (next == BoxTypes.Type || next == BoxTypes.Length)
                                  //If you're trying to insert a box in between a Length and a Type, I don't know what to tell ya...
                                  //And if you managed to get two lengths right next to eachother...
                                ? BoxTypes.Unknown
                                : BoxTypes.Type;
                        break;

                    case (BoxTypes.Type):
                        switch (next)
                        {
                        case (BoxTypes.ExtendedType):
                            current = BoxTypes.ExtendedLength;
                            break;

                        case (BoxTypes.Data):
                            switch (new FileInfo(list[index].Path).Length)
                            {
                            case (8):
                                current = BoxTypes.ExtendedLength;
                                break;

                            case (16):
                                current = BoxTypes.ExtendedType;
                                break;

                            default:
                                current = BoxTypes.Unknown;
                                break;
                            }
                            break;

                        //Only way length is gonna show up is if this box is missing data
                        case (BoxTypes.Length):
                            current = BoxTypes.Data;
                            break;

                        default:
                            current = BoxTypes.Unknown;
                            break;
                        }
                        break;

                    case (BoxTypes.ExtendedLength):
                        switch (next)
                        {
                        case (BoxTypes.Data):
                            current = BoxTypes.ExtendedType;
                            break;

                        case (BoxTypes.Length):
                            current = BoxTypes.Data;
                            break;

                        default:
                            current = BoxTypes.Unknown;
                            break;
                        }
                        break;

                    case (BoxTypes.ExtendedType):
                        current = (next == BoxTypes.Length)
                                ? BoxTypes.Data
                                : BoxTypes.Unknown;
                        break;

                    case (BoxTypes.Data):
                        current = (next == BoxTypes.Type)
                                ? BoxTypes.Length
                                : BoxTypes.Unknown;
                        boxNumber++;     //TODO might cause issues if the BoxType was found to be unknown?
                        break;
                    }
                }
                //If at end of list
                else
                {
                    switch (prev)
                    {
                    case (BoxTypes.Length):
                        current = BoxTypes.Type;
                        break;

                    case (BoxTypes.Type):
                        string typeData = File.ReadAllText(list[index - 1].Path);
                        switch (new FileInfo(list[index].Path).Length)
                        {
                        case (8):
                            //HACK just look at this. It basically has to validate the entire box before checking aaaaaaaaaaaaa
                            if (index >= 2 && (list[index - 2] as ISOFileFragment).BoxType == BoxTypes.Length &&      //TODO isn't this (vvv) big endian???????
                                new FileInfo(list[index - 2].Path).Length == 4 && BinaryFileInterpreter.ReadFileAs <uint>(list[index - 2].Path) == 0)
                            {
                                current = BoxTypes.ExtendedLength;
                            }
                            else
                            {
                                goto default;
                            }
                            break;

                        case (16):
                            if (typeData != "uuid")         //HACK this might not be good enough?
                            {
                                goto default;
                            }
                            current = BoxTypes.ExtendedType;
                            break;

                        default:
                            current = BoxTypes.Data;
                            break;
                        }
                        break;

                    case (BoxTypes.ExtendedLength):
                        current = (new FileInfo(list[index].Path).Length == 16)
                                ? BoxTypes.ExtendedType
                                : BoxTypes.Data;
                        break;

                    case (BoxTypes.ExtendedType):
                        current = BoxTypes.Data;
                        break;

                    case (BoxTypes.Data):
                        current = BoxTypes.Length;
                        boxNumber++;
                        break;
                    }
                }

                (list[index] as ISOFileFragment).BoxType   = current;
                (list[index] as ISOFileFragment).BoxNumber = boxNumber;
                return(false);
            }
        }