2011-03-31 11:23:58 +08:00
|
|
|
/****************************************************************************
|
2014-01-07 11:25:07 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2013-02-02 15:05:30 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
https://axys1.github.io/
|
2013-02-02 15:05:30 +08:00
|
|
|
|
2011-03-31 11:23:58 +08:00
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
2013-02-02 15:05:30 +08:00
|
|
|
|
2011-03-31 11:23:58 +08:00
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
2013-02-02 15:05:30 +08:00
|
|
|
|
2011-03-31 11:23:58 +08:00
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
2014-05-17 05:36:00 +08:00
|
|
|
#include "platform/CCCommon.h"
|
2011-03-31 11:23:58 +08:00
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2019-10-25 16:40:30 +08:00
|
|
|
#import <UIKit/UIAlertController.h>
|
|
|
|
#import <UIKit/UIWindow.h>
|
2014-04-30 08:37:36 +08:00
|
|
|
#include "base/CCDirector.h"
|
2014-04-27 01:35:57 +08:00
|
|
|
#include "base/CCConsole.h"
|
2011-03-31 11:23:58 +08:00
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_BEGIN
|
2011-03-31 11:23:58 +08:00
|
|
|
|
2013-07-24 10:46:13 +08:00
|
|
|
// ios no MessageBox, use log instead
|
2021-12-28 11:00:34 +08:00
|
|
|
void ccMessageBox(const char* msg, const char* title)
|
2011-03-31 11:23:58 +08:00
|
|
|
{
|
2015-12-29 07:59:36 +08:00
|
|
|
// only enable it on iOS.
|
|
|
|
// FIXME: Implement it for tvOS
|
2022-07-15 19:17:01 +08:00
|
|
|
#if !defined(AX_TARGET_OS_TVOS)
|
2021-12-28 11:00:34 +08:00
|
|
|
NSString* tmpTitle = (title) ? [NSString stringWithUTF8String:title] : nil;
|
|
|
|
NSString* tmpMsg = (msg) ? [NSString stringWithUTF8String:msg] : nil;
|
2019-10-25 16:40:30 +08:00
|
|
|
|
|
|
|
UIAlertController* alertController = [UIAlertController alertControllerWithTitle:tmpTitle
|
2021-12-28 11:00:34 +08:00
|
|
|
message:tmpMsg
|
|
|
|
preferredStyle:UIAlertControllerStyleAlert];
|
2019-10-25 16:40:30 +08:00
|
|
|
|
2021-12-28 11:00:34 +08:00
|
|
|
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK"
|
|
|
|
style:UIAlertActionStyleDefault
|
|
|
|
handler:^(UIAlertAction* action){
|
|
|
|
}];
|
2019-10-25 16:40:30 +08:00
|
|
|
|
|
|
|
[alertController addAction:defaultAction];
|
|
|
|
auto rootViewController = [UIApplication sharedApplication].windows[0].rootViewController;
|
|
|
|
[rootViewController presentViewController:alertController animated:YES completion:nil];
|
2015-12-29 07:59:36 +08:00
|
|
|
#endif
|
2011-03-31 11:23:58 +08:00
|
|
|
}
|
|
|
|
|
2021-12-28 11:00:34 +08:00
|
|
|
void LuaLog(const char* format)
|
2012-04-26 13:05:05 +08:00
|
|
|
{
|
2013-12-18 17:47:20 +08:00
|
|
|
puts(format);
|
2012-04-26 13:05:05 +08:00
|
|
|
}
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_END
|