[REQUEST] :CHANGEUI COMMAND PLUS EMULATOR REVISION 2 [REQUEST]

ptimmaq2

We all make mistakes
Aug 7, 2013
283
33
title says it all, i need :changeui command on plus emu r2 so i can switch between new and old ui.
 

Vanish

Rising Java Developer
Dec 8, 2013
630
94
OFT ; this should be in Habbo Help & Support.
ONT ; u need a specific habbo.swf and a specific source code fo dat ._.
 

13rad

King
Sep 15, 2013
156
36
Step 1 - Table alteration

Firstly, run the following MySQL query:


ALTER TABLE users
ADD use_newui enum('1','0') DEFAULT '1';
Step 2 - Modifying the Habbo class

Firstly, open Habbo.cs and find:


internal bool IsGuardian;

and add below it:

Code:
internal bool NewUI;
then, find:


internal Habbo(UInt32 Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, Int32 Credits,
Int32 ActivityPoints, Double LastActivityPointsUpdate, bool Muted,
UInt32 HomeRoom, Int32 Respect, Int32 DailyRespectPoints, Int32 DailyPetRespectPoints,
bool MutantPenalty, bool HasFriendRequestsDisabled, uint currentQuestID, int currentQuestProgress,
int achievementPoints, int LastOnline, bool AppearOffline, bool HideInRoom, bool VIP, double CreateDate,
bool Online, bool isguide, bool Blockwhisper, int SCurrency, bool mysbox, int key, List<GroupUser> Groups, uint FavId, int LastChange)


and add bool NewUI or replace it with this:

Code:
internal Habbo(UInt32 Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, Int32 Credits,
Int32 ActivityPoints, Double LastActivityPointsUpdate, bool Muted,
UInt32 HomeRoom, Int32 Respect, Int32 DailyRespectPoints, Int32 DailyPetRespectPoints,
bool MutantPenalty, bool HasFriendRequestsDisabled, uint currentQuestID, int currentQuestProgress,
int achievementPoints, int LastOnline, bool AppearOffline, bool HideInRoom, bool VIP, double CreateDate,
bool Online, bool isguide, bool Blockwhisper, int SCurrency, bool mysbox, int key, List<GroupUser> Groups, uint FavId, int LastChange, bool NewUI)

and then find:


this.IsGuardian = true;

and add this directly below:

Code:
this.NewUI = NewUI;

then you need to add this at the bottom of the Habbo.cs file:

Code:
internal void NewUISwitcher() {
if (NewUI)
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE users SET use_newui='0' WHERE id='" + this.Id + "'");
this.NewUI = false;
GetClient().SendNotif("New UI disabled!\n\nYour changes will be applied when you reload.");
}
}
else
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE users SET use_newui='1' WHERE id='" + this.Id + "'");
this.NewUI = true;
GetClient().SendNotif("New UI enabled!\n\nYour changes will be applied when you reload.");
}
}
}

Step 3 - modifying the Authenticator class
Firstly, open Authenticator.cs and find:



int LastChange = (int)dRow["last_change"];
add this directly below:

Code:
[B]bool NewUI = SilverwaveEnvironment.EnumToBool(dRow["use_newui"].ToString());[/B]
then, find:


return new Habbo(id, username, realname, rank, motto, look, gender, credits, activityPoints, activityPointsLastUpdate, isMuted, homeRoom, respect, dailyRespect, dailyPetRespect, mtantPenalty, blockFriends, questID, questProgress, achiecvementPoints,
lastonline, AppearOffline, HideFromRoom, vip, Createtime, online, isguide, Blockwhisper, Sc, mys, key, group, favid, LastChange);
and add the NewUI bool or replace it with this:

Code:
[B]return new Habbo(id, username, realname, rank, motto, look, gender, credits, activityPoints, activityPointsLastUpdate, isMuted, homeRoom, respect, dailyRespect, dailyPetRespect, mtantPenalty, blockFriends, questID, questProgress, achiecvementPoints,
lastonline, AppearOffline, HideFromRoom, vip, Createtime, online, isguide, Blockwhisper, Sc, mys, key, group, favid, LastChange, NewUI);[/B]
Step 4 - Adding the command
Open ChatCommandHandler.cs and add this:


Code:
[B]#region UI (:ui) case "ui":
{
Session.GetHabbo().NewUISwitcher();
return true;
}
#endregion[/B]
Step 5 - Final steps
Firstly open InfoRetrieveEvent.cs and find:



