Skip to content

Commit

Permalink
Merge 1.9 from inprogress branch
Browse files Browse the repository at this point in the history
Releasing 1.9

-Object notes (can be seen with /note command and on text3d, also is exported on maps on a comment on the end of the objects' lines)
-Per-object/group draw distance
-More advanced databases with much more information stored (saves map creator name, last edit time, spawn position for /gotomap, and interior/vw)
-Repeat last command with WALK + CROUCH (more buffered commands stuff coming)
-More advanced text3d options for notes and object model info (see /edittext3d)
-/mprop for map properties (currently only vw and interior)
-/gotomap and /setspawn for saved maps (/gotomap sends the player to the /setspawn location)
-Vehicle siren support
  • Loading branch information
Crayder authored Dec 4, 2017
2 parents aae8d4c + c01a310 commit 7a5dfb9
Show file tree
Hide file tree
Showing 16 changed files with 1,003 additions and 113 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ Icon
# Files that might appear on external disk
.Spotlight-V100
.Trashes
*.session
pawno/pawnc.bat
Binary file modified filterscripts/tstudio.amx
Binary file not shown.
42 changes: 40 additions & 2 deletions filterscripts/tstudio.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DDDDDDDDDDID~DDDDDDDD.O.,D8..$..?... DD8Z...8.Z:,?...7I.
| |/ _ \ \/ / __| | | | '__/ _ \ \___ \| __| | | |/ _` | |/ _ \
| | __/> <| |_| |_| | | | __/ ____) | |_| |_| | (_| | | (_) |
|_|\___/_/\_\\__|\__,_|_| \___| |_____/ \__|\__,_|\__,_|_|\___/
Texture Studio v1.5 by [uL]Pottus
Texture Studio v1.9 by [uL]Pottus and Crayder
You may modify and re-release this this script if you please just rememeber the
mule who built it!
Expand Down Expand Up @@ -193,6 +193,14 @@ Change Log:
v1.7 - /undo command (Note you can't undo edits on vehicles currently)
*/

/* NONE MAJOR MINOR PATCH
- 0x 00 00 00 00
- Major: X.00 (# 1-10)
- Minor: 0.X0 (# 1-10)
- Patch: 0.0X (Letter a-z, not A-Z)
*/
#define TS_VERSION (0x00010900)

#define FILTERSCRIPT

// Uncomment to turn on DEBUG mode
Expand Down Expand Up @@ -257,6 +265,9 @@ Change Log:
// Include 3D Menus (By SDraw)
#include "tstudio\3dmenu.pwn"

// Command Buffer
#include "tstudio\cmdbuffer.pwn"

// Common functions
#include <functions>

Expand All @@ -278,7 +289,7 @@ Change Log:
#define HIGHLIGHT_OBJECT_COLOR 0xFFFF0000

// Maximum text length
#define MAX_TEXT_LENGTH 128
#define MAX_TEXT_LENGTH 129


// 3D Text drawdistance
Expand Down Expand Up @@ -334,6 +345,7 @@ enum OBJECTINFO
oGroup, // Object group
oModel, // Object Model
Text3D:oTextID, // Object 3d text label
oNote[64], // Object note
Float:oX, // Position Z
Float:oY, // Position Z
Float:oZ, // Position Z
Expand All @@ -352,6 +364,7 @@ enum OBJECTINFO
oTextFontSize, // Font text size
oObjectText[MAX_TEXT_LENGTH], // Font text
oAttachedVehicle, // Vehicle object is attached to
Float:oDD // Draw distance
}

// Copy object material / color
Expand Down Expand Up @@ -379,6 +392,31 @@ new CopyBuffer[MAX_PLAYERS][COPYINFO];
// Object information array
new ObjectData[MAX_TEXTURE_OBJECTS][OBJECTINFO];

// 3D Text Options
enum TEXTOPTIONS
{
bool:tShowText,
bool:tShowNote,
bool:tShowModel,
bool:tShowGroup,
bool:tShowGrouped
}
new TextOption[TEXTOPTIONS] = {
true, false, false, true, true
};

// Map Options
enum MAPOPTIONS
{
mVersion,
mAuthor[MAX_PLAYER_NAME],
mLastEdit,
mSpawn[XYZ],

mInterior,
mVirtualWorld
}
new MapSetting[MAPOPTIONS];

// Sets the current object a player is editing
new CurrObject[MAX_PLAYERS] = { -1, ... };
Expand Down
65 changes: 65 additions & 0 deletions filterscripts/tstudio/cmdbuffer.pwn
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#define MAX_COMMAND_BUFFER (20)

new CommandBuffer[MAX_PLAYERS][MAX_COMMAND_BUFFER][128],
bool:CommandBuffed[MAX_PLAYERS][MAX_COMMAND_BUFFER];

#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0) \
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

new bool:HoldKeyPressed;
OnPlayerKeyStateChangeCMD(playerid,newkeys,oldkeys)
{
if(HoldKeyPressed && PRESSED(KEY_CROUCH) && !isnull(CommandBuffer[playerid][0]))
Command_ReProcess(playerid, CommandBuffer[playerid][0], 0); //BroadcastCommand(playerid, CommandBuffer[playerid][0]);

if(PRESSED(KEY_WALK))
HoldKeyPressed = true;
else if(RELEASED(KEY_WALK))
HoldKeyPressed = false;

return 0;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success)
{
// If we need to shift the buffer
if(CommandBuffed[playerid][MAX_COMMAND_BUFFER - 1])
{
// Make every slot, start from slot 2, take the data from the slot before
for(new i = 1; i < MAX_COMMAND_BUFFER; i++)
CommandBuffer[playerid][i] = CommandBuffer[playerid][i - 1];
}

// Insert the command and it's parameters into the buffer
CommandBuffer[playerid][0][0] = EOS;
strcat(CommandBuffer[playerid][0], cmdtext);

return 1;
}
return 0;
}

