Skip to content

Commit

Permalink
Release 1.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dronelektron committed Apr 6, 2024
2 parents 15b283e + 52b0196 commit 9a2d6b2
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 731 deletions.
674 changes: 0 additions & 674 deletions scripting/include/morecolors.inc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined _ru_entity_included
#if defined _respawn_unlocker_entity_included
#endinput
#endif
#define _ru_entity_included
#define _respawn_unlocker_entity_included

#define ENTITY_NOT_FOUND -1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined _ru_math_included
#if defined _respawn_unlocker_math_included
#endinput
#endif
#define _ru_math_included
#define _respawn_unlocker_math_included

#define X 0
#define Y 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined _ru_menu_included
#if defined _respawn_unlocker_menu_included
#endinput
#endif
#define _ru_menu_included
#define _respawn_unlocker_menu_included

#define TEXT_BUFFER_MAX_SIZE (256 * 4)
#define MENU_ITEM_INFO_MAX_SIZE 32
Expand Down
11 changes: 11 additions & 0 deletions scripting/include/respawn-unlocker/message.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#if defined _respawn_unlocker_message_included
#endinput
#endif
#define _respawn_unlocker_message_included

#define COLOR_DEFAULT "\x01"

#define PREFIX "[Respawn unlocker] "
#define PREFIX_COLORED "Prefix colored"

#define CONSOLE 0
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined _ru_storage_included
#if defined _respawn_unlocker_storage_included
#endinput
#endif
#define _ru_storage_included
#define _respawn_unlocker_storage_included

#define PERMISSIONS_USER (FPERM_U_READ | FPERM_U_WRITE | FPERM_U_EXEC)
#define PERMISSIONS_GROUP (FPERM_G_READ | FPERM_G_WRITE | FPERM_G_EXEC)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined _ru_visualizer_included
#if defined _respawn_unlocker_visualizer_included
#endinput
#endif
#define _ru_visualizer_included
#define _respawn_unlocker_visualizer_included

#define BEAM_START_FRAME 0
#define BEAM_FRAME_RATE 0
Expand Down
9 changes: 0 additions & 9 deletions scripting/include/ru/message.inc

This file was deleted.

19 changes: 19 additions & 0 deletions scripting/modules/event.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
void Event_Create() {
HookEvent("dod_round_start", Event_RoundStart);
HookEvent("dod_round_win", Event_RoundWin);
}

public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast) {
UseCase_RestoreWalls();
CrateEditor_Clear();

return Plugin_Continue;
}

public Action Event_RoundWin(Event event, const char[] name, bool dontBroadcast) {
UseCase_DisableWalls();
UseCase_DisableTriggers();
UseCase_AddCrates();

return Plugin_Continue;
}
6 changes: 3 additions & 3 deletions scripting/modules/message.sp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
void MessagePrint_WallsDisabled() {
CPrintToChatAll("%s%t", PREFIX_COLORED, "Walls disabled");
PrintToChatAll(COLOR_DEFAULT ... "%t%t", PREFIX_COLORED, "Walls disabled");
}

void MessagePrint_TriggersDisabled() {
CPrintToChatAll("%s%t", PREFIX_COLORED, "Triggers disabled");
PrintToChatAll(COLOR_DEFAULT ... "%t%t", PREFIX_COLORED, "Triggers disabled");
}

void MessagePrint_CratesAdded() {
CPrintToChatAll("%s%t", PREFIX_COLORED, "Crates added");
PrintToChatAll(COLOR_DEFAULT ... "%t%t", PREFIX_COLORED, "Crates added");
}

void Message_CratesLoaded(int client) {
Expand Down
38 changes: 9 additions & 29 deletions scripting/respawn-unlocker.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@
#undef REQUIRE_PLUGIN
#include <adminmenu>

#include "morecolors"

#pragma semicolon 1
#pragma newdecls required

#include "ru/entity"
#include "ru/math"
#include "ru/menu"
#include "ru/message"
#include "ru/storage"
#include "ru/visualizer"
#include "respawn-unlocker/entity"
#include "respawn-unlocker/math"
#include "respawn-unlocker/menu"
#include "respawn-unlocker/message"
#include "respawn-unlocker/storage"
#include "respawn-unlocker/visualizer"

#include "modules/console-command.sp"
#include "modules/console-variable.sp"
#include "modules/crate-editor.sp"
#include "modules/crate-list.sp"
#include "modules/entity.sp"
#include "modules/event.sp"
#include "modules/math.sp"
#include "modules/menu.sp"
#include "modules/message.sp"
Expand All @@ -34,7 +30,7 @@ public Plugin myinfo = {
name = "Respawn unlocker",
author = "Dron-elektron",
description = "Allows you to unlock respawn at the end of the round",
version = "1.6.3",
version = "1.6.4",
url = "https://github.com/dronelektron/respawn-unlocker"
};

Expand All @@ -46,8 +42,7 @@ public void OnPluginStart() {
TriggerList_Create();
CrateEditor_Create();
AdminMenu_Create();
HookEvent("dod_round_start", Event_RoundStart);
HookEvent("dod_round_win", Event_RoundWin);
Event_Create();
LoadTranslations("respawn-unlocker.phrases");
AutoExecConfig(true, "respawn-unlocker");
}
Expand Down Expand Up @@ -80,18 +75,3 @@ public void OnLibraryRemoved(const char[] name) {
AdminMenu_Destroy();
}
}

public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast) {
UseCase_RestoreWalls();
CrateEditor_Clear();

return Plugin_Continue;
}

public Action Event_RoundWin(Event event, const char[] name, bool dontBroadcast) {
UseCase_DisableWalls();
UseCase_DisableTriggers();
UseCase_AddCrates();

return Plugin_Continue;
}
11 changes: 8 additions & 3 deletions translations/respawn-unlocker.phrases.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
"Phrases"
{
"Prefix colored"
{
"en" "FF00FF[Respawn unlocker] "
}

"Walls disabled"
{
"en" "{default}Invisible walls are disabled"
"en" "Invisible walls are disabled"
}

"Triggers disabled"
{
"en" "{default}Triggers are disabled"
"en" "Triggers are disabled"
}

"Crates added"
{
"en" "{default}Crates are added"
"en" "Crates are added"
}

"Crate added"
Expand Down
6 changes: 3 additions & 3 deletions translations/ru/respawn-unlocker.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
{
"Walls disabled"
{
"ru" "{default}Невидимые стены отключены"
"ru" "Невидимые стены отключены"
}

"Triggers disabled"
{
"ru" "{default}Триггеры отключены"
"ru" "Триггеры отключены"
}

"Crates added"
{
"ru" "{default}Ящики добавлены"
"ru" "Ящики добавлены"
}

"Crate added"
Expand Down

0 comments on commit 9a2d6b2

Please sign in to comment.