Skip to content
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

Merged
merged 4 commits into from
Sep 21, 2022

Conversation

Luashine
Copy link
Collaborator

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.

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
@Luashine Luashine mentioned this pull request Sep 19, 2022
3 tasks
@@ -18,6 +18,22 @@ type real extends void
/**
A 32-bit twos-complement integer type.

Representations in Jass code:
Copy link
Owner

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).
Copy link
Owner

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
Copy link
Owner

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)
Copy link
Owner

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:
Copy link
Owner

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:**
Copy link
Owner

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.
Copy link
Owner

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
Copy link
Owner

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`.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source?

Copy link
Collaborator Author

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?

Copy link
Owner

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.

Copy link
Collaborator Author

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:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline before list.

@lep
Copy link
Owner

lep commented Sep 20, 2022

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.

Personally i don't find too valuable but i wont reject any patches.

@lep
Copy link
Owner

lep commented Sep 20, 2022 via email

@lep
Copy link
Owner

lep commented Sep 21, 2022

On my side this would be ready to merge if you give your OK.
And once again a big thank you for your work, i really appreciate it.

@Luashine
Copy link
Collaborator Author

I'm done now! Thanks :)

@lep lep merged commit f380122 into lep:master Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants