| 122 | } |
| 123 | |
| 124 | void IntrinsicEdManagerWindowAsset::initContextMenu(QMenu* p_ContextMenu) |
| 125 | { |
| 126 | IntrinsicEdManagerWindowBase::initContextMenu(p_ContextMenu); |
| 127 | |
| 128 | QTreeWidgetItem* currIt = _ui.resourceView->currentItem(); |
| 129 | Dod::Ref resRef = _itemToResourceMapping[currIt]; |
| 130 | |
| 131 | if (resRef.isValid()) |
| 132 | { |
| 133 | p_ContextMenu->addSeparator(); |
| 134 | |
| 135 | QAction* compileAsset = new QAction(IntrinsicEd::getIcon("Asset"), |
| 136 | "Compile " + _resourceName, this); |
| 137 | p_ContextMenu->addAction(compileAsset); |
| 138 | QObject::connect(compileAsset, SIGNAL(triggered()), this, |
| 139 | SLOT(onCompileAsset())); |
| 140 | } |
| 141 | else if (currIt->text(0u) == "Textures") |
| 142 | { |
| 143 | p_ContextMenu->addSeparator(); |
| 144 | |
| 145 | QAction* compileAsset = new QAction(IntrinsicEd::getIcon("Texture"), |
| 146 | "Compile All Textures", this); |
| 147 | p_ContextMenu->addAction(compileAsset); |
| 148 | QObject::connect(compileAsset, SIGNAL(triggered()), this, |
| 149 | SLOT(onCompileAllTextures())); |
| 150 | } |
| 151 | else if (currIt->text(0u) == "Meshes") |
| 152 | { |
| 153 | p_ContextMenu->addSeparator(); |
| 154 | |
| 155 | QAction* compileAsset = |
| 156 | new QAction(IntrinsicEd::getIcon("Mesh"), "Compile All Meshes", this); |
| 157 | p_ContextMenu->addAction(compileAsset); |
| 158 | QObject::connect(compileAsset, SIGNAL(triggered()), this, |
| 159 | SLOT(onCompileAllMeshes())); |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | void IntrinsicEdManagerWindowAsset::onCompileAsset() |
| 164 | { |