+ // tweaking: when right clic dropping a light entity, ask for light value in a custom dialog box
+ // see SF bug 105383
+
+ if (g_pGameDescription->mGameType == "hl") {
+ // FIXME - Hydra: really we need a combined light AND color dialog for halflife.
+ if (string_equal_nocase(name, "light")
+ || string_equal_nocase(name, "light_environment")
+ || string_equal_nocase(name, "light_spot")) {
+ int intensity = g_iLastLightIntensity;
+
+ if (DoLightIntensityDlg(&intensity) == eIDOK) {
+ g_iLastLightIntensity = intensity;
+ char buf[30];
+ sprintf(buf, "255 255 255 %d", intensity);
+ Node_getEntity(node)->setKeyValue("_light", buf);
+ }
+ }
+ } else if (string_equal_nocase(name, "light")) {
+ if (g_pGameDescription->mGameType != "doom3") {
+ int intensity = g_iLastLightIntensity;
+
+ if (DoLightIntensityDlg(&intensity) == eIDOK) {
+ g_iLastLightIntensity = intensity;
+ char buf[10];
+ sprintf(buf, "%d", intensity);
+ Node_getEntity(node)->setKeyValue("light", buf);
+ }
+ } else if (brushesSelected) { // use workzone to set light position/size for doom3 lights, if there are brushes selected
+ AABB bounds(Doom3Light_getBounds(workzone));
+ StringOutputStream key(64);
+ key << bounds.origin[0] << " " << bounds.origin[1] << " " << bounds.origin[2];
+ Node_getEntity(node)->setKeyValue("origin", key.c_str());
+ key.clear();
+ key << bounds.extents[0] << " " << bounds.extents[1] << " " << bounds.extents[2];
+ Node_getEntity(node)->setKeyValue("light_radius", key.c_str());
+ }
+ }
+
+ if (isModel) {
+ const char *model = misc_model_dialog(MainFrame_getWindow());
+ if (model != 0) {
+ Node_getEntity(node)->setKeyValue("model", model);
+ }