paint: add project_basepath_get
This commit is contained in:
@@ -42,6 +42,7 @@ void ui_box_show_message(char *title, char *text, bool copyable);
|
|||||||
void ui_files_show2(char *filters, bool is_save, bool open_multiple, void *files_done);
|
void ui_files_show2(char *filters, bool is_save, bool open_multiple, void *files_done);
|
||||||
void project_save(bool save_and_quit);
|
void project_save(bool save_and_quit);
|
||||||
char *project_filepath_get();
|
char *project_filepath_get();
|
||||||
|
char *project_basepath_get();
|
||||||
void project_filepath_set(char *s);
|
void project_filepath_set(char *s);
|
||||||
void project_reimport_mesh_skinned(i32 frame);
|
void project_reimport_mesh_skinned(i32 frame);
|
||||||
void context_set_viewport_shader(void *viewport_shader);
|
void context_set_viewport_shader(void *viewport_shader);
|
||||||
@@ -1210,6 +1211,7 @@ void minic_register_builtins() {
|
|||||||
R(ui_files_show2, "v(p,i,i,p)");
|
R(ui_files_show2, "v(p,i,i,p)");
|
||||||
R(project_save, "v(i)");
|
R(project_save, "v(i)");
|
||||||
R(project_filepath_get, "p()");
|
R(project_filepath_get, "p()");
|
||||||
|
R(project_basepath_get, "p()");
|
||||||
R(project_filepath_set, "v(p)");
|
R(project_filepath_set, "v(p)");
|
||||||
R(script_get_context, "p()");
|
R(script_get_context, "p()");
|
||||||
R(script_get_config, "p()");
|
R(script_get_config, "p()");
|
||||||
|
|||||||
@@ -133,6 +133,9 @@ void ui_files_show2(char *filters, bool is_save, bool open_multiple, void *files
|
|||||||
char *project_filepath_get() {
|
char *project_filepath_get() {
|
||||||
return g_project->_->filepath;
|
return g_project->_->filepath;
|
||||||
}
|
}
|
||||||
|
char *project_basepath_get() {
|
||||||
|
return substring(g_project->_->filepath, 0, string_last_index_of(g_project->_->filepath, PATH_SEP));
|
||||||
|
}
|
||||||
void project_filepath_set(char *s) {
|
void project_filepath_set(char *s) {
|
||||||
g_project->_->filepath = string_copy(s);
|
g_project->_->filepath = string_copy(s);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user