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

Replace bind with optional arguments to lambda func #239

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hide/comp/Scene.hx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class Scene extends hide.comp.Component implements h3d.IDrawable {
public function loadModel( path : String, mainScene = false, reload = false ) {
checkCurrent();
var lib = loadHMD(path, false, reload);
return lib.makeObject(loadTexture.bind(path));
return lib.makeObject(texturePath -> loadTexture(path, texturePath));
}

public function loadAnimation( path : String ) {
Expand Down
6 changes: 3 additions & 3 deletions hide/comp/cdb/Editor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ class Editor extends Component {
moveSubmenu.push({
label : sep.title,
enabled : true,
click : isSelectedLine ? moveLines.bind(selection, delta) : moveLine.bind(usedLine, delta),
click : isSelectedLine ? moveLines.bind(selection, delta) : () -> moveLine(usedLine, delta),
});
}

Expand All @@ -2035,12 +2035,12 @@ class Editor extends Component {
{
label : "Move Up",
enabled: (firstLine.index > 0 || sepIndex >= 0),
click : isSelectedLine ? moveLines.bind(selection, -1) : moveLine.bind(line, -1),
click : isSelectedLine ? moveLines.bind(selection, -1) : () -> moveLine(line, -1),
},
{
label : "Move Down",
enabled: (lastLine.index < sheet.lines.length - 1),
click : isSelectedLine ? moveLines.bind(selection, 1) : moveLine.bind(line, 1),
click : isSelectedLine ? moveLines.bind(selection, 1) : () -> moveLine(line, 1),
},
{ label : "Move to Group", enabled : moveSubmenu.length > 0, menu : moveSubmenu },
{ label : "", isSeparator : true },
Expand Down
2 changes: 1 addition & 1 deletion hide/view/Prefab.hx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class PrefabSceneEditor extends hide.comp.SceneEditor {

function setup(p : PrefabElement) {
autoName(p);
haxe.Timer.delay(addElements.bind([p]), 0);
haxe.Timer.delay(() -> addElements([p]), 0);
}

function addNewInstances() {
Expand Down
Loading