Skip to content

Commit

Permalink
Port some includes to transitional API.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvander committed Jul 5, 2014
1 parent db9ee53 commit e5b1b63
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 22 deletions.
26 changes: 25 additions & 1 deletion plugins/include/adt_array.inc
Expand Up @@ -68,7 +68,7 @@ stock ByteCountToCells(size)
* NOT be auto-intialized.
* @return New Handle to the array object.
*/
native Handle:CreateArray(blocksize=1, startsize=0);
native ArrayList:CreateArray(blocksize=1, startsize=0);

/**
* Clears an array of all entries. This is the same as ResizeArray(0).
Expand Down Expand Up @@ -281,3 +281,27 @@ native FindStringInArray(Handle:array, const String:item[]);
* @error Invalid Handle
*/
native FindValueInArray(Handle:array, any:item);

methodmap ArrayList < Handle {
public ArrayList() = CreateArray;
public Clear() = ClearArray;
public Clone() = CloneArray;
public Resize() = ResizeArray;
public Push() = PushArrayCell;
public PushString() = PushArrayString;
public PushArray() = PushArrayArray;
public Get() = GetArrayCell;
public GetString() = GetArrayString;
public GetArray() = GetArrayArray;
public Set() = SetArrayCell;
public SetString() = SetArrayString;
public SetArray() = SetArrayArray;
public ShiftUp() = ShiftArrayUp;
public Erase() = RemoveFromArray;
public SwapAt() = SwapArrayItems;
public FindString() = FindStringInArray;
public FindValue() = FindValueInArray;
property int Size {
public get() = GetArraySize;
}
};
16 changes: 8 additions & 8 deletions plugins/include/clients.inc
Expand Up @@ -80,7 +80,7 @@ forward bool:OnClientConnect(client, String:rejectmsg[], maxlen);
* @param client Client index.
* @noreturn
*/
forward OnClientConnected(client);
forward void OnClientConnected(client);

/**
* Called when a client is entering the game.
Expand All @@ -96,23 +96,23 @@ forward OnClientConnected(client);
* @param client Client index.
* @noreturn
*/
forward OnClientPutInServer(client);
forward void OnClientPutInServer(client);

/**
* Called when a client is disconnecting from the server.
*
* @param client Client index.
* @noreturn
*/
forward OnClientDisconnect(client);
forward void OnClientDisconnect(client);

/**
* Called when a client is disconnected from the server.
*
* @param client Client index.
* @noreturn
*/
forward OnClientDisconnect_Post(client);
forward void OnClientDisconnect_Post(client);

/**
* Called when a client is sending a command.
Expand All @@ -132,7 +132,7 @@ forward Action:OnClientCommand(client, args);
* @param client Client index.
* @noreturn
*/
forward OnClientSettingsChanged(client);
forward void OnClientSettingsChanged(client);

/**
* Called when a client receives a Steam ID. The state of a client's
Expand All @@ -145,7 +145,7 @@ forward OnClientSettingsChanged(client);
* @param auth Client auth string.
* @noreturn
*/
forward OnClientAuthorized(client, const String:auth[]);
forward void OnClientAuthorized(client, const String:auth[]);

/**
* Called once a client is authorized and fully in-game, but
Expand Down Expand Up @@ -180,7 +180,7 @@ forward Action:OnClientPreAdminCheck(client);
* @param client Client index.
* @noreturn
*/
forward OnClientPostAdminFilter(client);
forward void OnClientPostAdminFilter(client);

/**
* Called once a client is authorized and fully in-game, and
Expand All @@ -192,7 +192,7 @@ forward OnClientPostAdminFilter(client);
* @param client Client index.
* @noreturn
*/
forward OnClientPostAdminCheck(client);
forward void OnClientPostAdminCheck(client);

/**
* This function will be deprecated in a future release. Use the MaxClients variable instead.
Expand Down
2 changes: 1 addition & 1 deletion plugins/include/console.inc
Expand Up @@ -968,4 +968,4 @@ forward Action:OnClientSayCommand(client, const String:command[], const String:s
* @param sArgs Chat argument string.
*
*/
forward OnClientSayCommand_Post(client, const String:command[], const String:sArgs[]);
forward void OnClientSayCommand_Post(int client, const char[] command, const char[] sArgs);
4 changes: 2 additions & 2 deletions plugins/include/mapchooser.inc
Expand Up @@ -98,12 +98,12 @@ native bool:EndOfMapVoteEnabled();
* Called when mapchooser removes a nomination from its list.
* Nominations cleared on map start will not trigger this forward
*/
forward OnNominationRemoved(const String:map[], owner);
forward void OnNominationRemoved(char[] map, int owner);

/**
* Called when mapchooser starts a Map Vote.
*/
forward OnMapVoteStarted();
forward void OnMapVoteStarted();


public SharedPlugin:__pl_mapchooser =
Expand Down
63 changes: 60 additions & 3 deletions plugins/include/menus.inc
Expand Up @@ -152,7 +152,7 @@ enum MenuSource
* @param param2 Second action parameter (usually the item).
* @noreturn
*/
functag public MenuHandler(Handle:menu, MenuAction:action, param1, param2);
functag public MenuHandler(Menu:menu, MenuAction:action, param1, param2);