Session.SendMessage(new UserPerksComposer());
replace it with this:

Code:
[B]Session.SendMessage(new UserPerksComposer(Session.GetHabbo()));[/B]
then, open up UserPerksComposer.cs and add the following reference:
Code:
[B]using Silverwave.HabboHotel.Users;[/B]
then, find:


public UserPerksComposer()

and replace it with:

Code:
[B]public UserPerksComposer(Habbo Habbo)[/B]

then, find:


base.WriteString("NEW_UI");
base.WriteString("");
base.WriteBoolean(true);
and replace with with this:

Code:
[B]base.WriteString("NEW_UI"); base.WriteString("");
if (Habbo.NewUI)
{
base.WriteBoolean(true);
}
else
{
base.WriteBoolean(false);
}[/B]
HC6NQTJ.png

:up:
 

ptimmaq2

We all make mistakes
Aug 7, 2013
283
33
Step 1 - Table alteration

Firstly, run the following MySQL query:



Step 2 - Modifying the Habbo class

Firstly, open Habbo.cs and find:




and add below it:

Code:
internal bool NewUI;
then, find:





and add bool NewUI or replace it with this:

Code:
internal Habbo(UInt32 Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, Int32 Credits,
Int32 ActivityPoints, Double LastActivityPointsUpdate, bool Muted,
UInt32 HomeRoom, Int32 Respect, Int32 DailyRespectPoints, Int32 DailyPetRespectPoints,
bool MutantPenalty, bool HasFriendRequestsDisabled, uint currentQuestID, int currentQuestProgress,
int achievementPoints, int LastOnline, bool AppearOffline, bool HideInRoom, bool VIP, double CreateDate,
bool Online, bool isguide, bool Blockwhisper, int SCurrency, bool mysbox, int key, List<GroupUser> Groups, uint FavId, int LastChange, bool NewUI)

and then find:




and add this directly below:

Code:
this.NewUI = NewUI;

then you need to add this at the bottom of the Habbo.cs file:

Code:
internal void NewUISwitcher() {
if (NewUI)
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE users SET use_newui='0' WHERE id='" + this.Id + "'");
this.NewUI = false;
GetClient().SendNotif("New UI disabled!\n\nYour changes will be applied when you reload.");
}
}
else
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE users SET use_newui='1' WHERE id='" + this.Id + "'");
this.NewUI = true;
GetClient().SendNotif("New UI enabled!\n\nYour changes will be applied when you reload.");
}
}
}

Step 3 - modifying the Authenticator class
Firstly, open Authenticator.cs and find:




add this directly below:

Code:
[B]bool NewUI = SilverwaveEnvironment.EnumToBool(dRow["use_newui"].ToString());[/B]
then, find:



and add the NewUI bool or replace it with this:

Code:
[B]return new Habbo(id, username, realname, rank, motto, look, gender, credits, activityPoints, activityPointsLastUpdate, isMuted, homeRoom, respect, dailyRespect, dailyPetRespect, mtantPenalty, blockFriends, questID, questProgress, achiecvementPoints,
lastonline, AppearOffline, HideFromRoom, vip, Createtime, online, isguide, Blockwhisper, Sc, mys, key, group, favid, LastChange, NewUI);[/B]
Step 4 - Adding the command
Open ChatCommandHandler.cs and add this:


Code:
[B]#region UI (:ui) case "ui":
{
Session.GetHabbo().NewUISwitcher();
return true;
}
#endregion[/B]
Step 5 - Final steps
Firstly open InfoRetrieveEvent.cs and find:




replace it with this:

Code:
[B]Session.SendMessage(new UserPerksComposer(Session.GetHabbo()));[/B]
then, open up UserPerksComposer.cs and add the following reference:
Code:
[B]using Silverwave.HabboHotel.Users;[/B]
then, find:




and replace it with:

Code:
[B]public UserPerksComposer(Habbo Habbo)[/B]

then, find:



and replace with with this:

Code:
[B]base.WriteString("NEW_UI"); base.WriteString("");
if (Habbo.NewUI)
{
base.WriteBoolean(true);
}
else
{
base.WriteBoolean(false);
}[/B]
HC6NQTJ.png

:up:
Thanks gonna do this firs thing tomorrow. Now ill go sleep
 

ptimmaq2

We all make mistakes
Aug 7, 2013
283
33
nothing happens when i say :ui, it doesnt even appear as i said something, so its like a command but nothing happens..
 

Users who are viewing this thread

Top