BrandingProvider.java
4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package com.mumfrey.liteloader.api;
import java.net.URI;
import net.minecraft.util.ResourceLocation;
import com.mumfrey.liteloader.util.render.Icon;
/**
* LiteLoader Extensible API - Branding Provider
*
* The Branding Provider manages loader branding alterations for a particular API. This is an optional
* API component which allows an API to specify customisations and additions to the loader environment
* in order to provide a more comfortable integration for the API.
*
* Since some branding options simply stack (like the API copyright notices for example) all APIs will
* be allowed to supply this information, however other options (like the main logo image) can only be
* set by one API. To determine which API should be used to set this information, the getPriority()
* method will be called and used to sort branding providers by priority, with highest priority winning.
*
* All branding options may return a null/not set value, allowing a branding provider to only override
* the branding features it wishes. Some options require a non-null value to be returned from a set of
* methods in order to take effect. eg. the logo option requires non-null return values from BOTH the
* getLogoResource() and getLogoCoords() methods.
*
* @author Adam Mummery-Smith
*/
public interface BrandingProvider extends CustomisationProvider
{
/**
* Get the priority of this provider, higher numbers take precedence. Some brandings can only be set
* by one provider (eg. the main "about" logo) so the branding provider with the highest priority will
* be the one which gets control of that feature.
*/
public abstract int getPriority();
/**
* Get the primary branding colour for this API, the branding provider should return 0 if it
* does not wish to override the branding colour. The branding colour is used for the mod list
* entries and hyper-links within the about GUI panels, the colour returned should be fully opaque.
*/
public abstract int getBrandingColour();
/**
* Get the resource to use for the main logo, the API with the highest priority gets to define the
* logo, this method can return null if this API does not want to override the logo
*/
public abstract ResourceLocation getLogoResource();
/**
* Gets the coordinates of the logo as an IIcon instance, only called if getLogoResource() returns
* a non-null value and the logo will only be used if BOTH methods return a valid object.
*/
public abstract Icon getLogoCoords();
/**
* Get the resource to use for the icon logo (the chicken in the default setup), the API with the
* highest priority gets to define the icon logo, this method can return null if this API does not
* want to override the icon
*/
public abstract ResourceLocation getIconResource();
/**
* Gets the coordinates of the icon logo as an IIcon instance, only called if getIconResource()
* returns a non-null value and the icon will only be used if BOTH methods return a valid object.
*/
public abstract Icon getIconCoords();
/**
* Get the display name for this API, used on the "about" screen, must not return null
*/
public abstract String getDisplayName();
/**
* Get the copyright text for this API, used on the "about" screen, must not return null
*/
public abstract String getCopyrightText();
/**
* Get the main home page URL for this API, used on the "about" screen, must not return null
*/
public abstract URI getHomepage();
/**
* If you wish to display a clickable twitter icon next to the API information in the "about" panel
* then you must return values from this method as well as getTwitterAvatarResource() and
* getTwitterAvatarCoords(). Return the twitter user name here.
*/
public abstract String getTwitterUserName();
/**
* If you wish to display a clickable twitter icon next to the API information, return the icon
* resource here.
*/
public abstract ResourceLocation getTwitterAvatarResource();
/**
* If you wish to display a clickable twitter icon next to the API information, return the icon
* coordinates here.
*/
public abstract Icon getTwitterAvatarCoords();
}