public ZnmViewModel(IntPtr instance, EliteAPI api, ThirdPartyTools tools) { this.instance = instance; this.api = api; this.tools = tools; canexecute = true; TrapperButtonEnabled = true; TradeButtonEnabled = true; TrapperButtonText = "Start"; TradeButtonText = "Trade"; BlankSoulPlateCount = GetItemQuantities(18722); SoulPlateCount = GetItemQuantities(2477); uint result1 = GetItemQuantities(18721); uint result2 = GetItemQuantities(18724); TrapperGridVisibilty = Visibility.Hidden; TradeGridVisibilty = Visibility.Hidden; if (result1 > 0) { NqTrapperFound = Visibility.Visible; } else { NqTrapperFound = Visibility.Hidden; } if (result2 > 0) { NqTrapperFound = Visibility.Visible; } else { HqTrapperFound = Visibility.Hidden; } }
public CharacterSelectViewModel() { processList = Process.GetProcessesByName(processName); items = new List <ListBoxItem>(); canExecute = true; Title = "CharacterSelect"; if (processList.Count() != 0) { foreach (Process proc in processList) { ffInstance = CreateInstance((int)proc.Id); thirdPartyTools = new ThirdPartyTools(ffInstance); api = new EliteAPI((int)proc.Id); player = new PlayerTools(ffInstance, api); ListBoxItem temp = new ListBoxItem(); temp.Content = player.Name; items.Add(temp); } } else { //Title = "Game isn't running, or something's f****d."; } }
public TrustViewModel(IntPtr instance, EliteAPI api, ThirdPartyTools tools) { this.instance = instance; this.api = api; this.tools = tools; TopText = "Save file not loaded."; SaveButtonEnabled = false; ListRemoveButtonEnabled = false; TrustRemoveButtonEnabled = false; SummonButtonEnabled = false; canexecute = true; }
public MainWindow() { InitializeComponent(); if (!IsRunningAsAdministrator()) { // Setting up start info of the new process of the same application ProcessStartInfo processStartInfo = new ProcessStartInfo(Assembly.GetEntryAssembly().CodeBase); // Using operating shell and setting the ProcessStartInfo.Verb to “runas” will let it run as admin processStartInfo.UseShellExecute = true; processStartInfo.Verb = "runas"; // Start the application as new process Process.Start(processStartInfo); // Shut down the current (old) process Application.Current.Shutdown(); } else { Window CharacterWindow = new CharacterSelectWindow(); CharacterSelectViewModel vm = (CharacterSelectViewModel)CharacterWindow.DataContext; vm.OnRequestClose += (s, e) => CharacterWindow.Close(); CharacterWindow.ShowDialog(); this.Title = CharacterWindow.Title; if (Title != "CharacterSelect") { processList = Process.GetProcessesByName(processName); foreach (Process proc in processList) { if (proc.MainWindowTitle == this.Title) { ffInstance = CreateInstance((int)proc.Id); thirdPartyTools = new ThirdPartyTools(ffInstance); api = new EliteAPI((int)proc.Id); } } } else { MessageBox.Show("A character wasn't selected or the game isn't running.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); this.Close(); } } }
public EschaViewModel(IntPtr instance, EliteAPI api, ThirdPartyTools tools) { this.instance = instance; this.api = api; this.tools = tools; UpdateItemQuantities(); canExecute = true; ProgressVisibility = Visibility.Hidden; Progress = 0; ProgressMax = 0; ButtonText = "Start"; ButtonEnabled = true; StopVisibility = Visibility.Hidden; isStopped = false; }