RuneHive-Game
Loading...
Searching...
No Matches
Settings.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.mob.player;
2
3import com.runehive.content.clanchannel.content.ClanMemberComporator;
4import com.runehive.net.packet.out.SendConfig;
5import com.runehive.net.packet.out.SendScreenMode;
6import com.runehive.net.packet.out.SendZoom;
7
8/**
9 * Handles settings.
10 *
11 * @author Daniel
12 */
13public class Settings {
14 /** The lock experience flag. */
15 public boolean lockExperience = false;
16 /** The TriviaBot flag. */
17 public boolean triviaBot = true;
18 /** The drop notification flag. */
19 public boolean dropNotification = true;
20 /** The untradeable notification flag. */
21 public boolean untradeableNotification = true;
22 /** Welcome screen flag. */
23 public boolean welcomeScreen = true;
24 /** Prestige colors flag. */
25 public boolean prestigeColors = true;
26 /** The yell flag. */
27 public boolean yell = true;
28 /** Brightness. */
29 public int brightness = 3;
30 /** Zoom. */
31 public int zoom = -1;
32 /** Auto-retaliate. */
33 public boolean autoRetaliate = true;
34 /** Mouse button flag. */
35 public boolean mouse = false;
36 /** Chat effects flag. */
37 public boolean chatEffects = true;
38 /** Accept aid flag. */
39 public boolean acceptAid = false;
40 /** Split Private Chat flag. */
41 public boolean privateChat = true;
42 /** Profanity filter flag/ */
43 public boolean profanityFilter = false;
44 /** Camera movement flag/ */
45 public boolean cameraMovement = true;
46 /** ESC Close flage */
47 public boolean ESC_CLOSE = false;
48 public int clientWidth = 765;
49 public int clientHeight = 503;
50 public boolean screenshotKill = true;
51
52 /** The player instance. */
53 public Player player;
54
55 /** The clan sort type. */
57
58 /** Constructs a new <code>Settings</code>. */
60 this.player = player;
61 }
62
63 /** Handles a player logging in. */
64 public void login() {
65 setZoom(zoom, false);
66 player.send(new SendConfig(172, autoRetaliate ? 1 : 0));
67 player.send(new SendConfig(166, brightness));
68 player.send(new SendConfig(152, player.movement.isRunningToggled() ? 1 : 0));
69 player.send(new SendConfig(981, acceptAid ? 1 : 0));
70 player.send(new SendConfig(171, chatEffects ? 1 : 0));
71 player.send(new SendConfig(287, privateChat ? 1 : 0));
72 player.send(new SendConfig(203, profanityFilter ? 1 : 0));
73 player.send(new SendConfig(170, mouse ? 1 : 0));
74 player.send(new SendConfig(207, cameraMovement ? 1 : 0));
75 player.send(new SendConfig(980, 0));
76 player.send(new SendConfig(594, ESC_CLOSE ? 1 : 0));
77 player.send(new SendConfig(394, clanMemberComporator.ordinal()));
78 }
79
80 /** Sets the Zoom */
81 public void setZoom(int zoom, boolean save) {
82 int value = 0;
83 int config = zoom > 4 ? 4 : (zoom == -1 ? 1 : zoom);
84 switch (zoom) {
85 case -1: value = 600; break;
86 case 1: value = 200; break;
87 case 2: value = 400; break;
88 case 3: value = 800; break;
89 case 4: value = 1000; break;
90 }
91 if (this.zoom != zoom)
92 this.zoom = zoom;
93 if (!save) {
94 player.send(new SendZoom(value));
95 player.send(new SendConfig(176, config + 1));
96 }
97 }
98
99 /** Sets the brightness. */
100 public void setBrightness(int brightness) {
101 if (brightness > 4) {
102 brightness = 4;
103 } else if (brightness < 0) {
104 brightness = 0;
105 }
106 this.brightness = (byte) brightness;
107 }
108}
This class represents a character controlled by a player.
Definition Player.java:125
boolean lockExperience
The lock experience flag.
Definition Settings.java:15
boolean untradeableNotification
The untradeable notification flag.
Definition Settings.java:21
boolean profanityFilter
Profanity filter flag/.
Definition Settings.java:43
boolean dropNotification
The drop notification flag.
Definition Settings.java:19
ClanMemberComporator clanMemberComporator
The clan sort type.
Definition Settings.java:56
void login()
Handles a player logging in.
Definition Settings.java:64
Settings(Player player)
Constructs a new Settings.
Definition Settings.java:59
void setZoom(int zoom, boolean save)
Sets the Zoom.
Definition Settings.java:81
boolean privateChat
Split Private Chat flag.
Definition Settings.java:41
boolean prestigeColors
Prestige colors flag.
Definition Settings.java:25
void setBrightness(int brightness)
Sets the brightness.
boolean cameraMovement
Camera movement flag/.
Definition Settings.java:45
The OutgoingPacket responsible for changing settings on a client.