Skip to content

Commit 5e86020

Browse files
C# Work
1 parent 43061d5 commit 5e86020

145 files changed

Lines changed: 17124 additions & 885 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Build/CIScripts/BuildMac.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ namespace('build', function() {
2222
var cmds = [
2323
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/Atomic/ MACOSX",
2424
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicPlayer/ MACOSX",
25+
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicApp/ MACOSX",
26+
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicNETNative/ MACOSX",
27+
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicNETScript/ MACOSX",
2528
"cmake -DATOMIC_DEV_BUILD=0 -G Xcode ../../../../",
2629
"xcodebuild -target AtomicPlayer -configuration Release -parallelizeTargets -jobs 4"
2730
];
@@ -56,6 +59,9 @@ namespace('build', function() {
5659
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/ToolCore/ MACOSX",
5760
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/Editor/ MACOSX",
5861
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/WebView/ MACOSX",
62+
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicApp/ MACOSX",
63+
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicNETNative/ MACOSX",
64+
atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicNETScript/ MACOSX",
5965
"cmake -DATOMIC_DEV_BUILD=0 -G Xcode ../../../../",
6066
"xcodebuild -target AtomicEditor -configuration Release -parallelizeTargets -jobs 4",
6167
"cd " + editorBuildDir + "Source/AtomicEditor/Release && zip -r -X " + buildDir + "Bin/AtomicEditor.zip ./AtomicEditor.app"

‎Build/CMake/Modules/AtomicLinux.cmake‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ include(AtomicDesktop)
55

66
add_definitions(-DATOMIC_PLATFORM_LINUX -DATOMIC_OPENGL -DKNET_UNIX -DHAVE_INT64_T)
77

8-
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -std=gnu++0x")
8+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
9+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -std=gnu++0x -fPIC")
10+
911

1012
find_package(PkgConfig REQUIRED)
1113

‎Build/Managed/nuget/nuget.exe‎

3.77 MB
Binary file not shown.

‎Build/Scripts/BuildCommon.js‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,31 @@ namespace('build', function() {
7979
}
8080
}
8181

82+
task('genAtomicNET', {
83+
async:true
84+
}, function(platform, configuration) {
85+
86+
if (configuration != "Debug" && configuration != "Release")
87+
configuration = "Release";
88+
89+
// Compile AtomicNET assemblies
90+
var cmds = [];
91+
92+
if (os.platform() == "win32") {
93+
cmds.push(host.atomicTool + " net genproject " + atomicRoot + "/Script/AtomicNET/AtomicNETProject.json " + platform);
94+
cmds.push(host.atomicTool + " net compile " + atomicRoot + "Artifacts\\AtomicNET\\Build\\AtomicNET.sln " + configuration);
95+
}
96+
97+
jake.exec(cmds, function() {
98+
99+
complete();
100+
101+
}, {
102+
printStdout: true
103+
});
104+
105+
})
106+
82107
task('genscripts', {
83108
async: true
84109
}, function(platform, force) {

‎Build/Scripts/HostCommon.js‎

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@ function getScriptModules(platform) {
3939
var moduleName = pkg.modules[j];
4040

4141
if (pkg.moduleExclude && pkg.moduleExclude[platform])
42-
if (pkg.moduleExclude[platform].indexOf(moduleName) != -1)
43-
continue;
42+
if (pkg.moduleExclude[platform].indexOf(moduleName) != -1)
43+
continue;
4444

45-
if (!modules[pkg.name])
46-
modules[pkg.name] = [];
45+
if (!modules[pkg.name]) {
46+
modules[pkg.name] = {
47+
moduleNames: [],
48+
bindings: pkg.bindings
49+
};
50+
}
4751

48-
modules[pkg.name].push(moduleName);
52+
modules[pkg.name].moduleNames.push(moduleName);
4953
}
5054

5155
}
@@ -71,13 +75,36 @@ function getGenScriptFilenames(platform) {
7175

7276
for (var pkgName in modules) {
7377

74-
var jsPackageFolder = scriptGenRoot + "Javascript/Packages/" + pkgName + "/";
78+
var module = modules[pkgName];
7579

76-
// the JS package sources
77-
filenames.push(jsPackageFolder + "JSPackage" + pkgName + ".cpp");
80+
// handle JS bindings
81+
if (!module.bindings || module.bindings.indexOf("JavaScript") != -1) {
82+
83+
var jsPackageFolder = scriptGenRoot + "Javascript/Packages/" + pkgName + "/";
84+
85+
// the JS package sources
86+
filenames.push(jsPackageFolder + "JSPackage" + pkgName + ".cpp");
87+
88+
for (var i in module.moduleNames) {
89+
filenames.push(jsPackageFolder + "JSModule" + module.moduleNames[i] + ".cpp");
90+
}
91+
}
92+
93+
// C#
94+
if (!module.bindings || module.bindings.indexOf("CSharp") != -1) {
95+
96+
var csPackageFolder = scriptGenRoot + "CSharp/Packages/" + pkgName + "/";
97+
var csPackageNativeFolder = csPackageFolder + "Native/";
98+
var csPackageManagedFolder = csPackageFolder + "Managed/";
99+
100+
// Native Package sources
101+
filenames.push(csPackageNativeFolder + "CSPackage" + pkgName + ".cpp");
102+
filenames.push(csPackageNativeFolder + "CSPackage" + pkgName + ".h");
103+
104+
for (var i in module.moduleNames) {
105+
filenames.push(csPackageNativeFolder + "CSModule" + module.moduleNames[i] + ".cpp");
106+
}
78107

79-
for (var i in modules[pkgName]) {
80-
filenames.push(jsPackageFolder + "JSModule" + modules[pkgName][i] + ".cpp");
81108
}
82109

83110
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
//
2+
// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
3+
//
4+
// Permission is hereby granted, free of charge, to any person obtaining a copy
5+
// of this software and associated documentation files (the "Software"), to deal
6+
// in the Software without restriction, including without limitation the rights
7+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
// copies of the Software, and to permit persons to whom the Software is
9+
// furnished to do so, subject to the following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included in
12+
// all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
// THE SOFTWARE.
21+
//
22+
23+
import InspectorWidget = require("./InspectorWidget");
24+
import ArrayEditWidget = require("./ArrayEditWidget");
25+
import InspectorUtils = require("./InspectorUtils");
26+
27+
class AssemblyInspector extends InspectorWidget {
28+
29+
constructor() {
30+
31+
super();
32+
33+
this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
34+
35+
}
36+
37+
handleWidgetEvent(ev: Atomic.UIWidgetEvent):boolean {
38+
39+
return false;
40+
41+
}
42+
43+
inspect(asset: ToolCore.Asset) {
44+
45+
this.asset = asset;
46+
this.importer = <ToolCore.NETAssemblyImporter> asset.importer;
47+
48+
// node attr layout
49+
var rootLayout = this.rootLayout;
50+
51+
// Assembly Section
52+
var assemblyLayout = this.createSection(rootLayout, "NETAssembly", 1);
53+
54+
var assemblyFile = <AtomicNETScript.CSComponentAssembly> asset.importer.getResource();
55+
56+
var container = InspectorUtils.createContainer();
57+
container.gravity = Atomic.UI_GRAVITY_ALL;
58+
assemblyLayout.addChild(container);
59+
60+
var panel = new Atomic.UILayout();
61+
panel.axis = Atomic.UI_AXIS_Y;
62+
panel.layoutSize = Atomic.UI_LAYOUT_SIZE_PREFERRED;
63+
panel.layoutPosition = Atomic.UI_LAYOUT_POSITION_LEFT_TOP;
64+
container.addChild(panel);
65+
66+
var label = InspectorUtils.createAttrName("CSComponents:");
67+
panel.addChild(label);
68+
69+
for (var index in assemblyFile.classNames) {
70+
var classname = assemblyFile.classNames[index];
71+
72+
label = InspectorUtils.createAttrName(classname);
73+
panel.addChild(label);
74+
}
75+
76+
}
77+
78+
79+
asset: ToolCore.Asset;
80+
importer:ToolCore.NETAssemblyImporter;
81+
82+
}
83+
84+
export = AssemblyInspector;

‎Script/AtomicEditor/ui/frames/inspector/AttributeInfoEdit.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ class ResourceRefAttributeEdit extends AttributeInfoEdit {
675675
this.nameOverride = attrInfo.resourceTypeName + " " + this.refListIndex;
676676

677677
var importerName = ToolCore.assetDatabase.getResourceImporterName(attrInfo.resourceTypeName);
678-
678+
679679
if (!importerName)
680680
return false;
681681

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
//
2+
// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
3+
//
4+
// Permission is hereby granted, free of charge, to any person obtaining a copy
5+
// of this software and associated documentation files (the "Software"), to deal
6+
// in the Software without restriction, including without limitation the rights
7+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
// copies of the Software, and to permit persons to whom the Software is
9+
// furnished to do so, subject to the following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included in
12+
// all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
// THE SOFTWARE.
21+
//
22+
23+
import EditorUI = require("ui/EditorUI");
24+
25+
class CSComponentClassSelector extends Atomic.UIWindow {
26+
27+
constructor(editField: Atomic.UIEditField, component: AtomicNETScript.CSComponent) {
28+
29+
super();
30+
31+
var assemblyFile = component.assemblyFile;
32+
33+
this.text = "Select Class: " + assemblyFile.name;
34+
35+
this.rect = [0, 0, 400, 512];
36+
37+
var mainLayout = new Atomic.UILayout();
38+
mainLayout.gravity = Atomic.UI_GRAVITY_ALL;
39+
mainLayout.layoutDistribution = Atomic.UI_LAYOUT_DISTRIBUTION_AVAILABLE;
40+
mainLayout.axis = Atomic.UI_AXIS_Y;
41+
this.contentRoot.addChild(mainLayout);
42+
43+
// really want a grid container
44+
var scrollContainer = new Atomic.UIScrollContainer();
45+
scrollContainer.gravity = Atomic.UI_GRAVITY_ALL;
46+
scrollContainer.scrollMode = Atomic.UI_SCROLL_MODE_Y_AUTO;
47+
scrollContainer.adaptContentSize = true;
48+
49+
var scrollLayout = new Atomic.UILayout();
50+
scrollLayout.layoutPosition = Atomic.UI_LAYOUT_POSITION_LEFT_TOP;
51+
scrollLayout.layoutDistributionPosition = Atomic.UI_LAYOUT_DISTRIBUTION_POSITION_LEFT_TOP;
52+
scrollLayout.axis = Atomic.UI_AXIS_Y;
53+
54+
scrollContainer.contentRoot.addChild(scrollLayout);
55+
56+
var window = this;
57+
58+
for (var i in assemblyFile.classNames) {
59+
60+
var classname = assemblyFile.classNames[i];
61+
var button = new Atomic.UIButton();
62+
button.text = classname;
63+
64+
button.onClick = function() {
65+
editField.text = this.text;
66+
component.componentClassName = this.text;
67+
window.close();
68+
}.bind(button);
69+
70+
scrollLayout.addChild(button);
71+
}
72+
73+
mainLayout.addChild(scrollContainer);
74+
75+
EditorUI.getMainFrame().addChild(this);
76+
77+
this.center();
78+
79+
this.subscribeToEvent("WidgetEvent", (data) => this.handleWidgetEvent(data));
80+
81+
}
82+
83+
handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
84+
85+
if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
86+
87+
if (ev.target != this && !this.isAncestorOf(ev.target)) {
88+
89+
//this.close();
90+
91+
}
92+
93+
}
94+
95+
return false;
96+
97+
}
98+
99+
}
100+
101+
export = CSComponentClassSelector;

‎Script/AtomicEditor/ui/frames/inspector/InspectorFrame.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import MaterialInspector = require("./MaterialInspector");
2929
import ModelInspector = require("./ModelInspector");
3030
import PrefabInspector = require("./PrefabInspector");
3131
import TextureInspector = require("./TextureInspector");
32+
import AssemblyInspector = require("./AssemblyInspector");
3233

3334
import SelectionInspector = require("./SelectionInspector");
3435
// make sure these are hooked in
@@ -220,6 +221,14 @@ class InspectorFrame extends ScriptWidget {
220221
textureInspector.inspect(texture, asset);
221222
}
222223

224+
if (asset.importerTypeName == "NETAssemblyImporter") {
225+
226+
var assemblyInspector = new AssemblyInspector();
227+
container.addChild(assemblyInspector);
228+
assemblyInspector.inspect(asset);
229+
230+
}
231+
223232
}
224233

225234
}

‎Script/AtomicNET/.gitignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/bin/*
2+
**/obj/*
3+
**/project.lock.json
4+
**/.vscode/*
5+
**/Generated
6+

0 commit comments

Comments
 (0)