public string this[string key] { get { // compatibility requires key to be ToUpper-ed key = key.ToUpper(); return(internalDict[key]); } set { key = key.ToUpper(); internalDict[key] = value; TextHook.RemoveCache(key); } }
static Game() { //CustomGXTs = new Dictionary<string, string>(); CustomGXTs = new TextDictionary(); TextHook.RegisterCallback(key => { if (CustomGXTs.ContainsKey(key)) { return(CustomGXTs[key]); } return(null); }); #if GTA_SA GamePad = new Pad(new IntPtr(0xB73458)); GamePad2 = new Pad(new IntPtr(0xB7358C)); #endif InstallFolder = System.Windows.Forms.Application.StartupPath; }
void OnEnable() { targetHook = (TextHook)target; categoryData = new Dictionary <string, CategoryData>(); var categorySet = new HashSet <string>(); var entryIndex = 0; foreach (KeyValuePair <string, Dictionary <string, string> > entry in GameValueRegistry.registry) { var attributeNames = new List <string>(); var attributeTitles = new List <string>(); categorySet.Add(entry.Key); var innerIndex = 0; foreach (KeyValuePair <string, string> innerEntry in entry.Value) { if (innerEntry.Key == targetHook.entryName) { valueIndex = innerIndex; categoryIndex = entryIndex; } attributeNames.Add(innerEntry.Key); attributeTitles.Add(innerEntry.Value); innerIndex++; } categoryData.Add(entry.Key, new CategoryData(attributeNames.ToArray(), attributeTitles.ToArray())); entryIndex++; } categories = categorySet.ToArray(); previousCategoryIndex = categoryIndex; }
public MyContextFactory(TextHook textHook) { this.textHook = textHook; }