public OnPlayerConnect(playerid)
{
// Reset the player's buffer
new tmpCommandBuffer[MAX_COMMAND_BUFFER][128];
CommandBuffer[playerid] = tmpCommandBuffer;

#if defined CB_OnPlayerConnect
CB_OnPlayerConnect(playerid);
#endif
return 1;
}
#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect CB_OnPlayerConnect
#if defined CB_OnPlayerConnect
forward CB_OnPlayerConnect(playerid);
#endif
42 changes: 39 additions & 3 deletions filterscripts/tstudio/groups.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public OnUpdateGroup3DText(index)
GroupObjectText[i][index] = Text3D:-1;
}

if(GroupedObjects[i][index])
if(TextOption[tShowText] && TextOption[tShowGrouped] && GroupedObjects[i][index])
{
// 3D Text Label (To identify objects)
new line[32];
Expand Down Expand Up @@ -796,7 +796,7 @@ YCMD:gmtcolor(playerid, arg[], help)
DestroyDynamicObject(ObjectData[i][oID]);

// Re-create object
ObjectData[i][oID] = CreateDynamicObject(ObjectData[i][oModel], ObjectData[i][oX], ObjectData[i][oY], ObjectData[i][oZ], ObjectData[i][oRX], ObjectData[i][oRY], ObjectData[i][oRZ], -1, -1, -1, 300.0);
ObjectData[i][oID] = CreateDynamicObject(ObjectData[i][oModel], ObjectData[i][oX], ObjectData[i][oY], ObjectData[i][oZ], ObjectData[i][oRX], ObjectData[i][oRY], ObjectData[i][oRZ], MapSetting[mVirtualWorld], MapSetting[mInterior], -1, 300.0);
Streamer_SetFloatData(STREAMER_TYPE_OBJECT, ObjectData[i][oID], E_STREAMER_DRAW_DISTANCE, 300.0);

// Update the materials
Expand Down Expand Up @@ -1611,6 +1611,42 @@ YCMD:grz(playerid, arg[], help)
return 1;
}

YCMD:gdd(playerid, arg[], help)
{
if(help)
{
SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________");
SendClientMessage(playerid, STEALTH_GREEN, "Set a group's draw distance.");
return 1;
}

MapOpenCheck();
new time = GetTickCount();
new Float:dd;
sscanf(arg, "F(300.0)", dd);

db_begin_transaction(EditMap);
foreach(new i : Objects)
{
if(GroupedObjects[playerid][i])
{
SaveUndoInfo(i, UNDO_TYPE_EDIT, time);

ObjectData[i][oDD] = dd;
Streamer_SetFloatData(STREAMER_TYPE_OBJECT, ObjectData[i][oID], E_STREAMER_DRAW_DISTANCE, dd);
Streamer_SetFloatData(STREAMER_TYPE_OBJECT, ObjectData[i][oID], E_STREAMER_STREAM_DISTANCE, dd);

sqlite_UpdateObjectDD(i);
}
}
db_end_transaction(EditMap);

SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________");
SendClientMessage(playerid, STEALTH_GREEN, sprintf("Groups draw distance set to %.2f", dd));

return 1;
}


