-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge City17's wc3modding.info jassdoc contributions #68
Conversation
Most of the previous work was copy-pasted with adaptations. Some already existing descriptions were merged (improved upon). Link: https://wc3modding.info/index.php?action=profile;u=8882;area=showposts;start=0
@@ -18,6 +18,22 @@ type real extends void | |||
/** | |||
A 32-bit twos-complement integer type. | |||
|
|||
Representations in Jass code: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a newline before the list.
* 4 characters (aka rawcode, FourCC): Four ASCII characters in single-quotes are interpreted as a 32-bit integer: | ||
`'dddd'` = (100 << 24) + (100 << 16) + (100 << 8 ) + 100 = 1677721600 + 6553600 + 25600 + 100 = 1684300900 | ||
|
||
@note Lua is also compiled with 32-bit integers (game's exe is 64-bit). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a newline before the list.
common.j
Outdated
|
||
OrderId("humanbuild") --> returns 851995 (opens human build menu) | ||
|
||
@note See: OrderId2String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap native in backticks.
effects.j
Outdated
@note Before 1.29 there was no direct way to set a special effect's height. The following trick was used as a workaround: | ||
|
||
// Creates a temporary platform in the air, the special effect will be put on top of it: | ||
tempDestr = call CreateDestructableZ('OTis', x, y, z, 0, 1, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set tempDestr = CreateDestructableZ(...)
@@ -19,65 +19,165 @@ native IsNoDefeatCheat takes nothing returns boolean | |||
|
|||
|
|||
/** | |||
Adds a string to the preload buffer. | |||
It does two things: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline before list. And use 1.
instead of 1)
. At least he markdown implementation i'm using currently doesn't suppoert x)
lists.
|
||
**Example:** if player pressed CTRL+W then metakey=2 and oskeytype=OSKEY_W | ||
|
||
**Meta keys:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline before list.
|
||
@param whichPlayer The target player will be shown as sender of the message. | ||
|
||
@param recipient Changes the type of chat channel prefix shown. It has no effect on the message's visibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline before list.
unit.j
Outdated
@@ -1065,6 +1127,11 @@ native IssueBuildOrderById takes unit whichPeon, integer unitId, real x, real y | |||
|
|||
native IssueNeutralImmediateOrder takes player forWhichPlayer, unit neutralStructure, string unitToBuild returns boolean | |||
|
|||
/** | |||
TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove TODO?
|
||
Returns 0.0 if unit was removed or is null. | ||
|
||
Retrieving Z is desync prone, this version might cause desyncs, but (unconfirmed) should be faster than `BlzGetUnitZ`, hence why both exist. In case that you are doing a single player map (campaign), you might decide to use this one instead of `BlzGetUnitZ`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously existing jassdoc description here. Did you ask about desyncs or speed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh i see. Sorry, didn't check the full diff. I was just hoping for some source as i remember (probably faulty) that those two functions are actually the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
common.j's Blizzard's own comment says that they're the same.
They must've been different either in a first, unreleased version or possibly the first public version too?
/** | ||
Emulates an ESCAPE key press internally, used to interact with UI, e.g. close F10 menu. | ||
|
||
@bug Does not always work as expected if you use it to "Cancel" something on behalf of a player, like cancel research in the current building. Since it always sends the Escape key, it will break if hotkey layout was changed from classic to grid/custom in game settings. Explanation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline before list.
Personally i don't find too valuable but i wont reject any patches. |
Yes, that is perfect.
Am 20. September 2022 20:26:52 MESZ schrieb Luashine ***@***.***>:
***@***.*** commented on this pull request.
…
> @@ -1,47 +1,99 @@
// String Utility API
/**
+Returns a real representation for integer i.
+If i is not an integer or i is null, raises an error.
Is it OK if I write it like this?
> Lua: If i is not an integer or i is null, raises an error.
--
Reply to this email directly or view it on GitHub:
#68 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
On my side this would be ready to merge if you give your OK. |
I'm done now! Thanks :) |
Most of the previous work was copy-pasted with adaptations. Some already existing descriptions were merged (improved upon).
Link:
https://wc3modding.info/index.php?action=profile;u=8882;area=showposts;start=0
In most cases I replaced the previous description with the new one, where I think it was clearer. Open to discussion.
Also I don't remember what we settled upon for BJ descriptions, lep. Was it to not add one-line docs to BJ functions which are obvious from the source code? That's alright as long as the original BJ code is exported and displayed in an IDE as part of the doc.