Hey all,
I'm receiving the following errors from my custom GFxMoviePlayer scripts:
Heres the areas its referring to:
I'm also having trouble with the WidgetInitialized event, in some cases it states that 'case' cannot be used here when I have one case under another as I have shown here.
Heres the full script:
Any help would be great!
Thanks
I'm receiving the following errors from my custom GFxMoviePlayer scripts:
Code:
(67) Missing '>' in 'switch expression' (37) 'OnResolutionChange' mismatches delegate 'Event Listener' (14) 'MyOptions' : Bad command or expression
Code:
(67) function OnResolutionChange() { switch(MyOptions.GetFloat("selectedResolution")) { case(0): ConsoleCommand("setres 640x480"); break; case(1): ConsoleCommand("setres 800x600"); break; case(2): ConsoleCommand("setres 1024x760"); break; case(3): ConsoleCommand("setres 1152x864"); break; case(4): ConsoleCommand("setres 1280x768"); break; case(5): ConsoleCommand("setres 1280x800"); break; case(6): ConsoleCommand("setres 1280x960"); break; case(7): ConsoleCommand("setres 1280x1024"); break; case(8): ConsoleCommand("setres 1360x768"); break; case(9): ConsoleCommand("setres 1366x768"); break; case(10): ConsoleCommand("setres 1440x900"); break; case(11): ConsoleCommand("setres 1600x900"); break; case(12): ConsoleCommand("setres 1600x1200"); break; case(13): ConsoleCommand("setres 1680x1050"); break; case(14): ConsoleCommand("setres 1920x1080"); break; case(15): ConsoleCommand("setres 1920x1200"); break; default: break; } }
Code:
(37) event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget) { switch(WidgetName) { case ('bloomBtn'): // Bloom Widget bloomBtn = GFxClikWidget(Widget); bloomBtn.AddEventListener('CLIK_select', OnBLOOMBtnChange); break; case ('dofBtn'): // Depth of Field Widget dofBtn = GFxClikWidget(Widget); dofBtn.AddEventListener('CLIK_select', OnDOFBtnChange); break; case ('okBtn'): // OK Button OKButton = GFxClikWidget(Widget); OKButton.AddEventListener('ClIK_click', OnResolutionChange); break; } return true; }
Code:
(14) var GFxClikWidget StartButton; var GFxClikWidget bloomBtn; var GFxClikWidget dofBtn; var GFxClikWidget OKButton; var bool MyOption; function bool Start(optional bool StartPaused = false) { super.Start(); Advance(0); MyOptions = GetVariableObject("_root.options"); return true; }
Heres the full script:
Code:
var GFxClikWidget StartButton; var GFxClikWidget bloomBtn; var GFxClikWidget dofBtn; var GFxClikWidget OKButton; var bool MyOption; function bool Start(optional bool StartPaused = false) { super.Start(); Advance(0); MyOptions = GetVariableObject("_root.options"); return true; } // ** ------- Time for some Widgets!! ------- ** \\ event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget) { switch(WidgetName) { case ('bloomBtn'): // Bloom Widget bloomBtn = GFxClikWidget(Widget); bloomBtn.AddEventListener('CLIK_select', OnBLOOMBtnChange); break; case ('dofBtn'): // Depth of Field Widget dofBtn = GFxClikWidget(Widget); dofBtn.AddEventListener('CLIK_select', OnDOFBtnChange); break; case ('okBtn'): // OK Button OKButton = GFxClikWidget(Widget); OKButton.AddEventListener('ClIK_click', OnResolutionChange); break; } return true; } // ** ------- END Time for some Widgets!! END ------- ** \\ // ** ------- Widget Functions ------- ** \\ function OnBLOOMBtnChange(GFxClikWidget.EventData ev) // BLOOM { MyOption = bloomBtn.GetBool("_selected"); ConsoleCommand("scale toggle Bloom"); `log("bloomBtn has been set to: "@MyOption); } function OnDOFBtnChange(GFxClikWidget.EventData ev) // DOF { MyOption = dofBtn.GetBool("_selected"); ConsoleCommand("scale toggle DepthOfField"); `log("dofBtn has been set to: "@MyOption); } function OnResolutionChange() { switch(MyOptions.GetFloat("selectedResolution")) { case(0): ConsoleCommand("setres 640x480"); break; case(1): ConsoleCommand("setres 800x600"); break; case(2): ConsoleCommand("setres 1024x760"); break; case(3): ConsoleCommand("setres 1152x864"); break; case(4): ConsoleCommand("setres 1280x768"); break; case(5): ConsoleCommand("setres 1280x800"); break; case(6): ConsoleCommand("setres 1280x960"); break; case(7): ConsoleCommand("setres 1280x1024"); break; case(8): ConsoleCommand("setres 1360x768"); break; case(9): ConsoleCommand("setres 1366x768"); break; case(10): ConsoleCommand("setres 1440x900"); break; case(11): ConsoleCommand("setres 1600x900"); break; case(12): ConsoleCommand("setres 1600x1200"); break; case(13): ConsoleCommand("setres 1680x1050"); break; case(14): ConsoleCommand("setres 1920x1080"); break; case(15): ConsoleCommand("setres 1920x1200"); break; default: break; } } // ** ------- END Widget Functions END ------- ** \\ // ** ------ Switch to dark and light menus ------ ** \\ //function to receive External Interface call function optionsScreenAnim() { `log("###### ExternalInterface Call Received #####"); TriggerRemoteKismetEventoptionsScreen('optionsScreenAnim'); } //function to trigger a remote kismet event function TriggerRemoteKismetEventoptionsScreen( name EventName ) { local array<SequenceObject> AllSeqEvents; local Sequence GameSeq; local int i; GameSeq = GetPC().WorldInfo.GetGameSequence(); if (GameSeq != None) { // find any Level Reset events that exist GameSeq.FindSeqObjectsByClass(class'SeqEvent_RemoteEvent', true, AllSeqEvents); // activate them for (i = 0; i < AllSeqEvents.Length; i++) { if(SeqEvent_RemoteEvent(AllSeqEvents[i]).EventName == EventName) SeqEvent_RemoteEvent(AllSeqEvents[i]).CheckActivate(GetPC().WorldInfo, None); } } } //function to receive External Interface call function mainMenuAnim() { `log("###### ExternalInterface Call Received #####"); TriggerRemoteKismetEventmainMenu('mainMenuAnim'); } //function to trigger a remote kismet event function TriggerRemoteKismetEventmainMenu( name EventName ) { local array<SequenceObject> AllSeqEvents; local Sequence GameSeq; local int i; GameSeq = GetPC().WorldInfo.GetGameSequence(); if (GameSeq != None) { // find any Level Reset events that exist GameSeq.FindSeqObjectsByClass(class'SeqEvent_RemoteEvent', true, AllSeqEvents); // activate them for (i = 0; i < AllSeqEvents.Length; i++) { if(SeqEvent_RemoteEvent(AllSeqEvents[i]).EventName == EventName) SeqEvent_RemoteEvent(AllSeqEvents[i]).CheckActivate(GetPC().WorldInfo, None); } } } // ** ------ END Switch to dark and light menus END ------ ** \\ defaultproperties { WidgetBindings.Add((WidgetName="bloomBtn",WidgetClass=class'GFxClikWidget')) WidgetBindings.Add((WidgetName="dofBtn",WidgetClass=class'GFxClikWidget')) WidgetBindings.Add((WidgetName="okBtn",WidgetClass=class'GFxClikWidget')) }
Any help would be great!
Thanks
Comment