예제 #1
0
파일: MainForm.cs 프로젝트: adamuchi/slate
        public MainForm()
        {
            InitializeComponent();
            InitializeMenuItems();
            InitializeEvents();

            SlateCore.RegisterForm(this);
        }
예제 #2
0
파일: SlateCore.cs 프로젝트: adamuchi/slate
        public SlateCore()
        {
            instance = this;

            // Get our config
            Config = LoadOrCreateConfig();

            // Show the main form
            var form = new MainForm();

            form.Show();
        }
예제 #3
0
파일: MainForm.cs 프로젝트: adamuchi/slate
        private void OpenGameTab(string worldName, string characterName)
        {
            var world = SlateCore.Config.GetWorld(worldName);

            if (world == null)
            {
                var message = $"Cannot find world \"{worldName}\"";
                SlateCore.Log(message, SlateCore.LogLevel.Error);
                MessageBox.Show(message, "Error loading world", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            var character = world.GetCharacter(characterName);

            if (character == null)
            {
                var message = $"Cannot find character \"{characterName}\" in world \"{worldName}\"";
                SlateCore.Log(message, SlateCore.LogLevel.Error);
                MessageBox.Show(message, "Error loading world", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            MessageBox.Show($"Open \"{world.Name}\", \"{character.Name}\"");
        }