]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/plugin.cpp
refactored plugin api; refactored callback library; added signals library
[xonotic/netradiant.git] / radiant / plugin.cpp
index 3cf53115310f9a187fbe547c1f83c3e60d39fd5f..1e57eeb3375701e02c78d628e90a1937f0f4a258 100644 (file)
@@ -93,6 +93,33 @@ const char* GameDescription_getRequiredKeyValue(const char* key)
   return g_pGameDescription->getRequiredKeyValue(key);
 }
 
+const char* getMapName()
+{
+  return Map_Name(g_map);
+}
+
+scene::Node& getMapWorldEntity()
+{
+  return Map_FindOrInsertWorldspawn(g_map);
+}
+
+VIEWTYPE XYWindow_getViewType()
+{
+  return g_pParentWnd->GetXYWnd()->GetViewType();
+}
+
+Vector3 XYWindow_windowToWorld(const WindowVector& position)
+{
+  Vector3 result(0, 0, 0);
+  g_pParentWnd->GetXYWnd()->XY_ToPoint(static_cast<int>(position.x()), static_cast<int>(position.y()), result);
+  return result;
+}
+
+const char* TextureBrowser_getSelectedShader()
+{
+  return TextureBrowser_GetSelectedShader(GlobalTextureBrowser());
+}
+
 class RadiantCoreAPI
 {
   _QERFuncTable_1 m_radiantcore;
@@ -110,6 +137,10 @@ public:
     m_radiantcore.getGameName = &gamename_get;
     m_radiantcore.getGameMode = &gamemode_get;
 
+    m_radiantcore.getMapName = &getMapName;
+    m_radiantcore.getMapWorldEntity = getMapWorldEntity;
+    m_radiantcore.getGridSize = GetGridSize;
+
     m_radiantcore.getGameDescriptionKeyValue = &GameDescription_getKeyValue;
     m_radiantcore.getRequiredGameDescriptionKeyValue = &GameDescription_getRequiredKeyValue;
 
@@ -122,6 +153,12 @@ public:
     m_radiantcore.attachGameModeObserver = Radiant_attachGameModeObserver;
     m_radiantcore.detachGameModeObserver = Radiant_detachGameModeObserver;
 
+    m_radiantcore.XYWindowMouseDown_connect = XYWindowMouseDown_connect;
+    m_radiantcore.XYWindowMouseDown_disconnect = XYWindowMouseDown_disconnect;
+    m_radiantcore.XYWindow_getViewType = XYWindow_getViewType;
+    m_radiantcore.XYWindow_windowToWorld = XYWindow_windowToWorld;
+    m_radiantcore.TextureBrowser_getSelectedShader = TextureBrowser_getSelectedShader;
+
     m_radiantcore.m_pfnMessageBox = &gtk_MessageBox;
     m_radiantcore.m_pfnFileDialog = &file_dialog;
     m_radiantcore.m_pfnColorDialog = &color_dialog;