Skip to content

Commit

Permalink
tgui
Browse files Browse the repository at this point in the history
tgui update
  • Loading branch information
MosleyTheMalO committed Mar 13, 2024
1 parent 70fab82 commit 29b862c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tgui/packages/tgui-dev-server/dreamseeker.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export class DreamSeeker {
.map(key => encodeURIComponent(key)
+ '=' + encodeURIComponent(params[key]))
.join('&');
logger.log(
`topic call at ${this.client.defaults.baseURL + '/dummy?' + query}`
);
return this.client.get('/dummy?' + query);
}
}
Expand Down
5 changes: 3 additions & 2 deletions tgui/packages/tgui-dev-server/reloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ export const findCacheRoot = async () => {

const onCacheRootFound = cacheRoot => {
logger.log(`found cache at '${cacheRoot}'`);
// Plant a dummy
fs.closeSync(fs.openSync(cacheRoot + '/dummy', 'w'));
};

export const reloadByondCache = async bundleDir => {
Expand All @@ -93,6 +91,9 @@ export const reloadByondCache = async bundleDir => {
// Clear garbage
const garbage = await resolveGlob(cacheDir, './*.+(bundle|chunk|hot-update).*');
try {
// Plant a dummy browser window file, we'll be using this to avoid world topic
fs.closeSync(fs.openSync(cacheRoot + '/dummy', 'w'));

for (let file of garbage) {
fs.unlinkSync(file);
}
Expand Down
5 changes: 4 additions & 1 deletion tgui/public/tgui.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
// Basic checks to detect whether this page runs in BYOND
var isByond = (tridentVersion !== null || window.cef_to_byond)
&& location.hostname === '127.0.0.1'
&& location.pathname.indexOf('/tmp') === 0
&& location.search !== '?external';
//As of BYOND 515 the path doesn't seem to include tmp dir anymore if you're trying to open tgui in external browser and looking why it doesn't work
//&& location.pathname.indexOf('/tmp') === 0

// Version constants
Byond.IS_BYOND = isByond;
Expand Down Expand Up @@ -202,6 +203,8 @@
var len = styleSheets.length;
for (var i = 0; i < len; i++) {
var styleSheet = styleSheets[i];
if(styleSheet.href === undefined)
continue;
if (styleSheet.href.indexOf(url) !== -1) {
return styleSheet.rules.length > 0;
}
Expand Down
7 changes: 7 additions & 0 deletions tools/ci/check_grep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,11 @@ do
done < <(jq -r '[.map_file] | flatten | .[]' $json)
done

# Check for non-515 compatable .proc/ syntax
if grep -P --exclude='__byond_version_compat.dm' '\.proc/' code/**/*.dm; then
echo
echo -e "${RED}ERROR: Outdated proc reference use detected in code, please use proc reference helpers.${NC}"
st=1
fi;

exit $st

0 comments on commit 29b862c

Please sign in to comment.