Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ----------------------------------------------------------------------------
- class CMyModPopupCallback extends IModUiConfirmPopupCallback {
- public function OnConfirmed(action: String) {
- switch (action) {
- case "quit":
- theGame.GetGuiManager().ShowNotification("Confirmed!");
- break;
- }
- }
- }
- // ----------------------------------------------------------------------------
- class MyClass {
- private var confirmPopup: CModUiActionConfirmation;
- private var quitConfirmCallback: CMyModPopupCallback;
- public function popupRequest() {
- var msgTitle: String;
- var msgText: String;
- //SetIgnoreInput(true);
- if (confirmPopup) { delete confirmPopup; }
- confirmPopup = new CModUiActionConfirmation in this;
- msgTitle = "Popup title";
- msgText = "Popup text";
- /* public function open(caller: IModUiConfirmPopupCallback, title: String, msg: String, action: String) */
- confirmPopup.open(quitConfirmCallback, msgTitle, msgText, "quit");
- theGame.GetGuiManager().ShowNotification("opened!");
- }
- }
- // ----------------------------------------------------------------------------
- exec function test_mypopup() {
- var myClassObj : MyClass;
- myClassObj = new MyClass in thePlayer;
- theGame.GetGuiManager().ShowNotification("created!");
- myClassObj.popupRequest();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement