//static Security() { Initialize(); } public static void Initialize(BypassActivity parentActivity) { if (CurrentPanel == null) { CurrentPanel = new SecurityPanel(); } CurrentPanel.CurrentActivity = parentActivity; CurrentPanel.SetUpSecurity(); CurrentPanel.AlarmFX = new Effect("SecurityPanel.Alarm", Resource.Raw._169206_security_voice_activating_alarm); CurrentPanel.BoltsClosingFX = new Effect("SecurityPanel.BoltsClosing", Resource.Raw._110538_bolt_closing); CurrentPanel.BoltsOpeningFX = new Effect("SecurityPanel.BoltsOpening", Resource.Raw._213996_bolt_opening); CurrentPanel.SparksFX = new Effect("SecurityPanel.Sparks", Resource.Raw._277314_electricArc); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.BypassTools); SetUpToolButtons(); OutputText = FindViewById <TextView>(Resource.Id.display_bypass_info_detailtext); //SetTagRemovalResult(() => { }); // Has to exist or else we omit that whole infrastructure. Will get *changed* later. // See if the current kit is already in our (local, for now) library, and load it if so. var tkString = Res.SpecificTags.Get(InteractionLibrary.CurrentSpecificTag); if (tkString != null) { ThePlayersToolkit = Toolkit.FromString(tkString, InteractionLibrary.CurrentSpecificTag); } else if (InteractionLibrary.CurrentSpecificTag == null) // I.E. this is a "launch directly" order. { ThePlayersToolkit = new MemorylessToolkit(); } else { ThePlayersToolkit = new Toolkit(InteractionLibrary.CurrentSpecificTag); } SecurityPanel.Initialize(this); InfoPanel = new BypassInfoPanel(this, SecurityPanel.CurrentPanel); SetTypeface(Resource.Id.display_bypass_info_headertext, "FTLTLT.TTF"); CurrentStage = GestureRecognizerStage.NullStage; WhistleFX = new Effect("Whistle", Resource.Raw._98195_whistling); FindViewById(Resource.Id.choice_bypass_examine).CallOnClick(); OnBypassSuccessful += (o, e) => { OnBypassCompleted.Raise(e.Value); }; OnBypassFailed += (o, e) => { OnBypassCompleted.Raise(e.Value); }; }
public BypassInfoPanel(Activity parent, SecurityPanel securityPanel) { Parent = parent; SecurityPanel = securityPanel; SelfView = Parent.FindViewById <RelativeLayout>(Resource.Id.display_bypass_information); BackgroundImageView = SelfView.FindViewById <ImageView>(Resource.Id.display_bypass_info_picture); BackgroundOverlay = SelfView.FindViewById <ImageView>(Resource.Id.display_bypass_info_overlay); HeaderTextView = SelfView.FindViewById <TextView>(Resource.Id.display_bypass_info_headertext); DetailTextView = SelfView.FindViewById <TextView>(Resource.Id.display_bypass_info_detailtext); //Canvas = SelfView.FindViewById<SurfaceView>(Resource.Id.display_bypass_canvas); InSituMeasure = SelfView.FindViewById <ImageButton>(Resource.Id.display_bypass_insituMeasure); InSituSolder = SelfView.FindViewById <ImageButton>(Resource.Id.display_bypass_insituSolder); InSituWirecut = SelfView.FindViewById <ImageButton>(Resource.Id.display_bypass_insituWirecut); InSituCancel = SelfView.FindViewById <ImageButton>(Resource.Id.display_bypass_insituCancel); //if (new View[] { SelfView, BackgroundImageView, HeaderTextView, DetailTextView, Canvas, ModalOne, ModalTwo, ModalThree} if (new View[] { SelfView, BackgroundImageView, HeaderTextView, DetailTextView, InSituMeasure, InSituSolder, InSituWirecut, InSituCancel } .Any(v => v == null)) { Log.Error("Bypass|InfoPanel", "Problem locating all the sub-views needed for the Bypass Info Panel."); } InSituCancel.Click += (o, e) => { FirstNode = SecondNode = SecurityPanelNode.Unknown; SetUpExamineMode(); RecognizeNode(SecurityPanelNode.Unknown); }; InSituMeasure.Click += (o, e) => { var firstNode = FirstNode; var secondNode = SecondNode; FirstNode = SecondNode = SecurityPanelNode.Unknown; // Allows it to be assessed anew (as if rescanned under the new mode) SetUpMeasureMode(); RecognizeNode(firstNode); Task.Delay(250).Wait(); RecognizeNode(secondNode); }; InSituSolder.Click += (o, e) => { var firstNode = FirstNode; var secondNode = SecondNode; FirstNode = SecondNode = SecurityPanelNode.Unknown; // Allows it to be assessed anew (as if rescanned under the new mode) SetUpSolderMode(); RecognizeNode(firstNode); Task.Delay(500).Wait(); RecognizeNode(secondNode); }; InSituWirecut.Click += (o, e) => { var firstNode = FirstNode; var secondNode = SecondNode; FirstNode = SecondNode = SecurityPanelNode.Unknown; // Allows it to be assessed anew (as if rescanned under the new mode) SetUpWirecutterMode(); RecognizeNode(firstNode); Task.Delay(500).Wait(); RecognizeNode(secondNode); }; SetUpExamineMode(); }