Your method is simliar to what I suggested. The slight variation I suggested allows you to implement redo as well as undo.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
struct journal {
int Command; // necessary if there is more than one editor command
int TileX;
int TileY;
int NewTile;
int OldTile;
}
journal EditJournal[MAX_EDITS_PER_SESSION];
QuoteI was thinking about this topic when reading this thread earlier today. Should there be a resource pak available that contains some of the new cool website icons in a couple different sizes and varieties? These would be fore use on members websites to promote their games and/or AGS. They could also be used as sprites in games themselves, tutorials, etc.
If this graphic ever does become part of the website or anything, and anyone wants the background to be a different color, I can always give the png with Alpha or whatever.
Quote
The ratings panel is composed of xx members of the Ags community and experienced game developers. Panel members play each game from beginning to end and note such factors as playability, enjoyability, dialogue, story, graphics, sound, music, etc... to form an opinion. At the end of an evaluation period the panel members discuss their individual opinions and reach a consensus. One of the panel members is charged with writing a review consistent with the consensus of the panel.
struct guy {
String Name;
int HP;
int Level;
int Etc;
}
guy Guy[100];
int id;
String line, buf;
// Id, name, HP, Level, Etc
line = "1, Bob, 100, 20, 50";
id = Line.StrToken(',', true);
Guy[id].Name = Line.StrToken(',');
buf = Line.StrToken(',');
Guy[id].HP = buf.AsInt();
buf = Line.StrToken(',');
Guy[id].Level = buf.AsInt();
buf = Line.StrToken(',');
Guy[id].Etc = buf.AsInt();
*** Script Header ***
import String StrToken(this String*, char c, bool reset=0)
*** Global Script ***
//==================================================================
String TokenString;
int TokenIx=0;
//
String StrToken(this String*, char c, bool reset) {
//
// Emulates operation of standard C language strtok() function. When
// this function is first called, for a given string value, it
// returns the first occurance of the specified separator character.
// Subsequent calls return the next occurance of the specified token
// character.
//
// The parameter C specifies the token seperator character to use
// for this call. A different character may be specified eaxch time
// this function is called.
//
// The optional reset parameter fporces the tokenization process to
// start over from the begining of the lione.
//
// Example:
//
// String Line;
// Line = "Goodbye, cruel world. Farewell!");
// Display(Line.StrToken(' ',true);
// Display(Line.StrToken(',');
// Display(Line.StrToken('!');
// Display(Line.StrToken(',',true);
//
// Displays the following ...
// Goodbye,
// cruel world
// Farewell
// Goodbye
//-------------------------------------------------------------------
int i, j, t;
String token;
// Initialize tokenizer
if ((TokenString==null)||(TokenString!=this)||(reset)) {
if (this!=null) TokenString = this;
else TokenString = "";
TokenIx = 0;
}
// Check for end of string
if (TokenIx<this.Length) {
// Skip leading whitespace
token = "";
i = TokenIx;
while ((i<this.Length)&&(this.Chars[i]<=' ')) i++;
j = i; // Save token beginning
// Get token end
while ((i<this.Length)&&(this.Chars[i]!=c)) i++;
// Save token index for next time
TokenIx = i+1;
// Extract token from string
token = this.Substring(j, i-j);
}
else {
// Token index, TokenIx, is greater than the length so ...
// since there are no more tokens return an empty string
token = "";
}
return token;
}
// Variable have the same form as before. For example the string #{SomeVariable} is
// replaced with the value of SomeVariable.
//
// Commands start with a # symbol, kid of like macros in an include file. They can have
// a number of arguments and span multiple lines using the curly braces to delimit their extent.
// The for-each command for example has the following form
#for-each {
// Basic content model
item-type {
<tag>#{VariableName}</tag>
}
// Model that iterates over each of the item's lines
item-type-Begin {
<tag>
}
item-type-Lines {
<tag>#{Line}</tag>
}
item-type-End {
</tag>
}
// Model that iterates over each of the item's lines
item-type-Begin {
<tag>
}
item-type-Lines {
<tag>#{Line}</tag>
}
item-type-End {
</tag>
}
}
This is normal paragraph text blah, blah, bla bla bla blaaaah.
This is more of the same. This item will be of type eModox_Paragraph
having a text value of "Paragraph" which can be accessed in the template file
using the variable #{Type}.
[See Also] This is also paragraph text but it has an item type of eModox_Custom
and it has a text value of "SeeAlso" (note spaces are removed) which is also accessed in the template file via #{Type}.
// Commands start with a # symbol, kid of like macros in an include file. They can have
// a number of arguments and span multiple lines using the curly braces to delimit their extent.
// The for-each command for example has the following form
#for-each {
// Model that iterates over each word in the item
// implements "See Also" feature
SeeAlso-Begin {
<p class="#{Type}">#{Name}:
}
SeeAlso-Words {
<a href="##{Word}" class="#{Type}">#{Word}</a>,
}
SeeAlso-End {
</p>
}
}
#for-each {
// Make level-1 sectionz one all the way to the left margin
Section.1 {
<h1>#{Name}</h1>
}
// Make level-2 sections indented 5 spaces
Section.2 {
.....<h2>#{Name}</h2>
}
// Make paragraph tags indented 10 spaces
// Make paragraph text indented 15 spaces
paragraph {
..........<p>
...............#{Lines}
..........</p>
}
// In the above examples the leading dot characters
// will be replaced in the output file by space characters.
}
<pre class="Note">
Your note text .....
</pre>
QuoteNo and yes!
You're very much welcome and I'm glad to hear that the HTML tags are now exclusively contained in the template file. Does this mean that the template formatting can be preserved too? ...
QuoteThere is a set of, I believe three files, that is passed through the CHM compiler which is freely available from M$. The idea would be to first render the source files and then pass the result through the CHM compiler to get get the final chm.
CHM Help ...Quote
... I think it has to explicitly be passed through the CHM compiler to generate a valid CHM file.
QuoteThanks. Leaving this out was an oversight on my part. I'll get it fixed for the next version.
writeprotected int WriteProtectedData; // this can be publicly read, but can only be set privately
QuoteI am certain I had this working correctly at one point in time. I must have generated a bug along the way somewhere. I'll get it fixed for the next version.
If I remove the line " // blargh:" then the description does not show up at all.
Quote
Re: versions
...I don't recall the guidelines saying that the version number should be padded out to exactly 4 digits. In fact, it shows three digits. ...
Quote
What should I presumably be putting then between these so that there will be a distinction between the struct's members, the instance, and the global function instead of them all just being on the same header level with nothing separating them?
struct StructName {
int IntProperty; // documentation lines and such removed for simplicity sake :P, this is all just pseudo code anyway
String StringProperty;
// etc.
};
// 0 StructName Instances
import StructName StructMember;
import function FunctionName();
QuotePerhaps so. I just picked up whatever was on the line and only excluded the punctuation characters ";" and "{" at the end of the line(s). I can exclude the import statements if thats the consensus of how it ought to be. I don't really have a preference one way or the other, just what is best way for the most people.
I've just noticed that when the functions are being extracted the documentation includes the "import" keyword.
QuoteI was wondering about that and you know I didn't have any examples and wasn't certain public properties could be write protected. What is the proper form anyway/
-writeprotected members are ignored entirely. The module currently does not detect these properties at all, though since they are public they should be documented.
protected int SomeVariable;
QuoteThe parser is expecting the description to follow the declaration. The declaration statements
-Member descriptions are omitted. I was able to work around this by adding on a line by itself something such as "// blarg:" at the start of each property description.
int SomeVariable;
// This variable is used for this that and the other thing.
// The description of the variable follows the declaration so
// so these lines are the description of SomeVariable.
QuoteAhhh ok! I understand what's going on here. I keep a list of all the built-in AGS types and add to that list each of the user defined types as they are defined. So when the parser sees something like "int", "Monkeys_Object", etc it knows that this line needs further analysis. This should be fixed in the next version.
-Pointer members...are strange. I found that if you declare your pointers such as Type* Name (with the asterisk attached to the type) that the member is ignored entirely, yet if you declare it as Type *Name or even Type * Name then the asterisk is considered part of the property name!
QuoteI got this straight out of the module guidelines. Perhaps I am a bit out of date or this is a bit too strict. post some examples and I'll see what I can do about getting them be recognised.
-Version macros required odd formatting. It seems that in order to get the version macros to detect properly they must be padded to 4 spaces. This is far from desirable for me. As a matter of fact, I would like to be able to provide the VERSION macro as a float.
QuoteIs it the case that the global instance import statements follow the struct definition? If so what you are saying is that since the methods inside the struct and the global functions both have the same header level there doesn't appear to be a distinction between them when they are rendered into a document? Have I understood this correctly?
-No distinction between global and struct functions? I thought this was already implemented, yet when I run my module through yours the output does not reflect this. The struct name is reflected, its members listed, and then a global instance of that struct, as well as a global function are listed, but with nothing indicating they are not part of the struct. Actually as a matter of fact I would like to be able to avoid referencing the struct name altogether and only mention the instance because that is the user access interface.
Quotemonkey, thanks for your kind words. TerranRich got me started with CSS and I am grateful for his help.
This is really keen looking. It's awesome that you came up with the idea/way to do this and the HTML/CSS looks very professional and nice. I'd definitely like to give it a shot myself as well.
QuoteThat's pretty much what I am aiming for. The rendering process doesn't really care what's in the template file except for the #{...} things. You can think of the things inside the braces as a command or function with optoinal arguments. The command, arguments, and the braces are replaced by whatever text the command produces. It could be a short string or multiple lines of text.
Oh and regarding the idea of exporting plain-text docs instead of HTML...could that be done using simply a plain-text non-HTML template? Or does the parsing of the template expect valid HTML?
#{ForEach
Section {
<h#{Level}>#{Name}</h#{Level}>
<p class="definition">#{Definituion}</p>
}
Paragraph {
<p>
#{Lines}
</p>
}
:
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.276 seconds with 15 queries.