Page MenuHomeWildfire Games

Move custom JS classes to globalscripts.
ClosedPublic

Authored by Freagarach on Apr 16 2021, 9:10 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP25288: Move custom JS data structures to globalscripts.
Summary

Such that they can be used by e.g. GUI or maps scripts.

  • WeightedList.
  • FSM (refs. D1786).
  • MultiKeyMap.

They don't depend on the simulation. See also e.g. vector.js.

Test Plan

Verify unmoddified behaviour. Agree on the idea.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Freagarach created this revision.Apr 16 2021, 9:10 PM

Successful build - Chance fights ever on the side of the prudent.

Debug: 
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

     4>MSVCRTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\pyrogenesis.vcxproj]
    22>MSVCRTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
Release: 
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/5080/display/redirect

Freagarach published this revision for review.Apr 17 2021, 7:56 AM
Freagarach edited the summary of this revision. (Show Details)

One thing to check -> global scripts are run directly in the 'global namespace', not in a closure, so this might introduce some pollution/noise in the global namespace if local variables were defined by these scripts.

Otherwise I rather agree, and would suggest moving these globalscripts to another mod later down the road.

Do you mean vars? That is function-scoped so should just be within the defined functions, right?

This revision was not accepted when it landed; it landed in state Needs Review.Apr 18 2021, 10:31 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.