no message

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@962 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-04-15 22:49:56 +00:00
parent 6e8dc54356
commit 7b27df83e4
10 changed files with 148 additions and 21 deletions
+25
View File
@@ -0,0 +1,25 @@
// auto generated script to make the command reference readable for ActionCube
// section: Editing Reference
doccommand [edittoggle] [switches between map edit mode and normal.] [(default key = e). In map edit mode you can select bits of the map by clicking or dragging your crosshair on the floor or ceiling (using the "attack" command, normally MOUSE1), then use the commands below to modify the selection. While in edit mode, physics & collision don't apply (noclip), and key repeat is ON. Note that if you fly outside the map, cube still renders the world as if you were standing on the floor directly below the camera.];
doccommand [edittex] [Changes the texture on current selection by browsing through a list of textures directly shown on the cubes. ] [Default keys are the six keys above the cursor keys, which each 2 of them cycle one type (and numpad 7/4 for upper). The way this works is slightly strange at first, but allows for very fast texture assignment. All textures are in 3 individual lists for each type (both wall kinds treated the same), and each time a texture is used, it is moved to the top of the list. So after a bit of editing, all your most frequently used textures will come first when pressing these keys, and the most recently used texture is set immediately when you press the forward key for the type. These lists are saved with the map. make a selection (including wall bits) and press these keys to get a feel for what they do.];
docargument [T] [an integer denoting the type] [floor = 0, lower or wall = 1, ceiling = 2, upper wall = 3];
docargument [D] [D is the direction you want to cycle the textures in] [1 = forwards, -1 = backwards];
doccommand [editheight] [Changes the height of the current selection.] [Default keys are [ and ] for floor level, and o/p for ceiling.];
docargument [T] [an integer denoting the type] [floor = 0, lower or wall = 1, ceiling = 2];
docargument [D] [the delta value to move it in] [1 = forwards, -1 = backwards];
doccommand [newent] [adds a new entity] [(x,y) is determined by the current selection (the red dot corner) and z by the camera height, of said type. Type is a string giving the type of entity, such as "light", and may optionally take values (depending on the entity).];
docargument [type] [the entity type] [light,playerstart,shells,bullets,rockets,health,ammo,clips,mapmodel,ctf-flag,ladder];
docargument [value1] [see documentation: newent 'type'] [];
docargument [value2] [see documentation: newent 'type'] [];
docargument [value3] [see documentation: newent 'type'] [];
docargument [value4] [see documentation: newent 'type'] [];
doccommand [newent light] [adds a new light entity] [if only argument R is specified, it is interpreted as brightness for white light];
docargument [radius] [the light radius] [1..32];
docargument [R] [red colour component. see remarks below.] [1..255];
docargument [G] [green colour component] [1..255];
docargument [B] [blue colour component] [1..255];
+42 -4
View File
@@ -9,21 +9,59 @@
<xs:element maxOccurs="unbounded" name="command">
<xs:complexType>
<xs:sequence>
<xs:element name="description" type="xs:string" />
<xs:element name="description">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="arguments">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="argument">
<xs:complexType>
<xs:attribute name="token" type="xs:string" use="required" />
<xs:attribute name="description" type="xs:string" use="required" />
<xs:attribute name="token" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="8" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="description" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="values" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="remarks" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="512" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
+31 -7
View File
@@ -5,21 +5,45 @@
<cubescriptreference xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="cubescriptreference.xsd">
<section name="Editing Reference">
<command name="edittoggle">
<description><![CDATA[switches between map edit mode and normal (default key = e). In map edit mode you can select bits of the map by clicking or dragging your crosshair on the floor or ceiling (using the "attack" command, normally MOUSE1), then use the commands below to modify the selection. While in edit mode, physics & collision don't apply (noclip), and key repeat is ON. Note that if you fly outside the map, cube still renders the world as if you were standing on the floor directly below the camera.]]></description>
<description><![CDATA[switches between map edit mode and normal.]]></description>
<remarks><![CDATA[(default key = e). In map edit mode you can select bits of the map by clicking or dragging your crosshair on the floor or ceiling (using the "attack" command, normally MOUSE1), then use the commands below to modify the selection. While in edit mode, physics & collision don't apply (noclip), and key repeat is ON. Note that if you fly outside the map, cube still renders the world as if you were standing on the floor directly below the camera.]]></remarks>
</command>
<command name="edittex">
<description><![CDATA[Changes the texture on current selection by browsing through a list of textures directly shown on the cubes. T is an integer denoting the type (floor = 0, lower or wall = 1, ceiling = 2, upper wall = 3), D is the direction you want to cycle the textures in (1 = forwards, -1 = backwards). Default keys are the six keys above the cursor keys, which each 2 of them cycle one type (and numpad 7/4 for upper). The way this works is slightly strange at first, but allows for very fast texture assignment. All textures are in 3 individual lists for each type (both wall kinds treated the same), and each time a texture is used, it is moved to the top of the list. So after a bit of editing, all your most frequently used textures will come first when pressing these keys, and the most recently used texture is set immediately when you press the forward key for the type. These lists are saved with the map. make a selection (including wall bits) and press these keys to get a feel for what they do.]]></description>
<description><![CDATA[Changes the texture on current selection by browsing through a list of textures directly shown on the cubes. ]]></description>
<arguments>
<argument token="T" description="floor = 0, lower or wall = 1, ceiling = 2, upper wall = 3"/>
<argument token="D" description="1 = forwards, -1 = backwards"/>
<argument token="T" description="an integer denoting the type" values="floor = 0, lower or wall = 1, ceiling = 2, upper wall = 3"/>
<argument token="D" description="D is the direction you want to cycle the textures in" values="1 = forwards, -1 = backwards"/>
</arguments>
<remarks><![CDATA[Default keys are the six keys above the cursor keys, which each 2 of them cycle one type (and numpad 7/4 for upper). The way this works is slightly strange at first, but allows for very fast texture assignment. All textures are in 3 individual lists for each type (both wall kinds treated the same), and each time a texture is used, it is moved to the top of the list. So after a bit of editing, all your most frequently used textures will come first when pressing these keys, and the most recently used texture is set immediately when you press the forward key for the type. These lists are saved with the map. make a selection (including wall bits) and press these keys to get a feel for what they do.]]></remarks>
</command>
<command name="editheight">
<description><![CDATA[is the type as above (floors & ceilings only), and D is the delta value to move it in. Default keys are [ and ] for floor level, and o/p for ceiling.]]></description>
<description><![CDATA[Changes the height of the current selection.]]></description>
<arguments>
<argument token="T" description="floor = 0, lower or wall = 1, ceiling = 2"/>
<argument token="D" description="direction to move in"/>
<argument token="T" description="an integer denoting the type" values="floor = 0, lower or wall = 1, ceiling = 2"/>
<argument token="D" description="the delta value to move it in" values="1 = forwards, -1 = backwards"/>
</arguments>
<remarks><![CDATA[Default keys are [ and ] for floor level, and o/p for ceiling.]]></remarks>
</command>
<command name="newent">
<description>adds a new entity</description>
<arguments>
<argument token="type" description="the entity type" values="light,playerstart,shells,bullets,rockets,health,ammo,clips,mapmodel,ctf-flag,ladder"/>
<argument token="value1" description="see documentation: newent 'type'"/>
<argument token="value2" description="see documentation: newent 'type'"/>
<argument token="value3" description="see documentation: newent 'type'"/>
<argument token="value4" description="see documentation: newent 'type'"/>
</arguments>
<remarks>(x,y) is determined by the current selection (the red dot corner) and z by the camera height, of said type. Type is a string giving the type of entity, such as "light", and may optionally take values (depending on the entity).</remarks>
</command>
<command name="newent light">
<description>adds a new light entity</description>
<arguments>
<argument token="radius" description="the light radius" values="1..32"/>
<argument token="R" description="red colour component. see remarks below." values="1..255"/>
<argument token="G" description="green colour component" values="1..255"/>
<argument token="B" description="blue colour component" values="1..255"/>
</arguments>
<remarks>if only argument R is specified, it is interpreted as brightness for white light</remarks>
</command>
</section>
</cubescriptreference>
+7 -2
View File
@@ -21,15 +21,20 @@
<xsl:value-of select="@name"/>
<xsl:text>] [</xsl:text>
<xsl:value-of select="description"/>
<xsl:text>]; </xsl:text>
<xsl:text>] [</xsl:text>
<xsl:value-of select="remarks"/>
<xsl:text>];</xsl:text>
<xsl:text>&#13;&#10;</xsl:text>
<xsl:for-each select="arguments/argument">
<xsl:text>docattribute</xsl:text>
<xsl:text>docargument</xsl:text>
<xsl:text> [</xsl:text>
<xsl:value-of select="@token"/>
<xsl:text>] [</xsl:text>
<xsl:value-of select="@description"/>
<xsl:text>] [</xsl:text>
<xsl:value-of select="@values"/>
<xsl:text>];</xsl:text>
<xsl:text>&#13;&#10;</xsl:text>
</xsl:for-each>
+3
View File
@@ -278,6 +278,9 @@ int main(int argc, char **argv)
preload_hudguns();
preload_entmodels();
initlog("docs");
execfile("config/docs.cfg");
execute("start_game");
initlog("localconnect");
+8 -3
View File
@@ -62,6 +62,13 @@ void drawarrow(int dir, int x, int y, int size, float r = 1.0f, float g = 1.0f,
glEnable(GL_BLEND);
}
void drawmenubg(int x1, int y1, int x2, int y2, bool border)
{
static Texture *tex = NULL;
if(!tex) tex = textureload("packages/textures/makke/menu.jpg");
blendbox(x1, y1, x2, y2, border, tex->id);
};
#define MAXMENU 17
bool rendermenu()
@@ -93,9 +100,7 @@ bool rendermenu()
int h = (mdisp+2)*step;
int y = (VIRTH-h)/2;
int x = (VIRTW-w)/2;
static Texture *menutex = NULL;
if(!menutex) menutex = textureload("packages/textures/makke/menu.jpg");
blendbox(x-FONTH*3/2, y-FONTH, x+w+FONTH*3/2, y+h+FONTH, true, menutex->id);
drawmenubg(x-FONTH*3/2, y-FONTH, x+w+FONTH*3/2, y+h+FONTH, true);
if(offset>0) drawarrow(1, x+w+FONTH*3/2-FONTH*5/6, y-FONTH*5/6, FONTH*2/3);
if(offset+MAXMENU<m.items.length()) drawarrow(0, x+w+FONTH*3/2-FONTH*5/6, y+h+FONTH/6, FONTH*2/3);
draw_text(title, x, y);
+4
View File
@@ -33,6 +33,7 @@ extern void *addmenu(char *name, char *title = NULL, bool allowinput = true, voi
extern void rendermenumdl();
extern void menuset(void *m);
extern void menuselect(void *menu, int sel);
extern void drawmenubg(int x1, int y1, int x2, int y2, bool border);
// serverbrowser
extern void addserver(char *servername);
@@ -175,6 +176,7 @@ extern void keyrepeat(bool on);
// rendertext
extern void draw_text(const char *str, int left, int top);
extern void draw_textf(const char *fstr, int left, int top, ...);
extern int draw_textblock(char *text, int x, int y, uint width);
extern int char_width(int c, int x = 0);
extern int text_width(const char *str, int limit = -1);
extern int text_visible(const char *str, int max);
@@ -331,4 +333,6 @@ extern PFNGLACTIVETEXTUREARBPROC glActiveTexture_;
extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2f_;
extern PFNGLMULTITEXCOORD3FARBPROC glMultiTexCoord3f_;
// docs
extern void renderdoc(int x, int y);
+1 -1
View File
@@ -205,7 +205,7 @@ void blendbox(int x1, int y1, int x2, int y2, bool border, int tex)
if(tex>=0) glDisable(GL_TEXTURE_2D);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glBegin(GL_POLYGON);
glColor3f(0.6f, 0.6f, 0.6f); //glColor3d(0.2, 0.7, 0.4);
glColor3f(0.6f, 0.6f, 0.6f); //glColor3d(0.2, 0.7, 0.4);
glVertex2i(x1, y1);
glVertex2i(x2, y1);
glVertex2i(x2, y2);
+4 -3
View File
@@ -280,7 +280,8 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
}
char *infostr = editinfo();
if(getcurcommand()) rendercommand(20, 1570);
bool command = getcurcommand() ? true : false;
if(command) rendercommand(20, 1570);
else if(infostr) draw_text(infostr, 20, 1570);
else if(targetplayer) draw_text(targetplayer->name, 20, 1570);
@@ -288,6 +289,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
glOrtho(0, VIRTW*2, VIRTH*2, 0, -1, 1);
renderconsole();
if(command) renderdoc(40, VIRTH);
if(!hidestats)
{
const int left = (VIRTW-225-10)*2, top = (VIRTH*7/8)*2;
@@ -452,5 +454,4 @@ void show_out_of_renderloop_progress(float bar1, const char *text1, float bar2,
glEnable(GL_DEPTH_TEST);
SDL_GL_SwapBuffers();
}
}
+23 -1
View File
@@ -210,7 +210,8 @@ void draw_text(const char *str, int left, int top)
case '2': glColor3ub(255, 192, 64); i++; continue; // yellow: gameplay action messages, only actions done by players
case '3': glColor3ub(255, 64, 64); i++; continue; // red: important errors
case '4': glColor3ub(128, 128, 128); i++; continue; // gray
default: glColor3ub(255, 255, 255); i++; continue; // white: everything else
case '5': glColor3ub(255, 255, 255); i++; continue; // white: everything else
default: i++; continue;
}
case ' ':
@@ -241,3 +242,24 @@ void draw_text(const char *str, int left, int top)
}
}
// draw text block using a fixed width and dynamic height, cheap word wrapping based on char number
int draw_textblock(char *text, int x, int y, uint width)
{
uint numlines = 0;
char *lastline = text;
for(char *t = text; *t; t++)
{
size_t len = t-lastline+1;
if(len >= width || !*(t+1)) // EOL or EOS
{
if(len == width && *(t+1) && *(t+1) != ' ') while(*t && *t != ' ') if((len = --t-lastline) <= 0) { t = lastline+width; break; } // wrap word
char *s = new char[len+1];
s_strncpy(s, lastline, len+1);
draw_textf("%s", x, y+FONTH*numlines, *s == ' ' ? s+1 : s);
delete s;
lastline = t;
numlines++;
}
}
return numlines;
}