-
Notifications
You must be signed in to change notification settings - Fork 4
API
This event is called after the mod load the custom radio and radio add-ons. You can use it like this :
ExtendedRadio.ExtendedRadio.CallOnRadioLoad += FunctionToCall;Note
I named some method using a paterne.
- All the "convert" method use this paterne.
The Paterne : SomethingToSomething
Example : JsonToRadioChannel
In this example I convert a "Json" to the RadioChannel component/element
Note
In the name of the method you will find both Radio and RadioChannel, this is two different things.
- Radio: Is used when it converts/creates an entire radio, which creates a RadioChannel with all programs and segments inside.
- RadioChannel: Is used when it converts/create a RadioChannel component/element, there is no program inside.
This method add your CustomRadio directory to the a List. ExtendedRadio loop inside this list and load all the radio/network inside your folder.
Example :
ExtendedRadio.CustomRadios.RegisterCustomRadioDirectory(path)Arguments :
- path : String : The path to your custom radio directory, Example of value :
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)+"\\CustomRadios"
This method let you add a RadioNetwork to the game. This function need to be called during the CallOnRadioLoad event.
Example :
ExtendedRadio.CustomRadios.AddRadioNetworkToTheGame(radioNetwork);Arguments :
- radioNetwork : RadioNetwork : The radio network you want to add into the game.
Return :
- true : If the RadioNetwork is added correctly.
- false : Failed to add the RadioNetwork, because it already exists.
This method let you add a RadioChannel to the game. This function need to be called during the CallOnRadioLoad event.
Example :
ExtendedRadio.CustomRadios.AddRadioChannelToTheGame(radioChannel);Arguments :
- radioChannel : RadioChannel : The radio channel you want to add into the game.
Return :
- true : If the RadioChannel is added correctly.
- false : Failed to add the RadioChannel, because it already exists.
This method create a radio channel with all is program and segment.
Example :
ExtendedRadio.CustomRadios.JsonToRadio(path, radioNetworkName);Arguments :
- path : String : The path of the folder that contain the
RadioChannel.jsonfile. - radioNetworkName : String : (OPTIONAL) The name of the Network this radio should be in, it override the info inside the
RadioChannel.jsonandSegment.json.
Return : a RadioChannel.
This method create a radio network from is Json file.
Example :
ExtendedRadio.CustomRadios.JsonToRadioNetwork(path);Arguments :
- path : String : The path of the folder that contain the
RadioNetwork.jsonfile.
Return : a RadioNetwork.
This method create a radio channel from is Json file.
Example :
ExtendedRadio.CustomRadios.JsonToRadioChannel(path);Arguments :
- path : String : The path of the folder that contain the
RadioChannel.jsonfile.
Return : a RadioChannel.
This method create a Program from is Json file.
Example :
ExtendedRadio.CustomRadios.JsonToProgram(path);Arguments :
- path : String : The path of the folder that contain the
Program.jsonfile.
Return : a Program.
This method create a Segment from is Json file.
Example :
ExtendedRadio.CustomRadios.JsonToSegment(path);Arguments :
- path : String : The path of the folder that contain the
Segment.jsonfile.
Return : a Segment.