Ejemplo n.º 1
0
        public override void Initialize()
        {
            base.Initialize();

            Settings = new PersistentObject<BackpackSettings>(new BackpackSettings());
            Settings.SetFilePathAndLoad(Path.Combine(this.ModuleDataDir, "settings.xml"));
        }
Ejemplo n.º 2
0
        public override void Initialize()
        {
            base.Initialize();
            Settings = new PersistentObject<GrangerSettings>(new GrangerSettings());
            Settings.SetFilePathAndLoad(Path.Combine(base.ModuleDataDir, "settings.xml"));

            //init database
            DBSchema.SetConnectionString(Path.Combine(this.ModuleDataDir, "grangerDB.s3db"));

            SQLiteHelper.CreateTableIfNotExists(DBSchema.HorsesSchema, DBSchema.HorsesTableName, DBSchema.ConnectionString);
            SQLiteHelper.ValidateTable(DBSchema.HorsesSchema, DBSchema.HorsesTableName, DBSchema.ConnectionString);

            SQLiteHelper.CreateTableIfNotExists(DBSchema.TraitValuesSchema, DBSchema.TraitValuesTableName, DBSchema.ConnectionString);
            SQLiteHelper.ValidateTable(DBSchema.TraitValuesSchema, DBSchema.TraitValuesTableName, DBSchema.ConnectionString);

            SQLiteHelper.CreateTableIfNotExists(DBSchema.HerdsSchema, DBSchema.HerdsTableName, DBSchema.ConnectionString);
            SQLiteHelper.ValidateTable(DBSchema.HerdsSchema, DBSchema.HerdsTableName, DBSchema.ConnectionString);

            Context = new GrangerContext(new SQLiteConnection(DBSchema.ConnectionString));

            GrangerUI = new FormGrangerMain(this, Settings, Context);

            LogFeedMan = new LogFeedManager(this, Context);
            LogFeedMan.UpdatePlayers(Settings.Value.CaptureForPlayers);
            GrangerUI.Granger_PlayerListChanged += GrangerUI_Granger_PlayerListChanged;
        }
Ejemplo n.º 3
0
        public override void Initialize()
        {
            base.Initialize();
            Settings = new PersistentObject<TriggersSettings>(new TriggersSettings());
            Settings.SetFilePathAndLoad(Path.Combine(this.ModuleDataDir, "settings.xml"));

            const string queueSoundModFileName = "QueueSoundMod.txt";
            LogQueueParseHelper.Build(
                Path.Combine(this.ModuleDataDir, queueSoundModFileName),
                Path.Combine(this.ModuleAssetDir, queueSoundModFileName));

            SoundBank.ChangeGlobalVolume(Settings.Value.GlobalVolume);
            MainUI = new FormTriggersMain(this);
            foreach (var name in Settings.Value.ActiveCharacterNames.ToArray())
            {
                AddManager(name);
            }

            if (!Settings.Value.SoundNotifyImportCompleted)
            {
                try
                {
                    var importer = new SoundTriggersImporter(this);
                    var executed = importer.Execute();
                    if (executed)
                    {
                        importer.RenameDir();
                        Settings.Value.SoundNotifyImportCompleted = true;
                        Settings.Save();
                        MainUI.Shown += (sender, args) =>
                                       {
                                           MessageBox.Show(
                                               "Existing Sound Triggers have been imported into new Triggers feature. " +
                                               "If there were any errors or imported triggers are incorrect, please post a bug report in forum thread. " +
                                               "Importing can be repeated if needed, nothing is lost.",
                                               "Wurm Assistant Sound Triggers Importer",
                                               MessageBoxButtons.OK,
                                               MessageBoxIcon.Asterisk);
                                           Application.Restart();
                                       };

                    }
                }
                catch (Exception exception)
                {
                    Logger.LogError("Unknown error while importing Sound Triggers", this, exception);
                    MessageBox.Show(
                        "There was an unforseen error while trying to import Sound Triggers settings to new Triggers. Please report this as soon as possible. Process can be repeated, nothing is lost!", 
                        "OH NOES!", 
                        MessageBoxButtons.OK, 
                        MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 4
0
 public override void Initialize(PlayerTimersGroup parentGroup, string player, string timerId,
     WurmServer.ServerInfo.ServerGroup serverGroup, string compactId)
 {
     base.Initialize(parentGroup, player, timerId, serverGroup, compactId);
     Settings = new PersistentObject<JunkSaleTimerSettings>(new JunkSaleTimerSettings());
     Settings.SetFilePathAndLoad(SettingsSavePath);
     TimerDisplay.ShowSkill = true;
     VerifyMoneyAmountAgainstCd();
     UpdateMoneyCounter();
     InitCompleted = true;
 }
Ejemplo n.º 5
0
        //defQueueSoundPlayer = new SB_SoundPlayer(Path.Combine(ParentModule.ModuleAssetDir, "defQueueSound.ogg"));
        //defQueueSoundPlayer.Load(volumeAdjust: false);

        public TriggerManager(ModuleTriggers parentModule, string player, string moduleDataDir)
        {
            this._parentModule = parentModule;
            Player = player;
            string thisNotifierDataDir = Path.Combine(moduleDataDir, player);
            if (!Directory.Exists(thisNotifierDataDir)) Directory.CreateDirectory(thisNotifierDataDir);

            Settings = new PersistentObject<NotifierSettings>(new NotifierSettings());
            Settings.SetFilePathAndLoad(Path.Combine(thisNotifierDataDir, "settings.xml"));

            //create control for Module UI
            _controlUi = new UcPlayerTriggersController();

            //create this notifier UI
            _triggersConfigUi = new FormTriggersConfig(this);

            UpdateMutedState();
            _controlUi.label1.Text = player;
            _controlUi.buttonMute.Click += ToggleMute;
            _controlUi.buttonConfigure.Click += Configure;
            _controlUi.buttonRemove.Click += Stop;

            WurmLogs.SubscribeToLogFeed(this.Player, OnNewLogEvents);
        }
Ejemplo n.º 6
0
        public override void Initialize(PlayerTimersGroup parentGroup, string player, string timerId, Aldurcraft.WurmOnline.WurmState.WurmServer.ServerInfo.ServerGroup serverGroup, string compactId)
        {
            base.Initialize(parentGroup, player, timerId, serverGroup, compactId);
            TimerDisplay.SetCooldown(TimeSpan.FromDays(1));

            Settings = new PersistentObject<MeditPathSettings>(new MeditPathSettings());
            Settings.SetFilePathAndLoad(SettingsSavePath);

            MoreOptionsAvailable = true;

            PerformAsyncInits();
        }
Ejemplo n.º 7
0
 /// <summary>
 /// initialize this class by providing directory path to where cache should be saved
 /// </summary>
 /// <param name="dataDir"></param>
 public static void Initialize(string dataDir)
 {
     _settings = new PersistentObject<PlayerServerTrackerState>(new PlayerServerTrackerState());
     _settings.SetFilePathAndLoad(Path.Combine(dataDir, "PlayerServerTrackerState.xml"));
     _initializedTcs.SetResult(true);
 }