-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scriptable with temporary click function To be replaced, probably. Binding to add a scriptable to a level Update mocks Add first test callback Register for scriptable changed events Make view update automatically Have a data field on scriptables Tooltips for scriptables Show notes Temporary hack with screen position as rendering not inside scriptable Move rendering to the scriptable Update IScriptable.h Update ILevel.h
- Loading branch information
Showing
23 changed files
with
491 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#pragma once | ||
|
||
#include <functional> | ||
#include <memory> | ||
|
||
#include <trview.common/Event.h> | ||
|
||
#include "../../Geometry/IMesh.h" | ||
|
||
struct lua_State; | ||
|
||
namespace trview | ||
{ | ||
struct ICamera; | ||
|
||
struct IScriptable | ||
{ | ||
using Source = std::function<std::shared_ptr<IScriptable>(lua_State*)>; | ||
virtual ~IScriptable() = 0; | ||
virtual void click() = 0; | ||
virtual int data() const = 0; | ||
virtual std::shared_ptr<IMesh> mesh() const = 0; | ||
virtual std::string notes() const = 0; | ||
virtual DirectX::SimpleMath::Vector3 position() const = 0; | ||
virtual void render(const ICamera& camera) = 0; | ||
virtual DirectX::SimpleMath::Vector3 screen_position() const = 0; | ||
virtual void set_data(int ref) = 0; | ||
virtual void set_notes(const std::string& notes) = 0; | ||
virtual void set_on_click(int ref) = 0; | ||
virtual void set_position(const DirectX::SimpleMath::Vector3& position) = 0; | ||
virtual void set_on_tooltip(int ref) = 0; | ||
virtual void set_screen_position(const DirectX::SimpleMath::Vector3& position) = 0; | ||
virtual std::string tooltip() const = 0; | ||
|
||
Event<> on_changed; | ||
}; | ||
|
||
namespace lua | ||
{ | ||
void scriptable_register(lua_State* L, const IScriptable::Source& source); | ||
std::shared_ptr<IScriptable> to_scriptable(lua_State* L, int index); | ||
} | ||
} |
Oops, something went wrong.