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

lua: Add framework for shared Lua and add some Lua integration for bg_misc stuff #2930

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

DolceTriade
Copy link
Member

@DolceTriade DolceTriade commented Feb 22, 2024

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).

Copy link
Contributor

@slipher slipher left a 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 {
Copy link
Contributor

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

Choose a reason for hiding this comment

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

why if BUILD_CGAME?


if(IsReferenceCounted<T>())
{
// TODO: Remove
Copy link
Contributor

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

Choose a reason for hiding this comment

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

lol

/*
= =================*=========================================================

Daemon GPL Source Code
Copy link
Contributor

Choose a reason for hiding this comment

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

Daemon?

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