no message

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1075 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-06-01 20:42:59 +00:00
parent 2d93ad9416
commit ca342d0651
4 changed files with 31 additions and 29 deletions
+3 -3
View File
@@ -637,9 +637,9 @@ COMMAND(givemaster, ARG_1INT);
struct mline { string cmd; };
static vector<mline> mlines;
void *kickmenu = NULL, *banmenu = NULL;
void *kickmenu = NULL, *banmenu = NULL, *forceteammenu = NULL, *givemastermenu = NULL;
void refreshmastermenu(void *menu, bool init)
void refreshsopmenu(void *menu, bool init)
{
if(!init) return;
@@ -648,7 +648,7 @@ void refreshmastermenu(void *menu, bool init)
loopv(players) if(players[i])
{
string &s = mlines.add().cmd;
s_sprintf(s)("%s %d", menu==kickmenu ? "kick" : "ban", i);
s_sprintf(s)("%s %d", menu==kickmenu ? "kick" : (menu==banmenu ? "ban" : (menu==forceteammenu ? "forceteam" : "givemaster")), i);
menumanual(menu, item++, players[i]->name, s);
}
}
+5 -3
View File
@@ -270,13 +270,15 @@ int main(int argc, char **argv)
initsound();
initlog("cfg");
extern void *scoremenu, *teammenu, *ctfmenu, *servmenu, *kickmenu, *banmenu, *docmenu;
extern void *scoremenu, *teammenu, *ctfmenu, *servmenu, *kickmenu, *banmenu, *forceteammenu, *givemastermenu, *docmenu;
scoremenu = addmenu("score", "frags\tdeath\tpj\tping\tname\tcn", false, renderscores);
teammenu = addmenu("team score", "frags\tdeath\tpj\tping\tteam\tname\tcn", false, renderscores);
ctfmenu = addmenu("ctf score", "flags\tfrags\tdeath\tpj\tping\tteam\tname\tcn", false, renderscores);
servmenu = addmenu("server", "ping\tplr\tserver", true, refreshservers);
kickmenu = addmenu("kick player", NULL, true, refreshmastermenu);
banmenu = addmenu("ban player", NULL, true, refreshmastermenu);
kickmenu = addmenu("kick player", NULL, true, refreshsopmenu);
banmenu = addmenu("ban player", NULL, true, refreshsopmenu);
forceteammenu = addmenu("force team", NULL, true, refreshsopmenu);
givemastermenu = addmenu("give master", NULL, true, refreshsopmenu);
docmenu = addmenu("reference", NULL, true, renderdocmenu);
persistidents = false;
+1 -1
View File
@@ -154,7 +154,7 @@ extern void flagmsg(int flag, int action);
extern void arenarespawn();
extern void respawn();
extern void serveropcommand(int cmd, int arg1);
extern void refreshmastermenu(void *menu, bool init);
extern void refreshsopmenu(void *menu, bool init);
// scoreboard
extern void showscores(bool on);
+22 -22
View File
@@ -34,7 +34,7 @@ void drawradaricon(float x, float y, float s, int col, int row)
void drawctficon(float x, float y, float s, int col, int row, float ts)
{
static Texture *tex = NULL;
if(!tex) tex = textureload("packages/misc/teamicons.png");
if(!tex) tex = textureload("packages/misc/ctficons.png");
if(tex) drawicon(tex, x, y, s, col, row, ts);
}
@@ -49,7 +49,6 @@ VARP(hideradar, 0, 0, 1);
VARP(radarres, 1, 64, 1024);
VARP(radarentsize, 1, 4, 64);
VARP(hidectfhud, 0, 0, 1);
VARP(hideteamhud, 0, 1, 1);
VARP(hidedemohud, 0, 0, 1);
VAR(showmap, 0, 0, 1);
@@ -186,6 +185,7 @@ void drawradar(int w, int h)
circle(minimaptex, radarviewsize/2, radarviewsize/2, radarviewsize/2, centerpos.x/worldsize, centerpos.y/worldsize, res/2/worldsize);
}
glTranslatef(-(centerpos.x-res/2)/worldsize*radarsize, -(centerpos.y-res/2)/worldsize*radarsize, 0);
glColor4f(1.0f, 1.0f, 1.0f, 0.2f+(sinf(lastmillis/50.0f)+1.0f)/2.0f);
drawradarent(player1->o.x*coordtrans, player1->o.y*coordtrans, player1->yaw, player1->state==CS_ALIVE ? (isattacking(player1) ? 2 : 0) : 1, 2, iconsize, isattacking(player1), player1->name); // local player
@@ -204,9 +204,10 @@ void drawradar(int w, int h)
flaginfo &f = flaginfos[i];
entity *e = f.flag;
if(!e) continue;
float yaw = showmap ? 0 : player1->yaw;
if(f.state==CTFF_STOLEN && f.actor && insideradar(centerpos, res/2, f.actor->o))
drawradarent(f.actor->o.x*coordtrans+iconsize/2, f.actor->o.y*coordtrans+iconsize/2, 0, 3, f.team, iconsize, true); // draw near flag thief
else if(insideradar(centerpos, res/2, vec(e->x, e->y, centerpos.z))) drawradarent(e->x*coordtrans, e->y*coordtrans, 0, 3, f.team, iconsize, false); // draw on entitiy pos
drawradarent(f.actor->o.x*coordtrans+iconsize/2, f.actor->o.y*coordtrans+iconsize/2, yaw, 3, f.team, iconsize, true); // draw near flag thief
else if(insideradar(centerpos, res/2, vec(e->x, e->y, centerpos.z))) drawradarent(e->x*coordtrans, e->y*coordtrans, yaw, 3, f.team, iconsize, false); // draw on entitiy pos
}
}
@@ -219,12 +220,23 @@ void drawradar(int w, int h)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor3f(1, 1, 1);
static Texture *overlaytex = NULL;
if(!overlaytex) overlaytex = textureload("packages/misc/radaroverlay.png", 3);
quad(overlaytex->id, VIRTW-overlaysize-10, 10, overlaysize, 0.5f*team_int(player1->team), 0, 0.5f, 1.0f);
if(!overlaytex) overlaytex = textureload("packages/misc/radaroverlays.png", 3);
quad(overlaytex->id, VIRTW-overlaysize-10, 10, overlaysize, m_teammode ? 0.5f*team_int(player1->team) : 0, m_teammode ? 0 : 0.5f, 0.5f, 0.5f);
glEnable(GL_CULL_FACE);
}
}
void drawteamicons(int w, int h)
{
glDisable(GL_CULL_FACE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor3f(1, 1, 1);
static Texture *icons = NULL;
if(!icons) icons = textureload("packages/misc/teamicons.png", 3);
quad(icons->id, VIRTW-VIRTH/12-10, 10, VIRTH/12, team_int(player1->team) ? 0.5f : 0, 0, 0.5f, 0.5f);
glEnable(GL_CULL_FACE);
}
void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwater)
{
glDisable(GL_DEPTH_TEST);
@@ -280,12 +292,10 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
drawequipicons();
if(!hideradar)
{
glMatrixMode(GL_MODELVIEW);
drawradar(w, h);
glMatrixMode(GL_PROJECTION);
}
glMatrixMode(GL_MODELVIEW);
if(!hideradar) drawradar(w, h);
else drawteamicons(w, h);
glMatrixMode(GL_PROJECTION);
char *infostr = editinfo();
if(command) rendercommand(20, 1570);
@@ -336,16 +346,6 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
draw_text(gunstats, 690, 827);
}
if(m_teammode && !hideteamhud)
{
glLoadIdentity();
glOrtho(0, VIRTW, VIRTH, 0, -1, 1);
glDisable(GL_BLEND);
drawctficon(VIRTW-120-10, VIRTH/6+10+10, 120, team_int(player1->team), 1, 1/4.0f); // local players team
glEnable(GL_BLEND);
draw_textf(player1->team, VIRTW-VIRTH/6-10, VIRTH/6+10+10+120/2);
}
if(didteamkill)
{
glLoadIdentity();