#include "DeerStudio/StudioAPI/Debug.h"
#include "DeerRender/Log.h"

#include "angelscript.h"
#include "imgui.h"

namespace Deer {
	namespace StudioAPI {

		void errorCallback_angelscript(const asSMessageInfo* msg, void* param) {
			if (msg->type == asMSGTYPE_WARNING) {
				DEER_EDITOR_ENGINE_WARN("{0}:{1}:{2}) : {3}", msg->section,
				                        msg->row, msg->col, msg->message);
			} else if (msg->type == asMSGTYPE_INFORMATION) {
				DEER_EDITOR_ENGINE_INFO("{0}:{1}:{2}) : {3}", msg->section,
				                         msg->row, msg->col, msg->message);
			} else if (msg->type == asMSGTYPE_ERROR) {
				DEER_EDITOR_ENGINE_ERROR("{0}:{1}:{2}) : {3}", msg->section,
				                         msg->row, msg->col, msg->message);
			}else {
				DEER_EDITOR_ENGINE_INFO("{0}:{1}:{2}) : {3}", msg->section,
				                         msg->row, msg->col, msg->message);
			}
		}

		void print(std::string& msg) {
			DEER_EDITOR_ENGINE_INFO("{0}", msg.c_str());
		}

	} // namespace StudioAPI
} // namespace Deer