| 111 | VARP(hideeditslotinfo, 0, 0, 2); |
| 112 | |
| 113 | char *editinfo() |
| 114 | { |
| 115 | static string info; |
| 116 | if(!editmode) return NULL; |
| 117 | info[0] = '\0'; |
| 118 | int e = closestent(); |
| 119 | if(e >= 0) |
| 120 | { |
| 121 | entity &c = ents[e]; |
| 122 | int t = c.type < MAXENTTYPES ? c.type : 0; |
| 123 | extern int pointatent; |
| 124 | formatstring(info)("%s entity: %s (%s)", pinnedclosestent ? "\fs\f3pinned\fr" : (pointatent == 1 ? "point at" : "closest"), entnames[t], formatentityattributes(c, true)); |
| 125 | const char *unassigned = "unassigned slot", *slotinfo = unassigned; |
| 126 | if(t == MAPMODEL) |
| 127 | { |
| 128 | mapmodelinfo *mmi = getmminfo(c.attr2); |
| 129 | if(mmi) slotinfo = mmshortname(mmi->name); |
| 130 | } |
| 131 | else if(t == SOUND) |
| 132 | { |
| 133 | if(mapconfigdata.mapsoundlines.inrange(c.attr1)) slotinfo = mapconfigdata.mapsoundlines[c.attr1].name; |
| 134 | } |
| 135 | else slotinfo = ""; |
| 136 | if(*slotinfo && (hideeditslotinfo == 0 || (hideeditslotinfo == 1 && slotinfo == unassigned))) concatformatstring(info, " %s", slotinfo); |
| 137 | } |
| 138 | if(selset()) |
| 139 | { |
| 140 | concatformatstring(info, "\n\tselection = (%d, %d)", (sels.last()).xs, (sels.last()).ys); |
| 141 | if(sels.length() > 1) concatformatstring(info, " and %d more", sels.length() - 1); |
| 142 | } |
| 143 | else concatformatstring(info, "\n\tno selection"); |
| 144 | sqr *s; |
| 145 | if(!OUTBORD(cx, cy) && (s = S(cx,cy)) && !editfocusdetails(s) && !SOLID(s) && s->tag) concatformatstring(info, ", tag 0x%02X", s->tag); |
| 146 | return info; |
| 147 | } |
| 148 | |
| 149 | |
| 150 | // multiple sels |
no test coverage detected