Ejemplo n.º 1
0
        /// <summary>
        /// Quick method to return a pre-defined conversation string from Data.ovl
        /// </summary>
        /// <param name="index">index into string array (use DataOvlReference.CHUNK__PHRASES_CONVERSATION)</param>
        /// <returns>associated string</returns>
        public string GetConversationStr(DataOvlReference.CHUNK__PHRASES_CONVERSATION index)
        {
            char[] trimChars = new[] { '"' };
            string convStr   = dataOvlRef.GetStringFromDataChunkList(DataOvlReference.DataChunkName.PHRASES_CONVERSATION, (int)index).Trim();

            convStr = convStr.Trim(trimChars);
            return(convStr);
        }
Ejemplo n.º 2
0
        public string GetLocationName(SmallMapReferences.SingleMapReference.Location location)
        {
            Func <DataOvlReference.LOCATION_STRINGS, string> getLocationNameStr = delegate(DataOvlReference.LOCATION_STRINGS index)
            {
                return(dataRef.GetStringFromDataChunkList(DataOvlReference.DataChunkName.LOCATION_NAMES, (int)index));
            };

            // filthy way to convert our more commonly used Location enum to the less used LOCATION_STRINGS
            // they didn't even bother having them all match, and then decided to leave some out
            DataOvlReference.LOCATION_STRINGS newLocStrEnum = (DataOvlReference.LOCATION_STRINGS)Enum.Parse(typeof(DataOvlReference.LOCATION_STRINGS), location.ToString());

            // if the DataOVL didn't provide a name, then we are forced to set our own... :(
            if ((int)newLocStrEnum < 0)
            {
                switch (newLocStrEnum)
                {
                case DataOvlReference.LOCATION_STRINGS.Suteks_Hut:
                    return("SUTEK'S HUT");

                case DataOvlReference.LOCATION_STRINGS.SinVraals_Hut:
                    return("SIN VRAAL'S HUT");

                case DataOvlReference.LOCATION_STRINGS.Grendels_Hut:
                    return("GRENDAL'S HUT");

                case DataOvlReference.LOCATION_STRINGS.Lord_Britishs_Castle:
                    return("LORD BRITISH'S CASTLE");

                case DataOvlReference.LOCATION_STRINGS.Palace_of_Blackthorn:
                    return("PALACE OF BLACKTHORN");

                default:
                    throw new Exception("Ummm asked for a location name and wasn't on the guest list.");
                }
            }
            else
            {
                return(getLocationNameStr(newLocStrEnum));
            }
        }