/**
* Creates a new, empty menu using the default style.
Expand All @@ -164,7 +164,7 @@ functag public MenuHandler(Handle:menu, MenuAction:action, param1, param2);
* the only default actions.
* @return A new menu Handle.
*/
native Handle:CreateMenu(MenuHandler:handler, MenuAction:actions=MENU_ACTIONS_DEFAULT);
native Menu:CreateMenu(MenuHandler:handler, MenuAction:actions=MENU_ACTIONS_DEFAULT);

/**
* Displays a menu to a client.
Expand Down Expand Up @@ -528,7 +528,7 @@ stock bool:VoteMenuToAll(Handle:menu, time, flags=0)
* defines.
* @noreturn
*/
functag public VoteHandler(Handle:menu,
functag public VoteHandler(Menu:menu,
num_votes,
num_clients,
const client_info[][2],
Expand All @@ -546,6 +546,63 @@ functag public VoteHandler(Handle:menu,
*/
native SetVoteResultCallback(Handle:menu, VoteHandler:callback);

methodmap Menu < Handle {
public Menu() = CreateMenu;
public Display() = DisplayMenu;
public DisplayAt() = DisplayMenuAtItem;
public AddItem() = AddMenuItem;
public InsertItem() = InsertMenuItem;
public RemoveItem() = RemoveMenuItem;
public RemoveAllItems() = RemoveAllMenuItems;
public GetItem() = GetMenuItem;
public GetTitle() = GetMenuTitle;
public SetTitle() = SetMenuTitle;
public ToPanel() = CreatePanelFromMenu;
public Cancel() = CancelMenu;
public DisplayVote() = VoteMenu;
public DisplayVoteToAll() = VoteMenuToAll;

public SetPagination() = SetMenuPagination;
property int Pagination {
public get() = GetMenuPagination;
}

public SetOptionFlags() = SetMenuOptionFlags;
property int OptionFlags {
public get() = GetMenuOptionFlags;
}

public SetExitButton() = SetMenuExitButton;
property bool ExitButton {
public get() = GetMenuExitButton;
}
public SetExitBackButton() = SetMenuExitBackButton;
property bool ExitBackButton {
public get() = GetMenuExitBackButton;
}
public SetNoVoteButton() = SetMenuNoVoteButton;
public SetVoteResultCallback() = SetVoteResultCallback;

property int ItemCount {
public get() = GetMenuItemCount;
}
property Handle Style {
public get() = GetMenuStyle;
}
property bool VoteInProgress {
public get() {
return IsVoteInProgress(this);
}
}

public void CancelVote() {
CancelVote();
}
public int GetSelectionPosition() {
return GetMenuSelectionPosition();
}
};

/**
* Returns the number of seconds you should "wait" before displaying
* a publicly invocable menu. This number is the time remaining until
Expand Down
14 changes: 7 additions & 7 deletions plugins/include/sourcemod.inc
Expand Up @@ -172,7 +172,7 @@ forward void OnMapStart();
/**
* Called right before a map ends.
*/
forward OnMapEnd();
forward void OnMapEnd();

/**
* Called when the map has loaded, servercfgfile (server.cfg) has been
Expand Down Expand Up @@ -201,20 +201,20 @@ forward void OnConfigsExecuted();
*
* @noreturn
*/
forward OnAutoConfigsBuffered();
forward void OnAutoConfigsBuffered();

/**
* @deprecated Use OnConfigsExecuted() instead.
*/
#pragma deprecated Use OnConfigsExecuted() instead
forward OnServerCfg();
forward void OnServerCfg();

/**
* Called after all plugins have been loaded. This is called once for
* every plugin. If a plugin late loads, it will be called immediately
* after OnPluginStart().
*/
forward OnAllPluginsLoaded();
forward void OnAllPluginsLoaded();

/**
* Returns the calling plugin's Handle.
Expand Down Expand Up @@ -461,7 +461,7 @@ native GetExtensionFileStatus(const String:name[], String:error[]="", maxlength=
*
* @param name Library name.
*/
forward OnLibraryAdded(const String:name[]);
forward void OnLibraryAdded(const String:name[]);

/**
* Called right before a library is removed that the current plugin references
Expand All @@ -470,7 +470,7 @@ forward OnLibraryAdded(const String:name[]);
*
* @param name Library name.
*/
forward OnLibraryRemoved(const String:name[]);
forward void OnLibraryRemoved(const String:name[]);

#define MAPLIST_FLAG_MAPSFOLDER (1<<0) /**< On failure, use all maps in the maps folder. */
#define MAPLIST_FLAG_CLEARARRAY (1<<1) /**< If an input array is specified, clear it before adding. */
Expand Down Expand Up @@ -564,7 +564,7 @@ forward bool:OnClientFloodCheck(client);
* @param blocked True if client flooded last "say", false otherwise.
* @noreturn
*/
forward OnClientFloodResult(client, bool:blocked);
forward void OnClientFloodResult(client, bool:blocked);

/**
* Feature types.
Expand Down

0 comments on commit e5b1b63

Please sign in to comment.