mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Default color ist generated randomly now
This commit is contained in:
parent
7b81b91454
commit
4357ccf342
@ -67,7 +67,7 @@ public static function readUserData($field) {
|
|||||||
if ($data[WCF::getUser()->userID] === null) {
|
if ($data[WCF::getUser()->userID] === null) {
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'color':
|
case 'color':
|
||||||
$data[WCF::getUser()->userID] = array(1 => 0xFF0000, 2 => 0x00FF00);
|
$data[WCF::getUser()->userID] = array(1 => self::getRandomNumber(), 2 => self::getRandomNumber() * 0xFFFF);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
static::writeUserData(array($field => $data[WCF::getUser()->userID]));
|
static::writeUserData(array($field => $data[WCF::getUser()->userID]));
|
||||||
@ -79,6 +79,16 @@ public static function readUserData($field) {
|
|||||||
else return $data[WCF::getUser()->userID];
|
else return $data[WCF::getUser()->userID];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a random number.
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public static /* int */ getRandomNumber() {
|
||||||
|
return 4; // chosen by a fair dice roll
|
||||||
|
// guaranteed to be random
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes user data
|
* Writes user data
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user