OpenXRay / xray-16

Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. Join OpenXRay! ;)
https://discord.gg/sjRMQwv
Other
2.97k stars 456 forks source link

Update pSettings logic so that pSettings is mutable #1652

Open yohjimane opened 5 months ago

yohjimane commented 5 months ago

Is your feature request related to a problem? Please describe. pSettings could be made mutable, so we have access to write methods on engine side. We can build better user interfaces with this, especially for modders. Here is one specific usecase:

In this example, a modder wants to update hud positions for each weapon. Here's what the workflow for that looks like:

This entire process could be reduced to the first 2 steps, if we could write to the weapon ltx section programmatically after the position is updated.

Describe the solution you'd like update pSettings so that it's mutable and write functions can be called.

Additional context It looks like ShokerMod may have implemented this a long time ago, this solution could be looked at as reference: https://github.com/ShokerStlk/xray-16-SWM/commit/e884cf84bdf6b6d3c20da1478979836a099dba27

yohjimane commented 5 months ago

I checked out the shokermod implementation, and it's not ideal because it saves every single line to the system.ltx file. Ideally, the existing file structure should stay intact.