summaryrefslogtreecommitdiff
path: root/NET/worlds/console/AdBanner.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/console/AdBanner.java')
-rw-r--r--NET/worlds/console/AdBanner.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/NET/worlds/console/AdBanner.java b/NET/worlds/console/AdBanner.java
new file mode 100644
index 0000000..c4e8e63
--- /dev/null
+++ b/NET/worlds/console/AdBanner.java
@@ -0,0 +1,37 @@
+package NET.worlds.console;
+
+import NET.worlds.core.IniFile;
+
+public class AdBanner {
+ private WebControl wc = null;
+
+ public AdBanner(int width, int height, String url) {
+ if (IniFile.gamma().getIniInt("NoAdBanners", 0) != 1) {
+ Console c = Console.getActive();
+ if (c != null && c instanceof DefaultConsole) {
+ DefaultConsole dc = (DefaultConsole)c;
+
+ try {
+ RenderCanvas canvas = dc.getRender();
+ if (canvas == null) {
+ return;
+ }
+
+ this.wc = new WebControl(canvas, width, height, false, true, true);
+ this.wc.activate();
+ this.wc.setURL(url);
+ } catch (NoWebControlException var7) {
+ System.out.println("Error creating IE control; " + var7.toString());
+ }
+ }
+ }
+ }
+
+ public void detach() {
+ if (this.wc != null) {
+ this.wc.detach();
+ }
+
+ this.wc = null;
+ }
+}