示例#1
0
 protected override void Load(TemplatesDatabase.ValuesDictionary valuesDictionary)
 {
     base.Load(valuesDictionary);
     subsystemTerrain     = Project.FindSubsystem <SubsystemTerrain>(true);
     subsystemElectricity = Project.FindSubsystem <SubsystemElectricity>(true);
     mCommandEngine       = Project.FindSubsystem <SubsystemCommandEngine>(true);
 }
        public CommandHelperDialog(SubsystemCommandEngine engine)
        {
            commandEngine = engine;

            XElement node = ContentManager.Get <XElement>("Dialogs/CommandHelperDialog");

            WidgetsManager.LoadWidgetContents(this, this, node);
            animals = Children.Find <ButtonWidget>("CommandHelperDialog.ShowAnimals");
            blocks  = Children.Find <ButtonWidget>("CommandHelperDialog.ShowBlocks");
            back    = Children.Find <ButtonWidget>("CommandHelperDialog.Back");

            textBoxAnimal = Children.Find <TextBoxWidget>("CommandHelperDialog.AnimalName");
            textBoxBlock  = Children.Find <TextBoxWidget>("CommandHelperDialog.BlockName");
        }
示例#3
0
        public EditCommandBlockDialog(CommandData data)
        {
            XElement node = ContentManager.Get <XElement>("Dialogs/EditCommandBlockDialog");

            WidgetsManager.LoadWidgetContents(this, this, node);
            textBox      = Children.Find <TextBoxWidget>("EditCommandBlockDialog.TextBox");
            list         = Children.Find <ListPanelWidget>("EditCommandBlockDialog.List");
            okButton     = Children.Find <ButtonWidget>("EditCommandBlockDIalog.OkButton");
            cancelButton = Children.Find <ButtonWidget>("EditCommandBlockDIalog.CancelButton");

            commandData          = data;
            command              = data.Command;
            textBox.Text         = command;
            textBox.TextChanged += TextChanged;

            list.ItemClicked += ListSelected;

            engine = GameManager.Project.FindSubsystem <SubsystemCommandEngine>(true);
        }