MCPcopy Create free account
hub / github.com/assaultcube/AC / editinfo

Function editinfo

source/src/editing.cpp:113–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111VARP(hideeditslotinfo, 0, 0, 2);
112
113char *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

Callers 1

gl_drawhudFunction · 0.85

Calls 9

closestentFunction · 0.85
formatentityattributesFunction · 0.85
getmminfoFunction · 0.85
mmshortnameFunction · 0.85
concatformatstringFunction · 0.85
selsetFunction · 0.85
editfocusdetailsFunction · 0.85
inrangeMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected