-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an entirely new messaging system.
Added rendering support for groups. Each group member has now a box around it with the group's name and its own randomed color. Added auto-group joining upon first-time joining. Fixed some messages. Fixed several silent bugs. Reduced amount of messages spam by categorizing them in different parts of the screen depending on the kind of message. Added replication for groups, so that clients can now render such data. Added configurable classes for Messages and other classes to allow more advanced per-map-modding. 8 hours of work ;D
- Loading branch information
Showing
18 changed files
with
772 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/*============================================================================== | ||
TrialGroup | ||
Copyright (C) 2014 Eliot Van Uytfanghe | ||
This program is free software; you can redistribute and/or modify | ||
it under the terms of the Open Unreal Mod License version 1.1. | ||
==============================================================================*/ | ||
class GroupInstance extends ReplicationInfo; | ||
|
||
var GroupManager Manager; | ||
var int GroupId; | ||
var string GroupName; | ||
var Color GroupColor; | ||
|
||
var GroupPlayerLinkedReplicationInfo Commander; | ||
var private string QueueMessage; | ||
|
||
replication | ||
{ | ||
reliable if( IsRelevantToGroup( Level.ReplicationViewTarget ) ) | ||
QueueMessage; | ||
|
||
reliable if( bNetDirty ) | ||
Commander; | ||
|
||
reliable if( bNetInitial ) | ||
GroupName, GroupColor; | ||
} | ||
|
||
event PreBeginPlay() | ||
{ | ||
super.PreBeginPlay(); | ||
Manager = GroupManager(Owner); | ||
GroupColor.A = 255; | ||
GroupColor.R = Rand( 255 ); | ||
GroupColor.G = Rand( 255 ); | ||
GroupColor.B = Rand( 255 ); | ||
} | ||
|
||
final function bool IsRelevantToGroup( /**xPawn*/Actor target ) | ||
{ | ||
local int groupIndex; | ||
|
||
if( Pawn(target) == none || Pawn(target).Controller == none ) | ||
{ | ||
// Log( "Invalid target!" @ target ); | ||
return false; | ||
} | ||
|
||
groupIndex = Manager.GetGroupIndexByPlayer( Pawn(target).Controller ); | ||
return groupIndex != -1 && Manager.Groups[groupIndex].Instance == self; | ||
} | ||
|
||
final simulated function SetQueueMessage( string message ) | ||
{ | ||
QueueMessage = message; | ||
NetUpdateTime = Level.TimeSeconds - 1; | ||
} | ||
|
||
final simulated function string GetQueueMessage() | ||
{ | ||
return QueueMessage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/*============================================================================== | ||
TrialGroup | ||
Copyright (C) 2014 Eliot Van Uytfanghe | ||
This program is free software; you can redistribute and/or modify | ||
it under the terms of the Open Unreal Mod License version 1.1. | ||
==============================================================================*/ | ||
class GroupLocalMessage extends LocalMessage; | ||
|
||
static function string GetString( optional int Switch, | ||
optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, | ||
optional Object Source ) | ||
{ | ||
if( GroupInstance(Source) != none ) | ||
{ | ||
return GroupInstance(Source).GetQueueMessage(); | ||
} | ||
return GroupPlayerLinkedReplicationInfo(Source).ClientMessage; | ||
} | ||
|
||
/**static function RenderComplexMessage( | ||
Canvas C, | ||
out float XL, | ||
out float YL, | ||
optional String MessageString, | ||
optional int Switch, | ||
optional PlayerReplicationInfo RelatedPRI_1, | ||
optional PlayerReplicationInfo RelatedPRI_2, | ||
optional Object OptionalObject | ||
) | ||
{ | ||
local bool pForceAlpha; | ||
local byte pStyle; | ||
pForceAlpha = C.bForceAlpha; | ||
C.bForceAlpha = true; | ||
C.ForcedAlpha = 1.0 - C.DrawColor.A/255; | ||
pStyle = C.Style; | ||
C.Style = ERenderStyle.STY_Alpha; | ||
C.DrawTextClipped( MessageString, false ); | ||
C.bForceAlpha = pForceAlpha; | ||
C.Style = pStyle; | ||
}*/ | ||
|
||
defaultproperties | ||
{ | ||
bIsConsoleMessage=false | ||
bFadeMessage=true | ||
// bComplexString=true | ||
|
||
PosX=0.5 | ||
PosY=0.15 | ||
LifeTime=2 | ||
FontSize=-2 | ||
|
||
StackMode=SM_Down | ||
} |
Oops, something went wrong.