Skip to content

Commit

Permalink
[major] Made the scaling of tex dynmanic & added FPS
Browse files Browse the repository at this point in the history
  • Loading branch information
Vel-San committed May 2, 2021
1 parent 5adcfdc commit f1ffa0c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 23 deletions.
21 changes: 13 additions & 8 deletions Config/MovieAdsRemover_Config.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
[MovieAdsRemover.MovieAdsRemover]
# Removes the 'Movies' section completely
bCompletelyDisable=true
# Replace the movies with a texture image that you can specify below
# Replace the movies with a texture image/GIF that you can specify below
bReplaceWithTexture=true
# Texture Class Name
# All textures MUST be of dimension 1024/1024. Please Up-scale or Down-scale before you
# First, make sure the image you are trying to import is:
# A power-of-two number of pixels across (e.g. 1x1, 16x4, 64x128, 256x256, ...) up to 1024x1024.
# Using 8-bit color (256 color indexed) BMP or PCX for UT; 8-bit indexed BMP or PCX, 24 bit or 32 bit TGA or DDS for UT2003.
# Saved in .pcx or .bmp for UT; saved in .pcx, .bmp, targa, DXT or UPaint for UT2003.
# Import to KF-SDK. In-game they will automatically be downscaled to fit view of w=320 h=240
; sTextureName=MARTex.AT_FirePlace # This is just an Image
sTextureName=MARTex.Doro.Blood_a01 # This is an actual GIF
# Texture Dimensions
iW=320
iH=240
# This is just an `Image`
; sTextureName=MARTex.AT_FirePlace
# This is a `GIF`
sTextureName=MARTex.Doro.Blood_a01
# FPS of the Animated GIF/Texture - if set to 0, FPS will always be same
# as the Player's own FPS. This is sometimes problematic if you have 60+ FPS
# then the animation will be super fast!
fMaxFPS=60
33 changes: 21 additions & 12 deletions MovieAdsRemover/Classes/CustomLobbyMenu.uc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Modified class of LobbyMenu to show custon Textures
// as IMGs or GIFs

Class CustomLobbyMenu extends LobbyMenu DependsOn(MovieAdsRemover);

var texture ImgTex;
var string ImgName;
var texture CustomTex;
var string TexName;
var MovieAdsRemover MutRef;

function InitComponent(GUIController MyC, GUIComponent MyO)
Expand Down Expand Up @@ -54,19 +57,25 @@ function DrawPerk(Canvas Canvas)
AdBackground.WinWidth = 320 * X + 10;
AdBackground.WinHeight = 240 * X + 37;

// Show Canvas + Img
ImgName = MutRef.sTextureName;
ImgTex = texture(DynamicLoadObject(ImgName, class'texture', true));
Canvas.DrawTile(ImgTex, 320 * X, 240 * X,
0, 0, MutRef.iW, MutRef.iH);
// Show Canvas + Custom Texture
TexName = MutRef.sTextureName;
CustomTex = texture(DynamicLoadObject(TexName, class'texture', true));

// If 0, then FPS of animation will be same as Player's FPS
// Always recommended to 60
// If you are using an image instead of GIF, you can set this to 0
if(MutRef.fMaxFPS != 0) CustomTex.MaxFrameRate = MutRef.fMaxFPS;

// Draw Texture
Canvas.DrawTile(CustomTex, 320 * X, 240 * X, 0, 0, CustomTex.USize, CustomTex.VSize);
}
else
{
AdBackground.WinTop=0;
AdBackground.WinLeft=0;
AdBackground.WinWidth=0;
AdBackground.WinHeight=0;
AdBackground.RenderWeight=0;
AdBackground.WinTop=0;
AdBackground.WinLeft=0;
AdBackground.WinWidth=0;
AdBackground.WinHeight=0;
AdBackground.RenderWeight=0;
}


Expand Down
7 changes: 4 additions & 3 deletions MovieAdsRemover/Classes/MovieAdsRemover.uc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MovieAdsRemover extends Mutator Config(MovieAdsRemover_Config);
// Config Vars
var config bool bCompletelyDisable, bReplaceWithTexture;
var config string sTextureName;
var config int iW, iH;
var config float fMaxFPS;

// Local Vars
var MovieAdsRemover Mut;
Expand All @@ -20,7 +20,8 @@ replication
{
unreliable if (Role == ROLE_Authority)
bCompletelyDisable,bReplaceWithTexture,
sTextureName;
sTextureName,
fMaxFPS;
}

// Initialization
Expand Down Expand Up @@ -61,7 +62,7 @@ defaultproperties
{
GroupName = "KF-MovieAdsRemover"
FriendlyName = "Movie Ads Remover - v1.0"
Description = "Remove 'Movies Section' from LobbyMenu, or replace with a custom Image for your own Server; Written by Vel-San"
Description = "Remove 'Movies Section' from LobbyMenu, or replace with a custom IMG/GIF for your own Server; Written by Vel-San"
bAddToServerPackages=true
RemoteRole = ROLE_SimulatedProxy
bAlwaysRelevant = true
Expand Down
Binary file modified Textures/MARTex.utx
Binary file not shown.

0 comments on commit f1ffa0c

Please sign in to comment.