Compare commits

...

39 Commits

Author SHA1 Message Date
f1408da29a
add CHN and CHT localizations
translator: cheungfatzong
https://steamcommunity.com/profiles/76561199126205919
2024-04-28 20:12:17 +03:00
8464cf5367
Update README.md 2024-03-08 23:39:59 +03:00
86685f9b55
Merge pull request #7 from GenZmeY/short-name
add short alias for mutator
2024-03-08 23:38:41 +03:00
bf19cfa7b7
add short alias for mutator 2023-12-31 23:47:42 +03:00
4d60429c7b
update ci/cd 2023-12-31 20:50:13 +03:00
dd4cde6a61
fix broken server password icon 2023-10-21 13:08:39 +03:00
3bab74361c
update megalinter ci/cd 2023-10-21 13:02:44 +03:00
a2421820ed
Update README.md 2023-06-28 00:01:55 +03:00
2b595fdce1
Merge pull request #5 from GenZmeY/group-names
add group name (master)
2023-06-28 00:00:28 +03:00
81cc7791a4
Merge pull request #6 from GenZmeY/player-default-rank-fix
fix player default rank apply (master)
2023-06-28 00:00:10 +03:00
c40114ee56
Merge pull request #2 from GenZmeY/default_lang
Default lang + more localization (master)
2023-06-27 23:59:50 +03:00
b824302069 fix player default rank apply 2023-06-27 11:34:37 +03:00
1ad79aba1c add mutator group name 2023-06-03 17:14:44 +03:00
4ee7d2cc59 update .editorconfig 2023-05-14 12:21:03 +03:00
5f6aefea7d update build tools to v1.9.2-1-gfb458ac 2023-05-13 00:48:42 +03:00
9cd56e94df update build tools 2023-05-10 07:32:12 +03:00
145439ef10
Update README.md 2023-05-10 05:51:46 +03:00
741bb7279c include BoxPainterLib in codebase 2023-05-10 05:32:25 +03:00
ab21f050de update build tools 2023-05-10 05:25:43 +03:00
bdacf980c6 update BoxPainterLib 2023-05-10 05:24:53 +03:00
11f61e9da6 update build tools 2023-05-10 03:39:03 +03:00
9894b67d22
Merge pull request #3 from GenZmeY/editorconfig
update .editorconfig
2023-05-02 22:27:23 +03:00
b1635b8e28 update .editorconfig
I changed my mind a little
2023-05-02 22:15:56 +03:00
fdf420a75c add more localization (god bless google translate) 2023-05-02 00:52:46 +03:00
b50680554f add a hardcoded language in case localization files are missing 2023-05-02 00:37:07 +03:00
0dc735b800
Update README.md 2023-05-02 00:08:18 +03:00
9cf94dfba5
Merge pull request #1 from GenZmeY/MegaLinter
Mega linter, editorconfig, format fixes
2023-05-01 23:54:29 +03:00
b9410073cf add MegaLinter badge 2023-05-01 23:47:49 +03:00
e29d18ea1c update formatting to match .editorconfig 2023-05-01 23:26:11 +03:00
da1914f612 add .editorconfig 2023-05-01 23:03:19 +03:00
37db37f97c add MegaLinter CI/CD 2023-05-01 23:02:53 +03:00
206aebc98e Update README.md 2023-05-01 19:52:59 +03:00
430b3250be Merge branch 'BoxPainterLib' 2023-05-01 19:42:05 +03:00
05b8055ef1 remove TODO.md 2023-05-01 19:30:12 +03:00
95c3f414f9 Merge branch 'master' into BoxPainterLib 2023-05-01 19:28:45 +03:00
8b305519c2 update build tools 2023-05-01 19:28:32 +03:00
5cb5be5656 BoxPainterLib 2023-05-01 19:25:10 +03:00
07c37c7cb2 fix broken icons 2022-12-07 23:51:31 +03:00
8d432066ca fix frozen damage after rejoin 2022-10-23 03:02:54 +03:00
58 changed files with 1879 additions and 1587 deletions

33
.editorconfig Normal file
View File

@ -0,0 +1,33 @@
root = true
# Global
[*]
indent_style = unset
indent_size = 4
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = unset
# Unreal Engine 3 / Source
[*.uc]
indent_style = tab
[*.{uci,upkg}]
# Unreal Engine 3 / i18n
[*.{chn,cht,cze,dan,deu,dut,esl,esn,fra,frc,hun,int,ita,jpn,kor,pol,por,ptb,rus,tur,ukr}]
charset = utf-16le
# Other
[*.md]
indent_style = space
trim_trailing_whitespace = false
[*.yml]
indent_style = space
indent_size = 2
[*.{txt,cfg,conf}]
indent_style = tab

114
.github/workflows/mega-linter.yml vendored Normal file
View File

@ -0,0 +1,114 @@
---
name: MegaLinter
permissions: read-all
on:
push:
pull_request:
branches:
- master
env:
APPLY_FIXES: none
APPLY_FIXES_EVENT: pull_request
APPLY_FIXES_MODE: commit
FILTER_REGEX_EXCLUDE: (mega-linter.yml)
DISABLE: SPELL
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: MegaLinter
uses: oxsecurity/megalinter@7e042c726c68415475b05a65a686c612120a1232
id: ml
env:
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive production artifacts
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392
if: success() || failure()
with:
name: MegaLinter reports
path: |
megalinter-reports
mega-linter.log
- name: Set APPLY_FIXES_IF var
run: |
printf 'APPLY_FIXES_IF=%s\n' "${{
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
)
}}" >> "${GITHUB_ENV}"
- name: Set APPLY_FIXES_IF_* vars
run: |
printf 'APPLY_FIXES_IF_PR=%s\n' "${{
env.APPLY_FIXES_IF == 'true' &&
env.APPLY_FIXES_MODE == 'pull_request'
}}" >> "${GITHUB_ENV}"
printf 'APPLY_FIXES_IF_COMMIT=%s\n' "${{
env.APPLY_FIXES_IF == 'true' &&
env.APPLY_FIXES_MODE == 'commit' &&
(!contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref))
}}" >> "${GITHUB_ENV}"
- name: Create Pull Request with applied fixes
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
id: cpr
if: env.APPLY_FIXES_IF_PR == 'true'
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
commit-message: "[MegaLinter] Apply linters automatic fixes"
title: "[MegaLinter] Apply linters automatic fixes"
labels: bot
- name: Create PR output
if: env.APPLY_FIXES_IF_PR == 'true'
run: |
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Prepare commit
if: env.APPLY_FIXES_IF_COMMIT == 'true'
run: sudo chown -Rc $UID .git/
- name: Commit and push applied linter fixes
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d
if: env.APPLY_FIXES_IF_COMMIT == 'true'
with:
branch: >-
${{
github.event.pull_request.head.ref ||
github.head_ref ||
github.ref
}}
commit_message: "[MegaLinter] Apply linters fixes"
commit_user_name: "github-actions"
commit_user_email: "github-actions[bot]@users.noreply.github.com"

BIN
Localization/CHN/YAS.CHN Normal file

Binary file not shown.

BIN
Localization/CHT/YAS.CHT Normal file

Binary file not shown.

BIN
Localization/CZE/YAS.CZE Normal file

Binary file not shown.

BIN
Localization/DAN/YAS.DAN Normal file

Binary file not shown.

BIN
Localization/DEU/YAS.DEU Normal file

Binary file not shown.

BIN
Localization/ESN/YAS.ESN Normal file

Binary file not shown.

BIN
Localization/FRA/YAS.FRA Normal file

Binary file not shown.

BIN
Localization/HUN/YAS.HUN Normal file

Binary file not shown.

Binary file not shown.

BIN
Localization/ITA/YAS.ITA Normal file

Binary file not shown.

BIN
Localization/JPN/YAS.JPN Normal file

Binary file not shown.

BIN
Localization/KOR/YAS.KOR Normal file

Binary file not shown.

BIN
Localization/POL/YAS.POL Normal file

Binary file not shown.

BIN
Localization/POR/YAS.POR Normal file

Binary file not shown.

BIN
Localization/PTB/YAS.PTB Normal file

Binary file not shown.

Binary file not shown.

BIN
Localization/TUR/YAS.TUR Normal file

Binary file not shown.

BIN
Localization/UKR/YAS.UKR Normal file

Binary file not shown.

View File