// Export group of objects as an attached object
YCMD:gaexport(playerid, arg[], help)
Expand Down Expand Up @@ -1763,7 +1799,7 @@ AttachExport(playerid, mapname[], Float:drawdist)
}

fwrite(f,"//Attached Object Map Exported with Texture Studio By: [uL]Pottus////////////////////////////////////////////////\r\n");
fwrite(f,"/////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n");
fwrite(f,"//////////////////////////////////////////////////////////////and Crayder////////////////////////////////////////\r\n");
fwrite(f,"/////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n");

// Temp object for setting materials
Expand Down
6 changes: 3 additions & 3 deletions filterscripts/tstudio/listsel.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ ClickTextDrawListSel(playerid, Text:clickedid)
{
new i = CurrListHighlightObject[playerid];
DestroyDynamicObject(ObjectData[i][oID]);
ObjectData[i][oID] = CreateDynamicObject(ObjectData[i][oModel], ObjectData[i][oX], ObjectData[i][oY], ObjectData[i][oZ], ObjectData[i][oRX], ObjectData[i][oRY], ObjectData[i][oRZ], -1, -1, -1, 300.0);
ObjectData[i][oID] = CreateDynamicObject(ObjectData[i][oModel], ObjectData[i][oX], ObjectData[i][oY], ObjectData[i][oZ], ObjectData[i][oRX], ObjectData[i][oRY], ObjectData[i][oRZ], MapSetting[mVirtualWorld], MapSetting[mInterior], -1, 300.0);

UpdateMaterial(CurrListHighlightObject[playerid]);
UpdateObjectText(CurrListHighlightObject[playerid]);
Expand Down Expand Up @@ -724,7 +724,7 @@ static UpdateListPreview(playerid, index, bool:update = true)
if(i > -1)
{
DestroyDynamicObject(ObjectData[i][oID]);
ObjectData[i][oID] = CreateDynamicObject(ObjectData[i][oModel], ObjectData[i][oX], ObjectData[i][oY], ObjectData[i][oZ], ObjectData[i][oRX], ObjectData[i][oRY], ObjectData[i][oRZ], -1, -1, -1, 300.0);
ObjectData[i][oID] = CreateDynamicObject(ObjectData[i][oModel], ObjectData[i][oX], ObjectData[i][oY], ObjectData[i][oZ], ObjectData[i][oRX], ObjectData[i][oRY], ObjectData[i][oRZ], MapSetting[mVirtualWorld], MapSetting[mInterior], -1, 300.0);

UpdateMaterial(CurrListHighlightObject[playerid]);
UpdateObjectText(CurrListHighlightObject[playerid]);
Expand Down Expand Up @@ -752,7 +752,7 @@ static UpdateListPreview(playerid, index, bool:update = true)
{
new i = CurrListHighlightObject[playerid];
DestroyDynamicObject(ObjectData[i][oID]);
ObjectData[i][oID] = CreateDynamicObject(ObjectData[i][oModel], ObjectData[i][oX], ObjectData[i][oY], ObjectData[i][oZ], ObjectData[i][oRX], ObjectData[i][oRY], ObjectData[i][oRZ], -1, -1, -1, 300.0);
ObjectData[i][oID] = CreateDynamicObject(ObjectData[i][oModel], ObjectData[i][oX], ObjectData[i][oY], ObjectData[i][oZ], ObjectData[i][oRX], ObjectData[i][oRY], ObjectData[i][oRZ], MapSetting[mVirtualWorld], MapSetting[mInterior], -1, 300.0);

UpdateMaterial(CurrListHighlightObject[playerid]);
UpdateObjectText(CurrListHighlightObject[playerid]);
Expand Down
2 changes: 1 addition & 1 deletion filterscripts/tstudio/objm.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static AddOBMObject(playerid,modelid,Float:x,Float:y,Float:z,Float:rx,Float:ry,F
{
if(OBMStack[playerid][i][OMBID] == -1)
{
OBMStack[playerid][i][OMBID] = CreateDynamicObject(modelid, x, y, z, rx, ry, rz, -1, -1, -1, 300.0, 300.0);
OBMStack[playerid][i][OMBID] = CreateDynamicObject(modelid, x, y, z, rx, ry, rz, MapSetting[mVirtualWorld], MapSetting[mInterior], -1, 300.0, 300.0);
OBMStack[playerid][i][OMBModel] = modelid;
OBMStack[playerid][i][OBMX] = x;
OBMStack[playerid][i][OBMY] = y;
Expand Down
Loading

0 comments on commit 7a5dfb9

Please sign in to comment.