//Need more test because different result with old method. Most of diff its Art/ and others but sometimes see Metadata/parti...Probably async loads private void ParseByFiles(Dictionary <string, FileInformation> dictionary) { if (working) { return; } working = true; Task.Run(() => { debugInformation.TickAction(() => { if (Settings.ParallelParsing) { Parallel.ForEach(dictionary, pair => { var text = pair.Key; if (Settings.LoadOnlyMetadata && text[0] != 'M') { return; } if (text.Contains("@")) { text = text.Split('@')[0]; } CheckForPreload(text); }); } else { foreach (var pair in dictionary) { var text = pair.Key; if (Settings.LoadOnlyMetadata && text[0] != 'M') { continue; } if (text.Contains("@")) { text = text.Split('@')[0]; } CheckForPreload(text); } } lock (_locker) { DrawAlerts = alerts.OrderBy(x => x.Value.Text).Select(x => x.Value).ToList(); } }); working = false; }); }
public void Tick() { try { if (IsForeGroundLast != IsForeGroundCache) { IsForeGroundLast = IsForeGroundCache; eIsForegroundChanged(IsForeGroundCache); } AreaInstance.CurrentHash = Game.CurrentAreaHash; if (LeftPanel.Used) { LeftPanel.StartDrawPoint = LeftCornerMap.Value; } if (UnderPanel.Used) { UnderPanel.StartDrawPoint = UnderCornerMap.Value; } //Every 3 frame check area change and force garbage collect every new area if (Core.FramesCount % 3 == 0 && Area.RefreshState()) { debClearCache.TickAction(() => { RemoteMemoryObject.Cache.TryClearCache(); }); } InGame = Game.InGame; //Game.IngameState.InGame; IsLoading = Game.IsLoading; if (InGame) { if (!WasInGame) { // when core is created too early during game launch it will be missing some files pointers as they weren't loaded yet Game.ReloadFiles(); WasInGame = true; } Game.IngameState.UpdateData(); CachedValue.Latency = Game.IngameState.CurLatency; } } catch (Exception e) { DebugWindow.LogError(e.ToString()); } }
public void Tick() { try { if (IsForeGroundLast != IsForeGroundCache) { IsForeGroundLast = IsForeGroundCache; eIsForegroundChanged(IsForeGroundCache); } AreaInstance.CurrentHash = Game.CurrentAreaHash; if (LeftPanel.Used) { LeftPanel.StartDrawPoint = LeftCornerMap.Value; } if (UnderPanel.Used) { UnderPanel.StartDrawPoint = UnderCornerMap.Value; } //Every 3 frame check area change and force garbage collect every new area if (Core.FramesCount % 3 == 0 && Area.RefreshState()) { debClearCache.TickAction(() => { RemoteMemoryObject.Cache.TryClearCache(); }); } InGame = Game.InGame; //Game.IngameState.InGame; IsLoading = Game.IsLoading; if (InGame) { CachedValue.Latency = Game.IngameState.CurLatency; } } catch (Exception e) { DebugWindow.LogError(e.ToString()); } }
public unsafe void Render(GameController _gameController) { if (plugins == null) { plugins = core.pluginManager.Plugins.OrderBy(x => x.Name).ToList(); } if (_CoreSettings.ShowDemoWindow) { demo_window = true; ImGui.ShowDemoWindow(ref demo_window); _CoreSettings.ShowDemoWindow.Value = demo_window; } if (_CoreSettings.ShowDebugWindow) { debugInformation.TickAction(DebugWindowRender); } if (_CoreSettings.MainMenuKeyToggle.PressedOnce()) { _CoreSettings.Enable.Value = !_CoreSettings.Enable; if (_CoreSettings.Enable) { core.Graphics.LowLevel.ImGuiRender.TransparentState = false; plugins = core.pluginManager.Plugins.OrderBy(x => x.Name).ToList(); } else { _settingsContainer.SaveCoreSettings(); if (_gameController != null) { foreach (var plugin in core.pluginManager.Plugins) { _settingsContainer.SaveSettings(plugin.Plugin); } } core.Graphics.LowLevel.ImGuiRender.TransparentState = true; } } if (!_CoreSettings.Enable) { return; } ImGui.PushFont(core.Graphics.Font.Atlas); ImGui.SetNextWindowSize(new Vector2(800, 600), ImGuiCond.Appearing); var pOpen = _CoreSettings.Enable.Value; ImGui.Begin("HUD S3ttings", ref pOpen); _CoreSettings.Enable.Value = pOpen; ImGui.BeginChild("Left menu window", new Vector2(PluginNameWidth, ImGui.GetContentRegionAvail().Y), true, ImGuiWindowFlags.None); if (ImGui.Selectable("Core", _index == -1)) { _index = -1; Selected = CoreSettings; } ImGui.Separator(); if (ImGui.Selectable("ThemeEditor", _index == -2)) { _index = -2; Selected = () => { themeEditor.DrawSettingsMenu(); }; } if (_gameController != null && core.pluginManager != null) { for (var index = 0; index < plugins.Count; index++) { var plugin = plugins[index]; var temp = plugin.IsEnable; if (ImGui.Checkbox($"##{plugin.Name}{index}", ref temp)) { plugin.TurnOnOffPlugin(temp); } ImGui.SameLine(); if (ImGui.Selectable(plugin.Name, _index == index)) { _index = index; Selected = () => plugin.DrawSettings(); } } } ImGui.EndChild(); ImGui.SameLine(); ImGui.BeginChild("Options", ImGui.GetContentRegionAvail(), true); Selected?.Invoke(); ImGui.EndChild(); ImGui.End(); ImGui.PopFont(); }