@ -2,7 +2,7 @@
[h1]Description[/h1] [h1]Description[/h1]
Yet another scoreboard... Yet another scoreboard...
Based on the scoreboard from [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1963099942]ClassicHUD[/url] and heavily modified. Based on the scoreboard from [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1963099942]ClassicHUD[/url] and heavily modified.
[h1]Whitelisted?[/h1] [h1]Whitelisted?[/h1]
[b]No.[/b] But I really hope that it will be whitelisted. [b]No.[/b] But I really hope that it will be whitelisted.
@ -13,9 +13,9 @@ https://forums.tripwireinteractive.com/index.php?threads/whitelisting-mods-and-m
[h1]Usage (single player)[/h1] [h1]Usage (single player)[/h1]
[olist] [olist]
[*]Subscribe to this mutator; [*]Subscribe to this mutator;
[*]Start KF2; [*]Start KF2;
[*]Open console (`) and input: [*]Open console (`) and input:
[b]open KF-BioticsLab?Mutator=YAS.YASMut?[/b] [b]open KF-BioticsLab?Mutator=YAS.Mut?[/b]
(replace the map and add the parameters you need) (replace the map and add the parameters you need)
[*]<Enter>. [*]<Enter>.
[/olist] [/olist]
@ -30,7 +30,7 @@ https://forums.tripwireinteractive.com/index.php?threads/whitelisting-mods-and-m
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist): [*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
[b]ServerSubscribedWorkshopItems=2521826524[/b] [b]ServerSubscribedWorkshopItems=2521826524[/b]
[*]Start the server and wait until the mutator is downloading; [*]Start the server and wait until the mutator is downloading;
[*]Add mutator to server start parameters: [b]?Mutator=YAS.YASMut[/b] and restart the server. [*]Add mutator to server start parameters: [b]?Mutator=YAS.Mut[/b] and restart the server.
[/olist] [/olist]
[h1]Important setup information[/h1] [h1]Important setup information[/h1]
@ -110,7 +110,10 @@ If you need a SteamID64 for a steam group, open the group in a browser and add t
[img]https://raw.githubusercontent.com/GenZmeY/KF2-YetAnotherScoreboard/master/PublicationContent/ID4.png[/img] [img]https://raw.githubusercontent.com/GenZmeY/KF2-YetAnotherScoreboard/master/PublicationContent/ID4.png[/img]
[h1]Notes[/h1] [h1]Notes[/h1]
📌 VersusSurvival mode not supported (yet). 📌 VersusSurvival mode not supported.
[h1]Translators:[/h1]
[url=https://steamcommunity.com/profiles/76561199126205919]cheungfatzong[/url] - Traditional [CHT] and Simplified [CHN] Chinese.
[h1]Sources[/h1] [h1]Sources[/h1]
[url=https://github.com/GenZmeY/KF2-YetAnotherScoreboard]https://github.com/GenZmeY/KF2-YetAnotherScoreboard[/url] [b](GNU GPLv3)[/b] [url=https://github.com/GenZmeY/KF2-YetAnotherScoreboard]https://github.com/GenZmeY/KF2-YetAnotherScoreboard[/url] [b](GNU GPLv3)[/b]

View File

@ -3,22 +3,22 @@
[![Steam Workshop](https://img.shields.io/static/v1?message=workshop&logo=steam&labelColor=gray&color=blue&logoColor=white&label=steam%20)](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524) [![Steam Workshop](https://img.shields.io/static/v1?message=workshop&logo=steam&labelColor=gray&color=blue&logoColor=white&label=steam%20)](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524)
[![Steam Downloads](https://img.shields.io/steam/downloads/2521826524)](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524) [![Steam Downloads](https://img.shields.io/steam/downloads/2521826524)](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524)
[![Steam Favorites](https://img.shields.io/steam/favorites/2521826524)](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524) [![Steam Favorites](https://img.shields.io/steam/favorites/2521826524)](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524)
[![Steam Update Date](https://img.shields.io/steam/update-date/2521826524)](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524) [![MegaLinter](https://github.com/GenZmeY/KF2-YetAnotherScoreboard/actions/workflows/mega-linter.yml/badge.svg?branch=master)](https://github.com/GenZmeY/KF2-YetAnotherScoreboard/actions/workflows/mega-linter.yml)
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-YetAnotherScoreboard)](https://github.com/GenZmeY/KF2-YetAnotherScoreboard/tags) [![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-YetAnotherScoreboard)](https://github.com/GenZmeY/KF2-YetAnotherScoreboard/tags)
[![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-YetAnotherScoreboard)](LICENSE) [![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-YetAnotherScoreboard)](LICENSE)
# Description ## Description
Yet another scoreboard... Yet another scoreboard...
Based on the scoreboard from [ClassicHUD](https://steamcommunity.com/sharedfiles/filedetails/?id=1963099942) and heavily modified. Based on the scoreboard from [ClassicHUD](https://steamcommunity.com/sharedfiles/filedetails/?id=1963099942) and heavily modified.
# Usage ## Usage
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524) [See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2521826524)
*** ***
**Note:** If you want to build/test/brew/publish a mutator without git-bash and/or scripts, follow [these instructions](https://tripwireinteractive.atlassian.net/wiki/spaces/KF2SW/pages/26247172/KF2+Code+Modding+How-to) instead of what is described here. **Note:** If you want to build/test/brew/publish a mutator without git-bash and/or scripts, follow [these instructions](https://tripwireinteractive.atlassian.net/wiki/spaces/KF2SW/pages/26247172/KF2+Code+Modding+How-to) instead of what is described here.
# Build ## Build
1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win); 1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win);
2. open git-bash and go to any folder where you want to store sources: 2. open git-bash and go to any folder where you want to store sources:
`cd <ANY_FOLDER_YOU_WANT>` `cd <ANY_FOLDER_YOU_WANT>`
@ -31,14 +31,7 @@ Based on the scoreboard from [ClassicHUD](https://steamcommunity.com/sharedfiles
5. The compiled files will be here: 5. The compiled files will be here:
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\` `C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
# Testing ## Bug reports
Open git-bash in the source folder and run command:
`./tools/builder -t`
(or `./tools/builder -ct` if you haven't compiled the mutator yet)
A local single-user test will be launched with parameters from `test.cfg` (edit this file if you want to test mutator with different parameters).
# Bug reports
If you find a bug, go to the [issue page](https://github.com/GenZmeY/KF2-YetAnotherScoreboard/issues) and check if there is a description of your bug. If not, create a new issue. If you find a bug, go to the [issue page](https://github.com/GenZmeY/KF2-YetAnotherScoreboard/issues) and check if there is a description of your bug. If not, create a new issue.
Describe what the bug looks like and how reproduce it. Describe what the bug looks like and how reproduce it.
Attach screenshots if you think it might help. Attach screenshots if you think it might help.
@ -47,5 +40,6 @@ If it's a crash issue, be sure to include the `Launch.log` files. You can find t
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Logs\` `C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Logs\`
Please note that these files are overwritten every time you start the game/server. Therefore, you must take these files immediately after the game crashes in order not to lose information. Please note that these files are overwritten every time you start the game/server. Therefore, you must take these files immediately after the game crashes in order not to lose information.
# License ## License
[GNU GPLv3](LICENSE) [![license](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](LICENSE)

12
TODO.md
View File

@ -1,12 +0,0 @@
# TODO List:
+ ability to display HP on the left
- ability to hide rank
- ability to turn off the panel on the client
+ colors for perks
+ dynamic colors for dosh
+ dynamic colors for assists
- abbreviated dosh display (10K, 15K, etc.)
- images for HP (cross, skull with bones if dead)
+ show armor
+ use rank id as priority

595
YAS/Classes/BoxPainter.uc Normal file
View File

@ -0,0 +1,595 @@
class BoxPainter extends BoxPainterBase;
public final function DrawBox(float X, float Y, float Width, float Height, float Edge, optional byte Shape = 0)
{
Edge = FMin(FMin(Edge, Width * 0.5), Height * 0.5);
switch (Shape)
{
case 100:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 110:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |______/
ECS_BeveledCorner // BottomRight //
);
break;
case 111:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | \
ECS_BeveledCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______|
ECS_Corner // BottomRight //
);
break;
case 120:
DrawShapedBox(
X, Y, Width, Height, Edge, // |\____/|
ECS_VerticalCorner, // TopLeft // | |
ECS_VerticalCorner, // TopRight // | |
ECS_VerticalCorner, // BottomLeft // | ____ |
ECS_VerticalCorner // BottomRight // |/ \|
);
break;
case 121:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_HorisontalCorner, // TopLeft // \ /
ECS_HorisontalCorner, // TopRight // | |
ECS_HorisontalCorner, // BottomLeft // | |
ECS_HorisontalCorner // BottomRight // /_____\
);
break;
case 130:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |______/
ECS_BeveledCorner // BottomRight //
);
break;
case 131:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | \
ECS_BeveledCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 132:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 133:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______|
ECS_Corner // BottomRight //
);
break;
case 140:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / \
ECS_BeveledCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______|
ECS_Corner // BottomRight //
);
break;
case 141:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / |
ECS_Corner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______/
ECS_BeveledCorner // BottomRight //
);
break;
case 142:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | \
ECS_BeveledCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______/
ECS_BeveledCorner // BottomRight //
);
break;
case 143:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / \
ECS_BeveledCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |______/
ECS_BeveledCorner // BottomRight //
);
break;
case 150:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / \
ECS_BeveledCorner, // TopRight // | |
ECS_VerticalCorner, // BottomLeft // | ____ |
ECS_VerticalCorner // BottomRight // |/ \|
);
break;
case 151:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_BeveledCorner, // TopLeft // / /
ECS_HorisontalCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______\
ECS_HorisontalCorner // BottomRight //
);
break;
case 152:
DrawShapedBox(
X, Y, Width, Height, Edge, // |\____/|
ECS_VerticalCorner, // TopLeft // | |
ECS_VerticalCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______/
ECS_BeveledCorner // BottomRight //
);
break;
case 153:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_HorisontalCorner, // TopLeft // \ \
ECS_BeveledCorner, // TopRight // | |
ECS_HorisontalCorner, // BottomLeft // /______/
ECS_BeveledCorner // BottomRight //
);
break;
case 160:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / /
ECS_HorisontalCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \_____/
ECS_BeveledCorner // BottomRight //
);
break;
case 161:
DrawShapedBox(
X, Y, Width, Height, Edge, // |\_____
ECS_VerticalCorner, // TopLeft // | \
ECS_BeveledCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______/
ECS_BeveledCorner // BottomRight //
);
break;
case 162:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / \
ECS_BeveledCorner, // TopRight // | |
ECS_HorisontalCorner, // BottomLeft // /______/
ECS_BeveledCorner // BottomRight //
);
break;
case 163:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / \
ECS_BeveledCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \_____ |
ECS_VerticalCorner // BottomRight // \|
);
break;
case 170:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / \
ECS_BeveledCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______\
ECS_HorisontalCorner // BottomRight //
);
break;
case 171:
DrawShapedBox(
X, Y, Width, Height, Edge, // _____/|
ECS_BeveledCorner, // TopLeft // / |
ECS_VerticalCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______/
ECS_BeveledCorner // BottomRight //
);
break;
case 172:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_HorisontalCorner, // TopLeft // \ \
ECS_BeveledCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______/
ECS_BeveledCorner // BottomRight //
);
break;
case 173:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / \
ECS_BeveledCorner, // TopRight // | |
ECS_VerticalCorner, // BottomLeft // | _____/
ECS_BeveledCorner // BottomRight // |/
);
break;
case 180:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_Corner, // TopLeft // | /
ECS_HorisontalCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 181:
DrawShapedBox(
X, Y, Width, Height, Edge, // |\_____
ECS_VerticalCorner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 182:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_HorisontalCorner, // BottomLeft // /______|
ECS_Corner // BottomRight //
);
break;
case 183:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |_____ |
ECS_VerticalCorner // BottomRight // \|
);
break;
case 190:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |______\
ECS_HorisontalCorner // BottomRight //
);
break;
case 191:
DrawShapedBox(
X, Y, Width, Height, Edge, // _____/|
ECS_Corner, // TopLeft // | |
ECS_VerticalCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 192:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_HorisontalCorner, // TopLeft // \ |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 193:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_VerticalCorner, // BottomLeft // | _____|
ECS_Corner // BottomRight // |/
);
break;
case 200:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_VerticalCorner, // BottomLeft // | ____ |
ECS_VerticalCorner // BottomRight // |/ \|
);
break;
case 201:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_Corner, // TopLeft // | /
ECS_HorisontalCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |______\
ECS_HorisontalCorner // BottomRight //
);
break;
case 202:
DrawShapedBox(
X, Y, Width, Height, Edge, // |\____/|
ECS_VerticalCorner, // TopLeft // | |
ECS_VerticalCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 203:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_HorisontalCorner, // TopLeft // \ |
ECS_Corner, // TopRight // | |
ECS_HorisontalCorner, // BottomLeft // /______|
ECS_Corner // BottomRight //
);
break;
case 210:
DrawShapedBox(
X, Y, Width, Height, Edge, // ________
ECS_HorisontalCorner, // TopLeft // \ /
ECS_HorisontalCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______/
ECS_BeveledCorner // BottomRight //
);
break;
case 211:
DrawShapedBox(
X, Y, Width, Height, Edge, // |\_____
ECS_VerticalCorner, // TopLeft // | \
ECS_BeveledCorner, // TopRight // | |
ECS_VerticalCorner, // BottomLeft // | _____/
ECS_BeveledCorner // BottomRight // |/
);
break;
case 212:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / \
ECS_BeveledCorner, // TopRight // | |
ECS_HorisontalCorner, // BottomLeft // /______\
ECS_HorisontalCorner // BottomRight //
);
break;
case 213:
DrawShapedBox(
X, Y, Width, Height, Edge, // _____/|
ECS_BeveledCorner, // TopLeft // / |
ECS_VerticalCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \_____ |
ECS_VerticalCorner // BottomRight // \|
);
break;
case 220:
DrawShapedBox(
X, Y, Width, Height, Edge, // ________
ECS_HorisontalCorner, // TopLeft // \ /
ECS_HorisontalCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 221:
DrawShapedBox(
X, Y, Width, Height, Edge, // |\_____
ECS_VerticalCorner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_VerticalCorner, // BottomLeft // | _____|
ECS_Corner // BottomRight // |/
);
break;
case 222:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_HorisontalCorner, // BottomLeft // /______\
ECS_HorisontalCorner // BottomRight //
);
break;
case 223:
DrawShapedBox(
X, Y, Width, Height, Edge, // _____/|
ECS_Corner, // TopLeft // | |
ECS_VerticalCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |_____ |
ECS_VerticalCorner // BottomRight // \|
);
break;
case 230:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_BeveledCorner, // TopLeft // / /
ECS_HorisontalCorner, // TopRight // | |
ECS_HorisontalCorner, // BottomLeft // /______/
ECS_BeveledCorner // BottomRight //
);
break;
case 231:
DrawShapedBox(
X, Y, Width, Height, Edge, // |\_____
ECS_VerticalCorner, // TopLeft // | \
ECS_BeveledCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \_____ |
ECS_VerticalCorner // BottomRight // \|
);
break;
case 232:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_HorisontalCorner, // TopLeft // \ \
ECS_BeveledCorner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______\
ECS_HorisontalCorner // BottomRight //
);
break;
case 233:
DrawShapedBox(
X, Y, Width, Height, Edge, // _____/|
ECS_BeveledCorner, // TopLeft // / |
ECS_VerticalCorner, // TopRight // | |
ECS_VerticalCorner, // BottomLeft // | _____/
ECS_BeveledCorner // BottomRight // |/
);
break;
case 240:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_Corner, // TopLeft // | /
ECS_HorisontalCorner, // TopRight // | |
ECS_HorisontalCorner, // BottomLeft // /______|
ECS_Corner // BottomRight //
);
break;
case 241:
DrawShapedBox(
X, Y, Width, Height, Edge, // |\_____
ECS_VerticalCorner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |_____ |
ECS_VerticalCorner // BottomRight // \|
);
break;
case 242:
DrawShapedBox(
X, Y, Width, Height, Edge, // _______
ECS_HorisontalCorner, // TopLeft // \ |
ECS_Corner, // TopRight // | |
ECS_Corner, // BottomLeft // |______\
ECS_HorisontalCorner // BottomRight //
);
break;
case 243:
DrawShapedBox(
X, Y, Width, Height, Edge, // _____/|
ECS_Corner, // TopLeft // | |
ECS_VerticalCorner, // TopRight // | |
ECS_VerticalCorner, // BottomLeft // | _____|
ECS_Corner // BottomRight // |/
);
break;
case 250:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / \
ECS_BeveledCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |______|
ECS_Corner // BottomRight //
);
break;
case 251:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_BeveledCorner, // TopLeft // / |
ECS_Corner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______|
ECS_Corner // BottomRight //
);
break;
case 252:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | |
ECS_Corner, // TopRight // | |
ECS_BeveledCorner, // BottomLeft // \______/
ECS_BeveledCorner // BottomRight //
);
break;
case 253:
DrawShapedBox(
X, Y, Width, Height, Edge, // ______
ECS_Corner, // TopLeft // | \
ECS_BeveledCorner, // TopRight // | |
ECS_Corner, // BottomLeft // |______/
ECS_BeveledCorner // BottomRight //
);
break;
case 0:
default:
DrawShapedBox(
X, Y, Width, Height, Edge, //
ECS_BeveledCorner, // TopLeft // ______
ECS_BeveledCorner, // TopRight // / \
ECS_BeveledCorner, // BottomLeft // | |
ECS_BeveledCorner // BottomRight // \______/
);
break;
}
}
defaultproperties
{
}

View File

@ -0,0 +1,185 @@
class BoxPainterBase extends Object;
const Texture = Texture2D'UI_LevelChevrons_TEX.UI_LevelChevron_Icon_02';
enum EPosition
{
ECP_TopLeft,
ECP_TopRight,
ECP_BottomLeft,
ECP_BottomRight
};
enum EShape
{
ECS_Corner,
ECS_BeveledCorner,
ECS_VerticalCorner,
ECS_HorisontalCorner
};
var public Canvas Canvas;
private final function DrawBoxTexture(float X, float Y)
{
Canvas.DrawTile(Texture, X, Y, 19, 45, 1, 1);
}
private final function DrawCornerTexture(float Size, byte Position)
{
switch (Position)
{
case ECP_TopLeft: Canvas.DrawTile(Texture, Size, Size, 77, 15, -66, 58); return;
case ECP_TopRight: Canvas.DrawTile(Texture, Size, Size, 11, 15, 66, 58); return;
case ECP_BottomLeft: Canvas.DrawTile(Texture, Size, Size, 77, 73, -66, -58); return;
case ECP_BottomRight: Canvas.DrawTile(Texture, Size, Size, 11, 73, 66, -58); return;
}
}
private final function DrawCorner(float X, float Y, float Edge, byte Position, byte Shape)
{
switch (Position)
{
case ECP_TopLeft: switch (Shape)
{
case ECS_Corner:
return;
case ECS_BeveledCorner:
Canvas.SetPos(X, Y);
DrawCornerTexture(Edge, ECP_TopLeft);
return;
case ECS_VerticalCorner:
Canvas.SetPos(X, Y - Edge);
DrawCornerTexture(Edge, ECP_TopRight);
return;
case ECS_HorisontalCorner:
Canvas.SetPos(X - Edge, Y);
DrawCornerTexture(Edge, ECP_BottomLeft);
return;
}
case ECP_TopRight: switch (Shape)
{
case ECS_Corner:
return;
case ECS_BeveledCorner:
Canvas.SetPos(X - Edge, Y);
DrawCornerTexture(Edge, ECP_TopRight);
return;
case ECS_VerticalCorner:
Canvas.SetPos(X - Edge, Y - Edge);
DrawCornerTexture(Edge, ECP_TopLeft);
return;
case ECS_HorisontalCorner:
Canvas.SetPos(X, Y);
DrawCornerTexture(Edge, ECP_BottomRight);
return;
}
case ECP_BottomLeft: switch (Shape)
{
case ECS_Corner:
return;
case ECS_BeveledCorner:
Canvas.SetPos(X, Y - Edge);
DrawCornerTexture(Edge, ECP_BottomLeft);
return;
case ECS_VerticalCorner:
Canvas.SetPos(X, Y);
DrawCornerTexture(Edge, ECP_BottomRight);
return;
case ECS_HorisontalCorner:
Canvas.SetPos(X - Edge, Y - Edge);
DrawCornerTexture(Edge, ECP_TopLeft);
return;
}
case ECP_BottomRight: switch (Shape)
{
case ECS_Corner:
return;
case ECS_BeveledCorner:
Canvas.SetPos(X - Edge, Y - Edge);
DrawCornerTexture(Edge, ECP_BottomRight);
return;
case ECS_VerticalCorner:
Canvas.SetPos(X - Edge, Y);
DrawCornerTexture(Edge, ECP_BottomLeft);
return;
case ECS_HorisontalCorner:
Canvas.SetPos(X, Y - Edge);
DrawCornerTexture(Edge, ECP_TopRight);
return;
}
}
}
public final function DrawShapedBox(float X, float Y, float W, float H, float Edge, byte TopLeftShape, byte TopRightShape, byte BottomLeftShape, byte BottomRightShape)
{
local float BoxX, BoxW;
Canvas.PreOptimizeDrawTiles((
3 // x3 DrawBoxTexture(...) + x1..x4 DrawCornerTexture(...)
+ (TopLeftShape == ECS_Corner ? 0 : 1)
+ (TopRightShape == ECS_Corner ? 0 : 1)
+ (BottomLeftShape == ECS_Corner ? 0 : 1)
+ (BottomRightShape == ECS_Corner ? 0 : 1)
), Texture);
// Top Line
DrawCorner(X, Y, Edge, ECP_TopLeft, TopLeftShape);
BoxX = X; BoxW = W;
if (TopLeftShape == ECS_BeveledCorner)
{
BoxX += Edge;
BoxW -= Edge;
}
if (TopRightShape == ECS_BeveledCorner)
{
BoxW -= Edge;
}
Canvas.SetPos(BoxX, Y);
DrawBoxTexture(BoxW, Edge);
DrawCorner(X + W, Y, Edge, ECP_TopRight, TopRightShape);
// Mid Line
Canvas.SetPos(X, Y + Edge);
DrawBoxTexture(W, H - Edge * 2);
// Bottom Line
DrawCorner(X, Y + H, Edge, ECP_BottomLeft, BottomLeftShape);
BoxX = X; BoxW = W;
if (BottomLeftShape == ECS_BeveledCorner)
{
BoxX += Edge;
BoxW -= Edge;
}
if (BottomRightShape == ECS_BeveledCorner)
{
BoxW -= Edge;
}
Canvas.SetPos(BoxX, Y + H - Edge);
DrawBoxTexture(BoxW, Edge);
DrawCorner(X + W, Y + H, Edge, ECP_BottomRight, BottomRightShape);
}
defaultproperties
{
}

View File

@ -18,7 +18,7 @@ function RenderFramedWindow(KFGUI_FloatingWindow P)
Canvas.DrawTileStretched(TabTextures[`TAB_TOP], XS, TitleHeight, 0,0, 128, 16); Canvas.DrawTileStretched(TabTextures[`TAB_TOP], XS, TitleHeight, 0,0, 128, 16);
// Frame itself. // Frame itself.
if (`BOX_SMALL_SLIGHTTRANSPARENT >= 0 && `BOX_SMALL_SLIGHTTRANSPARENT < BorderTextures.Length) if (`BOX_SMALL_SLIGHTTRANSPARENT >= 0 && `BOX_SMALL_SLIGHTTRANSPARENT < BorderTextures.Length)
{ {
Canvas.SetPos(0, TitleHeight); Canvas.SetPos(0, TitleHeight);
@ -165,7 +165,7 @@ function RenderScrollBar(KFGUI_ScrollBarBase S)
Canvas.SetPos(0.f, S.ButtonOffset); Canvas.SetPos(0.f, S.ButtonOffset);
Canvas.DrawTileStretched(ScrollTexture, S.CompPos[2], S.SliderScale, 0,0, 32, 32); Canvas.DrawTileStretched(ScrollTexture, S.CompPos[2], S.SliderScale, 0,0, 32, 32);
} }
else else
{ {
Canvas.SetPos(S.ButtonOffset, 0.f); Canvas.SetPos(S.ButtonOffset, 0.f);
Canvas.DrawTileStretched(ScrollTexture, S.SliderScale, S.CompPos[3], 0,0, 32, 32); Canvas.DrawTileStretched(ScrollTexture, S.SliderScale, S.CompPos[3], 0,0, 32, 32);
@ -229,7 +229,7 @@ function RenderComboList(KFGUI_ComboSelector C)
// Draw background. // Draw background.
Edge = C.Combo.BorderSize; Edge = C.Combo.BorderSize;
if (`BOX_SMALL_SLIGHTTRANSPARENT >= 0 && `BOX_SMALL_SLIGHTTRANSPARENT < BorderTextures.Length) if (`BOX_SMALL_SLIGHTTRANSPARENT >= 0 && `BOX_SMALL_SLIGHTTRANSPARENT < BorderTextures.Length)
{ {
Canvas.SetPos(0.f, 0.f); Canvas.SetPos(0.f, 0.f);
@ -422,4 +422,5 @@ function RenderButton(KFGUI_Button B)
defaultproperties defaultproperties
{ {
} }

View File

@ -3,7 +3,7 @@ class GUIStyleBase extends Object
var Texture2D ItemTex; var Texture2D ItemTex;
var array<Texture2D> BorderTextures, ArrowTextures, ButtonTextures, TabTextures, ItemBoxTextures, PerkBox, CheckBoxTextures, ProgressBarTextures, SliderTextures; var array<Texture2D> BorderTextures, ArrowTextures, ButtonTextures, TabTextures, ItemBoxTextures, PerkBox, CheckBoxTextures, ProgressBarTextures, SliderTextures;
var Texture2D ScrollTexture, FavoriteIcon, BankNoteIcon; var Texture2D ScrollTexture, FavoriteIcon, BankNoteIcon;
var SoundCue MenuDown, MenuDrag, MenuEdit, MenuFade, MenuClick, MenuHover, MenuUp; var SoundCue MenuDown, MenuDrag, MenuEdit, MenuFade, MenuClick, MenuHover, MenuUp;
@ -16,6 +16,8 @@ var transient YAS_HUD HUDOwner;
var Font MainFont, NumberFont, InfiniteFont; var Font MainFont, NumberFont, InfiniteFont;
var Color BlurColor, BlurColor2; var Color BlurColor, BlurColor2;
var BoxPainter BoxPainter;
enum ECornerPosition enum ECornerPosition
{ {
ECP_TopLeft, ECP_TopLeft,
@ -54,6 +56,8 @@ function InitStyle()
if (ItemTex == None) if (ItemTex == None)
ItemTex=Texture2D'EngineMaterials.DefaultWhiteGrid'; ItemTex=Texture2D'EngineMaterials.DefaultWhiteGrid';
BoxPainter = new class'BoxPainter';
NumberFont = Font(DynamicLoadObject("UI_Canvas_Fonts.Font_General", class'Font')); NumberFont = Font(DynamicLoadObject("UI_Canvas_Fonts.Font_General", class'Font'));
BlurColor = MakeColor(60, 60, 60, 220); BlurColor = MakeColor(60, 60, 60, 220);
@ -181,35 +185,35 @@ function PickDefaultFontSize(float YRes)
final function float ScreenScale(float Size, optional float MaxRes=1080.f) final function float ScreenScale(float Size, optional float MaxRes=1080.f)
{ {
local float FillSizeX, FillSizeY; local float FillSizeX, FillSizeY;
GetFillScreenSize(FillSizeX, FillSizeY); GetFillScreenSize(FillSizeX, FillSizeY);
return Size * (FillSizeY / MaxRes); return Size * (FillSizeY / MaxRes);
} }
final function float GetFontScaler() final function float GetFontScaler()
{ {
local float FillSizeX, FillSizeY, Scaler; local float FillSizeX, FillSizeY, Scaler;
GetFillScreenSize(FillSizeX, FillSizeY); GetFillScreenSize(FillSizeX, FillSizeY);
if (FillSizeY <= 1080.0f) { scaler = 0.750f; } if (FillSizeY <= 1080.0f) { scaler = 0.750f; }
else if (FillSizeY <= 1440.0f) { scaler = 0.562f; } else if (FillSizeY <= 1440.0f) { scaler = 0.562f; }
else if (FillSizeY <= 2160.0f) { scaler = 0.377f; } else if (FillSizeY <= 2160.0f) { scaler = 0.377f; }
else { scaler = 0.190f; } else { scaler = 0.190f; }
return FClamp(FillSizeY * scaler / 1080.f, 0.175f, 1.0f); return FClamp(FillSizeY * scaler / 1080.f, 0.175f, 1.0f);
} }
final function GetFillScreenSize(out float SizeX, out float SizeY) final function GetFillScreenSize(out float SizeX, out float SizeY)
{ {
local float Base, BaseX, BaseY; local float Base, BaseX, BaseY;
BaseX = HUDOwner.SizeX / 16; BaseX = HUDOwner.SizeX / 16;
BaseY = HUDOwner.SizeY / 9; BaseY = HUDOwner.SizeY / 9;
Base = Min(BaseX, BaseY); Base = Min(BaseX, BaseY);
SizeX = Base * 16; SizeX = Base * 16;
SizeY = Base * 9; SizeY = Base * 9;
} }
@ -217,9 +221,9 @@ final function GetFillScreenSize(out float SizeX, out float SizeY)
final function float PickEdgeSize(float DefaultSize = 8.0f) final function float PickEdgeSize(float DefaultSize = 8.0f)
{ {
local float FillSizeX, FillSizeY; local float FillSizeX, FillSizeY;
GetFillScreenSize(FillSizeX, FillSizeY); GetFillScreenSize(FillSizeX, FillSizeY);
return (FillSizeY / 1080.f) * DefaultSize; return (FillSizeY / 1080.f) * DefaultSize;
} }
@ -271,7 +275,7 @@ final function DrawColoredText(coerce string S, float X, float Y, optional float
{ {
if (bUseOutline) if (bUseOutline)
DrawTextShadow(S, X, Y, 1, Scale); DrawTextShadow(S, X, Y, 1, Scale);
else else
{ {
Canvas.SetPos(X, Y); Canvas.SetPos(X, Y);
Canvas.DrawText(S, ,Scale, Scale); Canvas.DrawText(S, ,Scale, Scale);
@ -288,7 +292,7 @@ final function DrawColoredText(coerce string S, float X, float Y, optional float
if (bUseOutline) if (bUseOutline)
DrawTextShadow(PrevT, X, Y, 1, Scale); DrawTextShadow(PrevT, X, Y, 1, Scale);
else else
{ {
Canvas.SetPos(X, Y); Canvas.SetPos(X, Y);
Canvas.DrawText(PrevT, ,Scale, Scale); Canvas.DrawText(PrevT, ,Scale, Scale);
@ -315,7 +319,7 @@ final function DrawColoredText(coerce string S, float X, float Y, optional float
if (bUseOutline) if (bUseOutline)
DrawTextShadow(T, X, Y, 1, Scale); DrawTextShadow(T, X, Y, 1, Scale);
else else
{ {
Canvas.SetPos(X, Y); Canvas.SetPos(X, Y);
Canvas.DrawText(T, ,Scale, Scale); Canvas.DrawText(T, ,Scale, Scale);
@ -357,7 +361,7 @@ final function DrawTextOutline(coerce string S, float X, float Y, int Size, Colo
Size += 1; Size += 1;
Steps = (Size * 2) / 3; Steps = (Size * 2) / 3;
if (Steps < 1 ) if (Steps < 1 )
{ {
Steps = 1; Steps = 1;
} }
@ -556,693 +560,10 @@ final function DrawWhiteBox(float XS, float YS, optional bool bClip)
Canvas.DrawTile(ItemTex, XS, YS, 19, 45, 1,1, ,bClip); Canvas.DrawTile(ItemTex, XS, YS, 19, 45, 1,1, ,bClip);
} }
final function DrawCornerSmart(float X, float Y, float Edge, int CornerPosition, int CornerShape)
{
switch (CornerPosition)
{
case ECP_TopLeft:
switch (CornerShape)
{
case ECS_Corner:
return;
case ECS_BeveledCorner:
Canvas.SetPos(X, Y);
DrawCornerTex(Edge, 0);
return;
case ECS_VerticalCorner:
Canvas.SetPos(X, Y - Edge);
DrawCornerTex(Edge, 1);
return;
case ECS_HorisontalCorner:
Canvas.SetPos(X - Edge, Y);
DrawCornerTex(Edge, 2);
return;
}
case ECP_TopRight:
switch (CornerShape)
{
case ECS_Corner:
return;
case ECS_BeveledCorner:
Canvas.SetPos(X - Edge, Y);
DrawCornerTex(Edge, 1);
return;
case ECS_VerticalCorner:
Canvas.SetPos(X - Edge, Y - Edge);
DrawCornerTex(Edge, 0);
return;
case ECS_HorisontalCorner:
Canvas.SetPos(X, Y);
DrawCornerTex(Edge, 3);
return;
}
case ECP_BottomLeft:
switch (CornerShape)
{
case ECS_Corner:
return;
case ECS_BeveledCorner:
Canvas.SetPos(X, Y - Edge);
DrawCornerTex(Edge, 2);
return;
case ECS_VerticalCorner:
Canvas.SetPos(X, Y);
DrawCornerTex(Edge, 3);
return;
case ECS_HorisontalCorner:
Canvas.SetPos(X - Edge, Y - Edge);
DrawCornerTex(Edge, 0);
return;
}
case ECP_BottomRight:
switch (CornerShape)
{
case ECS_Corner:
return;
case ECS_BeveledCorner:
Canvas.SetPos(X - Edge, Y - Edge);
DrawCornerTex(Edge, 3);
return;
case ECS_VerticalCorner:
Canvas.SetPos(X - Edge, Y);
DrawCornerTex(Edge, 2);
return;
case ECS_HorisontalCorner:
Canvas.SetPos(X, Y - Edge);
DrawCornerTex(Edge, 1);
return;
}
}
}
final function DrawRectBoxSmart(float X, float Y, float W, float H, float Edge, int TopLeftShape, int TopRightShape, int BottomLeftShape, int BottomRightShape)
{
local float BoxX, BoxW;
// Top Line
DrawCornerSmart(X, Y, Edge, ECP_TopLeft, TopLeftShape);
BoxX = X; BoxW = W;
if (TopLeftShape == ECS_BeveledCorner)
{
BoxX += Edge;
BoxW -= Edge;
}
if (TopRightShape == ECS_BeveledCorner)
{
BoxW -= Edge;
}
Canvas.SetPos(BoxX, Y);
DrawWhiteBox(BoxW, Edge);
DrawCornerSmart(X + W, Y, Edge, ECP_TopRight, TopRightShape);
// Mid Line
Canvas.SetPos(X, Y + Edge);
DrawWhiteBox(W, H - Edge * 2);
// Bottom Line
DrawCornerSmart(X, Y + H, Edge, ECP_BottomLeft, BottomLeftShape);
BoxX = X; BoxW = W;
if (BottomLeftShape == ECS_BeveledCorner)
{
BoxX += Edge;
BoxW -= Edge;
}
if (BottomRightShape == ECS_BeveledCorner)
{
BoxW -= Edge;
}
Canvas.SetPos(BoxX, Y + H - Edge);
DrawWhiteBox(BoxW, Edge);
DrawCornerSmart(X + W, Y + H, Edge, ECP_BottomRight, BottomRightShape);
}
final function DrawRectBox(float X, float Y, float Width, float Height, float Edge, optional byte Extrav) final function DrawRectBox(float X, float Y, float Width, float Height, float Edge, optional byte Extrav)
{ {
if (Extrav == 2) if (BoxPainter.Canvas == None) BoxPainter.Canvas = Canvas;
Edge=Min(FMin(Edge, (Width)*0.5), Height);// Verify size. if (BoxPainter.Canvas != None) BoxPainter.DrawBox(X, Y, Width, Height, Edge, Extrav);
else
Edge=Min(FMin(Edge, (Width)*0.5), (Height)*0.5);// Verify size.
Canvas.PreOptimizeDrawTiles(Extrav == 0 ? 7 : 6, ItemTex);
switch (Extrav)
{
case 100:
// ______
// | |
// | |
// |______|
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 110:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 111:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 120:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_VerticalCorner, // TopLeft
ECS_VerticalCorner, // TopRight
ECS_VerticalCorner, // BottomLeft
ECS_VerticalCorner // BottomRight
);
break;
case 121:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_HorisontalCorner, // TopLeft
ECS_HorisontalCorner, // TopRight
ECS_HorisontalCorner, // BottomLeft
ECS_HorisontalCorner // BottomRight
);
break;
case 130:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 131:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 132:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 133:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 140:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 141:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_Corner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 142:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 143:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 150:
// ______
// / \
// | ____ |
// |/ \|
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_VerticalCorner, // BottomLeft
ECS_VerticalCorner // BottomRight
);
break;
case 151:
// _______
// / /
// | |
// \______\
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_HorisontalCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_HorisontalCorner // BottomRight
);
break;
case 152:
//
// |\____/|
// | |
// \______/
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_VerticalCorner, // TopLeft
ECS_VerticalCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 153:
// _______
// \ \
// | |
// /______/
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_HorisontalCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_HorisontalCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 160:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_HorisontalCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 161:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_VerticalCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 162:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_HorisontalCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 163:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_VerticalCorner // BottomRight
);
break;
case 170:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_HorisontalCorner // BottomRight
);
break;
case 171:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_VerticalCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 172:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_HorisontalCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 173:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_VerticalCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 180:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_HorisontalCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 181:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_VerticalCorner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 182:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_HorisontalCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 183:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_VerticalCorner // BottomRight
);
break;
case 190:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_HorisontalCorner // BottomRight
);
break;
case 191:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_VerticalCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 192:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_HorisontalCorner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 193:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_VerticalCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 200:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_VerticalCorner, // BottomLeft
ECS_VerticalCorner // BottomRight
);
break;
case 201:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_HorisontalCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_HorisontalCorner // BottomRight
);
break;
case 202:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_VerticalCorner, // TopLeft
ECS_VerticalCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 203:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_HorisontalCorner, // TopLeft
ECS_Corner, // TopRight
ECS_HorisontalCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 210:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_HorisontalCorner, // TopLeft
ECS_HorisontalCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 211:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_VerticalCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_VerticalCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 212:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_HorisontalCorner, // BottomLeft
ECS_HorisontalCorner // BottomRight
);
break;
case 213:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_VerticalCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_VerticalCorner // BottomRight
);
break;
case 220:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_HorisontalCorner, // TopLeft
ECS_HorisontalCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 221:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_VerticalCorner, // TopLeft
ECS_Corner, // TopRight
ECS_VerticalCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 222:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_HorisontalCorner, // BottomLeft
ECS_HorisontalCorner // BottomRight
);
break;
case 223:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_VerticalCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_VerticalCorner // BottomRight
);
break;
case 230:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_HorisontalCorner, // TopRight
ECS_HorisontalCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 231:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_VerticalCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_VerticalCorner // BottomRight
);
break;
case 232:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_HorisontalCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_HorisontalCorner // BottomRight
);
break;
case 233:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_VerticalCorner, // TopRight
ECS_VerticalCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 240:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_HorisontalCorner, // TopRight
ECS_HorisontalCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 241:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_VerticalCorner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_VerticalCorner // BottomRight
);
break;
case 242:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_HorisontalCorner, // TopLeft
ECS_Corner, // TopRight
ECS_Corner, // BottomLeft
ECS_HorisontalCorner // BottomRight
);
break;
case 243:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_VerticalCorner, // TopRight
ECS_VerticalCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 250:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 251:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_Corner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_Corner // BottomRight
);
break;
case 252:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_Corner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
case 253:
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_Corner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_Corner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
default: // 0
// ______
// / \
// | |
// \______/
DrawRectBoxSmart(X, Y, Width, Height, Edge,
ECS_BeveledCorner, // TopLeft
ECS_BeveledCorner, // TopRight
ECS_BeveledCorner, // BottomLeft
ECS_BeveledCorner // BottomRight
);
break;
}
} }
final function DrawBoxHollow(float X, float Y, float Width, float Height, float Thickness) final function DrawBoxHollow(float X, float Y, float Width, float Height, float Thickness)
@ -1351,7 +672,7 @@ final function DrawRoundedBoxHollowEx(float BorderSize, float X, float Y, float
DrawWhiteBox(W - BorderSize * 2, BorderSize); DrawWhiteBox(W - BorderSize * 2, BorderSize);
Canvas.SetPos(X, Y + BorderSize); Canvas.SetPos(X, Y + BorderSize);
DrawWhiteBox(BorderSize, H - BorderSize * 2); DrawWhiteBox(BorderSize, H - BorderSize * 2);
Canvas.SetPos(X + W - BorderSize, Y + BorderSize); Canvas.SetPos(X + W - BorderSize, Y + BorderSize);
DrawWhiteBox(BorderSize, H - BorderSize * 2); DrawWhiteBox(BorderSize, H - BorderSize * 2);
@ -1407,7 +728,7 @@ final function DrawArrowBox(int Direction, float X, float Y, float Width, float
function DrawTexture(Texture2D Tex, float X, float Y, float W, float H, optional float UL, optional float VL) function DrawTexture(Texture2D Tex, float X, float Y, float W, float H, optional float UL, optional float VL)
{ {
Canvas.SetPos(X, Y); Canvas.SetPos(X, Y);
Canvas.DrawTile(Tex, W, H, 0, 0, UL == 0.f ? float(Tex.SizeX) : UL, VL == 0.f ? float(Tex.SizeY) : VL); Canvas.DrawTile(Tex, W, H, 0, 0, UL == 0.f ? float(Tex.SizeX) : UL, VL == 0.f ? float(Tex.SizeY) : VL);
} }
@ -1415,17 +736,17 @@ final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float
{ {
local float mW, mH, MidX, MidY, SmallTileW, SmallTileH, fX, fY; local float mW, mH, MidX, MidY, SmallTileW, SmallTileH, fX, fY;
local int OptimizeTiles; local int OptimizeTiles;
if (Tex == None ) Tex = Texture2D'EngineMaterials.DefaultDiffuse'; if (Tex == None ) Tex = Texture2D'EngineMaterials.DefaultDiffuse';
// Get the size of the image // Get the size of the image
mW = Tex.GetSurfaceWidth(); mW = Tex.GetSurfaceWidth();
mH = Tex.GetSurfaceHeight(); mH = Tex.GetSurfaceHeight();
// Get the midpoints of the image // Get the midpoints of the image
MidX = int(mW/2); MidX = int(mW/2);
MidY = int(mH/2); MidY = int(mH/2);
// Grab info about the scaled image // Grab info about the scaled image
SmallTileW = XS - mW; SmallTileW = XS - mW;
SmallTileH = YS - mH; SmallTileH = YS - mH;
@ -1441,18 +762,18 @@ final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float
OptimizeTiles += 1; OptimizeTiles += 1;
Canvas.PreOptimizeDrawTiles(OptimizeTiles, Tex); Canvas.PreOptimizeDrawTiles(OptimizeTiles, Tex);
// Draw the spans first // Draw the spans first
// Top and Bottom // Top and Bottom
if (mW < XS) if (mW < XS)
{ {
fX = MidX; fX = MidX;
if (mH > YS) if (mH > YS)
fY = YS/2; fY = YS/2;
else else
fY = MidY; fY = MidY;
Canvas.SetPos(X+fX, Y); Canvas.SetPos(X+fX, Y);
Canvas.DrawTile(Tex, SmallTileW, fY, MidX, 0,1, fY); Canvas.DrawTile(Tex, SmallTileW, fY, MidX, 0,1, fY);
Canvas.SetPos(X+fX, Y+YS-fY); Canvas.SetPos(X+fX, Y+YS-fY);
@ -1460,12 +781,12 @@ final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float
} }
else else
fX = XS / 2; fX = XS / 2;
// Left and Right // Left and Right
if (mH < YS) if (mH < YS)
{ {
fY = MidY; fY = MidY;
Canvas.SetPos(X, Y+fY); Canvas.SetPos(X, Y+fY);
Canvas.DrawTile(Tex, fX, SmallTileH, 0,fY, fX, 1); Canvas.DrawTile(Tex, fX, SmallTileH, 0,fY, fX, 1);
Canvas.SetPos(X+XS-fX, Y+fY); Canvas.SetPos(X+XS-fX, Y+fY);
@ -1473,14 +794,14 @@ final function DrawTileStretched(Texture Tex, float X, float Y, float XS, float
} }
else else
fY = YS / 2; fY = YS / 2;
// Center // Center
if ((mH < YS) && (mW < XS)) if ((mH < YS) && (mW < XS))
{ {
Canvas.SetPos(X+fX, Y+fY); Canvas.SetPos(X+fX, Y+fY);
Canvas.DrawTile(Tex, SmallTileW, SmallTileH, fX, fY, 1,1); Canvas.DrawTile(Tex, SmallTileW, SmallTileH, fX, fY, 1,1);
} }
// Draw the 4 corners. // Draw the 4 corners.
Canvas.SetPos(X, Y); Canvas.SetPos(X, Y);
Canvas.DrawTile(Tex, fX, fY, 0,0, fX, fY); Canvas.DrawTile(Tex, fX, fY, 0,0, fX, fY);
@ -1549,7 +870,7 @@ defaultproperties
// Font'UI_Canvas_Fonts.Font_Main' // Font'UI_Canvas_Fonts.Font_Main'
//MainFont=Font'KFYAS_Assets.Font.KFMainFont' //MainFont=Font'KFYAS_Assets.Font.KFMainFont'
//InfiniteFont=Font'KFYAS_Assets.Font.KFInfiniteFont' //InfiniteFont=Font'KFYAS_Assets.Font.KFInfiniteFont'
MainFont=Font'UI_Canvas_Fonts.Font_Main' MainFont=Font'UI_Canvas_Fonts.Font_Main'
NumberFont=Font'UI_Canvas_Fonts.Font_General' NumberFont=Font'UI_Canvas_Fonts.Font_General'
InfiniteFont=Font'UI_Canvas_Fonts.Font_Main' InfiniteFont=Font'UI_Canvas_Fonts.Font_Main'

View File

@ -366,8 +366,8 @@ simulated function MenuInput(float DeltaTime)
V = ClientViewport.GetMousePosition(); V = ClientViewport.GetMousePosition();
MousePosition.X = Clamp(V.X, 0, ScreenSize.X); MousePosition.X = Clamp(V.X, 0, ScreenSize.X);
MousePosition.Y = Clamp(V.Y, 0, ScreenSize.Y); MousePosition.Y = Clamp(V.Y, 0, ScreenSize.Y);
MouseMove(); MouseMove();
} }
@ -756,8 +756,8 @@ simulated function bool ReceivedInputKey(int ControllerId, name Key, EInputEvent
if (KeyboardFocus == None) if (KeyboardFocus == None)
{ {
if (KFInput != None) if (KFInput != None)
{ {
KFInput.GetKeyBindFromCommand(BoundKey, "GBA_VoiceChat", false); KFInput.GetKeyBindFromCommand(BoundKey, "GBA_VoiceChat", false);
if (string(Key) ~= KFInput.GetBindDisplayName(BoundKey)) if (string(Key) ~= KFInput.GetBindDisplayName(BoundKey))
{ {
if (Event == IE_Pressed) if (Event == IE_Pressed)

View File

@ -59,4 +59,5 @@ function PreClientTravel(string PendingURL, ETravelType TravelType, bool bIsSeam
defaultproperties defaultproperties
{ {
} }

View File

@ -6,4 +6,4 @@ var KF2GUIController OutputObject;
function PostRender_Console(Canvas Canvas) function PostRender_Console(Canvas Canvas)
{ {
OutputObject.RenderMenu(Canvas); OutputObject.RenderMenu(Canvas);
} }

View File

@ -77,4 +77,5 @@ function DrawMenu()
defaultproperties defaultproperties
{ {
} }

View File

@ -86,4 +86,5 @@ function EmptyList()
defaultproperties defaultproperties
{ {
} }

View File

@ -50,7 +50,7 @@ final function KFGUI_Slider AddSlider(string Cap, name IDN, int MinValue, int Ma
Label.SetText(Cap); Label.SetText(Cap);
Label.XSize = 0.45; Label.XSize = 0.45;
Label.FontScale = 1; Label.FontScale = 1;
MC.AddComponent(Label); MC.AddComponent(Label);
ColorValueLabel = new(MC) class'KFGUI_TextLable'; ColorValueLabel = new(MC) class'KFGUI_TextLable';
ColorValueLabel.XPosition = 0.95; ColorValueLabel.XPosition = 0.95;
ColorValueLabel.XSize = 0.1; ColorValueLabel.XSize = 0.1;

View File

@ -5,7 +5,7 @@ var() float HeaderSize[2]; // Pixels wide for edges (left, top).
var() Texture FrameTex; var() Texture FrameTex;
var() bool bDrawHeader, bHeaderCenter, bUseLegacyDrawTile, bDrawBackground; var() bool bDrawHeader, bHeaderCenter, bUseLegacyDrawTile, bDrawBackground;
var() float FontScale; var() float FontScale;
function InitMenu() function InitMenu()
{ {
Super(KFGUI_Page).InitMenu(); Super(KFGUI_Page).InitMenu();
@ -43,12 +43,12 @@ delegate OnDrawFrame(Canvas C, float W, Float H)
{ {
Owner.CurrentStyle.DrawTileStretched(FrameTex, 0,0, W,H); Owner.CurrentStyle.DrawTileStretched(FrameTex, 0,0, W,H);
} }
else else
{ {
Canvas.SetPos(0.f, 0.f); Canvas.SetPos(0.f, 0.f);
Canvas.DrawTileStretched(FrameTex, W,H, 0,0, FrameTex.GetSurfaceWidth(), FrameTex.GetSurfaceHeight()); Canvas.DrawTileStretched(FrameTex, W,H, 0,0, FrameTex.GetSurfaceWidth(), FrameTex.GetSurfaceHeight());
} }
if (bDrawHeader && WindowTitle != "") if (bDrawHeader && WindowTitle != "")
{ {
FRI.bClipText = true; FRI.bClipText = true;
@ -68,7 +68,7 @@ delegate OnDrawFrame(Canvas C, float W, Float H)
C.DrawText(WindowTitle, ,T, T,FRI); C.DrawText(WindowTitle, ,T, T,FRI);
} }
} }
function PreDraw() function PreDraw()
{ {
local int i; local int i;
@ -90,7 +90,7 @@ function PreDraw()
XPosition = Lerp(CenterX, default.XPosition, Frac); XPosition = Lerp(CenterX, default.XPosition, Frac);
YPosition = Lerp(CenterY, default.YPosition, Frac); YPosition = Lerp(CenterY, default.YPosition, Frac);
} }
ComputeCoords(); ComputeCoords();
Canvas.SetDrawColor(255, 255, 255); Canvas.SetDrawColor(255, 255, 255);
Canvas.SetOrigin(CompPos[0], CompPos[1]); Canvas.SetOrigin(CompPos[0], CompPos[1]);
@ -120,7 +120,7 @@ defaultproperties
HeaderSize(0)=26.f HeaderSize(0)=26.f
HeaderSize(1)=8.f HeaderSize(1)=8.f
EdgeSize(0)=20 EdgeSize(0)=20
EdgeSize(1)=35 EdgeSize(1)=35
EdgeSize(2)=-40 EdgeSize(2)=-40

View File

@ -77,7 +77,7 @@ function DrawMenu()
break; break;
case ISTY_Stretched: case ISTY_Stretched:
if (X1 < 0 && X2 < 0 && Y1 < 0 && Y2 < 0 ) if (X1 < 0 && X2 < 0 && Y1 < 0 && Y2 < 0 )
Owner.CurrentStyle.DrawTileStretched(Image, 0.f, 0.f, CompPos[2], CompPos[3]); Owner.CurrentStyle.DrawTileStretched(Image, 0.f, 0.f, CompPos[2], CompPos[3]);
else else
{ {

View File

@ -41,4 +41,4 @@ function string GetSortStr(int Column)
function Clear() function Clear()
{ {
Columns.Length = 0; Columns.Length = 0;
} }

View File

@ -13,6 +13,7 @@ function InitMenu()
Components[i].InitMenu(); Components[i].InitMenu();
} }
} }
function ShowMenu() function ShowMenu()
{ {
local int i; local int i;
@ -20,6 +21,7 @@ function ShowMenu()
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
Components[i].ShowMenu(); Components[i].ShowMenu();
} }
function PreDraw() function PreDraw()
{ {
local int i; local int i;
@ -41,6 +43,7 @@ function PreDraw()
Components[i].PreDraw(); Components[i].PreDraw();
} }
} }
function InventoryChanged(optional KFWeapon Wep, optional bool bRemove) function InventoryChanged(optional KFWeapon Wep, optional bool bRemove)
{ {
local int i; local int i;
@ -48,6 +51,7 @@ function InventoryChanged(optional KFWeapon Wep, optional bool bRemove)
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
Components[i].InventoryChanged(Wep, bRemove); Components[i].InventoryChanged(Wep, bRemove);
} }
function MenuTick(float DeltaTime) function MenuTick(float DeltaTime)
{ {
local int i; local int i;
@ -72,6 +76,7 @@ function CloseMenu()
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
Components[i].CloseMenu(); Components[i].CloseMenu();
} }
function bool CaptureMouse() function bool CaptureMouse()
{ {
local int i; local int i;
@ -87,6 +92,7 @@ function bool CaptureMouse()
MouseArea = None; MouseArea = None;
return Super.CaptureMouse(); // check with frame itself. return Super.CaptureMouse(); // check with frame itself.
} }
function bool ReceievedControllerInput(int ControllerId, name Key, EInputEvent Event) function bool ReceievedControllerInput(int ControllerId, name Key, EInputEvent Event)
{ {
local int i; local int i;
@ -101,6 +107,7 @@ function bool ReceievedControllerInput(int ControllerId, name Key, EInputEvent E
return Super.ReceievedControllerInput(ControllerId, Key, Event); return Super.ReceievedControllerInput(ControllerId, Key, Event);
} }
function KFGUI_Base FindComponentID(name InID) function KFGUI_Base FindComponentID(name InID)
{ {
local int i; local int i;
@ -115,6 +122,7 @@ function KFGUI_Base FindComponentID(name InID)
} }
return Result; return Result;
} }
function FindAllComponentID(name InID, out array < KFGUI_Base> Res) function FindAllComponentID(name InID, out array < KFGUI_Base> Res)
{ {
local int i; local int i;
@ -124,6 +132,7 @@ function FindAllComponentID(name InID, out array < KFGUI_Base> Res)
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
Components[i].FindAllComponentID(InID, Res); Components[i].FindAllComponentID(InID, Res);
} }
function RemoveComponent(KFGUI_Base B) function RemoveComponent(KFGUI_Base B)
{ {
local int i; local int i;
@ -138,10 +147,11 @@ function RemoveComponent(KFGUI_Base B)
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
Components[i].RemoveComponent(B); Components[i].RemoveComponent(B);
} }
function NotifyLevelChange() function NotifyLevelChange()
{ {
local int i; local int i;
for (i=0; i < Components.Length; ++i) for (i=0; i < Components.Length; ++i)
Components[i].NotifyLevelChange(); Components[i].NotifyLevelChange();
} }

View File

@ -35,7 +35,7 @@ function DrawMenu()
Height = CompPos[3]; Height = CompPos[3];
// Select the right font in the Canvas // Select the right font in the Canvas
Canvas.Font = Owner.CurrentStyle.PickFont(Sc); Canvas.Font = Owner.CurrentStyle.PickFont(Sc);
if (CaptionWidth > 0.0 && Width > 0 && Len(Caption) > 0) if (CaptionWidth > 0.0 && Width > 0 && Len(Caption) > 0)
{ {
@ -79,7 +79,7 @@ function DrawMenu()
{ {
S = string(int(Value)); S = string(int(Value));
} }
else else
{ {
S = string(int(High)); S = string(int(High));
} }
@ -131,4 +131,4 @@ defaultproperties
ValueRightWidth=0.2 ValueRightWidth=0.2
ValueRightAlign=0 ValueRightAlign=0
NumDecimals=0 NumDecimals=0
} }

View File

@ -28,7 +28,7 @@ final function ComputeSize()
if (OldSizeX == Owner.ScreenSize.X) if (OldSizeX == Owner.ScreenSize.X)
return; return;
if (ItemRows.Length == 0) if (ItemRows.Length == 0)
{ {
YS = 0; YS = 0;
@ -86,7 +86,7 @@ function PreDraw()
Super.PreDraw(); Super.PreDraw();
} }
function DrawMenu() function DrawMenu()
{ {
Owner.CurrentStyle.RenderRightClickMenu(Self); Owner.CurrentStyle.RenderRightClickMenu(Self);
if (bDrawToolTip) if (bDrawToolTip)

View File

@ -49,4 +49,4 @@ defaultproperties
ID="Scrollbar" ID="Scrollbar"
End Object End Object
Components.Add(SliderScroll) Components.Add(SliderScroll)
} }

View File

@ -11,10 +11,10 @@ public static function InitConfig(int Version, int LatestVersion)
{ {
case `NO_CONFIG: case `NO_CONFIG:
ApplyDefault(); ApplyDefault();
default: break; default: break;
} }
if (LatestVersion != Version) if (LatestVersion != Version)
{ {
StaticSaveConfig(); StaticSaveConfig();
@ -25,7 +25,7 @@ private static function ApplyDefault()
{ {
default.DisplayTime = 30; default.DisplayTime = 30;
default.bRandomize = true; default.bRandomize = true;
default.Message.Length = 0; default.Message.Length = 0;
default.Message.AddItem("UwU"); default.Message.AddItem("UwU");
default.Message.AddItem("OwO"); default.Message.AddItem("OwO");
@ -34,4 +34,4 @@ private static function ApplyDefault()
defaultproperties defaultproperties
{ {
} }

60
YAS/Classes/Mut.uc Normal file
View File

@ -0,0 +1,60 @@
class Mut extends KFMutator;
var private YAS YAS;
public simulated function bool SafeDestroy()
{
return (bPendingDelete || bDeleteMe || Destroy());
}
public event PreBeginPlay()
{
Super.PreBeginPlay();
if (WorldInfo.NetMode == NM_Client) return;
foreach WorldInfo.DynamicActors(class'YAS', YAS)
{
break;
}
if (YAS == None)
{
YAS = WorldInfo.Spawn(class'YAS');
}
if (YAS == None)
{
`Log_Base("FATAL: Can't Spawn 'YAS'");
SafeDestroy();
}
}
public function AddMutator(Mutator M)
{
if (M == Self) return;
if (M.Class == Class)
Mut(M).SafeDestroy();
else
Super.AddMutator(M);
}
public function NotifyLogin(Controller C)
{
YAS.NotifyLogin(C);
Super.NotifyLogin(C);
}
public function NotifyLogout(Controller C)
{
YAS.NotifyLogout(C);
Super.NotifyLogout(C);
}
DefaultProperties
{
GroupNames.Add("Scoreboard")
}

View File

@ -10,10 +10,10 @@ public static function InitConfig(int Version, int LatestVersion)
{ {
case `NO_CONFIG: case `NO_CONFIG:
ApplyDefault(); ApplyDefault();
default: break; default: break;
} }
if (LatestVersion != Version) if (LatestVersion != Version)
{ {
StaticSaveConfig(); StaticSaveConfig();
@ -23,17 +23,17 @@ public static function InitConfig(int Version, int LatestVersion)
private static function ApplyDefault() private static function ApplyDefault()
{ {
local RankRelation NewRankRelation; local RankRelation NewRankRelation;
default.Relation.Length = 0; default.Relation.Length = 0;
// Example relation: // Example relation:
NewRankRelation.RankID = 1; // "Man of culture" ID NewRankRelation.RankID = 1; // "Man of culture" ID
NewRankRelation.ObjectID = "103582791429670253"; // HENTAI Group SteamID64 NewRankRelation.ObjectID = "103582791429670253"; // HENTAI Group SteamID64
default.Relation.AddItem(NewRankRelation); default.Relation.AddItem(NewRankRelation);
} }
defaultproperties defaultproperties
{ {
} }

View File

@ -12,10 +12,10 @@ public static function InitConfig(int Version, int LatestVersion)
{ {
case `NO_CONFIG: case `NO_CONFIG:
ApplyDefault(); ApplyDefault();
default: break; default: break;
} }
if (LatestVersion != Version) if (LatestVersion != Version)
{ {
StaticSaveConfig(); StaticSaveConfig();
@ -25,28 +25,28 @@ public static function InitConfig(int Version, int LatestVersion)
private static function ApplyDefault() private static function ApplyDefault()
{ {
local Rank NewRank; local Rank NewRank;
// System ranks: // System ranks:
default.Player.RankName = ""; default.Player.RankName = "";
default.Player.RankColor = MakeColor(250, 250, 250, 250); default.Player.RankColor = MakeColor(250, 250, 250, 250);
default.Player.PlayerColor = MakeColor(250, 250, 250, 250); default.Player.PlayerColor = MakeColor(250, 250, 250, 250);
default.Admin.RankName = "Admin"; default.Admin.RankName = "Admin";
default.Admin.RankColor = MakeColor(250, 0, 0, 250); default.Admin.RankColor = MakeColor(250, 0, 0, 250);
default.Admin.PlayerColor = MakeColor(250, 0, 0, 250); default.Admin.PlayerColor = MakeColor(250, 0, 0, 250);
default.Rank.Length = 0; default.Rank.Length = 0;
// Example custom rank: // Example custom rank:
NewRank.RankID = 1; NewRank.RankID = 1;
NewRank.RankName = "Man of culture"; NewRank.RankName = "Man of culture";
NewRank.RankColor = MakeColor(0, 250, 0, 250); NewRank.RankColor = MakeColor(0, 250, 0, 250);
NewRank.PlayerColor = MakeColor(250, 250, 250, 250); NewRank.PlayerColor = MakeColor(250, 250, 250, 250);
default.Rank.AddItem(NewRank); default.Rank.AddItem(NewRank);
} }
defaultproperties defaultproperties
{ {
} }

View File

@ -1,450 +1,451 @@
class YAS extends Info class YAS extends Info
config(YAS); config(YAS);
const LatestVersion = 1; const LatestVersion = 1;
const CfgRanks = class'Ranks'; const CfgRanks = class'Ranks';
const CfgRankRelations = class'RankRelations'; const CfgRankRelations = class'RankRelations';
const CfgMessageOfTheDay = class'MessageOfTheDay'; const CfgMessageOfTheDay = class'MessageOfTheDay';
const UpdateInterval = 1.0f; const UpdateInterval = 1.0f;
const MatchUID = "0x"; const MatchUID = "0x";
const MatchPlayerSteamID64 = "76561"; const MatchPlayerSteamID64 = "76561";
const MatchGroupSteamID64 = "10358279"; const MatchGroupSteamID64 = "10358279";
var private config int Version; var private config int Version;
var private config E_LogLevel LogLevel; var private config E_LogLevel LogLevel;
var private KFGameInfo KFGI; var private KFGameInfo KFGI;
var private KFGameInfo_Survival KFGIS; var private KFGameInfo_Survival KFGIS;
var private KFGameInfo_Endless KFGIE; var private KFGameInfo_Endless KFGIE;
var private KFGameReplicationInfo KFGRI; var private KFGameReplicationInfo KFGRI;
var private KFOnlineGameSettings KFOGS; var private KFOnlineGameSettings KFOGS;
var private OnlineSubsystemSteamworks OSS; var private OnlineSubsystemSteamworks OSS;
var private Array<YAS_RepInfoOwner> RepInfos; var private Array<YAS_RepInfoOwner> RepInfos;
var private Array<CachedRankRelation> PlayerRelations; var private Array<CachedRankRelation> PlayerRelations;
var private Array<CachedRankRelation> GroupRelations; var private Array<CachedRankRelation> GroupRelations;
var private int LastMessageID; var private int LastMessageID;
public simulated function bool SafeDestroy() public simulated function bool SafeDestroy()
{ {
`Log_Trace(); `Log_Trace();
return (bPendingDelete || bDeleteMe || Destroy()); return (bPendingDelete || bDeleteMe || Destroy());
} }
public event PreBeginPlay() public event PreBeginPlay()
{ {
`Log_Trace(); `Log_Trace();
if (WorldInfo.NetMode == NM_Client) if (WorldInfo.NetMode == NM_Client)
{ {
`Log_Fatal("NetMode == NM_Client"); `Log_Fatal("NetMode == NM_Client");
SafeDestroy(); SafeDestroy();
return; return;
} }
Super.PreBeginPlay(); Super.PreBeginPlay();
PreInit(); PreInit();
} }
public event PostBeginPlay() public event PostBeginPlay()
{ {
`Log_Trace(); `Log_Trace();
if (bPendingDelete || bDeleteMe) return; if (bPendingDelete || bDeleteMe) return;
Super.PostBeginPlay(); Super.PostBeginPlay();
PostInit(); PostInit();
} }
private function PreInit() private function PreInit()
{ {
`Log_Trace(); `Log_Trace();
if (Version == `NO_CONFIG) if (Version == `NO_CONFIG)
{ {
LogLevel = LL_Info; LogLevel = LL_Info;
SaveConfig(); SaveConfig();
} }
CfgRanks.static.InitConfig(Version, LatestVersion); CfgRanks.static.InitConfig(Version, LatestVersion);
CfgRankRelations.static.InitConfig(Version, LatestVersion); CfgRankRelations.static.InitConfig(Version, LatestVersion);
CfgMessageOfTheDay.static.InitConfig(Version, LatestVersion); CfgMessageOfTheDay.static.InitConfig(Version, LatestVersion);
switch (Version) switch (Version)
{ {
case `NO_CONFIG: case `NO_CONFIG:
`Log_Info("Config created"); `Log_Info("Config created");
case MaxInt: case MaxInt:
`Log_Info("Config updated to version" @ LatestVersion); `Log_Info("Config updated to version" @ LatestVersion);
break; break;
case LatestVersion: case LatestVersion:
`Log_Info("Config is up-to-date"); `Log_Info("Config is up-to-date");
break; break;
default: default:
`Log_Warn("The config version is higher than the current version (are you using an old mutator?)"); `Log_Warn("The config version is higher than the current version (are you using an old mutator?)");
`Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion); `Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion);
`Log_Warn("The config version will be changed to" @ LatestVersion); `Log_Warn("The config version will be changed to" @ LatestVersion);
break; break;
} }
if (LatestVersion != Version) if (LatestVersion != Version)
{ {
Version = LatestVersion; Version = LatestVersion;
SaveConfig(); SaveConfig();
} }
if (LogLevel == LL_WrongLevel) if (LogLevel == LL_WrongLevel)
{ {
LogLevel = LL_Info; LogLevel = LL_Info;
`Log_Warn("Wrong 'LogLevel', return to default value"); `Log_Warn("Wrong 'LogLevel', return to default value");
SaveConfig(); SaveConfig();
} }
`Log_Base("LogLevel:" @ LogLevel); `Log_Base("LogLevel:" @ LogLevel);
OSS = OnlineSubsystemSteamworks(class'GameEngine'.static.GetOnlineSubsystem()); OSS = OnlineSubsystemSteamworks(class'GameEngine'.static.GetOnlineSubsystem());
if (OSS != None) if (OSS != None)
{ {
InitRanks(); InitRanks();
} }
else else
{ {
`Log_Error("Can't get online subsystem!"); `Log_Error("Can't get online subsystem!");
} }
} }
private function InitRanks() private function InitRanks()
{ {
local Array<RankRelation> Relations; local Array<RankRelation> Relations;
local RankRelation Relation; local RankRelation Relation;
Relations = CfgRankRelations.default.Relation; Relations = CfgRankRelations.default.Relation;
foreach Relations(Relation) foreach Relations(Relation)
{ {
if (IsUID(Relation.ObjectID) || IsPlayerSteamID64(Relation.ObjectID)) if (IsUID(Relation.ObjectID) || IsPlayerSteamID64(Relation.ObjectID))
{ {
AddRelation(Relation, PlayerRelations); AddRelation(Relation, PlayerRelations);
} }
else if (IsGroupSteamID64(Relation.ObjectID)) else if (IsGroupSteamID64(Relation.ObjectID))
{ {
AddRelation(Relation, GroupRelations); AddRelation(Relation, GroupRelations);
} }
else else
{ {
`Log_Warn("Can't parse ID:" @ Relation.ObjectID); `Log_Warn("Can't parse ID:" @ Relation.ObjectID);
} }
} }
} }
private function AddRelation(RankRelation Relation, out Array<CachedRankRelation> OutArray) private function AddRelation(RankRelation Relation, out Array<CachedRankRelation> OutArray)
{ {
local CachedRankRelation CachedRankRelation; local CachedRankRelation CachedRankRelation;
local Array<Rank> Ranks; local Array<Rank> Ranks;
local Rank Rank; local Rank Rank;
if (AnyToUID(Relation.ObjectID, CachedRankRelation.UID)) if (AnyToUID(Relation.ObjectID, CachedRankRelation.UID))
{ {
CachedRankRelation.RawID = Relation.ObjectID; CachedRankRelation.RawID = Relation.ObjectID;
Ranks = CfgRanks.default.Rank; Ranks = CfgRanks.default.Rank;
foreach Ranks(Rank) foreach Ranks(Rank)
{ {
if (Rank.RankID == Relation.RankID) if (Rank.RankID == Relation.RankID)
{ {
CachedRankRelation.Rank = Rank; CachedRankRelation.Rank = Rank;
break; break;
} }
} }
if (CachedRankRelation.Rank.RankID > 0) if (CachedRankRelation.Rank.RankID > 0)
{ {
OutArray.AddItem(CachedRankRelation); OutArray.AddItem(CachedRankRelation);
} }
else else
{ {
`Log_Warn("Rank with ID" @ Relation.RankID @ "not found"); `Log_Warn("Rank with ID" @ Relation.RankID @ "not found");
} }
} }
else else
{ {
`Log_Warn("Can't convert to UniqueNetID:" @ Relation.ObjectID); `Log_Warn("Can't convert to UniqueNetID:" @ Relation.ObjectID);
} }
} }
private static function bool IsUID(String ID) private static function bool IsUID(String ID)
{ {
return (Left(ID, Len(MatchUID)) ~= MatchUID); return (Left(ID, Len(MatchUID)) ~= MatchUID);
} }
private static function bool IsPlayerSteamID64(String ID) private static function bool IsPlayerSteamID64(String ID)
{ {
return (Left(ID, Len(MatchPlayerSteamID64)) ~= MatchPlayerSteamID64); return (Left(ID, Len(MatchPlayerSteamID64)) ~= MatchPlayerSteamID64);
} }
private static function bool IsGroupSteamID64(String ID) private static function bool IsGroupSteamID64(String ID)
{ {
return (Left(ID, Len(MatchGroupSteamID64)) ~= MatchGroupSteamID64); return (Left(ID, Len(MatchGroupSteamID64)) ~= MatchGroupSteamID64);
} }
private function bool AnyToUID(String ID, out UniqueNetId UID) private function bool AnyToUID(String ID, out UniqueNetId UID)
{ {
return IsUID(ID) ? OSS.StringToUniqueNetId(ID, UID) : OSS.Int64ToUniqueNetId(ID, UID); return IsUID(ID) ? OSS.StringToUniqueNetId(ID, UID) : OSS.Int64ToUniqueNetId(ID, UID);
} }
private function PostInit() private function PostInit()
{ {
`Log_Trace(); `Log_Trace();
if (WorldInfo == None || WorldInfo.Game == None) if (WorldInfo == None || WorldInfo.Game == None)
{ {
SetTimer(1.0f, false, nameof(PostInit)); SetTimer(1.0f, false, nameof(PostInit));
return; return;
} }
KFGI = KFGameInfo(WorldInfo.Game); KFGI = KFGameInfo(WorldInfo.Game);
if (KFGI == None || KFGameInfo_VersusSurvival(KFGI) != None) // VersusSurvival is not supported (yet) if (KFGI == None || KFGameInfo_VersusSurvival(KFGI) != None) // VersusSurvival is not supported (yet)
{ {
`Log_Fatal("Incompatible gamemode:" @ WorldInfo.Game); `Log_Fatal("Incompatible gamemode:" @ WorldInfo.Game);
SafeDestroy(); SafeDestroy();
return; return;
} }
KFGI.HUDType = class'YAS_HUD'; KFGI.HUDType = class'YAS_HUD';
if (KFGI.GameReplicationInfo == None) if (KFGI.GameReplicationInfo == None)
{ {
SetTimer(1.0f, false, nameof(PostInit)); SetTimer(1.0f, false, nameof(PostInit));
return; return;
} }
KFGRI = KFGameReplicationInfo(KFGI.GameReplicationInfo); KFGRI = KFGameReplicationInfo(KFGI.GameReplicationInfo);
if (KFGRI == None) if (KFGRI == None)
{ {
`Log_Fatal("Incompatible Replication info:" @ KFGI.GameReplicationInfo); `Log_Fatal("Incompatible Replication info:" @ KFGI.GameReplicationInfo);
SafeDestroy(); SafeDestroy();
return; return;
} }
if (KFGI.PlayfabInter != None && KFGI.PlayfabInter.GetGameSettings() != None) if (KFGI.PlayfabInter != None && KFGI.PlayfabInter.GetGameSettings() != None)
{ {
KFOGS = KFOnlineGameSettings(KFGI.PlayfabInter.GetGameSettings()); KFOGS = KFOnlineGameSettings(KFGI.PlayfabInter.GetGameSettings());
} }
else if (KFGI.GameInterface != None) else if (KFGI.GameInterface != None)
{ {
KFOGS = KFOnlineGameSettings( KFOGS = KFOnlineGameSettings(
KFGI.GameInterface.GetGameSettings( KFGI.GameInterface.GetGameSettings(
KFGI.PlayerReplicationInfoClass.default.SessionName)); KFGI.PlayerReplicationInfoClass.default.SessionName));
} }
if (KFOGS == None) if (KFOGS == None)
{ {
SetTimer(1.0f, false, nameof(PostInit)); SetTimer(1.0f, false, nameof(PostInit));
return; return;
} }
KFGIS = KFGameInfo_Survival(KFGI); KFGIS = KFGameInfo_Survival(KFGI);
KFGIE = KFGameInfo_Endless(KFGI); KFGIE = KFGameInfo_Endless(KFGI);
SetTimer(UpdateInterval, true, nameof(UpdateTimer)); SetTimer(UpdateInterval, true, nameof(UpdateTimer));
if (CfgMessageOfTheDay.default.Message.Length > 0) if (CfgMessageOfTheDay.default.Message.Length > 0)
{ {
MessageOfTheDayTimer(); MessageOfTheDayTimer();
SetTimer(CfgMessageOfTheDay.default.DisplayTime, true, nameof(MessageOfTheDayTimer)); SetTimer(CfgMessageOfTheDay.default.DisplayTime, true, nameof(MessageOfTheDayTimer));
} }
} }
private function UpdateTimer() private function UpdateTimer()
{ {
local YAS_RepInfoOwner RepInfo; local YAS_RepInfoOwner RepInfo;
foreach RepInfos(RepInfo) foreach RepInfos(RepInfo)
{ {
RepInfo.DynamicServerName = KFOGS.OwningPlayerName; RepInfo.DynamicServerName = KFOGS.OwningPlayerName;
RepInfo.UsesStats = KFOGS.bUsesStats; RepInfo.UsesStats = KFOGS.bUsesStats;
RepInfo.Custom = KFOGS.bCustom; RepInfo.Custom = KFOGS.bCustom;
RepInfo.PasswordRequired = KFOGS.bRequiresPassword; RepInfo.PasswordRequired = KFOGS.bRequiresPassword;
} }
} }
private function MessageOfTheDayTimer() private function MessageOfTheDayTimer()
{ {
local YAS_RepInfoOwner RepInfo; local YAS_RepInfoOwner RepInfo;
local int MessageIndex; local int MessageIndex;
if (CfgMessageOfTheDay.default.bRandomize) if (CfgMessageOfTheDay.default.bRandomize)
{ {
MessageIndex = Rand(CfgMessageOfTheDay.default.Message.Length); MessageIndex = Rand(CfgMessageOfTheDay.default.Message.Length);
} }
else else
{ {
MessageIndex = LastMessageID + 1; MessageIndex = LastMessageID + 1;
} }
if (MessageIndex == LastMessageID) if (MessageIndex == LastMessageID)
{ {
++MessageIndex; ++MessageIndex;
} }
if (MessageIndex >= CfgMessageOfTheDay.default.Message.Length) if (MessageIndex >= CfgMessageOfTheDay.default.Message.Length)
{ {
MessageIndex = 0; MessageIndex = 0;
} }
foreach RepInfos(RepInfo) foreach RepInfos(RepInfo)
{ {
RepInfo.MessageOfTheDay = CfgMessageOfTheDay.default.Message[MessageIndex]; RepInfo.MessageOfTheDay = CfgMessageOfTheDay.default.Message[MessageIndex];
} }
LastMessageID = MessageIndex; LastMessageID = MessageIndex;
} }
public function NotifyLogin(Controller C) public function NotifyLogin(Controller C)
{ {
local YAS_RepInfoOwner RepInfo; local YAS_RepInfoOwner RepInfo;
`Log_Trace(); `Log_Trace();
RepInfo = CreateRepInfo(C); RepInfo = CreateRepInfo(C);
if (RepInfo == None) if (RepInfo == None)
{ {
`Log_Error("Can't create RepInfo for:" @ C); `Log_Error("Can't create RepInfo for:" @ C);
return; return;
} }
InitRank(RepInfo); InitRank(RepInfo);
} }
public function NotifyLogout(Controller C) public function NotifyLogout(Controller C)
{ {
local YAS_RepInfoOwner RepInfo; local YAS_RepInfoOwner RepInfo;
`Log_Trace(); `Log_Trace();
RepInfo = FindRepInfo(C); RepInfo = FindRepInfo(C);
if (!DestroyRepInfo(RepInfo)) if (!DestroyRepInfo(RepInfo))
{ {
`Log_Error("Can't destroy RepInfo of:" @ C); `Log_Error("Can't destroy RepInfo of:" @ C);
} }
} }
public function YAS_RepInfoOwner CreateRepInfo(Controller C) public function YAS_RepInfoOwner CreateRepInfo(Controller C)
{ {
local YAS_RepInfoOwner OwnerRepInfo; local YAS_RepInfoOwner OwnerRepInfo;
local YAS_RepInfoPlayer PlayerRepInfo; local YAS_RepInfoPlayer PlayerRepInfo;
`Log_Trace(); `Log_Trace();
OwnerRepInfo = Spawn(class'YAS_RepInfoOwner', C); OwnerRepInfo = Spawn(class'YAS_RepInfoOwner', C);
PlayerRepInfo = Spawn(class'YAS_RepInfoPlayer', C); PlayerRepInfo = Spawn(class'YAS_RepInfoPlayer', C);
if (OwnerRepInfo != None && PlayerRepInfo != None) if (OwnerRepInfo != None && PlayerRepInfo != None)
{ {
RepInfos.AddItem(OwnerRepInfo); RepInfos.AddItem(OwnerRepInfo);
OwnerRepInfo.PlayerRepInfo = PlayerRepInfo; PlayerRepInfo.Rank = class'YAS_Types'.static.FromSystemRank(CfgRanks.default.Player);
OwnerRepInfo.YAS = Self; OwnerRepInfo.PlayerRepInfo = PlayerRepInfo;
OwnerRepInfo.LogLevel = LogLevel; OwnerRepInfo.YAS = Self;
OwnerRepInfo.RankPlayer = CfgRanks.default.Player; OwnerRepInfo.LogLevel = LogLevel;
OwnerRepInfo.RankAdmin = CfgRanks.default.Admin; OwnerRepInfo.RankPlayer = CfgRanks.default.Player;
OwnerRepInfo.MessageOfTheDay = CfgMessageOfTheDay.default.Message[LastMessageID]; OwnerRepInfo.RankAdmin = CfgRanks.default.Admin;
OwnerRepInfo.MessageOfTheDay = CfgMessageOfTheDay.default.Message[LastMessageID];
return OwnerRepInfo;
} return OwnerRepInfo;
}
return None;
} return None;
}
private function YAS_RepInfoOwner FindRepInfo(Controller C)
{ private function YAS_RepInfoOwner FindRepInfo(Controller C)
local YAS_RepInfoOwner RepInfo; {
local YAS_RepInfoOwner RepInfo;
if (C == None) return None;
if (C == None) return None;
foreach RepInfos(RepInfo)
{ foreach RepInfos(RepInfo)
if (RepInfo.Owner == C) {
{ if (RepInfo.Owner == C)
return RepInfo; {
} return RepInfo;
} }
}
return None;
} return None;
}
public function bool DestroyRepInfo(YAS_RepInfoOwner RepInfo)
{ public function bool DestroyRepInfo(YAS_RepInfoOwner RepInfo)
`Log_Trace(); {
`Log_Trace();
if (RepInfo == None) return false;
if (RepInfo == None) return false;
RepInfos.RemoveItem(RepInfo);
RepInfo.PlayerRepInfo.SafeDestroy(); RepInfos.RemoveItem(RepInfo);
RepInfo.SafeDestroy(); RepInfo.PlayerRepInfo.SafeDestroy();
RepInfo.SafeDestroy();
return true;
} return true;
}
private function InitRank(YAS_RepInfoOwner RepInfo)
{ private function InitRank(YAS_RepInfoOwner RepInfo)
local CachedRankRelation Rel; {
local String JoinedGroupIDs; local CachedRankRelation Rel;
local PlayerReplicationInfo PRI; local String JoinedGroupIDs;
local KFPlayerController KFPC; local PlayerReplicationInfo PRI;
local Array<String> StringGroupIDs; local KFPlayerController KFPC;
local Array<String> StringGroupIDs;
`Log_Trace();
`Log_Trace();
KFPC = RepInfo.GetKFPC();
KFPC = RepInfo.GetKFPC();
if (KFPC == None) return;
if (KFPC == None) return;
PRI = KFPC.PlayerReplicationInfo;
if (PRI == None) return; PRI = KFPC.PlayerReplicationInfo;
if (PRI == None) return;
foreach PlayerRelations(Rel)
{ foreach PlayerRelations(Rel)
if (Rel.UID.Uid == PRI.UniqueID.Uid) {
{ if (Rel.UID.Uid == PRI.UniqueID.Uid)
RepInfo.PlayerRepInfo.Rank = Rel.Rank; {
break; RepInfo.PlayerRepInfo.Rank = Rel.Rank;
} break;
} }
}
if (RepInfo.PlayerRepInfo.Rank.RankID <= 0 && !KFPC.bIsEosPlayer)
{ if (RepInfo.PlayerRepInfo.Rank.RankID <= 0 && !KFPC.bIsEosPlayer)
foreach GroupRelations(Rel) {
{ foreach GroupRelations(Rel)
StringGroupIDs.AddItem(Rel.RawID); {
} StringGroupIDs.AddItem(Rel.RawID);
JoinArray(StringGroupIDs, JoinedGroupIDs); }
RepInfo.CheckGroupRanks(JoinedGroupIDs); JoinArray(StringGroupIDs, JoinedGroupIDs);
} RepInfo.CheckGroupRanks(JoinedGroupIDs);
} }
}
public function Rank RankByGroupID(UniqueNetId GroupUID)
{ public function Rank RankByGroupID(UniqueNetId GroupUID)
local CachedRankRelation Rel; {
local CachedRankRelation Rel;
foreach GroupRelations(Rel) if (Rel.UID == GroupUID) break;
foreach GroupRelations(Rel) if (Rel.UID == GroupUID) break;
return Rel.Rank;
} return Rel.Rank;
}
DefaultProperties
{ DefaultProperties
{
} }

View File

@ -1,4 +1,4 @@
[Flags] [Flags]
AllowDownload=True AllowDownload=True
ClientOptional=False ClientOptional=False
ServerSideOnly=False ServerSideOnly=False

View File

@ -1,60 +1 @@
class YASMut extends KFMutator; class YASMut extends Mut; // backward compatibility
var private YAS YAS;
public simulated function bool SafeDestroy()
{
return (bPendingDelete || bDeleteMe || Destroy());
}
public event PreBeginPlay()
{
Super.PreBeginPlay();
if (WorldInfo.NetMode == NM_Client) return;
foreach WorldInfo.DynamicActors(class'YAS', YAS)
{
break;
}
if (YAS == None)
{
YAS = WorldInfo.Spawn(class'YAS');
}
if (YAS == None)
{
`Log_Base("FATAL: Can't Spawn 'YAS'");
SafeDestroy();
}
}
public function AddMutator(Mutator Mut)
{
if (Mut == Self) return;
if (Mut.Class == Class)
Mut.Destroy();
else
Super.AddMutator(Mut);
}
public function NotifyLogin(Controller C)
{
YAS.NotifyLogin(C);
Super.NotifyLogin(C);
}
public function NotifyLogout(Controller C)
{
YAS.NotifyLogout(C);
Super.NotifyLogout(C);
}
DefaultProperties
{
}

View File

@ -0,0 +1,34 @@
class YAS_LocalMessage extends Object
abstract;
var const String PlayersDefault;
var private localized String Players;
var const String SpectatorsDefault;
var private localized String Spectators;
enum E_YAS_LocalMessageType
{
YAS_Players,
YAS_Spectators
};
public static function String GetLocalizedString(E_YAS_LocalMessageType LMT)
{
switch (LMT)
{
case YAS_Players:
return (default.Players != "" ? default.Players : default.PlayersDefault);
case YAS_Spectators:
return (default.Spectators != "" ? default.Spectators : default.SpectatorsDefault);
}
return "";
}
defaultproperties
{
PlayersDefault = "Players"
SpectatorsDefault = "Spectators"
}

View File

@ -24,7 +24,7 @@ replication
{ {
if (bNetInitial) if (bNetInitial)
LogLevel, RankPlayer, RankAdmin; LogLevel, RankPlayer, RankAdmin;
if (bNetDirty) if (bNetDirty)
DynamicServerName, UsesStats, Custom, PasswordRequired, MessageOfTheDay; DynamicServerName, UsesStats, Custom, PasswordRequired, MessageOfTheDay;
} }
@ -32,48 +32,50 @@ replication
public simulated function bool SafeDestroy() public simulated function bool SafeDestroy()
{ {
`Log_Trace(); `Log_Trace();
return (bPendingDelete || bDeleteMe || Destroy()); return (bPendingDelete || bDeleteMe || Destroy());
} }
public simulated event ReplicatedEvent(name VarName) public simulated event ReplicatedEvent(name VarName)
{ {
`Log_Trace(); `Log_Trace();
`Log_Debug(`Location @ "Var:" @ VarName);
switch (VarName) switch (VarName)
{ {
case 'LogLevel': case 'LogLevel':
if (SC != None) SC.LogLevel = LogLevel; if (SC != None) SC.LogLevel = LogLevel;
break; break;
case 'RankPlayer': case 'RankPlayer':
if (SC != None) SC.RankPlayer = RankPlayer; if (SC != None) SC.RankPlayer = RankPlayer;
break; break;
case 'RankAdmin': case 'RankAdmin':
if (SC != None) SC.RankAdmin = RankAdmin; if (SC != None) SC.RankAdmin = RankAdmin;
break; break;
case 'DynamicServerName': case 'DynamicServerName':
if (SC != None) SC.DynamicServerName = DynamicServerName; if (SC != None) SC.DynamicServerName = DynamicServerName;
break; break;
case 'MessageOfTheDay': case 'MessageOfTheDay':
if (SC != None) SC.MessageOfTheDay = MessageOfTheDay; if (SC != None) SC.MessageOfTheDay = MessageOfTheDay;
break; break;
case 'UsesStats': case 'UsesStats':
if (SC != None) SC.UsesStats = UsesStats; if (SC != None) SC.UsesStats = UsesStats;
break; break;
case 'Custom': case 'Custom':
if (SC != None) SC.Custom = Custom; if (SC != None) SC.Custom = Custom;
break; break;
case 'PasswordRequired': case 'PasswordRequired':
if (SC != None) SC.PasswordRequired = PasswordRequired; if (SC != None) SC.PasswordRequired = PasswordRequired;
break; break;
default: default:
super.ReplicatedEvent(VarName); super.ReplicatedEvent(VarName);
break; break;
@ -83,37 +85,37 @@ public simulated event ReplicatedEvent(name VarName)
public simulated event PreBeginPlay() public simulated event PreBeginPlay()
{ {
`Log_Trace(); `Log_Trace();
if (bPendingDelete || bDeleteMe) return; if (bPendingDelete || bDeleteMe) return;
Super.PreBeginPlay(); Super.PreBeginPlay();
if (Role < ROLE_Authority || WorldInfo.NetMode == NM_StandAlone) if (Role < ROLE_Authority || WorldInfo.NetMode == NM_StandAlone)
{ {
GetScoreboard(); GetScoreboard();
} }
if (Role == ROLE_Authority || WorldInfo.NetMode == NM_StandAlone) if (Role == ROLE_Authority || WorldInfo.NetMode == NM_StandAlone)
{ {
SetTimer(UpdatePlayerStatsTimer, true, nameof(UpdatePlayerStats)); SetTimer(UpdatePlayerStatsTimer, true, nameof(UpdatePlayerStats));
} }
GetOnlineSubsystem(); GetOnlineSubsystem();
} }
public simulated event PostBeginPlay() public simulated event PostBeginPlay()
{ {
if (bPendingDelete || bDeleteMe) return; if (bPendingDelete || bDeleteMe) return;
Super.PostBeginPlay(); Super.PostBeginPlay();
} }
public function UpdatePlayerStats() public function UpdatePlayerStats()
{ {
if (GetKFPC() == None || KFPC.MatchStats == None) return; if (GetKFPC() == None || KFPC.MatchStats == None) return;
if (WorldInfo.GRI == None || KFGameReplicationInfo(WorldInfo.GRI) == None) return; if (WorldInfo.GRI == None || KFGameReplicationInfo(WorldInfo.GRI) == None) return;
// At the end of the wave, TotalDamageDealt is incremented by GetDamageDealtInWave(), // At the end of the wave, TotalDamageDealt is incremented by GetDamageDealtInWave(),
// but GetDamageDealtInWave() is not reset immediately. // but GetDamageDealtInWave() is not reset immediately.
// In order not to receive a short-term doubling of damage in statistics, // In order not to receive a short-term doubling of damage in statistics,
@ -129,17 +131,17 @@ public reliable client function CheckGroupRanks(String JoinedGroupIDs)
local Array<String> StringGroupIDs; local Array<String> StringGroupIDs;
local String StringGroupID; local String StringGroupID;
local UniqueNetId GroupUID; local UniqueNetId GroupUID;
`Log_Trace(); `Log_Trace();
StringGroupIDs = SplitString(JoinedGroupIDs); StringGroupIDs = SplitString(JoinedGroupIDs);
if (GetOnlineSubsystem() == None) if (GetOnlineSubsystem() == None)
{ {
`Log_Error("Can't get online subsystem"); `Log_Error("Can't get online subsystem");
return; return;
} }
foreach StringGroupIDs(StringGroupID) foreach StringGroupIDs(StringGroupID)
{ {
if (OSS.Int64ToUniqueNetId(StringGroupID, GroupUID)) if (OSS.Int64ToUniqueNetId(StringGroupID, GroupUID))
@ -147,7 +149,7 @@ public reliable client function CheckGroupRanks(String JoinedGroupIDs)
PendingGroupIDs.AddItem(GroupUID); PendingGroupIDs.AddItem(GroupUID);
} }
} }
Retries = 0; Retries = 0;
CheckGroupsCycle(); CheckGroupsCycle();
} }
@ -155,15 +157,15 @@ public reliable client function CheckGroupRanks(String JoinedGroupIDs)
private simulated function CheckGroupsCycle() private simulated function CheckGroupsCycle()
{ {
local UniqueNetId GroupUID; local UniqueNetId GroupUID;
`Log_Trace(); `Log_Trace();
if (Retries++ >= MaxRetries) return; if (Retries++ >= MaxRetries) return;
// CheckPlayerGroup doesn't return real values right away, // CheckPlayerGroup doesn't return real values right away,
// so we do a dry run and a few checks just in case // so we do a dry run and a few checks just in case
foreach PendingGroupIDs(GroupUID) OSS.CheckPlayerGroup(GroupUID); foreach PendingGroupIDs(GroupUID) OSS.CheckPlayerGroup(GroupUID);
foreach PendingGroupIDs(GroupUID) foreach PendingGroupIDs(GroupUID)
{ {
if (OSS.CheckPlayerGroup(GroupUID)) if (OSS.CheckPlayerGroup(GroupUID))
@ -173,16 +175,16 @@ private simulated function CheckGroupsCycle()
return; return;
} }
} }
SetTimer(0.2f, false, nameof(CheckGroupsCycle)); SetTimer(0.2f, false, nameof(CheckGroupsCycle));
} }
private reliable server function ServerApplyMembership(UniqueNetId GroupUID) private reliable server function ServerApplyMembership(UniqueNetId GroupUID)
{ {
local Rank Rank; local Rank Rank;
`Log_Trace(); `Log_Trace();
Rank = YAS.RankByGroupID(GroupUID); Rank = YAS.RankByGroupID(GroupUID);
if (Rank.RankID > 0) if (Rank.RankID > 0)
{ {
@ -198,35 +200,35 @@ private reliable server function ServerApplyMembership(UniqueNetId GroupUID)
public simulated function KFPlayerController GetKFPC() public simulated function KFPlayerController GetKFPC()
{ {
`Log_Trace(); `Log_Trace();
if (KFPC != None) return KFPC; if (KFPC != None) return KFPC;
KFPC = KFPlayerController(Owner); KFPC = KFPlayerController(Owner);
if (KFPC == None && ROLE < ROLE_Authority) if (KFPC == None && ROLE < ROLE_Authority)
{ {
KFPC = KFPlayerController(GetALocalPlayerController()); KFPC = KFPlayerController(GetALocalPlayerController());
} }
return KFPC; return KFPC;
} }
private simulated function OnlineSubsystemSteamworks GetOnlineSubsystem() private simulated function OnlineSubsystemSteamworks GetOnlineSubsystem()
{ {
`Log_Trace(); `Log_Trace();
if (OSS == None) if (OSS == None)
{ {
OSS = OnlineSubsystemSteamworks(class'GameEngine'.static.GetOnlineSubsystem()); OSS = OnlineSubsystemSteamworks(class'GameEngine'.static.GetOnlineSubsystem());
} }
return OSS; return OSS;
} }
private reliable client function GetScoreboard() private reliable client function GetScoreboard()
{ {
`Log_Trace(); `Log_Trace();
if (SC == None) if (SC == None)
{ {
if (GetKFPC() != None && KFPC.myHUD != None) if (GetKFPC() != None && KFPC.myHUD != None)
@ -234,22 +236,22 @@ private reliable client function GetScoreboard()
SC = YAS_HUD(KFPC.myHUD).Scoreboard; SC = YAS_HUD(KFPC.myHUD).Scoreboard;
} }
} }
if (SC == None) if (SC == None)
{ {
SetTimer(0.2f, false, nameof(GetScoreboard)); SetTimer(0.2f, false, nameof(GetScoreboard));
return; return;
} }
InitScoreboard(); InitScoreboard();
} }
private simulated function InitScoreboard() private simulated function InitScoreboard()
{ {
`Log_Trace(); `Log_Trace();
if (SC == None) return; if (SC == None) return;
SC.LogLevel = LogLevel; SC.LogLevel = LogLevel;
SC.RankPlayer = RankPlayer; SC.RankPlayer = RankPlayer;
SC.RankAdmin = RankAdmin; SC.RankAdmin = RankAdmin;
@ -264,10 +266,10 @@ defaultproperties
{ {
Role = ROLE_Authority Role = ROLE_Authority
RemoteRole = ROLE_SimulatedProxy RemoteRole = ROLE_SimulatedProxy
bAlwaysRelevant = false bAlwaysRelevant = false
bOnlyRelevantToOwner = true bOnlyRelevantToOwner = true
bSkipActorPropertyReplication = false bSkipActorPropertyReplication = false
Retries = 0 Retries = 0
} }

View File

@ -8,7 +8,7 @@ replication
{ {
if (bNetInitial) if (bNetInitial)
UID; UID;
if (bNetDirty) if (bNetDirty)
Rank, DamageDealt; Rank, DamageDealt;
} }
@ -21,9 +21,9 @@ public simulated function bool SafeDestroy()
public simulated event PreBeginPlay() public simulated event PreBeginPlay()
{ {
if (bPendingDelete || bDeleteMe) return; if (bPendingDelete || bDeleteMe) return;
Super.PreBeginPlay(); Super.PreBeginPlay();
if (Role == ROLE_Authority || WorldInfo.NetMode == NM_StandAlone) if (Role == ROLE_Authority || WorldInfo.NetMode == NM_StandAlone)
{ {
if (Controller(Owner) != None && Controller(Owner).PlayerReplicationInfo != None) if (Controller(Owner) != None && Controller(Owner).PlayerReplicationInfo != None)
@ -37,7 +37,7 @@ defaultproperties
{ {
Role = ROLE_Authority Role = ROLE_Authority
RemoteRole = ROLE_SimulatedProxy RemoteRole = ROLE_SimulatedProxy
bAlwaysRelevant = true bAlwaysRelevant = true
bSkipActorPropertyReplication = false bSkipActorPropertyReplication = false
} }

View File

@ -1,6 +1,8 @@
class YAS_ScoreBoard extends KFGUI_Page class YAS_ScoreBoard extends KFGUI_Page
dependson(YAS_Types); dependson(YAS_Types);
const LocalMessage = class'YAS_LocalMessage';
const HeaderWidthRatio = 0.30f; const HeaderWidthRatio = 0.30f;
const PlayerListWidthRatio = 0.6f; const PlayerListWidthRatio = 0.6f;
const PlayerEntryHeightMod = 1.05f; const PlayerEntryHeightMod = 1.05f;
@ -13,13 +15,13 @@ const ListItemsDefault = 12;
const FontScalarModCompact = 1.0f; const FontScalarModCompact = 1.0f;
const FontScalarModDefault = 1.25f; const FontScalarModDefault = 1.25f;
const ShowDamage = true; const ShowDamage = true;
const IconRanked = Texture2D'DailyObjective_UI.KF2_Dailies_Icon_PerkLvl'; // where the hell is the right icon? const IconRanked = Texture2D'DailyObjective_UI.KF2_Dailies_Icon_PerkLvl'; // where the hell is the right icon?
const IconCustom = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I26'; //const IconCustom = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I26';
const IconUnranked = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I28'; //const IconUnranked = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I28';
const IconUnrankedAlt = Texture2D'UI_VoiceComms_TEX.UI_VoiceCommand_Icon_Negative'; const IconUnrankedAlt = Texture2D'UI_VoiceComms_TEX.UI_VoiceCommand_Icon_Negative';
const IconPassword = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I20'; const IconPassword = Texture2D'UI_Menus.ServerBrowserMenu_SWF_I28';
//const IconDosh = Texture2D'UI_HUD.InGameHUD_SWF_I13A'; //const IconDosh = Texture2D'UI_HUD.InGameHUD_SWF_I13A';
const IconPlayer = Texture2D'UI_HUD.InGameHUD_ZED_SWF_I1F5'; const IconPlayer = Texture2D'UI_HUD.InGameHUD_ZED_SWF_I1F5';
//const IconClock = Texture2D'UI_HUD.InGameHUD_SWF_I17D'; //const IconClock = Texture2D'UI_HUD.InGameHUD_SWF_I17D';
@ -50,8 +52,6 @@ var KFPlayerController OwnerPC;
var Color PingColor; var Color PingColor;
var float PingBars; var float PingBars;
var localized String Players, Spectators;
// Cache // Cache
var public Array<YAS_RepInfoPlayer> RepInfos; var public Array<YAS_RepInfoPlayer> RepInfos;
@ -68,45 +68,52 @@ var private float FontScalarMod;
function YAS_RepInfoPlayer FindRepInfo(KFPlayerReplicationInfo KFPRI) function YAS_RepInfoPlayer FindRepInfo(KFPlayerReplicationInfo KFPRI)
{ {
local YAS_RepInfoPlayer RepInfo; local YAS_RepInfoPlayer RepInfo;
foreach RepInfos(RepInfo) foreach RepInfos(RepInfo)
{ {
if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid) if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid)
{ {
return RepInfo; if (RepInfo.bPendingDelete || RepInfo.bDeleteMe)
{
RepInfos.RemoveItem(RepInfo);
break;
}
else return RepInfo;
} }
} }
foreach KFPRI.DynamicActors(class'YAS_RepInfoPlayer', RepInfo) foreach KFPRI.DynamicActors(class'YAS_RepInfoPlayer', RepInfo)
{ {
if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid) if (RepInfo.UID.Uid == KFPRI.UniqueId.Uid)
{ {
if (RepInfo.bPendingDelete || RepInfo.bDeleteMe) continue;
RepInfos.AddItem(RepInfo); RepInfos.AddItem(RepInfo);
return RepInfo; return RepInfo;
} }
} }
return None; return None;
} }
function Rank PlayerRank(YAS_RepInfoPlayer RepInfo, bool bAdmin) function Rank PlayerRank(YAS_RepInfoPlayer RepInfo, bool bAdmin)
{ {
local Rank Rank; local Rank Rank;
`Log_Trace(); `Log_Trace();
Rank = class'YAS_Types'.static.FromSystemRank(RankPlayer); Rank = class'YAS_Types'.static.FromSystemRank(RankPlayer);
if (RepInfo != None) if (RepInfo != None)
{ {
Rank = RepInfo.Rank; Rank = RepInfo.Rank;
} }
if (bAdmin && !Rank.OverrideAdmin) if (bAdmin && !Rank.OverrideAdmin)
{ {
Rank = class'YAS_Types'.static.FromSystemRank(RankAdmin); Rank = class'YAS_Types'.static.FromSystemRank(RankAdmin);
} }
return Rank; return Rank;
} }
@ -133,7 +140,7 @@ function float MinPerkBoxWidth(float FontScalar)
Canvas.TextSize(PerkName $ "A", XL, YL, FontScalar * FontScalarMod, FontScalar * FontScalarMod); Canvas.TextSize(PerkName $ "A", XL, YL, FontScalar * FontScalarMod, FontScalar * FontScalarMod);
if (XL > MaxWidth) MaxWidth = XL; if (XL > MaxWidth) MaxWidth = XL;
} }
return MaxWidth; return MaxWidth;
} }
@ -194,27 +201,27 @@ delegate bool InOrder(KFPlayerReplicationInfo P1, KFPlayerReplicationInfo P2)
function string WaveText() function string WaveText()
{ {
local int CurrentWaveNum; local int CurrentWaveNum;
CurrentWaveNum = KFGRI.WaveNum; CurrentWaveNum = KFGRI.WaveNum;
if (KFGRI.IsBossWave()) if (KFGRI.IsBossWave())
{ {
return class'KFGFxHUD_WaveInfo'.default.BossWaveString; return class'KFGFxHUD_WaveInfo'.default.BossWaveString;
} }
else if (KFGRI.IsFinalWave()) else if (KFGRI.IsFinalWave())
{ {
return class'KFGFxHUD_ScoreboardMapInfoContainer'.default.FinalString; return class'KFGFxHUD_ScoreboardMapInfoContainer'.default.FinalString;
} }
else else
{ {
if (KFGRI.default.bEndlessMode) if (KFGRI.default.bEndlessMode)
{ {
return "" $ CurrentWaveNum; return "" $ CurrentWaveNum;
} }
else else
{ {
return CurrentWaveNum $ " / " $ KFGRI.GetFinalWaveNum(); return CurrentWaveNum $ " / " $ KFGRI.GetFinalWaveNum();
} }
} }
} }
function KFGameReplicationInfo GetKFGRI() function KFGameReplicationInfo GetKFGRI()
@ -223,7 +230,7 @@ function KFGameReplicationInfo GetKFGRI()
{ {
KFGRI = KFGameReplicationInfo(GetPlayer().WorldInfo.GRI); KFGRI = KFGameReplicationInfo(GetPlayer().WorldInfo.GRI);
} }
return KFGRI; return KFGRI;
} }
@ -238,7 +245,7 @@ function DrawMenu()
local float BorderSize, EdgeSize, PlayerListSizeY; local float BorderSize, EdgeSize, PlayerListSizeY;
local Color ColorTMP; local Color ColorTMP;
local Array<String> MessageOfTheDayLines; local Array<String> MessageOfTheDayLines;
PC = GetPlayer(); PC = GetPlayer();
if (GetKFGRI() == None) if (GetKFGRI() == None)
{ {
@ -313,30 +320,30 @@ function DrawMenu()
Canvas.TextSize("ABC", XL, YL, FontScalar, FontScalar); Canvas.TextSize("ABC", XL, YL, FontScalar, FontScalar);
BorderSize = Owner.HUDOwner.ScaledBorderSize; BorderSize = Owner.HUDOwner.ScaledBorderSize;
EdgeSize = Owner.CurrentStyle.PickEdgeSize(); EdgeSize = Owner.CurrentStyle.PickEdgeSize();
// Server Info // Server Info
XPosCenter = Canvas.ClipX * 0.5; XPosCenter = Canvas.ClipX * 0.5;
Width = Canvas.ClipX * HeaderWidthRatio; // Full Box Width Width = Canvas.ClipX * HeaderWidthRatio; // Full Box Width
XPos = XPosCenter - Width * 0.5; XPos = XPosCenter - Width * 0.5;
YPos = YL; YPos = YL;
BoxW = Width; BoxW = Width;
BoxX = XPos; BoxX = XPos;
BoxH = YL + BorderSize; BoxH = YL + BorderSize;
// Top Rect (Server name) // Top Rect (Server name)
Canvas.SetDrawColorStruct(Settings.Style.ServerNameBoxColor); Canvas.SetDrawColorStruct(Settings.Style.ServerNameBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapeServerNameBox); Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapeServerNameBox);
Canvas.SetDrawColorStruct(Settings.Style.ServerNameTextColor); Canvas.SetDrawColorStruct(Settings.Style.ServerNameTextColor);
S = (DynamicServerName == "" ? KFGRI.ServerName : DynamicServerName); S = (DynamicServerName == "" ? KFGRI.ServerName : DynamicServerName);
DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, BoxH, FontScalar); DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, BoxH, FontScalar);
// icons // icons
ColorTMP = Settings.Style.ServerNameTextColor; ColorTMP = Settings.Style.ServerNameTextColor;
ColorTMP.A = 200; ColorTMP.A = 200;
Canvas.SetDrawColorStruct(ColorTMP); Canvas.SetDrawColorStruct(ColorTMP);
if (PasswordRequired) if (PasswordRequired)
{ {
Owner.CurrentStyle.DrawTexture( Owner.CurrentStyle.DrawTexture(
@ -346,7 +353,7 @@ function DrawMenu()
BoxH - BorderSize*4, BoxH - BorderSize*4,
BoxH - BorderSize*4); BoxH - BorderSize*4);
} }
if (UsesStats) if (UsesStats)
{ {
//if (Custom) //if (Custom)
@ -377,42 +384,42 @@ function DrawMenu()
// BoxH - BorderSize*4, // BoxH - BorderSize*4,
// 256, 256); // 256, 256);
//} //}
YPos += BoxH; YPos += BoxH;
// Mid Left Rect (Info) // Mid Left Rect (Info)
BoxW = Width * 0.7; BoxW = Width * 0.7;
BoxH = YL * 2 + BorderSize * 2; BoxH = YL * 2 + BorderSize * 2;
Canvas.SetDrawColorStruct(Settings.Style.GameInfoBoxColor); Canvas.SetDrawColorStruct(Settings.Style.GameInfoBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapeGameInfoBox); Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapeGameInfoBox);
Canvas.SetDrawColorStruct(Settings.Style.GameInfoTextColor); Canvas.SetDrawColorStruct(Settings.Style.GameInfoTextColor);
S = class'KFCommon_LocalizedStrings'.static.GetFriendlyMapName(PC.WorldInfo.GetMapName(true)); S = class'KFCommon_LocalizedStrings'.static.GetFriendlyMapName(PC.WorldInfo.GetMapName(true));
DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos, BoxH/2, FontScalar); DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos, BoxH/2, FontScalar);
S = KFGRI.GameClass.default.GameName $ " - " $ class'KFCommon_LocalizedStrings'.Static.GetDifficultyString(KFGRI.GameDifficulty); S = KFGRI.GameClass.default.GameName $ " - " $ class'KFCommon_LocalizedStrings'.Static.GetDifficultyString(KFGRI.GameDifficulty);
DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos + BoxH/2, BoxH/2, FontScalar); DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos + BoxH/2, BoxH/2, FontScalar);
// Mid Right Rect (Wave) // Mid Right Rect (Wave)
BoxX = BoxX + BoxW; BoxX = BoxX + BoxW;
BoxW = Width - BoxW; BoxW = Width - BoxW;
Canvas.SetDrawColorStruct(Settings.Style.WaveBoxColor); Canvas.SetDrawColorStruct(Settings.Style.WaveBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapeWaveInfoBox); Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapeWaveInfoBox);
Canvas.SetDrawColorStruct(Settings.Style.WaveTextColor); Canvas.SetDrawColorStruct(Settings.Style.WaveTextColor);
S = class'KFGFxHUD_ScoreboardMapInfoContainer'.default.WaveString; S = class'KFGFxHUD_ScoreboardMapInfoContainer'.default.WaveString;
DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, BoxH / 2, FontScalar); DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, BoxH / 2, FontScalar);
DrawTextShadowHVCenter(WaveText(), BoxX, YPos + BoxH / 2, BoxW, BoxH / 2, FontScalar); DrawTextShadowHVCenter(WaveText(), BoxX, YPos + BoxH / 2, BoxW, BoxH / 2, FontScalar);
YPos += BoxH; YPos += BoxH;
// Bottom Rect (Players count) // Bottom Rect (Players count)
BoxX = XPos; BoxX = XPos;
BoxW = Width; BoxW = Width;
BoxH = YL + BorderSize; BoxH = YL + BorderSize;
Canvas.SetDrawColorStruct(Settings.Style.PlayerCountBoxColor); Canvas.SetDrawColorStruct(Settings.Style.PlayerCountBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapePlayersCountBox); Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, EdgeSize, Settings.Style.ShapePlayersCountBox);
/* /*
Owner.CurrentStyle.DrawTexture(IconPlayer, Owner.CurrentStyle.DrawTexture(IconPlayer,
BoxX + EdgeSize + IconIndent, BoxX + EdgeSize + IconIndent,
@ -421,15 +428,17 @@ function DrawMenu()
BoxH - IconIndent*2, BoxH - IconIndent*2,
MakeColor(250,250,250,250)); MakeColor(250,250,250,250));
*/ */
Canvas.SetDrawColorStruct(Settings.Style.PlayerCountTextColor); Canvas.SetDrawColorStruct(Settings.Style.PlayerCountTextColor);
S = Players $ ":" @ NumPlayer @ "/" @ KFGRI.MaxHumanCount $ " " $ Spectators $ ": " $ NumSpec; ; S = LocalMessage.static.GetLocalizedString(YAS_Players) $ ":"
@ NumPlayer @ "/" @ KFGRI.MaxHumanCount $ " "
$ LocalMessage.static.GetLocalizedString(YAS_Spectators) $ ": " $ NumSpec; ;
Canvas.TextSize(S, XL, YL, FontScalar, FontScalar); Canvas.TextSize(S, XL, YL, FontScalar, FontScalar);
DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos, BoxH, FontScalar); DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos, BoxH, FontScalar);
S = Owner.CurrentStyle.GetTimeString(KFGRI.ElapsedTime); S = Owner.CurrentStyle.GetTimeString(KFGRI.ElapsedTime);
DrawTextShadowHVCenter(S, XPos + Width * 0.7, YPos, Width * 0.3, BoxH, FontScalar); DrawTextShadowHVCenter(S, XPos + Width * 0.7, YPos, Width * 0.3, BoxH, FontScalar);
YPos += BoxH; YPos += BoxH;
// Header // Header
@ -447,8 +456,8 @@ function DrawMenu()
Settings.Style.ShapeHeaderBox); Settings.Style.ShapeHeaderBox);
// Calc X offsets // Calc X offsets
MinBoxW = Width * 0.07; // minimum width for column MinBoxW = Width * 0.07; // minimum width for column
// Health // Health
HealthXPos = 0; HealthXPos = 0;
BoxW = 0; BoxW = 0;
@ -458,9 +467,9 @@ function DrawMenu()
{ {
HealthWBox = PlayersList.GetItemHeight(); HealthWBox = PlayersList.GetItemHeight();
} }
PlayerXPos = HealthXPos + HealthWBox + PlayersList.GetItemHeight() + EdgeSize; PlayerXPos = HealthXPos + HealthWBox + PlayersList.GetItemHeight() + EdgeSize;
Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.PingString$" ", XL, YL, FontScalar, FontScalar); Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.PingString$" ", XL, YL, FontScalar, FontScalar);
PingWBox = XL < MinBoxW ? MinBoxW : XL; PingWBox = XL < MinBoxW ? MinBoxW : XL;
if (NumPlayer <= PlayersList.ListItemsPerPage) if (NumPlayer <= PlayersList.ListItemsPerPage)
@ -468,28 +477,28 @@ function DrawMenu()
else else
ScrollBarWidth = BorderSize * 8; ScrollBarWidth = BorderSize * 8;
PingXPos = Width - PingWBox - ScrollBarWidth; PingXPos = Width - PingWBox - ScrollBarWidth;
Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.AssistsString$" ", XL, YL, FontScalar, FontScalar); Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.AssistsString$" ", XL, YL, FontScalar, FontScalar);
AssistWBox = XL < MinBoxW ? MinBoxW : XL; AssistWBox = XL < MinBoxW ? MinBoxW : XL;
AssistXPos = PingXPos - AssistWBox; AssistXPos = PingXPos - AssistWBox;
Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.KillsString$" ", XL, YL, FontScalar, FontScalar); Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.KillsString$" ", XL, YL, FontScalar, FontScalar);
KillsWBox = XL < MinBoxW ? MinBoxW : XL; KillsWBox = XL < MinBoxW ? MinBoxW : XL;
KillsXPos = AssistXPos - KillsWBox; KillsXPos = AssistXPos - KillsWBox;
Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.DoshString$" ", XL, YL, FontScalar, FontScalar); Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.DoshString$" ", XL, YL, FontScalar, FontScalar);
Canvas.TextSize("999999", DoshSize, YL, FontScalar, FontScalar); Canvas.TextSize("999999", DoshSize, YL, FontScalar, FontScalar);
DoshWBox = XL < DoshSize ? DoshSize : XL; DoshWBox = XL < DoshSize ? DoshSize : XL;
DoshXPos = KillsXPos - DoshWBox; DoshXPos = KillsXPos - DoshWBox;
BoxW = MinPerkBoxWidth(FontScalar); BoxW = MinPerkBoxWidth(FontScalar);
PerkWBox = BoxW < MinBoxW ? MinBoxW : BoxW; PerkWBox = BoxW < MinBoxW ? MinBoxW : BoxW;
PerkXPos = DoshXPos - PerkWBox; PerkXPos = DoshXPos - PerkWBox;
Canvas.TextSize("000", XL, YL, FontScalar, FontScalar); Canvas.TextSize("000", XL, YL, FontScalar, FontScalar);
LevelWBox = XL; LevelWBox = XL;
LevelXPos = PerkXPos - LevelWBox; LevelXPos = PerkXPos - LevelWBox;
// Header texts // Header texts
Canvas.SetDrawColorStruct(Settings.Style.ListHeaderTextColor); Canvas.SetDrawColorStruct(Settings.Style.ListHeaderTextColor);
DrawTextShadowHLeftVCenter(class'KFGFxHUD_ScoreboardWidget'.default.PlayerString, XPos + PlayerXPos, YPos, BoxH, FontScalar); DrawTextShadowHLeftVCenter(class'KFGFxHUD_ScoreboardWidget'.default.PlayerString, XPos + PlayerXPos, YPos, BoxH, FontScalar);
@ -505,7 +514,7 @@ function DrawMenu()
} }
DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.DoshString, XPos + DoshXPos, YPos, DoshWBox, BoxH, FontScalar); DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.DoshString, XPos + DoshXPos, YPos, DoshWBox, BoxH, FontScalar);
DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.PingString, XPos + PingXPos, YPos, PingWBox, BoxH, FontScalar); DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.PingString, XPos + PingXPos, YPos, PingWBox, BoxH, FontScalar);
ColorTMP = Settings.Style.ListHeaderTextColor; ColorTMP = Settings.Style.ListHeaderTextColor;
ColorTMP.A = 150; ColorTMP.A = 150;
Canvas.SetDrawColorStruct(ColorTMP); Canvas.SetDrawColorStruct(ColorTMP);
@ -517,17 +526,17 @@ function DrawMenu()
BoxH - BorderSize * 2, BoxH - BorderSize * 2,
256, 256,
256); 256);
PlayersList.XPosition = ((Canvas.ClipX - Width) * 0.5) / InputPos[2]; PlayersList.XPosition = ((Canvas.ClipX - Width) * 0.5) / InputPos[2];
PlayersList.YPosition = (YPos + YL + BorderSize * 4) / InputPos[3]; PlayersList.YPosition = (YPos + YL + BorderSize * 4) / InputPos[3];
PlayersList.YSize = (1.f - PlayersList.YPosition) - 0.15; PlayersList.YSize = (1.f - PlayersList.YPosition) - 0.15;
PlayersList.ChangeListSize(KFPRIArray.Length); PlayersList.ChangeListSize(KFPRIArray.Length);
PlayerListSizeY = PlayersList.GetItemHeight() * PlayerEntryHeightMod * (NumPlayer <= PlayersList.ListItemsPerPage ? NumPlayer : PlayersList.ListItemsPerPage); PlayerListSizeY = PlayersList.GetItemHeight() * PlayerEntryHeightMod * (NumPlayer <= PlayersList.ListItemsPerPage ? NumPlayer : PlayersList.ListItemsPerPage);
PlayerListSizeY -= PlayersList.GetItemHeight() * PlayerEntryHeightMod - PlayersList.GetItemHeight(); PlayerListSizeY -= PlayersList.GetItemHeight() * PlayerEntryHeightMod - PlayersList.GetItemHeight();
// Scroll bar (fake) // Scroll bar (fake)
// This is an imitation of a scroll bar // This is an imitation of a scroll bar
// just to let people know that they can scroll the mouse wheel. // just to let people know that they can scroll the mouse wheel.
@ -545,10 +554,10 @@ function DrawMenu()
EdgeSize, EdgeSize,
0); 0);
} }
// MessageOfTheDay // MessageOfTheDay
MessageOfTheDayLines = SplitString(MessageOfTheDay, "\n"); MessageOfTheDayLines = SplitString(MessageOfTheDay, "\n");
YPos += BoxH + BorderSize * 6 + PlayerListSizeY; YPos += BoxH + BorderSize * 6 + PlayerListSizeY;
Width = Canvas.ClipX * PlayerListWidthRatio; Width = Canvas.ClipX * PlayerListWidthRatio;
BoxH = YL + BorderSize; BoxH = YL + BorderSize;
@ -560,7 +569,7 @@ function DrawMenu()
BoxH * (MessageOfTheDayLines.Length > 0 ? MessageOfTheDayLines.Length : 1), BoxH * (MessageOfTheDayLines.Length > 0 ? MessageOfTheDayLines.Length : 1),
EdgeSize, EdgeSize,
152); 152);
if (MessageOfTheDay != "") if (MessageOfTheDay != "")
{ {
Canvas.SetDrawColorStruct(Settings.Style.ListHeaderTextColor); Canvas.SetDrawColorStruct(Settings.Style.ListHeaderTextColor);
@ -584,23 +593,23 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
local bool bIsZED; local bool bIsZED;
local int Ping; local int Ping;
local Rank Rank; local Rank Rank;
local float BorderSize, EdgeSize; local float BorderSize, EdgeSize;
local int Shape, ShapeHealth; local int Shape, ShapeHealth;
local Color HealthBoxColor; local Color HealthBoxColor;
BorderSize = Owner.HUDOwner.ScaledBorderSize; BorderSize = Owner.HUDOwner.ScaledBorderSize;
EdgeSize = Owner.CurrentStyle.PickEdgeSize(); EdgeSize = Owner.CurrentStyle.PickEdgeSize();
YOffset *= PlayerEntryHeightMod; YOffset *= PlayerEntryHeightMod;
KFPRI = KFPRIArray[Index]; KFPRI = KFPRIArray[Index];
RepInfo = FindRepInfo(KFPRI); RepInfo = FindRepInfo(KFPRI);
Rank = PlayerRank(RepInfo, KFPRI.bAdmin); Rank = PlayerRank(RepInfo, KFPRI.bAdmin);
if (KFGRI.bVersusGame) if (KFGRI.bVersusGame)
{ {
bIsZED = KFTeamInfo_Zeds(KFPRI.Team) != None; bIsZED = KFTeamInfo_Zeds(KFPRI.Team) != None;
@ -612,10 +621,10 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
FontScalar *= FontScalarMod; FontScalar *= FontScalarMod;
Canvas.TextSize("ABC", XL, YL, FontScalar, FontScalar); Canvas.TextSize("ABC", XL, YL, FontScalar, FontScalar);
ShapeHealth = Settings.Style.ShapeStateHealthBoxMidPlayer; ShapeHealth = Settings.Style.ShapeStateHealthBoxMidPlayer;
if (!KFGRI.bMatchHasBegun) if (!(KFGRI.bMatchHasBegun || KFGRI.bTraderIsOpen || KFGRI.bWaveIsActive))
{ {
HealthBoxColor = Settings.Style.StateBoxColorLobby; HealthBoxColor = Settings.Style.StateBoxColorLobby;
} }
@ -627,7 +636,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
{ {
HealthBoxColor = HealthColorByPercent(ByteToFloat(KFPRI.PlayerHealthPercent)); HealthBoxColor = HealthColorByPercent(ByteToFloat(KFPRI.PlayerHealthPercent));
} }
// Health box // Health box
C.SetDrawColorStruct(HealthBoxColor); C.SetDrawColorStruct(HealthBoxColor);
Owner.CurrentStyle.DrawRectBox( Owner.CurrentStyle.DrawRectBox(
@ -637,8 +646,8 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
Height, Height,
EdgeSize, EdgeSize,
ShapeHealth); ShapeHealth);
if (!KFGRI.bMatchHasBegun) if (!(KFGRI.bMatchHasBegun || KFGRI.bTraderIsOpen || KFGRI.bWaveIsActive))
{ {
ColorTMP = Settings.Style.ListHeaderTextColor; ColorTMP = Settings.Style.ListHeaderTextColor;
ColorTMP.A = 200; ColorTMP.A = 200;
@ -662,16 +671,14 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
HealthWBox - BorderSize * 4, HealthWBox - BorderSize * 4,
Height - BorderSize * 4); Height - BorderSize * 4);
} }
else
C.SetDrawColorStruct(Settings.Style.StateTextColorHealthHigh);
if (KFPRI.PlayerHealth > 0)
{ {
C.SetDrawColorStruct(Settings.Style.StateTextColorHealthHigh);
DrawTextShadowHVCenter(String(KFPRI.PlayerHealth), HealthXPos, YOffset, HealthWBox, Height, FontScalar); DrawTextShadowHVCenter(String(KFPRI.PlayerHealth), HealthXPos, YOffset, HealthWBox, Height, FontScalar);
} }
XPos += HealthWBox; XPos += HealthWBox;
// PlayerBox // PlayerBox
if (PlayerIndex == Index) if (PlayerIndex == Index)
C.SetDrawColorStruct(Settings.Style.PlayerOwnerBoxColor); C.SetDrawColorStruct(Settings.Style.PlayerOwnerBoxColor);
@ -682,12 +689,12 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
BoxWidth = DoshXPos - HealthWBox - BorderSize * 2; BoxWidth = DoshXPos - HealthWBox - BorderSize * 2;
Owner.CurrentStyle.DrawRectBox(XPos, YOffset, BoxWidth, Height, EdgeSize, Shape); Owner.CurrentStyle.DrawRectBox(XPos, YOffset, BoxWidth, Height, EdgeSize, Shape);
XPos += BoxWidth; XPos += BoxWidth;
// Right stats box // Right stats box
Shape = Settings.Style.ShapeStatsBoxMidPlayer; Shape = Settings.Style.ShapeStatsBoxMidPlayer;
BoxWidth = Width - XPos; BoxWidth = Width - XPos;
C.SetDrawColorStruct(Settings.Style.StatsBoxColor); C.SetDrawColorStruct(Settings.Style.StatsBoxColor);
Owner.CurrentStyle.DrawRectBox( Owner.CurrentStyle.DrawRectBox(
@ -738,15 +745,15 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
C.SetPos(PerkIconPosX, PerkIconPosY); C.SetPos(PerkIconPosX, PerkIconPosY);
C.DrawTile(KFPRI.CurrentPerkClass.default.PerkIcon, PerkIconSize, PerkIconSize, 0, 0, 256, 256); C.DrawTile(KFPRI.CurrentPerkClass.default.PerkIcon, PerkIconSize, PerkIconSize, 0, 0, 256, 256);
} }
if (Level < Settings.Level.Low[KFGRI.GameDifficulty]) if (Level < Settings.Level.Low[KFGRI.GameDifficulty])
C.SetDrawColorStruct(Settings.Style.LevelTextColorLow); C.SetDrawColorStruct(Settings.Style.LevelTextColorLow);
else if (Level < Settings.Level.High[KFGRI.GameDifficulty]) else if (Level < Settings.Level.High[KFGRI.GameDifficulty])
C.SetDrawColorStruct(Settings.Style.LevelTextColorMid); C.SetDrawColorStruct(Settings.Style.LevelTextColorMid);
else else
C.SetDrawColorStruct(Settings.Style.LevelTextColorHigh); C.SetDrawColorStruct(Settings.Style.LevelTextColorHigh);
S = String(Level); S = String(Level);
DrawTextShadowHLeftVCenter(S, LevelXPos, YOffset, Height, FontScalar); DrawTextShadowHLeftVCenter(S, LevelXPos, YOffset, Height, FontScalar);
@ -762,7 +769,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
RealPlayerWBox = PerkXPos - PlayerXPos; RealPlayerWBox = PerkXPos - PlayerXPos;
} }
} }
// Rank // Rank
if (Rank.RankName != "") if (Rank.RankName != "")
{ {
@ -775,7 +782,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
{ {
CheckAvatar(KFPRI, OwnerPC); CheckAvatar(KFPRI, OwnerPC);
} }
if (KFPRI.Avatar != None) if (KFPRI.Avatar != None)
{ {
C.SetDrawColor(255, 255, 255, 255); C.SetDrawColor(255, 255, 255, 255);
@ -809,7 +816,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
{ {
DrawTextShadowHVCenter(GetNiceSize(KFPRI.Assists), AssistXPos, YOffset, AssistWBox, Height, FontScalar); DrawTextShadowHVCenter(GetNiceSize(KFPRI.Assists), AssistXPos, YOffset, AssistWBox, Height, FontScalar);
} }
// Dosh // Dosh
if (bIsZED) if (bIsZED)
{ {
@ -822,7 +829,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
StrValue = GetNiceSize(int(KFPRI.Score)); StrValue = GetNiceSize(int(KFPRI.Score));
} }
DrawTextShadowHVCenter(StrValue, DoshXPos, YOffset, DoshWBox, Height, FontScalar); DrawTextShadowHVCenter(StrValue, DoshXPos, YOffset, DoshWBox, Height, FontScalar);
// Ping // Ping
if (KFPRI.bBot) if (KFPRI.bBot)
{ {
@ -835,7 +842,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
C.SetDrawColorStruct(PingColorByPing(Ping)); C.SetDrawColorStruct(PingColorByPing(Ping));
S = String(Ping); S = String(Ping);
} }
C.TextSize(S, XL, YL, FontScalar, FontScalar); C.TextSize(S, XL, YL, FontScalar, FontScalar);
DrawTextShadowHVCenter(S, PingXPos, YOffset, PingWBox/2, Height, FontScalar); DrawTextShadowHVCenter(S, PingXPos, YOffset, PingWBox/2, Height, FontScalar);
C.SetDrawColor(250, 250, 250, 255); C.SetDrawColor(250, 250, 250, 255);
@ -900,7 +907,7 @@ function ScrollMouseWheel(bool bUp)
function Color HealthColorByPercent(float FloatPercent) function Color HealthColorByPercent(float FloatPercent)
{ {
local Color CRED, CYLW, CGRN, RV; local Color CRED, CYLW, CGRN, RV;
CRED = MakeColor(200, 0, 0, 150); CRED = MakeColor(200, 0, 0, 150);
CYLW = MakeColor(200, 200, 0, 150); CYLW = MakeColor(200, 200, 0, 150);
CGRN = MakeColor(0, 200, 0, 150); CGRN = MakeColor(0, 200, 0, 150);
@ -921,14 +928,14 @@ function Color HealthColorByPercent(float FloatPercent)
{ {
RV = CRED; RV = CRED;
} }
return RV; return RV;
} }
function Color PingColorByPing(int Ping) function Color PingColorByPing(int Ping)
{ {
local Color CRED, CYLW, CGRN, RV; local Color CRED, CYLW, CGRN, RV;
CRED = MakeColor(200, 0, 0, 250); CRED = MakeColor(200, 0, 0, 250);
CYLW = MakeColor(200, 200, 0, 250); CYLW = MakeColor(200, 200, 0, 250);
CGRN = MakeColor(0, 200, 0, 250); CGRN = MakeColor(0, 200, 0, 250);
@ -949,7 +956,7 @@ function Color PingColorByPing(int Ping)
{ {
RV = CRED; RV = CRED;
} }
return RV; return RV;
} }
@ -959,19 +966,19 @@ function Color PickDynamicColor(Color LowerColor, Color UpperColor, float FloatP
// Percent: 0.0f <------- FloatPercent -------> 1.0f // Percent: 0.0f <------- FloatPercent -------> 1.0f
return MakeColor(( return MakeColor((
LowerColor.R < UpperColor.R ? LowerColor.R < UpperColor.R ?
LowerColor.R + ((UpperColor.R - LowerColor.R) * FloatPercent) : LowerColor.R + ((UpperColor.R - LowerColor.R) * FloatPercent) :
LowerColor.R - ((LowerColor.R - UpperColor.R) * FloatPercent)), LowerColor.R - ((LowerColor.R - UpperColor.R) * FloatPercent)),
( (
LowerColor.G < UpperColor.G ? LowerColor.G < UpperColor.G ?
LowerColor.G + ((UpperColor.G - LowerColor.G) * FloatPercent) : LowerColor.G + ((UpperColor.G - LowerColor.G) * FloatPercent) :
LowerColor.G - ((LowerColor.G - UpperColor.G) * FloatPercent)), LowerColor.G - ((LowerColor.G - UpperColor.G) * FloatPercent)),
( (
LowerColor.B < UpperColor.B ? LowerColor.B < UpperColor.B ?
LowerColor.B + ((UpperColor.B - LowerColor.B) * FloatPercent) : LowerColor.B + ((UpperColor.B - LowerColor.B) * FloatPercent) :
LowerColor.B - ((LowerColor.B - UpperColor.B) * FloatPercent)), LowerColor.B - ((LowerColor.B - UpperColor.B) * FloatPercent)),
( (
LowerColor.A < UpperColor.A ? LowerColor.A < UpperColor.A ?
LowerColor.A + ((UpperColor.A - LowerColor.A) * FloatPercent) : LowerColor.A + ((UpperColor.A - LowerColor.A) * FloatPercent) :
LowerColor.A - ((LowerColor.A - UpperColor.A) * FloatPercent))); LowerColor.A - ((LowerColor.A - UpperColor.A) * FloatPercent)));
} }
@ -991,7 +998,7 @@ function DrawTextShadowHLeftVCenter(string Str, float XPos, float YPos, float Bo
local float TextHeight; local float TextHeight;
Canvas.TextSize(Str, TextWidth, TextHeight, FontScalar, FontScalar); Canvas.TextSize(Str, TextWidth, TextHeight, FontScalar, FontScalar);
Owner.CurrentStyle.DrawTextShadow(Str, XPos, YPos + (BoxHeight - TextHeight)/2, 1, FontScalar); Owner.CurrentStyle.DrawTextShadow(Str, XPos, YPos + (BoxHeight - TextHeight)/2, 1, FontScalar);
} }
@ -1001,7 +1008,7 @@ function DrawTextShadowHRightVCenter(string Str, float XPos, float YPos, float B
local float TextHeight; local float TextHeight;
Canvas.TextSize(Str, TextWidth, TextHeight, FontScalar, FontScalar); Canvas.TextSize(Str, TextWidth, TextHeight, FontScalar, FontScalar);
Owner.CurrentStyle.DrawTextShadow(Str, XPos + BoxWidth - TextWidth, YPos + (BoxHeight - TextHeight)/2, 1, FontScalar); Owner.CurrentStyle.DrawTextShadow(Str, XPos + BoxWidth - TextWidth, YPos + (BoxHeight - TextHeight)/2, 1, FontScalar);
} }
@ -1009,7 +1016,7 @@ function DrawRankedIcon(float X, float Y, float W, float H)
{ {
local int Position; local int Position;
local float XPos, YPos, Size, Block; local float XPos, YPos, Size, Block;
Size = Min(W, H); Size = Min(W, H);
Block = Size * 0.25f; Block = Size * 0.25f;
@ -1017,27 +1024,27 @@ function DrawRankedIcon(float X, float Y, float W, float H)
{ {
XPos = X + (W > Size ? (W - Size) * 0.5f : 0.f); XPos = X + (W > Size ? (W - Size) * 0.5f : 0.f);
YPos = Y + Position * Size * 0.5f; YPos = Y + Position * Size * 0.5f;
// 1 // 1
Canvas.SetPos(XPos, YPos + Block); Canvas.SetPos(XPos, YPos + Block);
Owner.CurrentStyle.DrawCornerTex(Block, 0); Owner.CurrentStyle.DrawCornerTex(Block, 0);
// 2 // 2
Canvas.SetPos(XPos + Block, YPos + Block); Canvas.SetPos(XPos + Block, YPos + Block);
Owner.CurrentStyle.DrawCornerTex(Block, 3); Owner.CurrentStyle.DrawCornerTex(Block, 3);
// 3 // 3
Canvas.SetPos(XPos + Block, YPos); Canvas.SetPos(XPos + Block, YPos);
Owner.CurrentStyle.DrawCornerTex(Block, 0); Owner.CurrentStyle.DrawCornerTex(Block, 0);
// 4 // 4
Canvas.SetPos(XPos + Block * 2, YPos); Canvas.SetPos(XPos + Block * 2, YPos);
Owner.CurrentStyle.DrawCornerTex(Block, 1); Owner.CurrentStyle.DrawCornerTex(Block, 1);
// 5 // 5
Canvas.SetPos(XPos + Block * 2, YPos + Block); Canvas.SetPos(XPos + Block * 2, YPos + Block);
Owner.CurrentStyle.DrawCornerTex(Block, 2); Owner.CurrentStyle.DrawCornerTex(Block, 2);
// 6 // 6
Canvas.SetPos(XPos + Block * 3, YPos + Block); Canvas.SetPos(XPos + Block * 3, YPos + Block);
Owner.CurrentStyle.DrawCornerTex(Block, 1); Owner.CurrentStyle.DrawCornerTex(Block, 1);

View File

@ -1,10 +1,10 @@
class YAS_Types extends Object; class YAS_Types extends Object;
struct YAS_SettingsHealth struct YAS_SettingsHealth
{ {
var int Low; var int Low;
var int High; var int High;
Structdefaultproperties Structdefaultproperties
{ {
Low = 40 Low = 40
@ -16,7 +16,7 @@ struct YAS_SettingsPing
{ {
var int Low; var int Low;
var int High; var int High;
Structdefaultproperties Structdefaultproperties
{ {
Low = 60 Low = 60
@ -28,7 +28,7 @@ struct YAS_SettingsLevel
{ {
var int Low [4]; var int Low [4];
var int High[4]; var int High[4];
Structdefaultproperties Structdefaultproperties
{ {
Low [0] = 0 Low [0] = 0
@ -165,7 +165,7 @@ struct YAS_Style
var bool KillsTextSmoothColorChange; var bool KillsTextSmoothColorChange;
var bool AssistsTextSmoothColorChange; var bool AssistsTextSmoothColorChange;
var bool PingTextSmoothColorChange; var bool PingTextSmoothColorChange;
Structdefaultproperties Structdefaultproperties
{ {
// Box shapes // Box shapes
@ -183,27 +183,27 @@ struct YAS_Style
ShapeStatsBoxTopPlayer = 0 ShapeStatsBoxTopPlayer = 0
ShapeStatsBoxMidPlayer = 0 ShapeStatsBoxMidPlayer = 0
ShapeStatsBoxBottomPlayer = 0 ShapeStatsBoxBottomPlayer = 0
// Server box // Server box
ServerNameBoxColor = (R=75, G=0, B=0, A=200) ServerNameBoxColor = (R=75, G=0, B=0, A=200)
ServerNameTextColor = (R=250, G=250, B=250, A=255) ServerNameTextColor = (R=250, G=250, B=250, A=255)
// Game info box // Game info box
GameInfoBoxColor = (R=30, G=30, B=30, A=200) GameInfoBoxColor = (R=30, G=30, B=30, A=200)
GameInfoTextColor = (R=250, G=250, B=250, A=255) GameInfoTextColor = (R=250, G=250, B=250, A=255)
// Wave info box // Wave info box
WaveBoxColor = (R=10, G=10, B=10, A=200) WaveBoxColor = (R=10, G=10, B=10, A=200)
WaveTextColor = (R=250, G=250, B=250, A=255) WaveTextColor = (R=250, G=250, B=250, A=255)
// Player count box // Player count box
PlayerCountBoxColor = (R=75, G=0, B=0, A=200) PlayerCountBoxColor = (R=75, G=0, B=0, A=200)
PlayerCountTextColor = (R=250, G=250, B=250, A=255) PlayerCountTextColor = (R=250, G=250, B=250, A=255)
// Header box // Header box
ListHeaderBoxColor = (R=10, G=10, B=10, A=200) ListHeaderBoxColor = (R=10, G=10, B=10, A=200)
ListHeaderTextColor = (R=250, G=250, B=250, A=255) ListHeaderTextColor = (R=250, G=250, B=250, A=255)
// State box // State box
StateBoxColorLobby = (R=150, G=150, B=150, A=150) StateBoxColorLobby = (R=150, G=150, B=150, A=150)
StateBoxColorReady = (R=150, G=150, B=150, A=150) StateBoxColorReady = (R=150, G=150, B=150, A=150)
@ -214,15 +214,15 @@ struct YAS_Style
StateBoxColorHealthLow = (R=200, G=50, B=50, A=150) StateBoxColorHealthLow = (R=200, G=50, B=50, A=150)
StateBoxColorHealthMid = (R=200, G=200, B=0, A=150) StateBoxColorHealthMid = (R=200, G=200, B=0, A=150)
StateBoxColorHealthHigh = (R=0, G=200, B=0, A=150) StateBoxColorHealthHigh = (R=0, G=200, B=0, A=150)
// Player box // Player box
PlayerOwnerBoxColor = (R=100, G=10, B=10, A=150) PlayerOwnerBoxColor = (R=100, G=10, B=10, A=150)
PlayerBoxColor = (R=30, G=30, B=30, A=150) PlayerBoxColor = (R=30, G=30, B=30, A=150)
// Stats box // Stats box
StatsOwnerBoxColor = (R=10, G=10, B=10, A=150) StatsOwnerBoxColor = (R=10, G=10, B=10, A=150)
StatsBoxColor = (R=10, G=10, B=10, A=150) StatsBoxColor = (R=10, G=10, B=10, A=150)
// State text // State text
StateTextColorLobby = (R=150, G=150, B=150, A=150) StateTextColorLobby = (R=150, G=150, B=150, A=150)
StateTextColorReady = (R=150, G=150, B=150, A=150) StateTextColorReady = (R=150, G=150, B=150, A=150)
@ -233,18 +233,18 @@ struct YAS_Style
StateTextColorHealthLow = (R=250, G=250, B=250, A=255) StateTextColorHealthLow = (R=250, G=250, B=250, A=255)
StateTextColorHealthMid = (R=250, G=250, B=250, A=255) StateTextColorHealthMid = (R=250, G=250, B=250, A=255)
StateTextColorHealthHigh = (R=250, G=250, B=250, A=255) StateTextColorHealthHigh = (R=250, G=250, B=250, A=255)
// Rank text // Rank text
RankTextColor = (R=250, G=250, B=250, A=255) RankTextColor = (R=250, G=250, B=250, A=255)
// Player text // Player text
PlayerNameTextColor = (R=250, G=250, B=250, A=255) PlayerNameTextColor = (R=250, G=250, B=250, A=255)
// Level text // Level text
LevelTextColorLow = (R=250, G=100, B=100, A=255) LevelTextColorLow = (R=250, G=100, B=100, A=255)
LevelTextColorMid = (R=250, G=250, B=0, A=255) LevelTextColorMid = (R=250, G=250, B=0, A=255)
LevelTextColorHigh = (R=0, G=250, B=0, A=255) LevelTextColorHigh = (R=0, G=250, B=0, A=255)
// Perk text // Perk text
ZedTextColor = (R=255, G=0, B=0, A=255) ZedTextColor = (R=255, G=0, B=0, A=255)
PerkNoneTextColor = (R=250, G=250, B=250, A=255) PerkNoneTextColor = (R=250, G=250, B=250, A=255)
@ -258,28 +258,28 @@ struct YAS_Style
PerkSharpshooterTextColor = (R=250, G=250, B=250, A=255) PerkSharpshooterTextColor = (R=250, G=250, B=250, A=255)
PerkSwatTextColor = (R=250, G=250, B=250, A=255) PerkSwatTextColor = (R=250, G=250, B=250, A=255)
PerkSurvivalistTextColor = (R=250, G=250, B=250, A=255) PerkSurvivalistTextColor = (R=250, G=250, B=250, A=255)
// Dosh text // Dosh text
DoshTextColorLow = (R=250, G=250, B=100, A=255) DoshTextColorLow = (R=250, G=250, B=100, A=255)
DoshTextColorMid = (R=250, G=250, B=100, A=255) DoshTextColorMid = (R=250, G=250, B=100, A=255)
DoshTextColorHigh = (R=250, G=250, B=100, A=255) DoshTextColorHigh = (R=250, G=250, B=100, A=255)
// Kills text // Kills text
KillsTextColorLow = (R=250, G=250, B=250, A=255) KillsTextColorLow = (R=250, G=250, B=250, A=255)
KillsTextColorMid = (R=250, G=250, B=250, A=255) KillsTextColorMid = (R=250, G=250, B=250, A=255)
KillsTextColorHigh = (R=250, G=250, B=250, A=255) KillsTextColorHigh = (R=250, G=250, B=250, A=255)
// Assists text // Assists text
AssistsTextColorLow = (R=250, G=250, B=250, A=255) AssistsTextColorLow = (R=250, G=250, B=250, A=255)
AssistsTextColorMid = (R=250, G=250, B=250, A=255) AssistsTextColorMid = (R=250, G=250, B=250, A=255)
AssistsTextColorHigh = (R=250, G=250, B=250, A=255) AssistsTextColorHigh = (R=250, G=250, B=250, A=255)
// Ping text // Ping text
PingTextColorNone = (R=250, G=250, B=250, A=255) PingTextColorNone = (R=250, G=250, B=250, A=255)
PingTextColorLow = (R=0, G=250, B=0, A=255) PingTextColorLow = (R=0, G=250, B=0, A=255)
PingTextColorMid = (R=250, G=250, B=0, A=255) PingTextColorMid = (R=250, G=250, B=0, A=255)
PingTextColorHigh = (R=250, G=0, B=0, A=255) PingTextColorHigh = (R=250, G=0, B=0, A=255)
// Other settings // Other settings
ShowPingBars = true ShowPingBars = true
} }
@ -290,7 +290,7 @@ struct SystemRank
var String RankName; var String RankName;
var Color RankColor; var Color RankColor;
var Color PlayerColor; var Color PlayerColor;
structdefaultproperties structdefaultproperties
{ {
RankName = "" RankName = ""
@ -306,7 +306,7 @@ struct Rank
var Color RankColor; var Color RankColor;
var Color PlayerColor; var Color PlayerColor;
var bool OverrideAdmin; var bool OverrideAdmin;
structdefaultproperties structdefaultproperties
{ {
RankID = 0 RankID = 0
@ -341,17 +341,17 @@ struct YAS_Settings
public static function Rank FromSystemRank(SystemRank SysRank) public static function Rank FromSystemRank(SystemRank SysRank)
{ {
local Rank RV; local Rank RV;
RV.RankID = 0; RV.RankID = 0;
RV.RankName = SysRank.RankName; RV.RankName = SysRank.RankName;
RV.RankColor = SysRank.RankColor; RV.RankColor = SysRank.RankColor;
RV.PlayerColor = SysRank.PlayerColor; RV.PlayerColor = SysRank.PlayerColor;
RV.OverrideAdmin = false; RV.OverrideAdmin = false;
return RV; return RV;
} }
defaultproperties defaultproperties
{ {
} }

View File

@ -1,20 +1,20 @@
class _Logger extends Object class _Logger extends Object
abstract; abstract;
enum E_LogLevel enum E_LogLevel
{ {
LL_WrongLevel, LL_WrongLevel,
LL_None, LL_None,
LL_Fatal, LL_Fatal,
LL_Error, LL_Error,
LL_Warning, LL_Warning,
LL_Info, LL_Info,
LL_Debug, LL_Debug,
LL_Trace, LL_Trace,
LL_All LL_All
}; };
defaultproperties defaultproperties
{ {
} }

View File

@ -1,50 +1,50 @@
// Constants // Constants
`define NO_CONFIG 0 `define NO_CONFIG 0
// Scoreboard // Scoreboard
`define BOX_INNERBORDER 0 `define BOX_INNERBORDER 0
`define BOX_INNERBORDER_TRANSPARENT 1 `define BOX_INNERBORDER_TRANSPARENT 1
`define BOX_MEDIUM 2 `define BOX_MEDIUM 2
`define BOX_MEDIUM_SLIGHTTRANSPARENT 3 `define BOX_MEDIUM_SLIGHTTRANSPARENT 3
`define BOX_MEDIUM_TRANSPARENT 4 `define BOX_MEDIUM_TRANSPARENT 4
`define BOX_LARGE 5 `define BOX_LARGE 5
`define BOX_LARGE_SLIGHTTRANSPARENT 6 `define BOX_LARGE_SLIGHTTRANSPARENT 6
`define BOX_LARGE_TRANSPARENT 7 `define BOX_LARGE_TRANSPARENT 7
`define BOX_SMALL 8 `define BOX_SMALL 8
`define BOX_SMALL_SLIGHTTRANSPARENT 9 `define BOX_SMALL_SLIGHTTRANSPARENT 9
`define BOX_SMALL_TRANSPARENT 10 `define BOX_SMALL_TRANSPARENT 10
`define BOX_CORNER_8 11 `define BOX_CORNER_8 11
`define BOX_CORNER_16 12 `define BOX_CORNER_16 12
`define BOX_CORNER_32 13 `define BOX_CORNER_32 13
`define BOX_CORNER_64 14 `define BOX_CORNER_64 14
`define BOX_CORNER_512 15 `define BOX_CORNER_512 15
`define ITEMBOX_NORMAL 0 `define ITEMBOX_NORMAL 0
`define ITEMBOX_DISABLED 1 `define ITEMBOX_DISABLED 1
`define ITEMBOX_HIGHLIGHTED 2 `define ITEMBOX_HIGHLIGHTED 2
`define CHECKMARK_NORMAL 0 `define CHECKMARK_NORMAL 0
`define CHECKMARK_DISABLED 1 `define CHECKMARK_DISABLED 1
`define CHECKMARK_HIGHLIGHTED 2 `define CHECKMARK_HIGHLIGHTED 2
`define ARROW_DOWN 0 `define ARROW_DOWN 0
`define ARROW_LEFT 1 `define ARROW_LEFT 1
`define ARROW_RIGHT 2 `define ARROW_RIGHT 2
`define ARROW_UP 3 `define ARROW_UP 3
`define BUTTON_NORMAL 0 `define BUTTON_NORMAL 0
`define BUTTON_DISABLED 1 `define BUTTON_DISABLED 1
`define BUTTON_HIGHLIGHTED 2 `define BUTTON_HIGHLIGHTED 2
`define BUTTON_PRESSED 3 `define BUTTON_PRESSED 3
`define TAB_TOP 0 `define TAB_TOP 0
`define TAB_BOTTOM 1 `define TAB_BOTTOM 1
`define PEN_WHITE 0 `define PEN_WHITE 0
`define PEN_BLACK 1 `define PEN_BLACK 1
`define PEN_GRAY 2 `define PEN_GRAY 2
`define CURSOR_DEFAULT 0 `define CURSOR_DEFAULT 0
`define CURSOR_SELECTION 1 `define CURSOR_SELECTION 1
`define CURSOR_RESIZEVERT 2 `define CURSOR_RESIZEVERT 2
`define CURSOR_RESIZEHORZ 3 `define CURSOR_RESIZEHORZ 3

View File

@ -1,3 +1,3 @@
// Imports // Imports
`include(Logger.uci) `include(Logger.uci)
`include(Constants.uci) `include(Constants.uci)

View File

@ -1,15 +1,15 @@
// Logger // Logger
`define Log_Tag 'YAS' `define Log_Tag 'YAS'
`define LocationStatic "`{ClassName}::" $ GetFuncName() `define LocationStatic "`{ClassName}::" $ GetFuncName()
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag) `define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
`define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag) `define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag) `define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag)
`define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag) `define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag) `define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag)
`define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag) `define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag)
`define Log_Trace(msg) `log("TRACE:" @ `Location `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag) `define Log_Trace(msg) `log("TRACE:" @ `Location `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
`define Log_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag) `define Log_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)

View File

@ -7,7 +7,7 @@ StripSource="True"
# Mutators to be compiled # Mutators to be compiled
# Specify them with a space as a separator, # Specify them with a space as a separator,
# Mutators will be compiled in the specified order # Mutators will be compiled in the specified order
PackageBuildOrder="YAS" PackageBuildOrder="YAS"
@ -16,7 +16,7 @@ PackageBuildOrder="YAS"
# Packages you want to brew using @peelz's patched KFEditor. # Packages you want to brew using @peelz's patched KFEditor.
# Useful for cases where regular brew doesn't put *.upk inside the package. # Useful for cases where regular brew doesn't put *.upk inside the package.
# Specify them with a space as a separator, # Specify them with a space as a separator,
# The order doesn't matter # The order doesn't matter
PackagePeelzBrew="" PackagePeelzBrew=""
@ -24,7 +24,7 @@ PackagePeelzBrew=""
# Mutators that will be uploaded to the workshop # Mutators that will be uploaded to the workshop
# Specify them with a space as a separator, # Specify them with a space as a separator,
# The order doesn't matter # The order doesn't matter
PackageUpload="YAS" PackageUpload="YAS"
@ -39,7 +39,7 @@ Map="KF-Nuked"
# Endless: KFGameContent.KFGameInfo_Endless # Endless: KFGameContent.KFGameInfo_Endless
# Objective: KFGameContent.KFGameInfo_Objective # Objective: KFGameContent.KFGameInfo_Objective
# Versus: KFGameContent.KFGameInfo_VersusSurvival # Versus: KFGameContent.KFGameInfo_VersusSurvival
Game="KFGameContent.KFGameInfo_VersusSurvival" Game="KFGameContent.KFGameInfo_Survival"
# Difficulty: # Difficulty:
# Normal: 0 # Normal: 0
@ -55,7 +55,7 @@ Difficulty="0"
GameLength="0" GameLength="0"
# Mutators # Mutators
Mutators="YAS.YASMut,FriendlyHUD.FriendlyHUDMutator" Mutators="YAS.YASMut"
# Additional parameters # Additional parameters
Args="" Args=""

2
tools

@ -1 +1 @@
Subproject commit d830a5ea169e230fa40d63319b838fde1e25f6c1 Subproject commit fb458ac61f7e6c6426b8dff366dd5e7499e0d95f