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

AngelScript improvements: ImGui, mouse position, script monitor UI + loadscript console command. #2931

Merged
merged 12 commits into from
Aug 28, 2022

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented Aug 27, 2022

Separated out from #2930 to make things more manageable.
These changes do not involve the refcounting redesign, so there is small chance for bugs. I tested races and vehicle removal, everything works.

New script features:

  • imgui: enum ImGuiWindowFlags; ImGui::SliderInt(); class ImDrawList; ImGui::PushStyleColor(); ImGui::PlotLines()
  • game object funcs: getMouseScreenPosition(), getMouseTerrainPosition(), getScreenPosFromWorldPos(), getDisplaySize()
  • Documentation of GameScriptClass organized into groups.

New game features:

  • loadscript <filename> console command.
  • Script Monitor UI in Console window.
    obrazek

Developers only: Tidy-up of AngelScript bindings:

I moved all AngelScript-registration code to a single location, a new directory 'scripting/bindings/'. Previously, those registrations were all over the place (some in ScriptEngine.cpp, some in LocalStorage.cpp, most in FoobarAngelscript.cpp files). I placed all in dedicated 'FoobarAngelscript.cpp' files. It will make future bindings better organized.

Code changes:

  • scripting/bindings/ConsoleAngelscript.cpp - new file, extracted from ScriptEngine.cpp
  • scripting/bindings/GameScriptAngelscript.cpp - new file, extracted from ScriptEngine.cpp
  • scripting/bindings/ActorAngelscript.cpp - new file, extracted from ScriptEngine.cpp
  • scripting/bindings/InputEngineAngelscript.cpp - new file, extracted from ScriptEngine.cpp
  • scripting/bindings/ScriptEventsAngelscript.cpp - new file, extracted from ScriptEngine.cpp
  • scripting/bindings/VehicleAiAngelscript.cpp - new file, extracted from ScriptEngine.cpp
  • scripting/bindings/LocalStorageAngelscript.cpp - new file, extracted from LocalStorage.cpp
  • scripting/bindings/ImGuiAngelscript.cpp - existing file, just moved as-is.
  • scripting/bindings/OgreAngelscript.cpp - existing file, just moved as-is.
  • scripting/bindings/InputEngineAngelscript.cpp - existing file, just moved as-is.
  • CMakeLists.txt - removed dead include paths.

Copy link
Collaborator

@tritonas00 tritonas00 left a comment

Choose a reason for hiding this comment

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

Looks solid, no issues found so far.

@ohlidalp ohlidalp merged commit cbebeeb into RigsOfRods:master Aug 28, 2022
@ohlidalp ohlidalp deleted the prep-AngelScript branch August 28, 2022 11:52
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.

2 participants