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
lua: Add framework for shared Lua and add some Lua integration for bg_misc stuff #2930
base: master
Are you sure you want to change the base?
Conversation
- Move lua specific files to a lua/ subdir.
Need to end array with nullptr so the LuaLib knows that its the end of the array.
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.
So what's the point of having these APIs in the cgame? Is it supposed to replace some of the data sources?
The way you've done it is all right but it occurs to me that weapons/classes/upgrades/buildables don't really need to have a type with getter functions. It's just a constant key/value mapping so you could simply put the weapon attributes in a Lua table.
|
||
void CG_InitializeLuaPlayer( lua_State* L ); | ||
|
||
namespace Rml { |
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.
namespace should be fixed not to use the RmlUi one
|
||
=========================================================================== | ||
*/ | ||
#ifdef BUILD_CGAME |
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.
why if BUILD_CGAME?
src/shared/LuaLib.inl
Outdated
|
||
if(IsReferenceCounted<T>()) | ||
{ | ||
// TODO: Remove |
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.
So what is the story with object life cycle? Do we need that "DO NOT TRASH" shit? I don't remember how it works but if so we might have a problem since this library appears to be based on a really old version that doesn't have my crash fix (and even still uses the Rocket
namespace).
Also when importing code like this it would be nice to have the unmodified version of the imported code (not included in the build) as the first commit, with a note as to which commit in the external project it came from, and only hack it to suit our needs in the second commit.
@@ -2,7 +2,7 @@ | |||
=========================================================================== | |||
|
|||
Daemon GPL Source Code | |||
Copyright (C) 2012 Unvanquished Developers | |||
Copyright (C) 2012 Unv Developers |
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.
lol
src/shared/lua/Weapons.h
Outdated
/* | ||
= =================*========================================================= | ||
|
||
Daemon GPL Source 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.
Daemon?
With this change, we add lua to shared so it can be used for the sgame soon. We also add Lua APIs for accessing Unvanquished weapon/class/buildable/upgrade info (with the caveat that BG_InitAllConfigs() must be called and paks must be loaded).