generated from hertog/godot-module-template
chore: progress
This commit is contained in:
parent
e7cf1d3b95
commit
38409781c3
6 changed files with 84 additions and 7 deletions
33
engine/modules/sequester/client_window.cpp.old
Normal file
33
engine/modules/sequester/client_window.cpp.old
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include "client_window.h"
|
||||
|
||||
SubViewport ClientWindow::get_target_sub_viewport() {
|
||||
return this->target_sub_viewport;
|
||||
}
|
||||
|
||||
void ClientWindow::set_target_sub_viewport(SubViewport new_sub_viewport) {
|
||||
this->target_sub_viewport = new_sub_viewport;
|
||||
}
|
||||
|
||||
Node2D ClientWindow::get_player() {
|
||||
return this->player;
|
||||
}
|
||||
|
||||
void ClientWindow::set_player(Node2D new_player) {
|
||||
this->player = new_player;
|
||||
}
|
||||
|
||||
void ClientWindow::set_world_2d() {
|
||||
this->world_2d = this->target_sub_viewport.find_world_2d();
|
||||
}
|
||||
|
||||
void ClientWindow::_bind_methods() {
|
||||
|
||||
}
|
||||
|
||||
void ClientWindow::_notification(int p_what) {
|
||||
|
||||
}
|
||||
|
||||
void ClientWindow::move_camera() {
|
||||
this->camera.position = this->player.position;
|
||||
}
|
||||
12
engine/modules/sequester/client_window.h
Normal file
12
engine/modules/sequester/client_window.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef CLIENT_WINDOW_H
|
||||
#define CLIENT_WINDOW_H
|
||||
|
||||
#include "scene/main/window.h"
|
||||
|
||||
class ClientWindow : public Window {
|
||||
GDCLASS(ClientWindow, Window);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // !CLIENT_WINDOW_H
|
||||
31
engine/modules/sequester/client_window.h.old
Normal file
31
engine/modules/sequester/client_window.h.old
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef CLIENT_WINDOW_H
|
||||
#define CLIENT_WINDOW_H
|
||||
|
||||
#include "scene/main/window.h"
|
||||
#include "scene/main/viewport.h"
|
||||
#include "scene/2d/node_2d.h"
|
||||
|
||||
class ClientWindow : public Window {
|
||||
GDCLASS(ClientWindow, Window);
|
||||
|
||||
private:
|
||||
SubViewport target_sub_viewport {};
|
||||
Node2D player {};
|
||||
|
||||
public:
|
||||
SubViewport get_target_sub_viewport();
|
||||
void set_target_sub_viewport(SubViewport new_sub_viewport);
|
||||
|
||||
Node2D get_player();
|
||||
void set_player(Node2D new_player);
|
||||
|
||||
void set_world_2d();
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
void _notification(int p_what);
|
||||
|
||||
private:
|
||||
void move_camera();
|
||||
};
|
||||
|
||||
#endif // !CLIENT_WINDOW_H
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
#include "register_types.h"
|
||||
|
||||
#include "core/object/class_db.h"
|
||||
#include "client_window.h"
|
||||
|
||||
void initialize_sequester_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
ClassDB::register_class<ClientWindow>();
|
||||
}
|
||||
|
||||
void uninitialize_sequester_module(ModuleInitializationLevel p_level) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue