set g_sandbox_object_scale_max 2 "maximum scale that objects can be set to"
set g_sandbox_object_material_velocity_min 100 "velocity objects must have while colliding for material effects to be applied"
set g_sandbox_object_material_velocity_factor 0.002 "velocity range which decides the intensity of material effects"
+set cl_sandbox_clipboard ""
seta menu_sandbox_spawn_model ""
seta menu_sandbox_attach_bone ""
me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Spawn"), '0 0 0', "sandbox object_spawn \"$menu_sandbox_spawn_model\"", 0));
me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Remove *"), '0 0 0', "sandbox object_remove", 0));
me.TDempty(me, 0.1);
- me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Copy *"), '0 0 0', "sandbox object_duplicate copy", 0));
+ me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Copy *"), '0 0 0', "sandbox object_duplicate copy cl_sandbox_clipboard", 0));
me.TD(me, 1, 0.5, makeXonoticCommandButton(_("Paste"), '0 0 0', "sandbox object_duplicate paste", 0));
me.TR(me);
me.TD(me, 1, 0.25, e = makeXonoticTextLabel(0, _("Bone:")));
{
entity e;
float i;
+ string s;
// ---------------- COMMAND: HELP ----------------
case "help":
e = sandbox_ObjectEdit_Get(autocvar_g_sandbox_editor_free); // can we copy objects we can't edit?
if(e != world)
{
- if(self.object_clipboard)
- strunzone(self.object_clipboard);
- self.object_clipboard = strzone(sandbox_ObjectPort_Save(e, FALSE));
+ s = sandbox_ObjectPort_Save(e, FALSE);
+ s = strreplace("\"", "\\\"", s);
+ stuffcmd(self, strcat("set ", argv(3), " \"", s, "\""));
print_to(self, "^2SANDBOX - INFO: ^7Object copied to clipboard");
return TRUE;