-
Notifications
You must be signed in to change notification settings - Fork 159
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
AGS 4: Script API: convert Walk-areas and Walkbehinds API to OO-style #2307
AGS 4: Script API: convert Walk-areas and Walkbehinds API to OO-style #2307
Conversation
aac43ff
to
deef019
Compare
Hey, the build failures are because the new files need to be added to
Not sure if I am missing this somewhere, but the Room struct in the Script API could also have an ObjectsCount property - perhaps the same to others, or not if they are a fixed number. |
There's is one already. |
deef019
to
aa859d9
Compare
I added two global pointer arrays in addition to existing ones, since these are still in use:
But also room properties for getting everything, as an alternative:
|
042f4ab
to
f5844c6
Compare
import void SetScaling(int min, int max); | ||
/// Gets the ID number for this area. | ||
import readonly attribute int ID; | ||
/// Gets/sets whether this walkable area is enabled. |
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.
Gets/sets
in the comment should just be Gets for ScalingMin
and ScalingMax
Engine/ac/dynobj/cc_walkablearea.cpp
Outdated
|
||
// return the type name of the object | ||
const char *CCWalkableArea::GetType() { | ||
return "Walkarea"; |
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.
Should this be WalkableArea
?
f5844c6
to
4904962
Compare
#ifdef SCRIPT_API_v400 | ||
builtin managed struct Walkbehind { | ||
/// Gets the walk-behind at the specified position on the screen. | ||
import static WalkableArea* GetAtScreenXY(int x, int y); // $AUTOCOMPLETESTATICONLY$ |
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.
This should be a Walkbehind pointer - and the next one too.
4904962
to
25b337c
Compare
Converting walkable areas and walk-behinds script api to OO-style, in compliance with existing Hotspot, Regions etc api.
This adds two managed structs, and array properties in the Room struct for getting these.
Added 2 global arrays of pointers to match existing ones, since they are still in use:
But also added Room properties that return room's elements, as a suggestion for future use: