Skip to content

Commit fafb703

Browse files
author
Burak
authored
Add files via upload
1 parent d2498cf commit fafb703

39 files changed

+20453
-0
lines changed

src/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
project(textdraw-streamer)
2+
3+
set(CMAKE_SUPPRESS_REGENERATION true)
4+
5+
cmake_minimum_required(VERSION 2.8)
6+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
7+
8+
include(AMXConfig)
9+
include(AddSAMPPlugin)
10+
11+
include_directories(
12+
${CMAKE_CURRENT_SOURCE_DIR}
13+
${CMAKE_CURRENT_SOURCE_DIR}/amx
14+
)
15+
16+
add_definitions(-DSAMPGDK_AMALGAMATION)
17+
18+
add_samp_plugin(textdraw-streamer
19+
amxplugin.cpp
20+
Item.cpp
21+
Natives.cpp
22+
precompiler.cpp
23+
Servis.cpp
24+
SlotManager.cpp
25+
Makro.h
26+
main.cpp
27+
textdraw-streamer.def
28+
sampgdk.c
29+
sampgdk.h
30+
)

src/Item.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (C) 2020 Burak (NexoR)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include "Item.h"
18+
19+
std::unordered_map<int, std::unordered_map<int, std::unique_ptr<PlayerText>>> Item::pText;
20+
PlayerTextDefault Item::def_pText;
21+
22+
void Item::Reset()
23+
{
24+
for (size_t i = 0; i < MAX_PLAYERS; i++)
25+
{
26+
pText[i].clear();
27+
}
28+
}

src/Item.h

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
* Copyright (C) 2020 Burak (NexoR)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
19+
#include "precompiler.h"
20+
21+
struct PlayerTextDefault
22+
{
23+
float lettersize_x = 0.0;
24+
float lettersize_y = 0.0;
25+
26+
float textsize_x = 0.0;
27+
float textsize_y = 0.0;
28+
29+
int alignment = 1;
30+
int color = -2;
31+
int usebox = 0;
32+
int boxcolor = -2;
33+
int shadow = 2;
34+
int outline = 0;
35+
int backgroundcolor = -2;
36+
int font = 1;
37+
int proportional = 1;
38+
int selectable = 0;
39+
40+
std::string setstring;
41+
42+
int modelindex = 0;
43+
float fRotX = 0.0;
44+
float fRotY = 0.0;
45+
float fRotZ = 0.0;
46+
float fZoom = 1.0;
47+
48+
int veh_col1 = -2;
49+
int veh_col2 = -2;
50+
};
51+
52+
struct PlayerText
53+
{
54+
int real_id;
55+
56+
float create_x;
57+
float create_y;
58+
59+
std::string text;
60+
61+
float lettersize_x;
62+
float lettersize_y;
63+
64+
float textsize_x;
65+
float textsize_y;
66+
67+
int alignment;
68+
int color;
69+
int usebox;
70+
int boxcolor;
71+
int shadow;
72+
int outline;
73+
int backgroundcolor;
74+
int font;
75+
int proportional;
76+
int selectable;
77+
78+
std::string setstring;
79+
80+
int modelindex;
81+
float fRotX;
82+
float fRotY;
83+
float fRotZ;
84+
float fZoom;
85+
86+
int veh_col1;
87+
int veh_col2;
88+
};
89+
90+
class Item
91+
{
92+
public:
93+
static void Reset();
94+
static std::unordered_map<int, std::unordered_map<int, std::unique_ptr<PlayerText>>> pText;
95+
static PlayerTextDefault def_pText;
96+
97+
private:
98+
99+
};

src/Makro.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (C) 2020 Burak (NexoR)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
19+
constexpr auto LOG = "[plugin.textdrawstreamer]";
20+
constexpr auto LOG_MODE = false;
21+
22+
constexpr auto INVALID_DYNAMIC_TEXTDRAW = -1;

0 commit comments

Comments
 (0)